commit 77953699f13100fbb44d6dec4403b8375a680605 Author: ArthurSonzogni Date: Tue Aug 26 11:02:15 2025 +0000 deploy: 11f7132886ee87d27363c95983c1d2a4ec6f66b9 diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 000000000..e69de29bb diff --git a/animation_8cpp.html b/animation_8cpp.html new file mode 100644 index 000000000..b937e473e --- /dev/null +++ b/animation_8cpp.html @@ -0,0 +1,293 @@ + + + + + + + + +FTXUI: animation.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
animation.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
namespace  ftxui::animation
 The FTXUI ftxui::animation:: namespace.
 
namespace  ftxui::animation::easing
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

float Linear (float p)
 Modeled after the line y = x.
 
float QuadraticIn (float p)
 Modeled after the parabola y = x^2.
 
float QuadraticOut (float p)
 
float QuadraticInOut (float p)
 
float CubicIn (float p)
 
float CubicOut (float p)
 
float CubicInOut (float p)
 
float QuarticIn (float p)
 
float QuarticOut (float p)
 
float QuarticInOut (float p)
 
float QuinticIn (float p)
 
float QuinticOut (float p)
 
float QuinticInOut (float p)
 
float SineIn (float p)
 
float SineOut (float p)
 
float SineInOut (float p)
 
float CircularIn (float p)
 
float CircularOut (float p)
 
float CircularInOut (float p)
 
float ExponentialIn (float p)
 
float ExponentialOut (float p)
 
float ExponentialInOut (float p)
 
float ElasticIn (float p)
 
float ElasticOut (float p)
 
float ElasticInOut (float p)
 
float BackIn (float p)
 
float BackOut (float p)
 
float BackInOut (float p)
 
float BounceIn (float p)
 
float BounceOut (float p)
 
float BounceInOut (float p)
 
+
+
+ + + + + diff --git a/animation_8cpp.js b/animation_8cpp.js new file mode 100644 index 000000000..edaed4dac --- /dev/null +++ b/animation_8cpp.js @@ -0,0 +1,34 @@ +var animation_8cpp = +[ + [ "Linear", "animation_8cpp.html#a39923c8d62cdaacdc179c2ece3ee16b4", null ], + [ "QuadraticIn", "animation_8cpp.html#ab0b9303e7f956c36960e601f158e488f", null ], + [ "QuadraticOut", "animation_8cpp.html#aa1618a8f59ae7bae191d0ab36bf90e66", null ], + [ "QuadraticInOut", "animation_8cpp.html#a8155757f48a6e85e27da99c0a93f7e8d", null ], + [ "CubicIn", "animation_8cpp.html#a2288ba740a847ea0e565017cb16c24f2", null ], + [ "CubicOut", "animation_8cpp.html#acd3c619812de25f3613b36735a5cdc91", null ], + [ "CubicInOut", "animation_8cpp.html#a2aa1d45766fe10c3b16b7dd4f65db859", null ], + [ "QuarticIn", "animation_8cpp.html#af60268bac4059d32b3f7680042dba350", null ], + [ "QuarticOut", "animation_8cpp.html#a8878f359f37551ae64eb183af3ca93b8", null ], + [ "QuarticInOut", "animation_8cpp.html#a72dd2cb5c7ffddfe3a3d8b455f68d37e", null ], + [ "QuinticIn", "animation_8cpp.html#ab4eae8c5808cc6ab161037659e761a50", null ], + [ "QuinticOut", "animation_8cpp.html#aae2598b1aa6a2fc944f52edbf0453fd5", null ], + [ "QuinticInOut", "animation_8cpp.html#afcbc9e6b461fe3418a59faf4a5f9284d", null ], + [ "SineIn", "animation_8cpp.html#af48c179e363c6656e904045b33756aeb", null ], + [ "SineOut", "animation_8cpp.html#a92e397623fa5a607f64ba58d5c3dc56a", null ], + [ "SineInOut", "animation_8cpp.html#a0eddac1c5f32c9f874ed1c6687a3c830", null ], + [ "CircularIn", "animation_8cpp.html#a9af9e9dc6ba657b5ab681eb8be39ddb5", null ], + [ "CircularOut", "animation_8cpp.html#a4188d3f98b876d0e0f181f9fd707f476", null ], + [ "CircularInOut", "animation_8cpp.html#a0d1df50c1810db4a8b16416b62ac7db0", null ], + [ "ExponentialIn", "animation_8cpp.html#ab0ca381749febbe74887c9fff0522434", null ], + [ "ExponentialOut", "animation_8cpp.html#a9de59af8a36489121dace3f2a996f029", null ], + [ "ExponentialInOut", "animation_8cpp.html#a502f9e65e97d295f46c6a6435a84464d", null ], + [ "ElasticIn", "animation_8cpp.html#a0cc4cc8d40617d7b21dea78f71917bbc", null ], + [ "ElasticOut", "animation_8cpp.html#ad771aec6f0170cb9039446699d1d2295", null ], + [ "ElasticInOut", "animation_8cpp.html#a537ce88e07af5658175f95eb70369fb9", null ], + [ "BackIn", "animation_8cpp.html#ae9cca3240dd9f14a807364e322bbdf79", null ], + [ "BackOut", "animation_8cpp.html#a440085789f25b7f3ffa1391f09e154f3", null ], + [ "BackInOut", "animation_8cpp.html#a4dfa1e95971ff8e4d0f7539f2e8ae577", null ], + [ "BounceIn", "animation_8cpp.html#a3a136fc5aedb4e99e08e5bea138463cb", null ], + [ "BounceOut", "animation_8cpp.html#aba7f60496f13f39385d9a47349e97c09", null ], + [ "BounceInOut", "animation_8cpp.html#a1a048fdae839f9493331cf1745767519", null ] +]; \ No newline at end of file diff --git a/animation_8cpp_source.html b/animation_8cpp_source.html new file mode 100644 index 000000000..7ebc6b090 --- /dev/null +++ b/animation_8cpp_source.html @@ -0,0 +1,603 @@ + + + + + + + + +FTXUI: animation.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
animation.cpp
+
+
+Go to the documentation of this file.
1#include <cmath> // for sin, pow, sqrt, cos
+
2#include <utility> // for move
+
3
+ +
5
+
6// NOLINTBEGIN(*-magic-numbers)
+
7namespace ftxui::animation {
+
8
+
9namespace easing {
+
10
+
11namespace {
+
12constexpr float kPi = 3.14159265358979323846f;
+
13constexpr float kPi2 = kPi / 2.f;
+
14} // namespace
+
15
+
16// Easing function have been taken out of:
+
17// https://github.com/warrenm/AHEasing/blob/master/AHEasing/easing.c
+
18//
+
19// Corresponding license:
+
20// Copyright (c) 2011, Auerhaus Development, LLC
+
21//
+
22// This program is free software. It comes without any warranty, to
+
23// the extent permitted by applicable law. You can redistribute it
+
24// and/or modify it under the terms of the Do What The Fuck You Want
+
25// To Public License, Version 2, as published by Sam Hocevar. See
+
26// http://sam.zoy.org/wtfpl/COPYING for more details.
+
27
+
28/// @brief Modeled after the line y = x
+
+
29float Linear(float p) {
+
30 return p;
+
31}
+
+
32
+
33/// @brief Modeled after the parabola y = x^2
+
+
34float QuadraticIn(float p) {
+
35 return p * p;
+
36}
+
+
37
+
38// @brief Modeled after the parabola y = -x^2 + 2x
+
+
39float QuadraticOut(float p) {
+
40 return -(p * (p - 2.f));
+
41}
+
+
42
+
43// @brief Modeled after the piecewise quadratic
+
44// y = (1/2)((2x)^2) ; [0, 0.5)
+
45// y = -(1/2)((2x-1)*(2x-3) - 1) ; [0.5, 1]
+
+
46float QuadraticInOut(float p) {
+
47 return p < 0.5f ? 2.f * p * p : (-2.f * p * p) + (4.f * p) - 1.f;
+
48}
+
+
49
+
50// @brief Modeled after the cubic y = x^3
+
+
51float CubicIn(float p) {
+
52 return p * p * p;
+
53}
+
+
54
+
55// @brief Modeled after the cubic y = (x - 1)^3 + 1
+
+
56float CubicOut(float p) {
+
57 const float f = (p - 1.f);
+
58 return f * f * f + 1.f;
+
59}
+
+
60
+
61// @brief Modeled after the piecewise cubic
+
62// y = (1/2)((2x)^3) ; [0, 0.5)
+
63// y = (1/2)((2x-2)^3 + 2) ; [0.5, 1]
+
+
64float CubicInOut(float p) {
+
65 if (p < 0.5f) {
+
66 return 4.f * p * p * p;
+
67 }
+
68 const float f = ((2.f * p) - 2.f);
+
69 return 0.5f * f * f * f + 1.f;
+
70}
+
+
71
+
72// @brief Modeled after the quartic x^4
+
+
73float QuarticIn(float p) {
+
74 return p * p * p * p;
+
75}
+
+
76
+
77// @brief Modeled after the quartic y = 1 - (x - 1)^4
+
+
78float QuarticOut(float p) {
+
79 const float f = (p - 1.f);
+
80 return f * f * f * (1.f - p) + 1.f;
+
81}
+
+
82
+
83// @brief Modeled after the piecewise quartic
+
84// y = (1/2)((2x)^4) ; [0, 0.5)
+
85// y = -(1/2)((2x-2)^4 - 2) ; [0.5, 1]
+
+
86float QuarticInOut(float p) {
+
87 if (p < 0.5f) {
+
88 return 8.f * p * p * p * p;
+
89 }
+
90 const float f = (p - 1.f);
+
91 return -8.f * f * f * f * f + 1.f;
+
92}
+
+
93
+
94// @brief Modeled after the quintic y = x^5
+
+
95float QuinticIn(float p) {
+
96 return p * p * p * p * p;
+
97}
+
+
98
+
99// @brief Modeled after the quintic y = (x - 1)^5 + 1
+
+
100float QuinticOut(float p) {
+
101 const float f = (p - 1.f);
+
102 return f * f * f * f * f + 1.f;
+
103}
+
+
104
+
105// @brief Modeled after the piecewise quintic
+
106// y = (1/2)((2x)^5) ; [0, 0.5)
+
107// y = (1/2)((2x-2)^5 + 2) ; [0.5, 1]
+
+
108float QuinticInOut(float p) {
+
109 if (p < 0.5f) {
+
110 return 16.f * p * p * p * p * p;
+
111 }
+
112 const float f = ((2.f * p) - 2.f);
+
113 return 0.5f * f * f * f * f * f + 1.f;
+
114}
+
+
115
+
116// @brief Modeled after quarter-cycle of sine wave
+
+
117float SineIn(float p) {
+
118 return std::sin((p - 1.f) * kPi2) + 1.f;
+
119}
+
+
120
+
121// @brief Modeled after quarter-cycle of sine wave (different phase)
+
+
122float SineOut(float p) {
+
123 return std::sin(p * kPi2);
+
124}
+
+
125
+
126// @brief Modeled after half sine wave
+
+
127float SineInOut(float p) {
+
128 return 0.5f * (1.f - std::cos(p * kPi));
+
129}
+
+
130
+
131// @brief Modeled after shifted quadrant IV of unit circle
+
+
132float CircularIn(float p) {
+
133 return 1.f - std::sqrt(1.f - (p * p));
+
134}
+
+
135
+
136// @brief Modeled after shifted quadrant II of unit circle
+
+
137float CircularOut(float p) {
+
138 return std::sqrt((2.f - p) * p);
+
139}
+
+
140
+
141// @brief Modeled after the piecewise circular function
+
142// y = (1/2)(1 - sqrt(1 - 4x^2)) ; [0, 0.5)
+
143// y = (1/2)(sqrt(-(2x - 3)*(2x - 1)) + 1) ; [0.5, 1]
+
+
144float CircularInOut(float p) {
+
145 if (p < 0.5f) {
+
146 return 0.5f * (1.f - std::sqrt(1.f - 4.f * (p * p)));
+
147 }
+
148 return 0.5f * (std::sqrt(-((2.f * p) - 3.f) * ((2.f * p) - 1.f)) + 1.f);
+
149}
+
+
150
+
151// @brief Modeled after the exponential function y = 2^(10(x - 1))
+
+
152float ExponentialIn(float p) {
+
153 return (p == 0.f) ? p : std::pow(2.f, 10.f * (p - 1.f));
+
154}
+
+
155
+
156// @brief Modeled after the exponential function y = -2^(-10x) + 1
+
+
157float ExponentialOut(float p) {
+
158 return (p == 1.f) ? p : 1.f - std::pow(2.f, -10.f * p);
+
159}
+
+
160
+
161// @brief Modeled after the piecewise exponential
+
162// y = (1/2)2^(10(2x - 1)) ; [0,0.5)
+
163// y = -(1/2)*2^(-10(2x - 1))) + 1 ; [0.5,1]
+
+
164float ExponentialInOut(float p) {
+
165 if (p == 0.f || p == 1.f) {
+
166 return p;
+
167 }
+
168
+
169 if (p < 0.5f) {
+
170 return 0.5f * std::pow(2.f, (20.f * p) - 10.f);
+
171 }
+
172 return -0.5f * std::pow(2.f, (-20.f * p) + 10.f) + 1.f;
+
173}
+
+
174
+
175// @brief Modeled after the damped sine wave y = sin(13pi/2*x)*pow(2, 10 * (x -
+
176// 1))
+
+
177float ElasticIn(float p) {
+
178 return std::sin(13.f * kPi2 * p) * std::pow(2.f, 10.f * (p - 1.f));
+
179}
+
+
180
+
181// @brief Modeled after the damped sine wave y = sin(-13pi/2*(x + 1))*pow(2,
+
182// -10x) +
+
183// 1
+
+
184float ElasticOut(float p) {
+
185 return std::sin(-13.f * kPi2 * (p + 1.f)) * std::pow(2.f, -10.f * p) + 1.f;
+
186}
+
+
187
+
188// @brief Modeled after the piecewise exponentially-damped sine wave:
+
189// y = (1/2)*sin(13pi/2*(2*x))*pow(2, 10 * ((2*x) - 1)) ; [0,0.5)
+
190// y = (1/2)*(sin(-13pi/2*((2x-1)+1))*pow(2,-10(2*x-1)) + 2) ; [0.5, 1]
+
+
191float ElasticInOut(float p) {
+
192 if (p < 0.5f) {
+
193 return 0.5f * std::sin(13.f * kPi2 * (2.f * p)) *
+
194 std::pow(2.f, 10.f * ((2.f * p) - 1.f));
+
195 }
+
196 return 0.5f * (std::sin(-13.f * kPi2 * ((2.f * p - 1.f) + 1.f)) *
+
197 std::pow(2.f, -10.f * (2.f * p - 1.f)) +
+
198 2.f);
+
199}
+
+
200
+
201// @brief Modeled after the overshooting cubic y = x^3-x*sin(x*pi)
+
+
202float BackIn(float p) {
+
203 return p * p * p - p * std::sin(p * kPi);
+
204}
+
+
205
+
206// @brief Modeled after overshooting cubic y = 1-((1-x)^3-(1-x)*sin((1-x)*pi))
+
+
207float BackOut(float p) {
+
208 const float f = (1.f - p);
+
209 return 1.f - (f * f * f - f * std::sin(f * kPi));
+
210}
+
+
211
+
212// @brief Modeled after the piecewise overshooting cubic function:
+
213// y = (1/2)*((2x)^3-(2x)*sin(2*x*pi)) ; [0, 0.5)
+
214// y = (1/2)*(1-((1-x)^3-(1-x)*sin((1-x)*pi))+1) ; [0.5, 1]
+
+
215float BackInOut(float p) {
+
216 if (p < 0.5f) {
+
217 const float f = 2.f * p;
+
218 return 0.5f * (f * f * f - f * std::sin(f * kPi));
+
219 }
+
220 const float f = (1.f - (2.f * p - 1.f));
+
221 return 0.5f * (1.f - (f * f * f - f * std::sin(f * kPi))) + 0.5f;
+
222}
+
+
223
+
+
224float BounceIn(float p) {
+
225 return 1.f - BounceOut(1.f - p);
+
226}
+
+
227
+
+
228float BounceOut(float p) {
+
229 if (p < 4.f / 11.f) {
+
230 return (121.f * p * p) / 16.f;
+
231 }
+
232
+
233 if (p < 8.f / 11.f) {
+
234 return (363.f / 40.f * p * p) - (99.f / 10.f * p) + 17.f / 5.f;
+
235 }
+
236
+
237 if (p < 9.f / 10.f) {
+
238 return (4356.f / 361.f * p * p) - (35442.f / 1805.f * p) + 16061.f / 1805.f;
+
239 }
+
240
+
241 return (54.f / 5.f * p * p) - (513 / 25.f * p) + 268 / 25.f;
+
242}
+
+
243
+
+
244float BounceInOut(float p) {
+
245 if (p < 0.5f) {
+
246 return 0.5f * BounceIn(p * 2.f);
+
247 }
+
248 return 0.5f * BounceOut(p * 2.f - 1.f) + 0.5f;
+
249}
+
+
250
+
251} // namespace easing
+
252
+
+ +
254 float to,
+
255 Duration duration,
+
256 easing::Function easing_function,
+
257 Duration delay)
+
258 : value_(from),
+
259 from_(*from),
+
260 to_(to),
+
261 duration_(duration),
+
262 easing_function_(std::move(easing_function)),
+
263 current_(-delay) {
+ +
265}
+
+
266
+
+ +
268 current_ += params.duration();
+
269
+
270 if (current_ >= duration_) {
+
271 *value_ = to_;
+
272 return;
+
273 }
+
274
+
275 if (current_ <= Duration()) {
+
276 *value_ = from_;
+
277 } else {
+
278 *value_ = from_ + (to_ - from_) * easing_function_(current_ / duration_);
+
279 }
+
280
+ +
282}
+
+
283
+
284} // namespace ftxui::animation
+
285
+
286// NOLINTEND(*-magic-numbers)
+ +
Animator(float *from, float to=0.f, Duration duration=std::chrono::milliseconds(250), easing::Function easing_function=easing::Linear, Duration delay=std::chrono::milliseconds(0))
+ + +
Duration duration() const
The duration this animation step represents.
Definition animation.hpp:38
+
void RequestAnimationFrame()
RequestAnimationFrame is a function that requests a new frame to be drawn in the next animation cycle...
+
The FTXUI sf::animation::easing:: namespace.
+
float ElasticIn(float p)
+
float CircularInOut(float p)
+
float SineInOut(float p)
+
float BounceInOut(float p)
+
float CubicIn(float p)
Definition animation.cpp:51
+
float CubicInOut(float p)
Definition animation.cpp:64
+
float Linear(float p)
Modeled after the line y = x.
Definition animation.cpp:29
+
float BounceIn(float p)
+
float CircularOut(float p)
+ +
float BackInOut(float p)
+
float ExponentialInOut(float p)
+
float ElasticInOut(float p)
+
float QuarticInOut(float p)
Definition animation.cpp:86
+
float QuadraticInOut(float p)
Definition animation.cpp:46
+
float QuarticOut(float p)
Definition animation.cpp:78
+ +
float CircularIn(float p)
+
float ExponentialOut(float p)
+
float QuadraticOut(float p)
Definition animation.cpp:39
+
float QuinticOut(float p)
+
float QuadraticIn(float p)
Modeled after the parabola y = x^2.
Definition animation.cpp:34
+
float ExponentialIn(float p)
+
float QuinticIn(float p)
Definition animation.cpp:95
+
float BounceOut(float p)
+
float CubicOut(float p)
Definition animation.cpp:56
+
float ElasticOut(float p)
+
std::function< float(float)> Function
Definition animation.hpp:45
+ + +
float QuarticIn(float p)
Definition animation.cpp:73
+
float QuinticInOut(float p)
+
The FTXUI ftxui::animation:: namespace.
Definition animation.hpp:10
+
std::chrono::duration< float > Duration
Definition animation.hpp:30
+
std::string value_
+
+
+ + + + + diff --git a/animation_8cppm.html b/animation_8cppm.html new file mode 100644 index 000000000..5577a815f --- /dev/null +++ b/animation_8cppm.html @@ -0,0 +1,228 @@ + + + + + + + + +FTXUI: animation.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
animation.cppm File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + + + + + + + + +

+Namespaces

namespace  ftxui::animation
 The FTXUI ftxui::animation:: namespace.
 
namespace  ftxui
 The FTXUI ftxui:: namespace.
 
namespace  easing
 The FTXUI sf::animation::easing:: namespace.
 
namespace  ftxui::animation::easing
 
+
+
+ + + + + diff --git a/animation_8cppm_source.html b/animation_8cppm_source.html new file mode 100644 index 000000000..69e3786e1 --- /dev/null +++ b/animation_8cppm_source.html @@ -0,0 +1,284 @@ + + + + + + + + +FTXUI: animation.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
animation.cppm
+
+
+Go to the documentation of this file.
1/// @module ftxui.component.animation
+
2/// @brief C++20 module interface for the Animation namespace of the Component module.
+
3///
+
4
+
5module;
+
6
+ +
8
+
9export module ftxui.component.animation;
+
10
+
11/**
+
12 * @namespace ftxui::animation
+
13 * @brief The FTXUI ftxui::animation:: namespace
+
14 */
+
15export namespace ftxui::animation {
+
16 using ftxui::animation::RequestAnimationFrame;
+
17
+ + + +
21
+ +
23
+
24 /**
+
25 * @namespace easing
+
26 * @brief The FTXUI sf::animation::easing:: namespace
+
27 */
+
28 namespace easing {
+ +
30
+
31 using ftxui::animation::easing::Linear;
+
32 using ftxui::animation::easing::QuadraticIn;
+
33 using ftxui::animation::easing::QuadraticOut;
+
34 using ftxui::animation::easing::QuadraticInOut;
+
35 using ftxui::animation::easing::CubicIn;
+
36 using ftxui::animation::easing::CubicOut;
+
37 using ftxui::animation::easing::CubicInOut;
+
38 using ftxui::animation::easing::QuarticIn;
+
39 using ftxui::animation::easing::QuarticOut;
+
40 using ftxui::animation::easing::QuarticInOut;
+
41 using ftxui::animation::easing::QuinticIn;
+
42 using ftxui::animation::easing::QuinticOut;
+
43 using ftxui::animation::easing::QuinticInOut;
+
44 using ftxui::animation::easing::SineIn;
+
45 using ftxui::animation::easing::SineOut;
+
46 using ftxui::animation::easing::SineInOut;
+
47 using ftxui::animation::easing::CircularIn;
+
48 using ftxui::animation::easing::CircularOut;
+
49 using ftxui::animation::easing::CircularInOut;
+
50 using ftxui::animation::easing::ExponentialIn;
+
51 using ftxui::animation::easing::ExponentialOut;
+
52 using ftxui::animation::easing::ExponentialInOut;
+
53 using ftxui::animation::easing::ElasticIn;
+
54 using ftxui::animation::easing::ElasticOut;
+
55 using ftxui::animation::easing::ElasticInOut;
+
56 using ftxui::animation::easing::BackIn;
+
57 using ftxui::animation::easing::BackOut;
+
58 using ftxui::animation::easing::BackInOut;
+
59 using ftxui::animation::easing::BounceIn;
+
60 using ftxui::animation::easing::BounceOut;
+
61 using ftxui::animation::easing::BounceInOut;
+
62 }
+
63
+ +
65}
+ + + +
C++20 module interface for the Animation namespace of the Component module.
+
The FTXUI sf::animation::easing:: namespace.
+
std::function< float(float)> Function
Definition animation.hpp:45
+
The FTXUI ftxui::animation:: namespace.
Definition animation.hpp:10
+
std::chrono::steady_clock Clock
Definition animation.hpp:28
+
std::chrono::duration< float > Duration
Definition animation.hpp:30
+
std::chrono::time_point< Clock > TimePoint
Definition animation.hpp:29
+
+
+ + + + + diff --git a/animation_8hpp.html b/animation_8hpp.html new file mode 100644 index 000000000..b730f2643 --- /dev/null +++ b/animation_8hpp.html @@ -0,0 +1,316 @@ + + + + + + + + +FTXUI: animation.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
animation.hpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + +

+Classes

class  Params
 
class  Animator
 
+ + + + + + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
namespace  ftxui::animation
 The FTXUI ftxui::animation:: namespace.
 
namespace  ftxui::animation::easing
 
+ + + + + + + + + +

+Typedefs

using Clock = std::chrono::steady_clock
 
using TimePoint = std::chrono::time_point<Clock>
 
using Duration = std::chrono::duration<float>
 
using Function = std::function<float(float)>
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

void RequestAnimationFrame ()
 RequestAnimationFrame is a function that requests a new frame to be drawn in the next animation cycle.
 
float Linear (float p)
 Modeled after the line y = x.
 
float QuadraticIn (float p)
 Modeled after the parabola y = x^2.
 
float QuadraticOut (float p)
 
float QuadraticInOut (float p)
 
float CubicIn (float p)
 
float CubicOut (float p)
 
float CubicInOut (float p)
 
float QuarticIn (float p)
 
float QuarticOut (float p)
 
float QuarticInOut (float p)
 
float QuinticIn (float p)
 
float QuinticOut (float p)
 
float QuinticInOut (float p)
 
float SineIn (float p)
 
float SineOut (float p)
 
float SineInOut (float p)
 
float CircularIn (float p)
 
float CircularOut (float p)
 
float CircularInOut (float p)
 
float ExponentialIn (float p)
 
float ExponentialOut (float p)
 
float ExponentialInOut (float p)
 
float ElasticIn (float p)
 
float ElasticOut (float p)
 
float ElasticInOut (float p)
 
float BackIn (float p)
 
float BackOut (float p)
 
float BackInOut (float p)
 
float BounceIn (float p)
 
float BounceOut (float p)
 
float BounceInOut (float p)
 
+
+
+ + + + + diff --git a/animation_8hpp.js b/animation_8hpp.js new file mode 100644 index 000000000..e68bcb6c7 --- /dev/null +++ b/animation_8hpp.js @@ -0,0 +1,41 @@ +var animation_8hpp = +[ + [ "Params", "classftxui_1_1animation_1_1Params.html", "classftxui_1_1animation_1_1Params" ], + [ "Animator", "classftxui_1_1animation_1_1Animator.html", "classftxui_1_1animation_1_1Animator" ], + [ "Clock", "animation_8hpp.html#a19bfb27380067c74ae297dd7dad5fb37", null ], + [ "TimePoint", "animation_8hpp.html#a97ee0a9619acebafade22a9b7b0de667", null ], + [ "Duration", "animation_8hpp.html#a3c06579c86b609bce4a9a097b23cd739", null ], + [ "Function", "animation_8hpp.html#ad820848234fca6290b7399cc5e07af3a", null ], + [ "RequestAnimationFrame", "animation_8hpp.html#gad94d3d42aba3359550759aae5bcffbe9", null ], + [ "Linear", "animation_8hpp.html#a39923c8d62cdaacdc179c2ece3ee16b4", null ], + [ "QuadraticIn", "animation_8hpp.html#ab0b9303e7f956c36960e601f158e488f", null ], + [ "QuadraticOut", "animation_8hpp.html#aa1618a8f59ae7bae191d0ab36bf90e66", null ], + [ "QuadraticInOut", "animation_8hpp.html#a8155757f48a6e85e27da99c0a93f7e8d", null ], + [ "CubicIn", "animation_8hpp.html#a2288ba740a847ea0e565017cb16c24f2", null ], + [ "CubicOut", "animation_8hpp.html#acd3c619812de25f3613b36735a5cdc91", null ], + [ "CubicInOut", "animation_8hpp.html#a2aa1d45766fe10c3b16b7dd4f65db859", null ], + [ "QuarticIn", "animation_8hpp.html#af60268bac4059d32b3f7680042dba350", null ], + [ "QuarticOut", "animation_8hpp.html#a8878f359f37551ae64eb183af3ca93b8", null ], + [ "QuarticInOut", "animation_8hpp.html#a72dd2cb5c7ffddfe3a3d8b455f68d37e", null ], + [ "QuinticIn", "animation_8hpp.html#ab4eae8c5808cc6ab161037659e761a50", null ], + [ "QuinticOut", "animation_8hpp.html#aae2598b1aa6a2fc944f52edbf0453fd5", null ], + [ "QuinticInOut", "animation_8hpp.html#afcbc9e6b461fe3418a59faf4a5f9284d", null ], + [ "SineIn", "animation_8hpp.html#af48c179e363c6656e904045b33756aeb", null ], + [ "SineOut", "animation_8hpp.html#a92e397623fa5a607f64ba58d5c3dc56a", null ], + [ "SineInOut", "animation_8hpp.html#a0eddac1c5f32c9f874ed1c6687a3c830", null ], + [ "CircularIn", "animation_8hpp.html#a9af9e9dc6ba657b5ab681eb8be39ddb5", null ], + [ "CircularOut", "animation_8hpp.html#a4188d3f98b876d0e0f181f9fd707f476", null ], + [ "CircularInOut", "animation_8hpp.html#a0d1df50c1810db4a8b16416b62ac7db0", null ], + [ "ExponentialIn", "animation_8hpp.html#ab0ca381749febbe74887c9fff0522434", null ], + [ "ExponentialOut", "animation_8hpp.html#a9de59af8a36489121dace3f2a996f029", null ], + [ "ExponentialInOut", "animation_8hpp.html#a502f9e65e97d295f46c6a6435a84464d", null ], + [ "ElasticIn", "animation_8hpp.html#a0cc4cc8d40617d7b21dea78f71917bbc", null ], + [ "ElasticOut", "animation_8hpp.html#ad771aec6f0170cb9039446699d1d2295", null ], + [ "ElasticInOut", "animation_8hpp.html#a537ce88e07af5658175f95eb70369fb9", null ], + [ "BackIn", "animation_8hpp.html#ae9cca3240dd9f14a807364e322bbdf79", null ], + [ "BackOut", "animation_8hpp.html#a440085789f25b7f3ffa1391f09e154f3", null ], + [ "BackInOut", "animation_8hpp.html#a4dfa1e95971ff8e4d0f7539f2e8ae577", null ], + [ "BounceIn", "animation_8hpp.html#a3a136fc5aedb4e99e08e5bea138463cb", null ], + [ "BounceOut", "animation_8hpp.html#aba7f60496f13f39385d9a47349e97c09", null ], + [ "BounceInOut", "animation_8hpp.html#a1a048fdae839f9493331cf1745767519", null ] +]; \ No newline at end of file diff --git a/animation_8hpp_source.html b/animation_8hpp_source.html new file mode 100644 index 000000000..bb24eda02 --- /dev/null +++ b/animation_8hpp_source.html @@ -0,0 +1,385 @@ + + + + + + + + +FTXUI: animation.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
animation.hpp
+
+
+Go to the documentation of this file.
1// Copyright 2022 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#ifndef FTXUI_ANIMATION_HPP
+
5#define FTXUI_ANIMATION_HPP
+
6
+
7#include <chrono> // for milliseconds, duration, steady_clock, time_point
+
8#include <functional> // for function
+
9
+
+ +
11/// @brief RequestAnimationFrame is a function that requests a new frame to be
+
12/// drawn in the next animation cycle.
+
13///
+
14/// @note This function is typically called by components that need to
+
15/// update their state or appearance over time, such as animations or
+
16/// transitions. This is useful when the change doesn't depend depend on the
+
17/// events seen by the terminal, but rather on the passage of time.
+
18///
+
19/// Components who haven't completed their animation can call this function to
+
20/// request a new frame to be drawn later.
+
21///
+
22/// When there is no new events and no animations to complete, no new frame is
+
23/// drawn.
+
24///
+
25/// @ingroup component
+ +
27
+
28using Clock = std::chrono::steady_clock;
+
29using TimePoint = std::chrono::time_point<Clock>;
+
30using Duration = std::chrono::duration<float>;
+
31
+
32// Parameter of Component::OnAnimation(param).
+
+
33class Params {
+
34 public:
+
35 explicit Params(Duration duration) : duration_(duration) {}
+
36
+
37 /// The duration this animation step represents.
+
38 Duration duration() const { return duration_; }
+
39
+
40 private:
+
41 Duration duration_;
+
42};
+
+
43
+
+
44namespace easing {
+
45using Function = std::function<float(float)>;
+
46// Linear interpolation (no easing)
+
47float Linear(float p);
+
48
+
49// Quadratic easing; p^2
+
50float QuadraticIn(float p);
+
51float QuadraticOut(float p);
+
52float QuadraticInOut(float p);
+
53
+
54// Cubic easing; p^3
+
55float CubicIn(float p);
+
56float CubicOut(float p);
+
57float CubicInOut(float p);
+
58
+
59// Quartic easing; p^4
+
60float QuarticIn(float p);
+
61float QuarticOut(float p);
+
62float QuarticInOut(float p);
+
63
+
64// Quintic easing; p^5
+
65float QuinticIn(float p);
+
66float QuinticOut(float p);
+
67float QuinticInOut(float p);
+
68
+
69// Sine wave easing; sin(p * PI/2)
+
70float SineIn(float p);
+
71float SineOut(float p);
+
72float SineInOut(float p);
+
73
+
74// Circular easing; sqrt(1 - p^2)
+
75float CircularIn(float p);
+
76float CircularOut(float p);
+
77float CircularInOut(float p);
+
78
+
79// Exponential easing, base 2
+
80float ExponentialIn(float p);
+
81float ExponentialOut(float p);
+
82float ExponentialInOut(float p);
+
83
+
84// Exponentially-damped sine wave easing
+
85float ElasticIn(float p);
+
86float ElasticOut(float p);
+
87float ElasticInOut(float p);
+
88
+
89// Overshooting cubic easing;
+
90float BackIn(float p);
+
91float BackOut(float p);
+
92float BackInOut(float p);
+
93
+
94// Exponentially-decaying bounce easing
+
95float BounceIn(float p);
+
96float BounceOut(float p);
+
97float BounceInOut(float p);
+
98} // namespace easing
+
+
99
+
+
100class Animator {
+
101 public:
+
102 explicit Animator(float* from,
+
103 float to = 0.f,
+
104 Duration duration = std::chrono::milliseconds(250),
+
105 easing::Function easing_function = easing::Linear,
+
106 Duration delay = std::chrono::milliseconds(0));
+
107
+
108 void OnAnimation(Params&);
+
109
+
110 float to() const { return to_; }
+
111
+
112 private:
+
113 float* value_;
+
114 float from_;
+
115 float to_;
+
116 Duration duration_;
+
117 easing::Function easing_function_;
+
118 Duration current_;
+
119};
+
+
120
+
121} // namespace ftxui::animation
+
+
122
+
123#endif /* end of include guard: FTXUI_ANIMATION_HPP */
+ +
Animator(float *from, float to=0.f, Duration duration=std::chrono::milliseconds(250), easing::Function easing_function=easing::Linear, Duration delay=std::chrono::milliseconds(0))
+ + + +
Params(Duration duration)
Definition animation.hpp:35
+
Duration duration() const
The duration this animation step represents.
Definition animation.hpp:38
+
void RequestAnimationFrame()
RequestAnimationFrame is a function that requests a new frame to be drawn in the next animation cycle...
+
The FTXUI sf::animation::easing:: namespace.
+
float ElasticIn(float p)
+
float CircularInOut(float p)
+
float SineInOut(float p)
+
float BounceInOut(float p)
+
float CubicIn(float p)
Definition animation.cpp:51
+
float CubicInOut(float p)
Definition animation.cpp:64
+
float Linear(float p)
Modeled after the line y = x.
Definition animation.cpp:29
+
float BounceIn(float p)
+
float CircularOut(float p)
+ +
float BackInOut(float p)
+
float ExponentialInOut(float p)
+
float ElasticInOut(float p)
+
float QuarticInOut(float p)
Definition animation.cpp:86
+
float QuadraticInOut(float p)
Definition animation.cpp:46
+
float QuarticOut(float p)
Definition animation.cpp:78
+ +
float CircularIn(float p)
+
float ExponentialOut(float p)
+
float QuadraticOut(float p)
Definition animation.cpp:39
+
float QuinticOut(float p)
+
float QuadraticIn(float p)
Modeled after the parabola y = x^2.
Definition animation.cpp:34
+
float ExponentialIn(float p)
+
float QuinticIn(float p)
Definition animation.cpp:95
+
float BounceOut(float p)
+
float CubicOut(float p)
Definition animation.cpp:56
+
float ElasticOut(float p)
+
std::function< float(float)> Function
Definition animation.hpp:45
+ + +
float QuarticIn(float p)
Definition animation.cpp:73
+
float QuinticInOut(float p)
+
The FTXUI ftxui::animation:: namespace.
Definition animation.hpp:10
+
std::chrono::steady_clock Clock
Definition animation.hpp:28
+
std::chrono::duration< float > Duration
Definition animation.hpp:30
+
std::chrono::time_point< Clock > TimePoint
Definition animation.hpp:29
+
+
+ + + + + diff --git a/annotated.html b/annotated.html new file mode 100644 index 000000000..e2a2f28b6 --- /dev/null +++ b/annotated.html @@ -0,0 +1,280 @@ + + + + + + + + +FTXUI: Class List + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Class List
+
+
+
Here are the classes, structs, unions and interfaces with brief descriptions:
+
[detail level 123]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 NftxuiThe FTXUI ftxui:: namespace
 NanimationThe FTXUI ftxui::animation:: namespace
 CAnimator
 CParams
 Nbox_helper
 CElement
 Nflexbox_helper
 CBlock
 CGlobal
 CLine
 Ntask
 CPendingTask
 CTaskQueue
 CTaskRunner
 CAnimatedColorOptionOption about a potentially animated color
 CAnimatedColorsOption
 CAnimationTask
 CAutoResetAssign a value to a variable, reset its old value when going out of scope
 CBoxBox is a structure that represents a rectangular area in a 2D space
 CButtonOptionOption for the AnimatedButton component
 CCanvasCanvas is a drawable buffer associated with drawing operations
 CCapturedMouseInterface
 CCheckboxOptionOption for the Checkbox component
 CColorColor is a class that represents a color in the terminal user interface
 CColorInfoColorInfo is a structure that contains information about the terminal color palette
 CComponentBaseIt implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ftxui::Event
 CConstRefAn adapter. Own or reference an immutable object
 CConstStringListRefAn adapter. Reference a list of strings
 CAdapter
 CConstStringRefAn adapter. Own or reference a constant string. For convenience, this class convert multiple immutable string toward a shared representation
 CDimensionsDimensions is a structure that represents the size of the terminal
 CDropdownOptionOption for the Dropdown component.A dropdown menu is a checkbox opening/closing a radiobox
 CEntryStateArguments for transform from |ButtonOption|, |CheckboxOption|, |RadioboxOption|, |MenuEntryOption|, |MenuOption|
 CEventRepresent an event. It can be key press event, a terminal resize, or more ..
 CFlexboxConfigFlexboxConfig is a configuration structure that defines the layout properties for a flexbox container
 CImageA rectangular grid of Pixel
 CInputOptionOption for the Input component
 CInputStateUsed to define style for the Input component
 CLinearGradientA class representing the settings for linear-gradient color effect
 CStop
 CLoopLoop is a class that manages the event loop for a component
 CMenuEntryOptionOption for the MenuEntry component
 CMenuOptionOption for the Menu component
 CMouseA mouse event. It contains the coordinate of the mouse, the button pressed and the modifier (shift, ctrl, meta)
 CNodeNode is the base class for all elements in the DOM tree
 CStatus
 CNodeDecorator
 CPixelA Unicode character and its associated style
 CRadioboxOptionOption for the Radiobox component
 CReceiverImpl
 CRefAn adapter. Own or reference an mutable object
 CRequirementRequirement is a structure that defines the layout requirements for a Node in the terminal user interface
 CFocused
 CResizableSplitOption
 CScreenA rectangular grid of Pixel
 CCursor
 CScreenInteractiveScreenInteractive is a Screen that can handle events, run a main loop, and manage components
 CPrivate
 CSelectionRepresents a selection in a terminal user interface
 CSenderImpl
 CSliderOption
 CStringRefAn adapter. Own or reference a constant string. For convenience, this class convert multiple mutable string toward a shared representation
 CTableTable is a utility to draw tables
 CTableSelection
 CTerminalInputParser
 CUnderlineOptionOption for the underline effect
 CWindowOptions
 CWindowRenderStateState passed to the Window component's render function
+
+
+
+ + + + + diff --git a/annotated_dup.js b/annotated_dup.js new file mode 100644 index 000000000..15bf298c3 --- /dev/null +++ b/annotated_dup.js @@ -0,0 +1,70 @@ +var annotated_dup = +[ + [ "ftxui", "namespaceftxui.html", [ + [ "animation", "namespaceftxui_1_1animation.html", [ + [ "Animator", "classftxui_1_1animation_1_1Animator.html", "classftxui_1_1animation_1_1Animator" ], + [ "Params", "classftxui_1_1animation_1_1Params.html", "classftxui_1_1animation_1_1Params" ] + ] ], + [ "box_helper", "namespaceftxui_1_1box__helper.html", [ + [ "Element", "structftxui_1_1box__helper_1_1Element.html", "structftxui_1_1box__helper_1_1Element" ] + ] ], + [ "flexbox_helper", "namespaceftxui_1_1flexbox__helper.html", [ + [ "Block", "structftxui_1_1flexbox__helper_1_1Block.html", "structftxui_1_1flexbox__helper_1_1Block" ], + [ "Global", "structftxui_1_1flexbox__helper_1_1Global.html", "structftxui_1_1flexbox__helper_1_1Global" ], + [ "Line", "structftxui_1_1flexbox__helper_1_1Line.html", "structftxui_1_1flexbox__helper_1_1Line" ] + ] ], + [ "task", "namespaceftxui_1_1task.html", [ + [ "PendingTask", "structftxui_1_1task_1_1PendingTask.html", "structftxui_1_1task_1_1PendingTask" ], + [ "TaskQueue", "structftxui_1_1task_1_1TaskQueue.html", "structftxui_1_1task_1_1TaskQueue" ], + [ "TaskRunner", "classftxui_1_1task_1_1TaskRunner.html", "classftxui_1_1task_1_1TaskRunner" ] + ] ], + [ "AnimatedColorOption", "group__component.html#structftxui_1_1AnimatedColorOption", "group__component_structftxui_1_1AnimatedColorOption" ], + [ "AnimatedColorsOption", "structftxui_1_1AnimatedColorsOption.html", "structftxui_1_1AnimatedColorsOption" ], + [ "AnimationTask", "classftxui_1_1AnimationTask.html", null ], + [ "AutoReset", "classftxui_1_1AutoReset.html", "classftxui_1_1AutoReset" ], + [ "Box", "group__screen.html#structftxui_1_1Box", "group__screen_structftxui_1_1Box" ], + [ "ButtonOption", "group__component.html#structftxui_1_1ButtonOption", "group__component_structftxui_1_1ButtonOption" ], + [ "Canvas", "group__dom.html#structftxui_1_1Canvas", "group__dom_structftxui_1_1Canvas" ], + [ "CapturedMouseInterface", "classftxui_1_1CapturedMouseInterface.html", "classftxui_1_1CapturedMouseInterface" ], + [ "CheckboxOption", "group__component.html#structftxui_1_1CheckboxOption", "group__component_structftxui_1_1CheckboxOption" ], + [ "Color", "group__screen.html#classftxui_1_1Color", "group__screen_classftxui_1_1Color" ], + [ "ColorInfo", "group__screen.html#structftxui_1_1ColorInfo", "group__screen_structftxui_1_1ColorInfo" ], + [ "ComponentBase", "group__component.html#classftxui_1_1ComponentBase", "group__component_classftxui_1_1ComponentBase" ], + [ "ConstRef", "classftxui_1_1ConstRef.html", "classftxui_1_1ConstRef" ], + [ "ConstStringListRef", "classftxui_1_1ConstStringListRef.html", "classftxui_1_1ConstStringListRef" ], + [ "ConstStringRef", "classftxui_1_1ConstStringRef.html", "classftxui_1_1ConstStringRef" ], + [ "Dimensions", "group__screen.html#structftxui_1_1Dimensions", "group__screen_structftxui_1_1Dimensions" ], + [ "DropdownOption", "group__component.html#structftxui_1_1DropdownOption", "group__component_structftxui_1_1DropdownOption" ], + [ "EntryState", "structftxui_1_1EntryState.html", "structftxui_1_1EntryState" ], + [ "Event", "group__component.html#structftxui_1_1Event", "group__component_structftxui_1_1Event" ], + [ "FlexboxConfig", "group__dom.html#structftxui_1_1FlexboxConfig", "group__dom_structftxui_1_1FlexboxConfig" ], + [ "Image", "group__screen.html#classftxui_1_1Image", "group__screen_classftxui_1_1Image" ], + [ "InputOption", "group__component.html#structftxui_1_1InputOption", "group__component_structftxui_1_1InputOption" ], + [ "InputState", "structftxui_1_1InputState.html", "structftxui_1_1InputState" ], + [ "LinearGradient", "group__dom.html#structftxui_1_1LinearGradient", "group__dom_structftxui_1_1LinearGradient" ], + [ "Loop", "group__component.html#classftxui_1_1Loop", "group__component_classftxui_1_1Loop" ], + [ "MenuEntryOption", "group__component.html#structftxui_1_1MenuEntryOption", "group__component_structftxui_1_1MenuEntryOption" ], + [ "MenuOption", "group__component.html#structftxui_1_1MenuOption", "group__component_structftxui_1_1MenuOption" ], + [ "Mouse", "group__component.html#structftxui_1_1Mouse", "group__component_structftxui_1_1Mouse" ], + [ "Node", "group__dom.html#classftxui_1_1Node", "group__dom_classftxui_1_1Node" ], + [ "NodeDecorator", "classftxui_1_1NodeDecorator.html", "classftxui_1_1NodeDecorator" ], + [ "Pixel", "group__screen.html#structftxui_1_1Pixel", "group__screen_structftxui_1_1Pixel" ], + [ "RadioboxOption", "group__component.html#structftxui_1_1RadioboxOption", "group__component_structftxui_1_1RadioboxOption" ], + [ "ReceiverImpl", "classftxui_1_1ReceiverImpl.html", "classftxui_1_1ReceiverImpl" ], + [ "Ref", "classftxui_1_1Ref.html", "classftxui_1_1Ref" ], + [ "Requirement", "group__dom.html#structftxui_1_1Requirement", "group__dom_structftxui_1_1Requirement" ], + [ "ResizableSplitOption", "structftxui_1_1ResizableSplitOption.html", "structftxui_1_1ResizableSplitOption" ], + [ "Screen", "group__screen.html#classftxui_1_1Screen", "group__screen_classftxui_1_1Screen" ], + [ "ScreenInteractive", "group__component.html#classftxui_1_1ScreenInteractive", "group__component_classftxui_1_1ScreenInteractive" ], + [ "Selection", "group__dom.html#classftxui_1_1Selection", "group__dom_classftxui_1_1Selection" ], + [ "SenderImpl", "classftxui_1_1SenderImpl.html", "classftxui_1_1SenderImpl" ], + [ "SliderOption", "structftxui_1_1SliderOption.html", "structftxui_1_1SliderOption" ], + [ "StringRef", "classftxui_1_1StringRef.html", "classftxui_1_1StringRef" ], + [ "Table", "group__dom.html#classftxui_1_1Table", "group__dom_classftxui_1_1Table" ], + [ "TableSelection", "classftxui_1_1TableSelection.html", "classftxui_1_1TableSelection" ], + [ "TerminalInputParser", "classftxui_1_1TerminalInputParser.html", "classftxui_1_1TerminalInputParser" ], + [ "UnderlineOption", "group__component.html#structftxui_1_1UnderlineOption", "group__component_structftxui_1_1UnderlineOption" ], + [ "WindowOptions", "structftxui_1_1WindowOptions.html", "structftxui_1_1WindowOptions" ], + [ "WindowRenderState", "group__component.html#structftxui_1_1WindowRenderState", "group__component_structftxui_1_1WindowRenderState" ] + ] ] +]; \ No newline at end of file diff --git a/automerge_8cpp.html b/automerge_8cpp.html new file mode 100644 index 000000000..030818a8f --- /dev/null +++ b/automerge_8cpp.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: automerge.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
automerge.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+ + + + +

+Functions

Element automerge (Element child)
 Enable character to be automatically merged with others nearby.
 
+
+
+ + + + + diff --git a/automerge_8cpp.js b/automerge_8cpp.js new file mode 100644 index 000000000..9886abf62 --- /dev/null +++ b/automerge_8cpp.js @@ -0,0 +1,4 @@ +var automerge_8cpp = +[ + [ "automerge", "automerge_8cpp.html#gaca42bd6c44d8d366d5c1014330402086", null ] +]; \ No newline at end of file diff --git a/automerge_8cpp_source.html b/automerge_8cpp_source.html new file mode 100644 index 000000000..7b5c456d0 --- /dev/null +++ b/automerge_8cpp_source.html @@ -0,0 +1,258 @@ + + + + + + + + +FTXUI: automerge.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
automerge.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <memory> // for make_shared
+
5#include <utility> // for move
+
6
+
7#include "ftxui/dom/elements.hpp" // for Element, automerge
+
8#include "ftxui/dom/node.hpp" // for Node
+
9#include "ftxui/dom/node_decorator.hpp" // for NodeDecorator
+
10#include "ftxui/screen/box.hpp" // for Box
+
11#include "ftxui/screen/screen.hpp" // for Pixel, Screen
+
12
+
13namespace ftxui {
+
14
+
15/// @brief Enable character to be automatically merged with others nearby.
+
16/// @ingroup dom
+
+ +
18 class Impl : public NodeDecorator {
+
19 public:
+
20 using NodeDecorator::NodeDecorator;
+
21
+
22 void Render(Screen& screen) override {
+
23 for (int y = box_.y_min; y <= box_.y_max; ++y) {
+
24 for (int x = box_.x_min; x <= box_.x_max; ++x) {
+
25 screen.PixelAt(x, y).automerge = true;
+
26 }
+
27 }
+
28 Node::Render(screen);
+
29 }
+
30 };
+
31
+
32 return std::make_shared<Impl>(std::move(child));
+
33}
+
+
34
+
35} // namespace ftxui
+ + + +
Element automerge(Element child)
Enable character to be automatically merged with others nearby.
Definition automerge.cpp:17
+
Pixel & PixelAt(int x, int y)
Access a cell (Pixel) at a given position.
Definition image.cpp:43
+
bool automerge
Definition pixel.hpp:36
+
A rectangular grid of Pixel.
Definition screen.hpp:26
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+ + + +
+
+ + + + + diff --git a/autoreset_8cppm.html b/autoreset_8cppm.html new file mode 100644 index 000000000..d57078a46 --- /dev/null +++ b/autoreset_8cppm.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: autoreset.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
autoreset.cppm File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+
+
+ + + + + diff --git a/autoreset_8cppm_source.html b/autoreset_8cppm_source.html new file mode 100644 index 000000000..090a2c3e6 --- /dev/null +++ b/autoreset_8cppm_source.html @@ -0,0 +1,229 @@ + + + + + + + + +FTXUI: autoreset.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
autoreset.cppm
+
+
+Go to the documentation of this file.
1/// @module ftxui.util.autoreset
+
2/// @brief Module file for the AutoReset class of the Util module
+
3
+
4module;
+
5
+ +
7
+
8export module ftxui.util.autoreset;
+
9
+
10/**
+
11 * @namespace ftxui
+
12 * @brief The FTXUI ftxui:: namespace
+
13 */
+
14export namespace ftxui {
+
15 using ftxui::AutoReset;
+
16}
+ +
Assign a value to a variable, reset its old value when going out of scope.
Definition autoreset.hpp:13
+
Module file for the AutoReset class of the Util module.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
+
+ + + + + diff --git a/autoreset_8hpp.html b/autoreset_8hpp.html new file mode 100644 index 000000000..c75c433ab --- /dev/null +++ b/autoreset_8hpp.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: autoreset.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
autoreset.hpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Classes

class  AutoReset< T >
 Assign a value to a variable, reset its old value when going out of scope. More...
 
+ + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+
+
+ + + + + diff --git a/autoreset_8hpp.js b/autoreset_8hpp.js new file mode 100644 index 000000000..5103931c4 --- /dev/null +++ b/autoreset_8hpp.js @@ -0,0 +1,4 @@ +var autoreset_8hpp = +[ + [ "AutoReset< T >", "classftxui_1_1AutoReset.html", "classftxui_1_1AutoReset" ] +]; \ No newline at end of file diff --git a/autoreset_8hpp_source.html b/autoreset_8hpp_source.html new file mode 100644 index 000000000..ef61924b6 --- /dev/null +++ b/autoreset_8hpp_source.html @@ -0,0 +1,253 @@ + + + + + + + + +FTXUI: autoreset.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
autoreset.hpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#ifndef FTXUI_UTIL_AUTORESET_HPP
+
5#define FTXUI_UTIL_AUTORESET_HPP
+
6
+
7#include <utility>
+
8
+
9namespace ftxui {
+
10
+
11/// Assign a value to a variable, reset its old value when going out of scope.
+
12template <typename T>
+
+
13class AutoReset {
+
14 public:
+
+
15 AutoReset(T* variable, T new_value)
+
16 : variable_(variable), previous_value_(std::move(*variable)) {
+
17 *variable_ = std::move(new_value);
+
18 }
+
+
19 AutoReset(const AutoReset&) = delete;
+
20 AutoReset(AutoReset&&) = delete;
+
21 AutoReset& operator=(const AutoReset&) = delete;
+ +
23 ~AutoReset() { *variable_ = std::move(previous_value_); }
+
24
+
25 private:
+
26 T* variable_;
+
27 T previous_value_;
+
28};
+
+
29
+
30} // namespace ftxui
+
31
+
32#endif /* end of include guard: FTXUI_UTIL_AUTORESET_HPP */
+
Assign a value to a variable, reset its old value when going out of scope.
Definition autoreset.hpp:13
+
AutoReset(const AutoReset &)=delete
+
AutoReset & operator=(AutoReset &&)=delete
+
AutoReset & operator=(const AutoReset &)=delete
+
AutoReset(AutoReset &&)=delete
+ +
AutoReset(T *variable, T new_value)
Definition autoreset.hpp:15
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
+
+ + + + + diff --git a/bc_s.png b/bc_s.png new file mode 100644 index 000000000..07ac55c04 Binary files /dev/null and b/bc_s.png differ diff --git a/bc_sd.png b/bc_sd.png new file mode 100644 index 000000000..d3fb3fd77 Binary files /dev/null and b/bc_sd.png differ diff --git a/blink_8cpp.html b/blink_8cpp.html new file mode 100644 index 000000000..9c815d26b --- /dev/null +++ b/blink_8cpp.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: blink.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
blink.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+ + + + +

+Functions

Element blink (Element child)
 The text drawn alternates in between visible and hidden.
 
+
+
+ + + + + diff --git a/blink_8cpp.js b/blink_8cpp.js new file mode 100644 index 000000000..77235739a --- /dev/null +++ b/blink_8cpp.js @@ -0,0 +1,4 @@ +var blink_8cpp = +[ + [ "blink", "blink_8cpp.html#gad57613de5895e774218d91dea48d074b", null ] +]; \ No newline at end of file diff --git a/blink_8cpp_source.html b/blink_8cpp_source.html new file mode 100644 index 000000000..e02c8edae --- /dev/null +++ b/blink_8cpp_source.html @@ -0,0 +1,259 @@ + + + + + + + + +FTXUI: blink.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
blink.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <memory> // for make_shared
+
5#include <utility> // for move
+
6
+
7#include "ftxui/dom/elements.hpp" // for Element, blink
+
8#include "ftxui/dom/node.hpp" // for Node
+
9#include "ftxui/dom/node_decorator.hpp" // for NodeDecorator
+
10#include "ftxui/screen/box.hpp" // for Box
+
11#include "ftxui/screen/screen.hpp" // for Pixel, Screen
+
12
+
13namespace ftxui {
+
14
+
15namespace {
+
16class Blink : public NodeDecorator {
+
17 public:
+ +
19
+
20 void Render(Screen& screen) override {
+
21 Node::Render(screen);
+
22 for (int y = box_.y_min; y <= box_.y_max; ++y) {
+
23 for (int x = box_.x_min; x <= box_.x_max; ++x) {
+
24 screen.PixelAt(x, y).blink = true;
+
25 }
+
26 }
+
27 }
+
28};
+
29} // namespace
+
30
+
31/// @brief The text drawn alternates in between visible and hidden.
+
32/// @ingroup dom
+
+ +
34 return std::make_shared<Blink>(std::move(child));
+
35}
+
+
36
+
37} // namespace ftxui
+ +
NodeDecorator(Element child)
+ +
friend void Render(Screen &screen, Node *node, Selection &selection)
Definition node.cpp:96
+
void Render(Screen &screen, const Element &element)
Display an element on a ftxui::Screen.
Definition node.cpp:84
+
Element blink(Element)
The text drawn alternates in between visible and hidden.
Definition blink.cpp:33
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+ + + +
+
+ + + + + diff --git a/bold_8cpp.html b/bold_8cpp.html new file mode 100644 index 000000000..8a10af198 --- /dev/null +++ b/bold_8cpp.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: bold.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
bold.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+ + + + +

+Functions

Element bold (Element child)
 Use a bold font, for elements with more emphasis.
 
+
+
+ + + + + diff --git a/bold_8cpp.js b/bold_8cpp.js new file mode 100644 index 000000000..c4c830271 --- /dev/null +++ b/bold_8cpp.js @@ -0,0 +1,4 @@ +var bold_8cpp = +[ + [ "bold", "bold_8cpp.html#ga353c769068e25303eb41fa2da565c604", null ] +]; \ No newline at end of file diff --git a/bold_8cpp_source.html b/bold_8cpp_source.html new file mode 100644 index 000000000..207a7408a --- /dev/null +++ b/bold_8cpp_source.html @@ -0,0 +1,259 @@ + + + + + + + + +FTXUI: bold.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
bold.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <memory> // for make_shared
+
5#include <utility> // for move
+
6
+
7#include "ftxui/dom/elements.hpp" // for Element, bold
+
8#include "ftxui/dom/node.hpp" // for Node
+
9#include "ftxui/dom/node_decorator.hpp" // for NodeDecorator
+
10#include "ftxui/screen/box.hpp" // for Box
+
11#include "ftxui/screen/screen.hpp" // for Pixel, Screen
+
12
+
13namespace ftxui {
+
14
+
15namespace {
+
16class Bold : public NodeDecorator {
+
17 public:
+ +
19
+
20 void Render(Screen& screen) override {
+
21 for (int y = box_.y_min; y <= box_.y_max; ++y) {
+
22 for (int x = box_.x_min; x <= box_.x_max; ++x) {
+
23 screen.PixelAt(x, y).bold = true;
+
24 }
+
25 }
+
26 Node::Render(screen);
+
27 }
+
28};
+
29} // namespace
+
30
+
31/// @brief Use a bold font, for elements with more emphasis.
+
32/// @ingroup dom
+
+ +
34 return std::make_shared<Bold>(std::move(child));
+
35}
+
+
36
+
37} // namespace ftxui
+ +
NodeDecorator(Element child)
+ +
friend void Render(Screen &screen, Node *node, Selection &selection)
Definition node.cpp:96
+
Element bold(Element)
Use a bold font, for elements with more emphasis.
Definition bold.cpp:33
+
void Render(Screen &screen, const Element &element)
Display an element on a ftxui::Screen.
Definition node.cpp:84
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+ + + +
+
+ + + + + diff --git a/border__colored_8cpp.html b/border__colored_8cpp.html new file mode 100644 index 000000000..2e1589d1c --- /dev/null +++ b/border__colored_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: border_colored.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
border_colored.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 12 of file border_colored.cpp.

+ +
+
+
+
+ + + + + diff --git a/border__colored_8cpp.js b/border__colored_8cpp.js new file mode 100644 index 000000000..c6418b2eb --- /dev/null +++ b/border__colored_8cpp.js @@ -0,0 +1,4 @@ +var border__colored_8cpp = +[ + [ "main", "border__colored_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/border__colored_8cpp_source.html b/border__colored_8cpp_source.html new file mode 100644 index 000000000..2c96c538b --- /dev/null +++ b/border__colored_8cpp_source.html @@ -0,0 +1,256 @@ + + + + + + + + +FTXUI: border_colored.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
border_colored.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <ftxui/dom/elements.hpp> // for operator|, text, Element, Fit, borderDouble, borderHeavy, borderLight, borderRounded, vbox
+
5#include <ftxui/screen/screen.hpp> // for Screen
+
6#include <iostream> // for endl, cout, ostream
+
7#include <memory> // for allocator
+
8
+
9#include "ftxui/dom/node.hpp" // for Render
+
10#include "ftxui/screen/color.hpp" // for ftxui
+
11
+
+
12int main() {
+
13 using namespace ftxui;
+
14
+
15 auto make_boxed = [] {
+
16 return vbox({
+
17 text("borderLight") | borderStyled(LIGHT, Color::Red),
+
18 text("borderDashed") | borderStyled(DASHED, Color::Green),
+
19 text("borderHeavy") | borderStyled(HEAVY, Color::Blue),
+
20 text("borderDouble") | borderStyled(DOUBLE, Color::Yellow),
+
21 text("borderRounded") | borderStyled(ROUNDED, Color::Cyan),
+
22 });
+
23 };
+
24
+
25 auto document = hbox({
+
26 make_boxed(),
+
27 separator() | color(Color::Red),
+
28 make_boxed(),
+
29 separator() | color(Color::Red),
+
30 make_boxed(),
+
31 }) |
+
32 borderStyled(ROUNDED, Color::Red);
+
33
+
34 auto screen =
+
35 Screen::Create(Dimension::Fit(document), Dimension::Fit(document));
+
36 Render(screen, document);
+
37 screen.Print();
+
38 std::cout << std::endl;
+
39}
+
+
int main()
+ + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/border__style_8cpp.html b/border__style_8cpp.html new file mode 100644 index 000000000..42e461e36 --- /dev/null +++ b/border__style_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: border_style.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
border_style.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 12 of file border_style.cpp.

+ +
+
+
+
+ + + + + diff --git a/border__style_8cpp.js b/border__style_8cpp.js new file mode 100644 index 000000000..7919084c5 --- /dev/null +++ b/border__style_8cpp.js @@ -0,0 +1,4 @@ +var border__style_8cpp = +[ + [ "main", "border__style_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/border__style_8cpp_source.html b/border__style_8cpp_source.html new file mode 100644 index 000000000..1d456d69b --- /dev/null +++ b/border__style_8cpp_source.html @@ -0,0 +1,245 @@ + + + + + + + + +FTXUI: border_style.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
border_style.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <ftxui/dom/elements.hpp> // for operator|, text, Element, Fit, borderDouble, borderHeavy, borderLight, borderRounded, vbox
+
5#include <ftxui/screen/screen.hpp> // for Screen
+
6#include <iostream> // for endl, cout, ostream
+
7#include <memory> // for allocator
+
8
+
9#include "ftxui/dom/node.hpp" // for Render
+
10#include "ftxui/screen/color.hpp" // for ftxui
+
11
+
+
12int main() {
+
13 using namespace ftxui;
+
14
+
15 auto document = vbox({
+
16 text("borderLight") | borderLight,
+
17 text("borderDashed") | borderDashed,
+
18 text("borderHeavy") | borderHeavy,
+
19 text("borderDouble") | borderDouble,
+
20 text("borderRounded") | borderRounded,
+
21 });
+
22
+
23 auto screen =
+
24 Screen::Create(Dimension::Fit(document), Dimension::Fit(document));
+
25 Render(screen, document);
+
26 screen.Print();
+
27 std::cout << std::endl;
+
28}
+
+
int main()
+ + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/box_8cpp.html b/box_8cpp.html new file mode 100644 index 000000000..70fb5c708 --- /dev/null +++ b/box_8cpp.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: box.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
box.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+
+
+ + + + + diff --git a/box_8cpp_source.html b/box_8cpp_source.html new file mode 100644 index 000000000..f7f7c20e3 --- /dev/null +++ b/box_8cpp_source.html @@ -0,0 +1,302 @@ + + + + + + + + +FTXUI: box.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
box.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+ +
5
+
6#include <algorithm>
+
7
+
8namespace ftxui {
+
9/// @return the biggest Box contained in both |a| and |b|.
+
10// static
+
+ +
12 return Box{
+
13 std::max(a.x_min, b.x_min),
+
14 std::min(a.x_max, b.x_max),
+
15 std::max(a.y_min, b.y_min),
+
16 std::min(a.y_max, b.y_max),
+
17 };
+
18}
+
+
19
+
20/// @return the smallest Box containing both |a| and |b|.
+
21// static
+
+ +
23 return Box{
+
24 std::min(a.x_min, b.x_min),
+
25 std::max(a.x_max, b.x_max),
+
26 std::min(a.y_min, b.y_min),
+
27 std::max(a.y_max, b.y_max),
+
28 };
+
29}
+
+
30
+
31/// Shift the box by (x,y).
+
32/// @param x horizontal shift.
+
33/// @param y vertical shift.
+
+
34void Box::Shift(int x, int y) {
+
35 x_min += x;
+
36 x_max += x;
+
37 y_min += y;
+
38 y_max += y;
+
39}
+
+
40
+
41/// @return whether (x,y) is contained inside the box.
+
+
42bool Box::Contain(int x, int y) const {
+
43 return x_min <= x && //
+
44 x_max >= x && //
+
45 y_min <= y && //
+
46 y_max >= y;
+
47}
+
+
48
+
49/// @return whether the box is empty.
+
+
50bool Box::IsEmpty() const {
+
51 return x_min > x_max || y_min > y_max;
+
52}
+
+
53
+
54/// @return whether |other| is the same as |this|
+
+
55bool Box::operator==(const Box& other) const {
+
56 return (x_min == other.x_min) && (x_max == other.x_max) &&
+
57 (y_min == other.y_min) && (y_max == other.y_max);
+
58}
+
+
59
+
60/// @return whether |other| and |this| are different.
+
+
61bool Box::operator!=(const Box& other) const {
+
62 return !operator==(other);
+
63}
+
+
64
+
65} // namespace ftxui
+ +
bool operator!=(const Box &other) const
Definition box.cpp:61
+
bool Contain(int x, int y) const
Definition box.cpp:42
+
void Shift(int x, int y)
Definition box.cpp:34
+
int x_max
Definition box.hpp:18
+
int y_min
Definition box.hpp:19
+
static auto Intersection(Box a, Box b) -> Box
Definition box.cpp:11
+
bool IsEmpty() const
Definition box.cpp:50
+
int y_max
Definition box.hpp:20
+
bool operator==(const Box &other) const
Definition box.cpp:55
+
static auto Union(Box a, Box b) -> Box
Definition box.cpp:22
+
int x_min
Definition box.hpp:17
+
Box is a structure that represents a rectangular area in a 2D space.
Definition box.hpp:16
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
+
+ + + + + diff --git a/box_8cppm.html b/box_8cppm.html new file mode 100644 index 000000000..644d80c23 --- /dev/null +++ b/box_8cppm.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: box.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
box.cppm File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+
+
+ + + + + diff --git a/box_8cppm_source.html b/box_8cppm_source.html new file mode 100644 index 000000000..9f4b6bc15 --- /dev/null +++ b/box_8cppm_source.html @@ -0,0 +1,229 @@ + + + + + + + + +FTXUI: box.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
box.cppm
+
+
+Go to the documentation of this file.
1/// @module ftxui.screen.box
+
2/// @brief Module file for the Box struct of the Screen module
+
3
+
4module;
+
5
+ +
7
+
8export module ftxui.screen.box;
+
9
+
10/**
+
11 * @namespace ftxui
+
12 * @brief The FTXUI ftxui:: namespace
+
13 */
+
14export namespace ftxui {
+
15 using ftxui::Box;
+
16}
+ +
Box is a structure that represents a rectangular area in a 2D space.
Definition box.hpp:16
+
Module file for the Box struct of the Screen module.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
+
+ + + + + diff --git a/box_8hpp.html b/box_8hpp.html new file mode 100644 index 000000000..302817e4c --- /dev/null +++ b/box_8hpp.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: box.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
box.hpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Classes

struct  Box
 Box is a structure that represents a rectangular area in a 2D space. More...
 
+ + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+
+
+ + + + + diff --git a/box_8hpp_source.html b/box_8hpp_source.html new file mode 100644 index 000000000..953e47a78 --- /dev/null +++ b/box_8hpp_source.html @@ -0,0 +1,257 @@ + + + + + + + + +FTXUI: box.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
box.hpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#ifndef FTXUI_SCREEN_BOX_HPP
+
5#define FTXUI_SCREEN_BOX_HPP
+
6
+
7namespace ftxui {
+
8
+
9/// @brief Box is a structure that represents a rectangular area in a 2D space.
+
10///
+
11/// It is defined by its minimum and maximum coordinates along the x and y axes.
+
12/// Note that the coordinates are inclusive, meaning that the box includes both
+
13/// the minimum and maximum values.
+
14///
+
15/// @ingroup screen
+
+
16struct Box {
+
17 int x_min = 0;
+
18 int x_max = 0;
+
19 int y_min = 0;
+
20 int y_max = 0;
+
21
+
22 static auto Intersection(Box a, Box b) -> Box;
+
23 static auto Union(Box a, Box b) -> Box;
+
24 void Shift(int x, int y);
+
25 bool Contain(int x, int y) const;
+
26 bool IsEmpty() const;
+
27 bool operator==(const Box& other) const;
+
28 bool operator!=(const Box& other) const;
+
29};
+
+
30
+
31} // namespace ftxui
+
32
+
33#endif // FTXUI_SCREEN_BOX_HPP
+
bool operator!=(const Box &other) const
Definition box.cpp:61
+
bool Contain(int x, int y) const
Definition box.cpp:42
+
void Shift(int x, int y)
Definition box.cpp:34
+
int x_max
Definition box.hpp:18
+
int y_min
Definition box.hpp:19
+
static auto Intersection(Box a, Box b) -> Box
Definition box.cpp:11
+
bool IsEmpty() const
Definition box.cpp:50
+
int y_max
Definition box.hpp:20
+
bool operator==(const Box &other) const
Definition box.cpp:55
+
static auto Union(Box a, Box b) -> Box
Definition box.cpp:22
+
int x_min
Definition box.hpp:17
+
Box is a structure that represents a rectangular area in a 2D space.
Definition box.hpp:16
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
+
+ + + + + diff --git a/box__helper_8cpp.html b/box__helper_8cpp.html new file mode 100644 index 000000000..7baf7ce63 --- /dev/null +++ b/box__helper_8cpp.html @@ -0,0 +1,228 @@ + + + + + + + + +FTXUI: box_helper.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
box_helper.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
namespace  ftxui::box_helper
 
+ + + +

+Functions

void Compute (std::vector< Element > *elements, int target_size)
 
+
+
+ + + + + diff --git a/box__helper_8cpp.js b/box__helper_8cpp.js new file mode 100644 index 000000000..3da01e37d --- /dev/null +++ b/box__helper_8cpp.js @@ -0,0 +1,4 @@ +var box__helper_8cpp = +[ + [ "Compute", "box__helper_8cpp.html#aede4ed6e71fbe0689a500ff8db06f3a3", null ] +]; \ No newline at end of file diff --git a/box__helper_8cpp_source.html b/box__helper_8cpp_source.html new file mode 100644 index 000000000..5e277dd01 --- /dev/null +++ b/box__helper_8cpp_source.html @@ -0,0 +1,310 @@ + + + + + + + + +FTXUI: box_helper.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
box_helper.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2021 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+ +
5
+
6#include <algorithm> // for max
+
7#include <vector> // for vector
+
8
+
+ +
10
+
11namespace {
+
12// Called when the size allowed is greater than the requested size. This
+
13// distributes the extra spaces toward the flexible elements, in relative
+
14// proportions.
+
15void ComputeGrow(std::vector<Element>* elements,
+
16 int extra_space,
+
17 int flex_grow_sum) {
+
18 for (Element& element : *elements) {
+
19 const int added_space =
+
20 extra_space * element.flex_grow / std::max(flex_grow_sum, 1);
+
21 extra_space -= added_space;
+
22 flex_grow_sum -= element.flex_grow;
+
23 element.size = element.min_size + added_space;
+
24 }
+
25}
+
26
+
27// Called when the size allowed is lower than the requested size, and the
+
28// shrinkable element can absorbe the (negative) extra_space. This distribute
+
29// the extra_space toward those.
+
30void ComputeShrinkEasy(std::vector<Element>* elements,
+
31 int extra_space,
+
32 int flex_shrink_sum) {
+
33 for (Element& element : *elements) {
+
34 const int added_space = extra_space * element.min_size *
+
35 element.flex_shrink / std::max(flex_shrink_sum, 1);
+
36 extra_space -= added_space;
+
37 flex_shrink_sum -= element.flex_shrink * element.min_size;
+
38 element.size = element.min_size + added_space;
+
39 }
+
40}
+
41
+
42// Called when the size allowed is lower than the requested size, and the
+
43// shrinkable element can not absorbe the (negative) extra_space. This assign
+
44// zero to shrinkable elements and distribute the remaining (negative)
+
45// extra_space toward the other non shrinkable elements.
+
46void ComputeShrinkHard(std::vector<Element>* elements,
+
47 int extra_space,
+
48 int size) {
+
49 for (Element& element : *elements) {
+
50 if (element.flex_shrink != 0) {
+
51 element.size = 0;
+
52 continue;
+
53 }
+
54
+
55 const int added_space = extra_space * element.min_size / std::max(1, size);
+
56 extra_space -= added_space;
+
57 size -= element.min_size;
+
58
+
59 element.size = element.min_size + added_space;
+
60 }
+
61}
+
62
+
63} // namespace
+
64
+
+
65void Compute(std::vector<Element>* elements, int target_size) {
+
66 int size = 0;
+
67 int flex_grow_sum = 0;
+
68 int flex_shrink_sum = 0;
+
69 int flex_shrink_size = 0;
+
70
+
71 for (auto& element : *elements) {
+
72 flex_grow_sum += element.flex_grow;
+
73 flex_shrink_sum += element.min_size * element.flex_shrink;
+
74 if (element.flex_shrink != 0) {
+
75 flex_shrink_size += element.min_size;
+
76 }
+
77 size += element.min_size;
+
78 }
+
79
+
80 const int extra_space = target_size - size;
+
81 if (extra_space >= 0) {
+
82 ComputeGrow(elements, extra_space, flex_grow_sum);
+
83 } else if (flex_shrink_size + extra_space >= 0) {
+
84 ComputeShrinkEasy(elements, extra_space, flex_shrink_sum);
+
85
+
86 } else {
+
87 ComputeShrinkHard(elements, extra_space + flex_shrink_size,
+
88 size - flex_shrink_size);
+
89 }
+
90}
+
+
91
+
92} // namespace ftxui::box_helper
+
+ +
Decorator size(WidthOrHeight, Constraint, int value)
Apply a constraint on the size of an element.
+ +
void Compute(std::vector< Element > *elements, int target_size)
+ +
+
+ + + + + diff --git a/box__helper_8hpp.html b/box__helper_8hpp.html new file mode 100644 index 000000000..96c16d97f --- /dev/null +++ b/box__helper_8hpp.html @@ -0,0 +1,234 @@ + + + + + + + + +FTXUI: box_helper.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
box_helper.hpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Classes

struct  Element
 
+ + + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
namespace  ftxui::box_helper
 
+ + + +

+Functions

void Compute (std::vector< Element > *elements, int target_size)
 
+
+
+ + + + + diff --git a/box__helper_8hpp.js b/box__helper_8hpp.js new file mode 100644 index 000000000..264ab37d5 --- /dev/null +++ b/box__helper_8hpp.js @@ -0,0 +1,5 @@ +var box__helper_8hpp = +[ + [ "Element", "structftxui_1_1box__helper_1_1Element.html", "structftxui_1_1box__helper_1_1Element" ], + [ "Compute", "box__helper_8hpp.html#aede4ed6e71fbe0689a500ff8db06f3a3", null ] +]; \ No newline at end of file diff --git a/box__helper_8hpp_source.html b/box__helper_8hpp_source.html new file mode 100644 index 000000000..8a0ab1b67 --- /dev/null +++ b/box__helper_8hpp_source.html @@ -0,0 +1,241 @@ + + + + + + + + +FTXUI: box_helper.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
box_helper.hpp
+
+
+Go to the documentation of this file.
1// Copyright 2021 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.line.
+
4#ifndef FTXUI_DOM_BOX_HELPER_HPP
+
5#define FTXUI_DOM_BOX_HELPER_HPP
+
6
+
7#include <vector>
+ +
9
+
10namespace ftxui::box_helper {
+
11
+
+
12struct Element {
+
13 // Input:
+
14 int min_size = 0;
+
15 int flex_grow = 0;
+
16 int flex_shrink = 0;
+
17
+
18 // Output;
+
19 int size = 0;
+
20};
+
+
21
+
22void Compute(std::vector<Element>* elements, int target_size);
+
23} // namespace ftxui::box_helper
+
24
+
25#endif /* end of include guard: FTXUI_DOM_BOX_HELPER_HPP */
+ +
void Compute(std::vector< Element > *elements, int target_size)
+ + + +
+
+ + + + + diff --git a/button__animated_8cpp.html b/button__animated_8cpp.html new file mode 100644 index 000000000..28405a5bc --- /dev/null +++ b/button__animated_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: button_animated.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
button_animated.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 17 of file button_animated.cpp.

+ +
+
+
+
+ + + + + diff --git a/button__animated_8cpp.js b/button__animated_8cpp.js new file mode 100644 index 000000000..85f8d8e62 --- /dev/null +++ b/button__animated_8cpp.js @@ -0,0 +1,4 @@ +var button__animated_8cpp = +[ + [ "main", "button__animated_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/button__animated_8cpp_source.html b/button__animated_8cpp_source.html new file mode 100644 index 000000000..45de094d1 --- /dev/null +++ b/button__animated_8cpp_source.html @@ -0,0 +1,278 @@ + + + + + + + + +FTXUI: button_animated.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
button_animated.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <memory> // for shared_ptr, __shared_ptr_access
+
5#include <string> // for operator+, to_string
+
6
+
7#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
8#include "ftxui/component/component.hpp" // for Button, Horizontal, Renderer
+
9#include "ftxui/component/component_base.hpp" // for ComponentBase
+
10#include "ftxui/component/component_options.hpp" // for ButtonOption
+
11#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
12#include "ftxui/dom/elements.hpp" // for gauge, separator, text, vbox, operator|, Element, border
+
13#include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Green, Color::Red
+
14
+
15using namespace ftxui;
+
16
+
+
17int main() {
+
18 int value = 50;
+
19
+
20 // The tree of components. This defines how to navigate using the keyboard.
+
21 auto buttons = Container::Horizontal({
+
22 Button(
+
23 "Decrease", [&] { value--; }, ButtonOption::Animated(Color::Red)),
+
24 Button(
+
25 "Reset", [&] { value = 50; }, ButtonOption::Animated(Color::Green)),
+
26 Button(
+
27 "Increase", [&] { value++; }, ButtonOption::Animated(Color::Blue)),
+
28 });
+
29
+
30 // Modify the way to render them on screen:
+
31 auto component = Renderer(buttons, [&] {
+
32 return vbox({
+
33 vbox({
+
34 text("value = " + std::to_string(value)),
+
35 separator(),
+
36 gauge(value * 0.01f),
+
37 }) | border,
+
38 buttons->Render(),
+
39 });
+
40 });
+
41
+
42 auto screen = ScreenInteractive::FitComponent();
+
43 screen.Loop(component);
+
44 return 0;
+
45}
+
+
int main()
+ + + + + + +
static ButtonOption Animated()
Create a ButtonOption, using animated colors.
+
static ScreenInteractive FitComponent()
+
Component Horizontal(Components children)
A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow...
+
Component Button(ButtonOption options)
Draw a button. Execute a function when clicked.
+
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
+
virtual void Render(Screen &screen)
Display an element on a ftxui::Screen.
Definition node.cpp:59
+
Element text(std::wstring text)
Display a piece of unicode text.
Definition text.cpp:160
+
Element separator()
Draw a vertical or horizontal separation in between two other elements.
+
Element gauge(float progress)
Draw a high definition progress bar.
+
Element vbox(Elements)
A container displaying elements vertically one by one.
Definition vbox.cpp:96
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/button__in__frame_8cpp.html b/button__in__frame_8cpp.html new file mode 100644 index 000000000..b95db64be --- /dev/null +++ b/button__in__frame_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: button_in_frame.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
button_in_frame.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 17 of file button_in_frame.cpp.

+ +
+
+
+
+ + + + + diff --git a/button__in__frame_8cpp.js b/button__in__frame_8cpp.js new file mode 100644 index 000000000..f1699abcc --- /dev/null +++ b/button__in__frame_8cpp.js @@ -0,0 +1,4 @@ +var button__in__frame_8cpp = +[ + [ "main", "button__in__frame_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/button__in__frame_8cpp_source.html b/button__in__frame_8cpp_source.html new file mode 100644 index 000000000..776ea863d --- /dev/null +++ b/button__in__frame_8cpp_source.html @@ -0,0 +1,283 @@ + + + + + + + + +FTXUI: button_in_frame.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
button_in_frame.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2022 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <memory> // for allocator, __shared_ptr_access, shared_ptr
+
5#include <string> // for to_string, operator+
+
6
+
7#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
8#include "ftxui/component/component.hpp" // for Button, Renderer, Vertical
+
9#include "ftxui/component/component_base.hpp" // for ComponentBase
+
10#include "ftxui/component/component_options.hpp" // for ButtonOption
+
11#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
12#include "ftxui/dom/elements.hpp" // for operator|, text, Element, hbox, separator, size, vbox, border, frame, vscroll_indicator, HEIGHT, LESS_THAN
+
13#include "ftxui/screen/color.hpp" // for Color, Color::Default, Color::GrayDark, Color::White
+
14
+
15using namespace ftxui;
+
16
+
+
17int main() {
+
18 int counter = 0;
+
19 auto on_click = [&] { counter++; };
+
20
+ + +
23
+
24 auto container = Container::Vertical({});
+
25 for (int i = 0; i < 30; ++i) {
+
26 auto button = Button("Button " + std::to_string(i), on_click, style);
+
27 container->Add(button);
+
28 }
+
29
+
30 auto renderer = Renderer(container, [&] {
+
31 return vbox({
+
32 hbox({
+
33 text("Counter:"),
+
34 text(std::to_string(counter)),
+
35 }),
+
36 separator(),
+
37 container->Render() | vscroll_indicator | frame |
+
38 size(HEIGHT, LESS_THAN, 20),
+
39 }) |
+
40 border;
+
41 });
+
42
+
43 auto screen = ScreenInteractive::FitComponent();
+
44 screen.Loop(renderer);
+
45
+
46 return 0;
+
47}
+
+
int main()
+ + + + + + +
static ButtonOption Animated()
Create a ButtonOption, using animated colors.
+
static ScreenInteractive FitComponent()
+
Component Button(ButtonOption options)
Draw a button. Execute a function when clicked.
+
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
+
Component Vertical(Components children)
A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
+
virtual void Render(Screen &screen)
Display an element on a ftxui::Screen.
Definition node.cpp:59
+
Decorator size(WidthOrHeight, Constraint, int value)
Apply a constraint on the size of an element.
+
Element text(std::wstring text)
Display a piece of unicode text.
Definition text.cpp:160
+
Element separator()
Draw a vertical or horizontal separation in between two other elements.
+
Element vbox(Elements)
A container displaying elements vertically one by one.
Definition vbox.cpp:96
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
Element hbox(Elements)
A container displaying elements horizontally one by one.
Definition hbox.cpp:94
+
@ LESS_THAN
Definition elements.hpp:162
+ +
+
+ + + + + diff --git a/button__style_8cpp.html b/button__style_8cpp.html new file mode 100644 index 000000000..d651e1def --- /dev/null +++ b/button__style_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: button_style.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
button_style.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 16 of file button_style.cpp.

+ +
+
+
+
+ + + + + diff --git a/button__style_8cpp.js b/button__style_8cpp.js new file mode 100644 index 000000000..60f4b3dab --- /dev/null +++ b/button__style_8cpp.js @@ -0,0 +1,4 @@ +var button__style_8cpp = +[ + [ "main", "button__style_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/button__style_8cpp_source.html b/button__style_8cpp_source.html new file mode 100644 index 000000000..658491ac2 --- /dev/null +++ b/button__style_8cpp_source.html @@ -0,0 +1,292 @@ + + + + + + + + +FTXUI: button_style.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
button_style.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <string> // for operator+, to_string
+
5
+
6#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
7#include "ftxui/component/component.hpp" // for Button, Vertical, Renderer, Horizontal, operator|
+
8#include "ftxui/component/component_base.hpp" // for Component
+
9#include "ftxui/component/component_options.hpp" // for ButtonOption
+
10#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
11#include "ftxui/dom/elements.hpp" // for Element, separator, text, border
+
12#include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Green, Color::Red
+
13
+
14using namespace ftxui;
+
15
+
+
16int main() {
+
17 int value = 0;
+
18 auto action = [&] { value++; };
+
19 auto action_renderer =
+
20 Renderer([&] { return text("count = " + std::to_string(value)); });
+
21
+
22 auto buttons =
+ +
24 action_renderer,
+
25 Renderer([] { return separator(); }),
+
26 Container::Horizontal({
+ +
28 Button("Ascii 1", action, ButtonOption::Ascii()),
+
29 Button("Ascii 2", action, ButtonOption::Ascii()),
+
30 Button("Ascii 3", action, ButtonOption::Ascii()),
+
31 }),
+
32 Renderer([] { return separator(); }),
+
33 Container::Vertical({
+
34 Button("Simple 1", action, ButtonOption::Simple()),
+
35 Button("Simple 2", action, ButtonOption::Simple()),
+
36 Button("Simple 3", action, ButtonOption::Simple()),
+
37 }),
+
38 Renderer([] { return separator(); }),
+
39 Container::Vertical({
+
40 Button("Animated 1", action, ButtonOption::Animated()),
+
41 Button("Animated 2", action, ButtonOption::Animated()),
+
42 Button("Animated 3", action, ButtonOption::Animated()),
+
43 }),
+
44 Renderer([] { return separator(); }),
+
45 Container::Vertical({
+
46 Button("Animated 4", action,
+ +
48 Button("Animated 5", action,
+ +
50 Button("Animated 6", action,
+ +
52 }),
+
53 }),
+
54 }) |
+
55 border;
+
56
+
57 auto screen = ScreenInteractive::FitComponent();
+
58 screen.Loop(buttons);
+
59 return 0;
+
60}
+
+
int main()
+ + + + + + +
static ButtonOption Animated()
Create a ButtonOption, using animated colors.
+
static ScreenInteractive FitComponent()
+
static ButtonOption Simple()
Create a ButtonOption, inverted when focused.
+
static ButtonOption Ascii()
Create a ButtonOption, highlighted using [] characters.
+
Component Button(ButtonOption options)
Draw a button. Execute a function when clicked.
+
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
+
Component Vertical(Components children)
A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
+
Element text(std::wstring text)
Display a piece of unicode text.
Definition text.cpp:160
+
Element separator()
Draw a vertical or horizontal separation in between two other elements.
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/canvas_8cppm.html b/canvas_8cppm.html new file mode 100644 index 000000000..cc2216ae1 --- /dev/null +++ b/canvas_8cppm.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: canvas.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
canvas.cppm File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+
+
+ + + + + diff --git a/canvas_8cppm_source.html b/canvas_8cppm_source.html new file mode 100644 index 000000000..4665c293c --- /dev/null +++ b/canvas_8cppm_source.html @@ -0,0 +1,229 @@ + + + + + + + + +FTXUI: canvas.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
canvas.cppm
+
+
+Go to the documentation of this file.
1/// @module ftxui.dom.canvas
+
2/// @brief Module file for the Canvas struct of the Dom module
+
3
+
4module;
+
5
+ +
7
+
8export module ftxui.dom.canvas;
+
9
+
10/**
+
11 * @namespace ftxui
+
12 * @brief The FTXUI ftxui:: namespace
+
13 */
+
14export namespace ftxui {
+
15 using ftxui::Canvas;
+
16}
+ +
Canvas is a drawable buffer associated with drawing operations.
Definition canvas.hpp:38
+
Module file for the Canvas struct of the Dom module.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
+
+ + + + + diff --git a/canvas_8hpp.html b/canvas_8hpp.html new file mode 100644 index 000000000..50efc1565 --- /dev/null +++ b/canvas_8hpp.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: canvas.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
canvas.hpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Classes

struct  Canvas
 Canvas is a drawable buffer associated with drawing operations. More...
 
+ + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+
+
+ + + + + diff --git a/canvas_8hpp_source.html b/canvas_8hpp_source.html new file mode 100644 index 000000000..c8275becd --- /dev/null +++ b/canvas_8hpp_source.html @@ -0,0 +1,407 @@ + + + + + + + + +FTXUI: canvas.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
canvas.hpp
+
+
+Go to the documentation of this file.
1// Copyright 2021 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#ifndef FTXUI_DOM_CANVAS_HPP
+
5#define FTXUI_DOM_CANVAS_HPP
+
6
+
7#include <cstddef> // for size_t
+
8#include <functional> // for function
+
9#include <string> // for string
+
10#include <unordered_map> // for unordered_map
+
11
+
12#include "ftxui/screen/color.hpp" // for Color
+
13#include "ftxui/screen/image.hpp" // for Pixel, Image
+
14
+
15#ifdef DrawText
+
16// Workaround for WinUsr.h (via Windows.h) defining macros that break things.
+
17// https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-drawtext
+
18#undef DrawText
+
19#endif
+
20
+
21namespace ftxui {
+
22
+
23/// @brief Canvas is a drawable buffer associated with drawing operations.
+
24///
+
25/// Canvas is a drawable area that can be used to create complex graphics. It
+
26/// supports drawing points, lines, circles, ellipses, text, and images using
+
27/// braille, block, or normal characters.
+
28///
+
29/// Note: A terminal contains cells. A cells is a unit of:
+
30/// - 2x4 braille characters (1x1 pixel)
+
31/// - 2x2 block characters (2x2 pixels)
+
32/// - 2x4 normal characters (2x4 pixels)
+
33///
+
34/// You need to multiply the x coordinate by 2 and the y coordinate by 4 to
+
35/// get the correct position in the terminal.
+
36///
+
37/// @ingroup dom
+
+
38struct Canvas {
+
39 public:
+
40 Canvas() = default;
+
41 Canvas(int width, int height);
+
42
+
43 // Getters:
+
44 int width() const { return width_; }
+
45 int height() const { return height_; }
+
46 Pixel GetPixel(int x, int y) const;
+
47
+
48 using Stylizer = std::function<void(Pixel&)>;
+
49
+
50 // Draws using braille characters --------------------------------------------
+
51 void DrawPointOn(int x, int y);
+
52 void DrawPointOff(int x, int y);
+
53 void DrawPointToggle(int x, int y);
+
54 void DrawPoint(int x, int y, bool value);
+
55 void DrawPoint(int x, int y, bool value, const Stylizer& s);
+
56 void DrawPoint(int x, int y, bool value, const Color& color);
+
57 void DrawPointLine(int x1, int y1, int x2, int y2);
+
58 void DrawPointLine(int x1, int y1, int x2, int y2, const Stylizer& s);
+
59 void DrawPointLine(int x1, int y1, int x2, int y2, const Color& color);
+
60 void DrawPointCircle(int x, int y, int radius);
+
61 void DrawPointCircle(int x, int y, int radius, const Stylizer& s);
+
62 void DrawPointCircle(int x, int y, int radius, const Color& color);
+
63 void DrawPointCircleFilled(int x, int y, int radius);
+
64 void DrawPointCircleFilled(int x, int y, int radius, const Stylizer& s);
+
65 void DrawPointCircleFilled(int x, int y, int radius, const Color& color);
+
66 void DrawPointEllipse(int x, int y, int r1, int r2);
+
67 void DrawPointEllipse(int x, int y, int r1, int r2, const Color& color);
+
68 void DrawPointEllipse(int x, int y, int r1, int r2, const Stylizer& s);
+
69 void DrawPointEllipseFilled(int x, int y, int r1, int r2);
+
70 void DrawPointEllipseFilled(int x, int y, int r1, int r2, const Color& color);
+
71 void DrawPointEllipseFilled(int x, int y, int r1, int r2, const Stylizer& s);
+
72
+
73 // Draw using box characters -------------------------------------------------
+
74 // Block are of size 1x2. y is considered to be a multiple of 2.
+
75 void DrawBlockOn(int x, int y);
+
76 void DrawBlockOff(int x, int y);
+
77 void DrawBlockToggle(int x, int y);
+
78 void DrawBlock(int x, int y, bool value);
+
79 void DrawBlock(int x, int y, bool value, const Stylizer& s);
+
80 void DrawBlock(int x, int y, bool value, const Color& color);
+
81 void DrawBlockLine(int x1, int y1, int x2, int y2);
+
82 void DrawBlockLine(int x1, int y1, int x2, int y2, const Stylizer& s);
+
83 void DrawBlockLine(int x1, int y1, int x2, int y2, const Color& color);
+
84 void DrawBlockCircle(int x1, int y1, int radius);
+
85 void DrawBlockCircle(int x1, int y1, int radius, const Stylizer& s);
+
86 void DrawBlockCircle(int x1, int y1, int radius, const Color& color);
+
87 void DrawBlockCircleFilled(int x1, int y1, int radius);
+
88 void DrawBlockCircleFilled(int x1, int y1, int radius, const Stylizer& s);
+
89 void DrawBlockCircleFilled(int x1, int y1, int radius, const Color& color);
+
90 void DrawBlockEllipse(int x1, int y1, int r1, int r2);
+
91 void DrawBlockEllipse(int x1, int y1, int r1, int r2, const Stylizer& s);
+
92 void DrawBlockEllipse(int x1, int y1, int r1, int r2, const Color& color);
+
93 void DrawBlockEllipseFilled(int x1, int y1, int r1, int r2);
+
94 void DrawBlockEllipseFilled(int x1,
+
95 int y1,
+
96 int r1,
+
97 int r2,
+
98 const Stylizer& s);
+
99 void DrawBlockEllipseFilled(int x1,
+
100 int y1,
+
101 int r1,
+
102 int r2,
+
103 const Color& color);
+
104
+
105 // Draw using normal characters ----------------------------------------------
+
106 // Draw using character of size 2x4 at position (x,y)
+
107 // x is considered to be a multiple of 2.
+
108 // y is considered to be a multiple of 4.
+
109 void DrawText(int x, int y, const std::string& value);
+
110 void DrawText(int x, int y, const std::string& value, const Color& color);
+
111 void DrawText(int x, int y, const std::string& value, const Stylizer& style);
+
112
+
113 // Draw using directly pixels or images --------------------------------------
+
114 // x is considered to be a multiple of 2.
+
115 // y is considered to be a multiple of 4.
+
116 void DrawPixel(int x, int y, const Pixel&);
+
117 void DrawImage(int x, int y, const Image&);
+
118
+
119 // Decorator:
+
120 // x is considered to be a multiple of 2.
+
121 // y is considered to be a multiple of 4.
+
122 void Style(int x, int y, const Stylizer& style);
+
123
+
124 private:
+
125 bool IsIn(int x, int y) const {
+
126 return x >= 0 && x < width_ && y >= 0 && y < height_;
+
127 }
+
128
+
129 enum CellType {
+
130 kCell, // Units of size 2x4
+
131 kBlock, // Units of size 2x2
+
132 kBraille, // Units of size 1x1
+
133 };
+
134
+
135 struct Cell {
+
136 CellType type = kCell;
+
137 Pixel content;
+
138 };
+
139
+
140 struct XY {
+
141 int x;
+
142 int y;
+
143 bool operator==(const XY& other) const {
+
144 return x == other.x && y == other.y;
+
145 }
+
146 };
+
147
+
148 struct XYHash {
+
149 size_t operator()(const XY& xy) const {
+
150 constexpr size_t shift = 1024;
+
151 return size_t(xy.x) * shift + size_t(xy.y);
+
152 }
+
153 };
+
154
+
155 int width_ = 0;
+
156 int height_ = 0;
+
157 std::unordered_map<XY, Cell, XYHash> storage_;
+
158};
+
+
159
+
160} // namespace ftxui
+
161
+
162#endif // FTXUI_DOM_CANVAS_HPP
+ +
ButtonOption Style()
+
void DrawImage(int x, int y, const Image &)
Draw a predefined image, with top-left corner at the given coordinate You can supply negative coordin...
+
void DrawBlockLine(int x1, int y1, int x2, int y2)
Draw a line made of block characters.
+
void DrawPointEllipseFilled(int x, int y, int r1, int r2)
Draw a filled ellipse made of braille dots.
+
void DrawPointLine(int x1, int y1, int x2, int y2)
Draw a line made of braille dots.
+
void DrawText(int x, int y, const std::string &value)
Draw a piece of text.
+
Canvas()=default
+
std::function< void(Pixel &)> Stylizer
Definition canvas.hpp:48
+
void DrawBlockOn(int x, int y)
Draw a block.
+
void DrawPointCircleFilled(int x, int y, int radius)
Draw a filled circle made of braille dots.
+
void DrawPointOn(int x, int y)
Draw a braille dot.
+
void DrawPointOff(int x, int y)
Erase a braille dot.
+
Pixel GetPixel(int x, int y) const
Get the content of a cell.
+
void DrawBlockEllipseFilled(int x1, int y1, int r1, int r2)
Draw a filled ellipse made of block characters.
+
void DrawPointEllipse(int x, int y, int r1, int r2)
Draw an ellipse made of braille dots.
+
void DrawPoint(int x, int y, bool value)
Draw a braille dot.
+
void DrawBlockEllipse(int x1, int y1, int r1, int r2)
Draw an ellipse made of block characters.
+
void DrawBlockToggle(int x, int y)
Toggle a block. If it is filled, it will be erased. If it is empty, it will be filled.
+
void DrawBlockCircle(int x1, int y1, int radius)
Draw a circle made of block characters.
+
void DrawBlockCircleFilled(int x1, int y1, int radius)
Draw a filled circle made of block characters.
+
void DrawPointCircle(int x, int y, int radius)
Draw a circle made of braille dots.
+
int height() const
Definition canvas.hpp:45
+
void DrawBlockOff(int x, int y)
Erase a block.
+
int width() const
Definition canvas.hpp:44
+
void DrawBlock(int x, int y, bool value)
Draw a block.
+
void DrawPointToggle(int x, int y)
Toggle a braille dot. A filled one will be erased, and the other will be drawn.
+
void DrawPixel(int x, int y, const Pixel &)
Directly draw a predefined pixel at the given coordinate.
+
Canvas is a drawable buffer associated with drawing operations.
Definition canvas.hpp:38
+
Color is a class that represents a color in the terminal user interface.
Definition color.hpp:22
+
A rectangular grid of Pixel.
Definition image.hpp:17
+
A Unicode character and its associated style.
Definition pixel.hpp:15
+ +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
+
+ + + + + diff --git a/canvas__animated_8cpp.html b/canvas__animated_8cpp.html new file mode 100644 index 000000000..fddaa6dd2 --- /dev/null +++ b/canvas__animated_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: canvas_animated.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
canvas_animated.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 20 of file canvas_animated.cpp.

+ +
+
+
+
+ + + + + diff --git a/canvas__animated_8cpp.js b/canvas__animated_8cpp.js new file mode 100644 index 000000000..e6883829c --- /dev/null +++ b/canvas__animated_8cpp.js @@ -0,0 +1,4 @@ +var canvas__animated_8cpp = +[ + [ "main", "canvas__animated_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/canvas__animated_8cpp_source.html b/canvas__animated_8cpp_source.html new file mode 100644 index 000000000..a268c257c --- /dev/null +++ b/canvas__animated_8cpp_source.html @@ -0,0 +1,493 @@ + + + + + + + + +FTXUI: canvas_animated.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
canvas_animated.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2021 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSED file.
+
4#include <cmath> // for sin, cos
+
5#include <ftxui/dom/elements.hpp> // for canvas, Element, separator, hbox, operator|, border
+
6#include <ftxui/screen/screen.hpp> // for Pixel
+
7#include <memory> // for allocator, shared_ptr, __shared_ptr_access
+
8#include <string> // for string, basic_string
+
9#include <utility> // for move
+
10#include <vector> // for vector, __alloc_traits<>::value_type
+
11
+
12#include "ftxui/component/component.hpp" // for Renderer, CatchEvent, Horizontal, Menu, Tab
+
13#include "ftxui/component/component_base.hpp" // for ComponentBase
+
14#include "ftxui/component/event.hpp" // for Event
+
15#include "ftxui/component/mouse.hpp" // for Mouse
+
16#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
17#include "ftxui/dom/canvas.hpp" // for Canvas
+
18#include "ftxui/screen/color.hpp" // for Color, Color::Red, Color::Blue, Color::Green, ftxui
+
19
+
+
20int main() {
+
21 using namespace ftxui;
+
22
+
23 int mouse_x = 0;
+
24 int mouse_y = 0;
+
25
+
26 // A triangle following the mouse, using braille characters.
+
27 auto renderer_line_braille = Renderer([&] {
+
28 auto c = Canvas(100, 100);
+
29 c.DrawText(0, 0, "Several lines (braille)");
+
30 c.DrawPointLine(mouse_x, mouse_y, 80, 10, Color::Red);
+
31 c.DrawPointLine(80, 10, 80, 40, Color::Blue);
+
32 c.DrawPointLine(80, 40, mouse_x, mouse_y, Color::Green);
+
33 return canvas(std::move(c));
+
34 });
+
35
+
36 // A triangle following the mouse, using block characters.
+
37 auto renderer_line_block = Renderer([&] {
+
38 auto c = Canvas(100, 100);
+
39 c.DrawText(0, 0, "Several lines (block)");
+
40 c.DrawBlockLine(mouse_x, mouse_y, 80, 10, Color::Red);
+
41 c.DrawBlockLine(80, 10, 80, 40, Color::Blue);
+
42 c.DrawBlockLine(80, 40, mouse_x, mouse_y, Color::Green);
+
43 return canvas(std::move(c));
+
44 });
+
45
+
46 // A circle following the mouse, using braille characters.
+
47 auto renderer_circle_braille = Renderer([&] {
+
48 auto c = Canvas(100, 100);
+
49 c.DrawText(0, 0, "A circle (braille)");
+
50 c.DrawPointCircle(mouse_x, mouse_y, 30);
+
51 return canvas(std::move(c));
+
52 });
+
53
+
54 // A circle following the mouse, using block characters.
+
55 auto renderer_circle_block = Renderer([&] {
+
56 auto c = Canvas(100, 100);
+
57 c.DrawText(0, 0, "A circle (block)");
+
58 c.DrawBlockCircle(mouse_x, mouse_y, 30);
+
59 return canvas(std::move(c));
+
60 });
+
61
+
62 // A filled circle following the mouse, using braille characters.
+
63 auto renderer_circle_filled_braille = Renderer([&] {
+
64 auto c = Canvas(100, 100);
+
65 c.DrawText(0, 0, "A circle filled (braille)");
+
66 c.DrawPointCircleFilled(mouse_x, mouse_y, 30);
+
67 return canvas(std::move(c));
+
68 });
+
69
+
70 // A filled circle following the mouse, using block characters.
+
71 auto renderer_circle_filled_block = Renderer([&] {
+
72 auto c = Canvas(100, 100);
+
73 c.DrawText(0, 0, "A circle filled (block)");
+
74 c.DrawBlockCircleFilled(mouse_x, mouse_y, 30);
+
75 return canvas(std::move(c));
+
76 });
+
77
+
78 // An ellipse following the mouse, using braille characters.
+
79 auto renderer_ellipse_braille = Renderer([&] {
+
80 auto c = Canvas(100, 100);
+
81 c.DrawText(0, 0, "An ellipse (braille)");
+
82 c.DrawPointEllipse(mouse_x / 2, mouse_y / 2, mouse_x / 2, mouse_y / 2);
+
83 return canvas(std::move(c));
+
84 });
+
85
+
86 // An ellipse following the mouse, using block characters.
+
87 auto renderer_ellipse_block = Renderer([&] {
+
88 auto c = Canvas(100, 100);
+
89 c.DrawText(0, 0, "An ellipse (block)");
+
90 c.DrawBlockEllipse(mouse_x / 2, mouse_y / 2, mouse_x / 2, mouse_y / 2);
+
91 return canvas(std::move(c));
+
92 });
+
93
+
94 // An ellipse following the mouse filled, using braille characters.
+
95 auto renderer_ellipse_filled_braille = Renderer([&] {
+
96 auto c = Canvas(100, 100);
+
97 c.DrawText(0, 0, "A filled ellipse (braille)");
+
98 c.DrawPointEllipseFilled(mouse_x / 2, mouse_y / 2, mouse_x / 2,
+
99 mouse_y / 2);
+
100 return canvas(std::move(c));
+
101 });
+
102
+
103 // An ellipse following the mouse filled, using block characters.
+
104 auto renderer_ellipse_filled_block = Renderer([&] {
+
105 auto c = Canvas(100, 100);
+
106 c.DrawText(0, 0, "A filled ellipse (block)");
+
107 c.DrawBlockEllipseFilled(mouse_x / 2, mouse_y / 2, mouse_x / 2,
+
108 mouse_y / 2);
+
109 c.DrawBlockEllipse(mouse_x / 2, mouse_y / 2, mouse_x / 2, mouse_y / 2);
+
110 return canvas(std::move(c));
+
111 });
+
112
+
113 // A text following the mouse
+
114 auto renderer_text = Renderer([&] {
+
115 auto c = Canvas(100, 100);
+
116 c.DrawText(0, 0, "A piece of text");
+
117 c.DrawText(mouse_x, mouse_y, "This is a piece of text with effects",
+
118 [](Pixel& p) {
+
119 p.foreground_color = Color::Red;
+
120 p.underlined = true;
+
121 p.bold = true;
+
122 });
+
123 return canvas(std::move(c));
+
124 });
+
125
+
126 auto renderer_plot_1 = Renderer([&] {
+
127 auto c = Canvas(100, 100);
+
128 c.DrawText(0, 0, "A graph");
+
129
+
130 std::vector<int> ys(100);
+
131 for (int x = 0; x < 100; x++) {
+
132 float dx = float(x - mouse_x);
+
133 float dy = 50.f;
+
134 ys[x] = int(dy + 20 * cos(dx * 0.14) + 10 * sin(dx * 0.42));
+
135 }
+
136 for (int x = 1; x < 99; x++) {
+
137 c.DrawPointLine(x, ys[x], x + 1, ys[x + 1]);
+
138 }
+
139
+
140 return canvas(std::move(c));
+
141 });
+
142
+
143 auto renderer_plot_2 = Renderer([&] {
+
144 auto c = Canvas(100, 100);
+
145 c.DrawText(0, 0, "A symmetrical graph filled");
+
146 std::vector<int> ys(100);
+
147 for (int x = 0; x < 100; x++) {
+
148 ys[x] = int(30 + //
+
149 10 * cos(x * 0.2 - mouse_x * 0.05) + //
+
150 5 * sin(x * 0.4) + //
+
151 5 * sin(x * 0.3 - mouse_y * 0.05)); //
+
152 }
+
153 for (int x = 0; x < 100; x++) {
+
154 c.DrawPointLine(x, 50 + ys[x], x, 50 - ys[x], Color::Red);
+
155 }
+
156
+
157 return canvas(std::move(c));
+
158 });
+
159
+
160 auto renderer_plot_3 = Renderer([&] {
+
161 auto c = Canvas(100, 100);
+
162 c.DrawText(0, 0, "A 2D gaussian plot");
+
163 int size = 15;
+
164
+
165 // mouse_x = 5mx + 3*my
+
166 // mouse_y = 0mx + -5my + 90
+
167 float my = (mouse_y - 90) / -5.f;
+
168 float mx = (mouse_x - 3 * my) / 5.f;
+
169 std::vector<std::vector<float>> ys(size, std::vector<float>(size));
+
170 for (int y = 0; y < size; y++) {
+
171 for (int x = 0; x < size; x++) {
+
172 float dx = x - mx;
+
173 float dy = y - my;
+
174 ys[y][x] = -1.5 + 3.0 * std::exp(-0.2f * (dx * dx + dy * dy));
+
175 }
+
176 }
+
177 for (int y = 0; y < size; y++) {
+
178 for (int x = 0; x < size; x++) {
+
179 if (x != 0) {
+
180 c.DrawPointLine(
+
181 5 * (x - 1) + 3 * (y - 0), 90 - 5 * (y - 0) - 5 * ys[y][x - 1],
+
182 5 * (x - 0) + 3 * (y - 0), 90 - 5 * (y - 0) - 5 * ys[y][x]);
+
183 }
+
184 if (y != 0) {
+
185 c.DrawPointLine(
+
186 5 * (x - 0) + 3 * (y - 1), 90 - 5 * (y - 1) - 5 * ys[y - 1][x],
+
187 5 * (x - 0) + 3 * (y - 0), 90 - 5 * (y - 0) - 5 * ys[y][x]);
+
188 }
+
189 }
+
190 }
+
191
+
192 return canvas(std::move(c));
+
193 });
+
194
+
195 int selected_tab = 12;
+
196 auto tab = Container::Tab(
+
197 {
+
198 renderer_line_braille,
+
199 renderer_line_block,
+
200 renderer_circle_braille,
+
201 renderer_circle_block,
+
202 renderer_circle_filled_braille,
+
203 renderer_circle_filled_block,
+
204 renderer_ellipse_braille,
+
205 renderer_ellipse_block,
+
206 renderer_ellipse_filled_braille,
+
207 renderer_ellipse_filled_block,
+
208
+
209 renderer_plot_1,
+
210 renderer_plot_2,
+
211 renderer_plot_3,
+
212
+
213 renderer_text,
+
214 },
+
215 &selected_tab);
+
216
+
217 // This capture the last mouse position.
+
218 auto tab_with_mouse = CatchEvent(tab, [&](Event e) {
+
219 if (e.is_mouse()) {
+
220 mouse_x = (e.mouse().x - 1) * 2;
+
221 mouse_y = (e.mouse().y - 1) * 4;
+
222 }
+
223 return false;
+
224 });
+
225
+
226 std::vector<std::string> tab_titles = {
+
227 "line (braille)",
+
228 "line (block)",
+
229 "circle (braille)",
+
230 "circle (block)",
+
231 "circle filled (braille)",
+
232 "circle filled (block)",
+
233 "ellipse (braille)",
+
234 "ellipse (block)",
+
235 "ellipse filled (braille)",
+
236 "ellipse filled (block)",
+
237 "plot_1 simple",
+
238 "plot_2 filled",
+
239 "plot_3 3D",
+
240 "text",
+
241 };
+
242 auto tab_toggle = Menu(&tab_titles, &selected_tab);
+
243
+
244 auto component = Container::Horizontal({
+
245 tab_with_mouse,
+
246 tab_toggle,
+
247 });
+
248
+
249 // Add some separator to decorate the whole component:
+
250 auto component_renderer = Renderer(component, [&] {
+
251 return hbox({
+
252 tab_with_mouse->Render(),
+
253 separator(),
+
254 tab_toggle->Render(),
+
255 }) |
+
256 border;
+
257 });
+
258
+
259 auto screen = ScreenInteractive::FitComponent();
+
260 screen.Loop(component_renderer);
+
261
+
262 return 0;
+
263}
+
+ +
int main()
+ + + + + +
bool is_mouse() const
Definition event.hpp:109
+
struct Mouse mouse
Definition event.hpp:144
+
Represent an event. It can be key press event, a terminal resize, or more ...
Definition event.hpp:29
+
Canvas is a drawable buffer associated with drawing operations.
Definition canvas.hpp:38
+
Color foreground_color
Definition pixel.hpp:49
+
bool bold
Definition pixel.hpp:29
+
bool underlined
Definition pixel.hpp:33
+
A Unicode character and its associated style.
Definition pixel.hpp:15
+ +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/captured__mouse_8cppm.html b/captured__mouse_8cppm.html new file mode 100644 index 000000000..d8a1fffa7 --- /dev/null +++ b/captured__mouse_8cppm.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: captured_mouse.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
captured_mouse.cppm File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+
+
+ + + + + diff --git a/captured__mouse_8cppm_source.html b/captured__mouse_8cppm_source.html new file mode 100644 index 000000000..2503db9bf --- /dev/null +++ b/captured__mouse_8cppm_source.html @@ -0,0 +1,229 @@ + + + + + + + + +FTXUI: captured_mouse.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
captured_mouse.cppm
+
+
+Go to the documentation of this file.
1/// @module ftxui.component.captured_mouse
+
2/// @brief Module file for the CapturedMouseInterface class of the Component module
+
3
+
4module;
+
5
+ +
7
+ +
9
+
10/**
+
11 * @namespace ftxui
+
12 * @brief The FTXUI ftxui:: namespace
+
13 */
+
14export namespace ftxui {
+ +
16}
+ + +
Module file for the CapturedMouseInterface class of the Component module.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
+
+ + + + + diff --git a/captured__mouse_8hpp.html b/captured__mouse_8hpp.html new file mode 100644 index 000000000..882ef28a3 --- /dev/null +++ b/captured__mouse_8hpp.html @@ -0,0 +1,232 @@ + + + + + + + + +FTXUI: captured_mouse.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
captured_mouse.hpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Classes

class  CapturedMouseInterface
 
+ + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+ + + +

+Typedefs

using CapturedMouse = std::unique_ptr<CapturedMouseInterface>
 
+
+
+ + + + + diff --git a/captured__mouse_8hpp.js b/captured__mouse_8hpp.js new file mode 100644 index 000000000..c631dfebb --- /dev/null +++ b/captured__mouse_8hpp.js @@ -0,0 +1,5 @@ +var captured__mouse_8hpp = +[ + [ "CapturedMouseInterface", "classftxui_1_1CapturedMouseInterface.html", "classftxui_1_1CapturedMouseInterface" ], + [ "CapturedMouse", "captured__mouse_8hpp.html#a24b663cb6b0b262055c94d3a03bdd274", null ] +]; \ No newline at end of file diff --git a/captured__mouse_8hpp_source.html b/captured__mouse_8hpp_source.html new file mode 100644 index 000000000..89dc759e2 --- /dev/null +++ b/captured__mouse_8hpp_source.html @@ -0,0 +1,243 @@ + + + + + + + + +FTXUI: captured_mouse.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
captured_mouse.hpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#ifndef FTXUI_CAPTURED_MOUSE_HPP
+
5#define FTXUI_CAPTURED_MOUSE_HPP
+
6
+
7#include <memory>
+
8
+
9namespace ftxui {
+
10
+ +
20using CapturedMouse = std::unique_ptr<CapturedMouseInterface>;
+
21} // namespace ftxui
+
22
+
23#endif /* end of include guard: FTXUI_CAPTURED_MOUSE_HPP */
+ +
CapturedMouseInterface(CapturedMouseInterface &&)=delete
+
CapturedMouseInterface(const CapturedMouseInterface &)=default
+ +
CapturedMouseInterface & operator=(CapturedMouseInterface &&)=delete
+
CapturedMouseInterface & operator=(const CapturedMouseInterface &)=default
+
virtual ~CapturedMouseInterface()=default
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::unique_ptr< CapturedMouseInterface > CapturedMouse
+
+
+ + + + + diff --git a/catch__event_8cpp.html b/catch__event_8cpp.html new file mode 100644 index 000000000..95a1e6cac --- /dev/null +++ b/catch__event_8cpp.html @@ -0,0 +1,230 @@ + + + + + + + + +FTXUI: catch_event.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
catch_event.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+ + + + + + + +

+Functions

Component CatchEvent (Component child, std::function< bool(Event event)> on_event)
 Return a component, using |on_event| to catch events. This function must returns true when the event has been handled, false otherwise.
 
ComponentDecorator CatchEvent (std::function< bool(Event)> on_event)
 Decorate a component, using |on_event| to catch events. This function must returns true when the event has been handled, false otherwise.
 
+
+
+ + + + + diff --git a/catch__event_8cpp.js b/catch__event_8cpp.js new file mode 100644 index 000000000..b451bc1a1 --- /dev/null +++ b/catch__event_8cpp.js @@ -0,0 +1,5 @@ +var catch__event_8cpp = +[ + [ "CatchEvent", "catch__event_8cpp.html#ga0bfd67a2815807dc6fc9bc0f79bce29e", null ], + [ "CatchEvent", "catch__event_8cpp.html#gad2948235799c010c76c6de861c050c59", null ] +]; \ No newline at end of file diff --git a/catch__event_8cpp_source.html b/catch__event_8cpp_source.html new file mode 100644 index 000000000..04fd251ef --- /dev/null +++ b/catch__event_8cpp_source.html @@ -0,0 +1,311 @@ + + + + + + + + +FTXUI: catch_event.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
catch_event.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2021 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <functional> // for function
+
5#include <utility> // for move
+
6
+
7#include "ftxui/component/component.hpp" // for Make, CatchEvent, ComponentDecorator
+
8#include "ftxui/component/component_base.hpp" // for Component, ComponentBase
+
9#include "ftxui/component/event.hpp" // for Event
+
10
+
11namespace ftxui {
+
12
+
13class CatchEventBase : public ComponentBase {
+
14 public:
+
15 // Constructor.
+
16 explicit CatchEventBase(std::function<bool(Event)> on_event)
+
17 : on_event_(std::move(on_event)) {}
+
18
+
19 // Component implementation.
+
20 bool OnEvent(Event event) override {
+
21 if (on_event_(event)) {
+
22 return true;
+
23 } else {
+
24 return ComponentBase::OnEvent(event);
+
25 }
+
26 }
+
27
+
28 protected:
+
29 std::function<bool(Event)> on_event_;
+
30};
+
31
+
32/// @brief Return a component, using |on_event| to catch events. This function
+
33/// must returns true when the event has been handled, false otherwise.
+
34/// @param child The wrapped component.
+
35/// @param on_event The function drawing the interface.
+
36/// @ingroup component
+
37///
+
38/// ### Example
+
39///
+
40/// ```cpp
+
41/// auto screen = ScreenInteractive::TerminalOutput();
+
42/// auto renderer = Renderer([] {
+
43/// return text("My interface");
+
44/// });
+
45/// auto component = CatchEvent(renderer, [&](Event event) {
+
46/// if (event == Event::Character('q')) {
+
47/// screen.ExitLoopClosure()();
+
48/// return true;
+
49/// }
+
50/// return false;
+
51/// });
+
52/// screen.Loop(component);
+
53/// ```
+
+ +
55 std::function<bool(Event event)> on_event) {
+
56 auto out = Make<CatchEventBase>(std::move(on_event));
+
57 out->Add(std::move(child));
+
58 return out;
+
59}
+
+
60
+
61/// @brief Decorate a component, using |on_event| to catch events. This function
+
62/// must returns true when the event has been handled, false otherwise.
+
63/// @param on_event The function drawing the interface.
+
64/// @ingroup component
+
65///
+
66/// ### Example
+
67///
+
68/// ```cpp
+
69/// auto screen = ScreenInteractive::TerminalOutput();
+
70/// auto renderer = Renderer([] { return text("Hello world"); });
+
71/// renderer |= CatchEvent([&](Event event) {
+
72/// if (event == Event::Character('q')) {
+
73/// screen.ExitLoopClosure()();
+
74/// return true;
+
75/// }
+
76/// return false;
+
77/// });
+
78/// screen.Loop(renderer);
+
79/// ```
+
+
80ComponentDecorator CatchEvent(std::function<bool(Event)> on_event) {
+
81 return [on_event = std::move(on_event)](Component child) {
+
82 return CatchEvent(std::move(child), [on_event = on_event](Event event) {
+
83 return on_event(std::move(event));
+
84 });
+
85 };
+
86}
+
+
87
+
88} // namespace ftxui
+ + + +
virtual bool OnEvent(Event)
Called in response to an event.
+
Represent an event. It can be key press event, a terminal resize, or more ...
Definition event.hpp:29
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< T > Make(Args &&... args)
Definition component.hpp:27
+
std::function< Component(Component)> ComponentDecorator
Definition component.hpp:32
+
std::shared_ptr< ComponentBase > Component
+
Component CatchEvent(Component child, std::function< bool(Event)>)
+
+
+ + + + + diff --git a/checkbox__in__frame_8cpp.html b/checkbox__in__frame_8cpp.html new file mode 100644 index 000000000..c95f58a29 --- /dev/null +++ b/checkbox__in__frame_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: checkbox_in_frame.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
checkbox_in_frame.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 16 of file checkbox_in_frame.cpp.

+ +
+
+
+
+ + + + + diff --git a/checkbox__in__frame_8cpp.js b/checkbox__in__frame_8cpp.js new file mode 100644 index 000000000..1a4884807 --- /dev/null +++ b/checkbox__in__frame_8cpp.js @@ -0,0 +1,4 @@ +var checkbox__in__frame_8cpp = +[ + [ "main", "checkbox__in__frame_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/checkbox__in__frame_8cpp_source.html b/checkbox__in__frame_8cpp_source.html new file mode 100644 index 000000000..dc4962110 --- /dev/null +++ b/checkbox__in__frame_8cpp_source.html @@ -0,0 +1,260 @@ + + + + + + + + +FTXUI: checkbox_in_frame.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
checkbox_in_frame.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <array> // for array
+
5#include <memory> // for shared_ptr, __shared_ptr_access
+
6#include <string> // for operator+, to_string
+
7
+
8#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
9#include "ftxui/component/component.hpp" // for Checkbox, Renderer, Vertical
+
10#include "ftxui/component/component_base.hpp" // for ComponentBase
+
11#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
12#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, vscroll_indicator, HEIGHT, LESS_THAN
+
13
+
14using namespace ftxui;
+
15
+
+
16int main() {
+
17 std::array<bool, 30> states;
+
18
+
19 auto container = Container::Vertical({});
+
20 for (int i = 0; i < 30; ++i) {
+
21 states[i] = false;
+
22 container->Add(Checkbox("Checkbox" + std::to_string(i), &states[i]));
+
23 }
+
24
+
25 auto renderer = Renderer(container, [&] {
+
26 return container->Render() | vscroll_indicator | frame |
+ +
28 });
+
29
+
30 auto screen = ScreenInteractive::FitComponent();
+
31 screen.Loop(renderer);
+
32
+
33 return 0;
+
34}
+
+ +
int main()
+ + + +
static ScreenInteractive FitComponent()
+
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
+
Component Vertical(Components children)
A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
+
Component Checkbox(CheckboxOption options)
Draw checkable element.
+
Decorator size(WidthOrHeight, Constraint, int value)
Apply a constraint on the size of an element.
+
Element border(Element)
Draw a border around the element.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
@ LESS_THAN
Definition elements.hpp:162
+ +
+
+ + + + + diff --git a/classes.html b/classes.html new file mode 100644 index 000000000..7313820dc --- /dev/null +++ b/classes.html @@ -0,0 +1,262 @@ + + + + + + + + +FTXUI: Class Index + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Class Index
+
+
+
A | B | C | D | E | F | G | I | L | M | N | P | R | S | T | U | W
+ +
+
+ + + + + diff --git a/classftxui_1_1AnimationTask.html b/classftxui_1_1AnimationTask.html new file mode 100644 index 000000000..a1b1af463 --- /dev/null +++ b/classftxui_1_1AnimationTask.html @@ -0,0 +1,217 @@ + + + + + + + + +FTXUI: AnimationTask Class Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
AnimationTask Class Reference
+
+
+ +

#include <task.hpp>

+

Detailed Description

+
+

Definition at line 12 of file task.hpp.

+

The documentation for this class was generated from the following file: +
+
+ + + + + diff --git a/classftxui_1_1AutoReset-members.html b/classftxui_1_1AutoReset-members.html new file mode 100644 index 000000000..9b1731d25 --- /dev/null +++ b/classftxui_1_1AutoReset-members.html @@ -0,0 +1,217 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
AutoReset< T > Member List
+
+
+ +

This is the complete list of members for AutoReset< T >, including all inherited members.

+ + + + + + + +
AutoReset(T *variable, T new_value)AutoReset< T >inline
AutoReset(const AutoReset &)=deleteAutoReset< T >
AutoReset(AutoReset &&)=deleteAutoReset< T >
operator=(const AutoReset &)=deleteAutoReset< T >
operator=(AutoReset &&)=deleteAutoReset< T >
~AutoReset()AutoReset< T >inline
+
+ + + + + diff --git a/classftxui_1_1AutoReset.html b/classftxui_1_1AutoReset.html new file mode 100644 index 000000000..dad91853f --- /dev/null +++ b/classftxui_1_1AutoReset.html @@ -0,0 +1,413 @@ + + + + + + + + +FTXUI: AutoReset< T > Class Template Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
AutoReset< T > Class Template Reference
+
+
+ +

Assign a value to a variable, reset its old value when going out of scope. + More...

+ +

#include <autoreset.hpp>

+ + + + + + + + + + + + + + +

+Public Member Functions

 AutoReset (T *variable, T new_value)
 
 AutoReset (const AutoReset &)=delete
 
 AutoReset (AutoReset &&)=delete
 
AutoResetoperator= (const AutoReset &)=delete
 
AutoResetoperator= (AutoReset &&)=delete
 
 ~AutoReset ()
 
+

Detailed Description

+
template<typename T>
+class ftxui::AutoReset< T >

Assign a value to a variable, reset its old value when going out of scope.

+ +

Definition at line 13 of file autoreset.hpp.

+

Constructor & Destructor Documentation

+ +

◆ AutoReset() [1/3]

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + + + + + +
AutoReset (T * variable,
T new_value )
+
+inline
+
+ +

Definition at line 15 of file autoreset.hpp.

+ +
+
+ +

◆ AutoReset() [2/3]

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
AutoReset (const AutoReset< T > & )
+
+delete
+
+ +
+
+ +

◆ AutoReset() [3/3]

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
AutoReset (AutoReset< T > && )
+
+delete
+
+ +
+
+ +

◆ ~AutoReset()

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
~AutoReset ()
+
+inline
+
+ +

Definition at line 23 of file autoreset.hpp.

+ +
+
+

Member Function Documentation

+ +

◆ operator=() [1/2]

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
AutoReset & operator= (const AutoReset< T > & )
+
+delete
+
+ +
+
+ +

◆ operator=() [2/2]

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
AutoReset & operator= (AutoReset< T > && )
+
+delete
+
+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + + diff --git a/classftxui_1_1AutoReset.js b/classftxui_1_1AutoReset.js new file mode 100644 index 000000000..7f9fccfdb --- /dev/null +++ b/classftxui_1_1AutoReset.js @@ -0,0 +1,9 @@ +var classftxui_1_1AutoReset = +[ + [ "AutoReset", "classftxui_1_1AutoReset.html#ae393855d753027bcb3d4d1e1514e6ad4", null ], + [ "AutoReset", "classftxui_1_1AutoReset.html#a5280cdbbbecce1de0ae69bfdca10d7ed", null ], + [ "AutoReset", "classftxui_1_1AutoReset.html#aaef5fed3c034c065dfc218244e112a4e", null ], + [ "~AutoReset", "classftxui_1_1AutoReset.html#ad7e022164fb38a279cca7c6cf478f379", null ], + [ "operator=", "classftxui_1_1AutoReset.html#a72b3c7613f9ecfb66005b1c30a5189d4", null ], + [ "operator=", "classftxui_1_1AutoReset.html#a63fb3bea42919c7f183d4fb315451f6a", null ] +]; \ No newline at end of file diff --git a/classftxui_1_1CapturedMouseInterface-members.html b/classftxui_1_1CapturedMouseInterface-members.html new file mode 100644 index 000000000..fa7430179 --- /dev/null +++ b/classftxui_1_1CapturedMouseInterface-members.html @@ -0,0 +1,217 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
CapturedMouseInterface Member List
+
+
+ +

This is the complete list of members for CapturedMouseInterface, including all inherited members.

+ + + + + + + +
CapturedMouseInterface()=defaultCapturedMouseInterface
CapturedMouseInterface(const CapturedMouseInterface &)=defaultCapturedMouseInterface
CapturedMouseInterface(CapturedMouseInterface &&)=deleteCapturedMouseInterface
operator=(const CapturedMouseInterface &)=defaultCapturedMouseInterface
operator=(CapturedMouseInterface &&)=deleteCapturedMouseInterface
~CapturedMouseInterface()=defaultCapturedMouseInterfacevirtual
+
+ + + + + diff --git a/classftxui_1_1CapturedMouseInterface.html b/classftxui_1_1CapturedMouseInterface.html new file mode 100644 index 000000000..dbfffd944 --- /dev/null +++ b/classftxui_1_1CapturedMouseInterface.html @@ -0,0 +1,388 @@ + + + + + + + + +FTXUI: CapturedMouseInterface Class Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
CapturedMouseInterface Class Reference
+
+
+ +

#include <captured_mouse.hpp>

+ + + + + + + + + + + + + + +

+Public Member Functions

 CapturedMouseInterface ()=default
 
 CapturedMouseInterface (const CapturedMouseInterface &)=default
 
 CapturedMouseInterface (CapturedMouseInterface &&)=delete
 
CapturedMouseInterfaceoperator= (const CapturedMouseInterface &)=default
 
CapturedMouseInterfaceoperator= (CapturedMouseInterface &&)=delete
 
virtual ~CapturedMouseInterface ()=default
 
+

Detailed Description

+
+

Definition at line 11 of file captured_mouse.hpp.

+

Constructor & Destructor Documentation

+ +

◆ CapturedMouseInterface() [1/3]

+ +
+
+ + + + + +
+ + + + + + + +
CapturedMouseInterface ()
+
+default
+
+ +
+
+ +

◆ CapturedMouseInterface() [2/3]

+ +
+
+ + + + + +
+ + + + + + + +
CapturedMouseInterface (const CapturedMouseInterface & )
+
+default
+
+ +
+
+ +

◆ CapturedMouseInterface() [3/3]

+ +
+
+ + + + + +
+ + + + + + + +
CapturedMouseInterface (CapturedMouseInterface && )
+
+delete
+
+ +
+
+ +

◆ ~CapturedMouseInterface()

+ +
+
+ + + + + +
+ + + + + + + +
virtual ~CapturedMouseInterface ()
+
+virtualdefault
+
+ +
+
+

Member Function Documentation

+ +

◆ operator=() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
CapturedMouseInterface & operator= (const CapturedMouseInterface & )
+
+default
+
+ +
+
+ +

◆ operator=() [2/2]

+ +
+
+ + + + + +
+ + + + + + + +
CapturedMouseInterface & operator= (CapturedMouseInterface && )
+
+delete
+
+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + + diff --git a/classftxui_1_1CapturedMouseInterface.js b/classftxui_1_1CapturedMouseInterface.js new file mode 100644 index 000000000..ffe40f011 --- /dev/null +++ b/classftxui_1_1CapturedMouseInterface.js @@ -0,0 +1,9 @@ +var classftxui_1_1CapturedMouseInterface = +[ + [ "CapturedMouseInterface", "classftxui_1_1CapturedMouseInterface.html#abc72c038150d1866199c28dffe7ace7b", null ], + [ "CapturedMouseInterface", "classftxui_1_1CapturedMouseInterface.html#abb21b580f6362d9f5f4d25c6b8ca54cb", null ], + [ "CapturedMouseInterface", "classftxui_1_1CapturedMouseInterface.html#a2f92bdd8e2c098ade383916b8e47b7e0", null ], + [ "~CapturedMouseInterface", "classftxui_1_1CapturedMouseInterface.html#af35148d7f798953f8d7e8c1a0e2b2ef0", null ], + [ "operator=", "classftxui_1_1CapturedMouseInterface.html#adfa362c249253f9570e5c1cf42fc16c3", null ], + [ "operator=", "classftxui_1_1CapturedMouseInterface.html#ac349c4e493dbe8aa7c47052d91e0f411", null ] +]; \ No newline at end of file diff --git a/classftxui_1_1ConstRef-members.html b/classftxui_1_1ConstRef-members.html new file mode 100644 index 000000000..6b0bd820a --- /dev/null +++ b/classftxui_1_1ConstRef-members.html @@ -0,0 +1,222 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
ConstRef< T > Member List
+
+
+ +

This is the complete list of members for ConstRef< T >, including all inherited members.

+ + + + + + + + + + + + +
ConstRef()=defaultConstRef< T >
ConstRef(T t)ConstRef< T >inline
ConstRef(const T *t)ConstRef< T >inline
ConstRef(const ConstRef< T > &)=defaultConstRef< T >
ConstRef(ConstRef< T > &&) noexcept=defaultConstRef< T >
operator()() constConstRef< T >inline
operator*() constConstRef< T >inline
operator->() constConstRef< T >inline
operator=(ConstRef &&) noexcept=defaultConstRef< T >
operator=(const ConstRef< T > &)=defaultConstRef< T >
~ConstRef()=defaultConstRef< T >
+
+ + + + + diff --git a/classftxui_1_1ConstRef.html b/classftxui_1_1ConstRef.html new file mode 100644 index 000000000..c4705d8b8 --- /dev/null +++ b/classftxui_1_1ConstRef.html @@ -0,0 +1,560 @@ + + + + + + + + +FTXUI: ConstRef< T > Class Template Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
ConstRef< T > Class Template Reference
+
+
+ +

An adapter. Own or reference an immutable object. + More...

+ +

#include <ref.hpp>

+ + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 ConstRef ()=default
 
 ConstRef (T t)
 
 ConstRef (const T *t)
 
ConstRefoperator= (ConstRef &&) noexcept=default
 
 ConstRef (const ConstRef< T > &)=default
 
 ConstRef (ConstRef< T > &&) noexcept=default
 
 ~ConstRef ()=default
 
ConstRef< T > & operator= (const ConstRef< T > &)=default
 
const T & operator() () const
 
const T & operator* () const
 
const T * operator-> () const
 
+

Detailed Description

+
template<typename T>
+class ftxui::ConstRef< T >

An adapter. Own or reference an immutable object.

+ +

Definition at line 17 of file ref.hpp.

+

Constructor & Destructor Documentation

+ +

◆ ConstRef() [1/5]

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
ConstRef ()
+
+default
+
+ +
+
+ +

◆ ConstRef() [2/5]

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
ConstRef (T t)
+
+inline
+
+ +

Definition at line 20 of file ref.hpp.

+ +
+
+ +

◆ ConstRef() [3/5]

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
ConstRef (const T * t)
+
+inline
+
+ +

Definition at line 21 of file ref.hpp.

+ +
+
+ +

◆ ConstRef() [4/5]

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
ConstRef (const ConstRef< T > & )
+
+default
+
+ +
+
+ +

◆ ConstRef() [5/5]

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
ConstRef (ConstRef< T > && )
+
+defaultnoexcept
+
+ +
+
+ +

◆ ~ConstRef()

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
~ConstRef ()
+
+default
+
+ +
+
+

Member Function Documentation

+ +

◆ operator=() [1/2]

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
ConstRef & operator= (ConstRef< T > && )
+
+defaultnoexcept
+
+ +
+
+ +

◆ operator=() [2/2]

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
ConstRef< T > & operator= (const ConstRef< T > & )
+
+default
+
+ +
+
+ +

◆ operator()()

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
const T & operator() () const
+
+inline
+
+ +

Definition at line 31 of file ref.hpp.

+ +
+
+ +

◆ operator*()

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
const T & operator* () const
+
+inline
+
+ +

Definition at line 32 of file ref.hpp.

+ +
+
+ +

◆ operator->()

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
const T * operator-> () const
+
+inline
+
+ +

Definition at line 33 of file ref.hpp.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + + diff --git a/classftxui_1_1ConstRef.js b/classftxui_1_1ConstRef.js new file mode 100644 index 000000000..da7059d79 --- /dev/null +++ b/classftxui_1_1ConstRef.js @@ -0,0 +1,14 @@ +var classftxui_1_1ConstRef = +[ + [ "ConstRef", "classftxui_1_1ConstRef.html#a2949426897a0bd427771597c7cc34f08", null ], + [ "ConstRef", "classftxui_1_1ConstRef.html#aa33f2e3c9020518540c2850c7ad2669f", null ], + [ "ConstRef", "classftxui_1_1ConstRef.html#a7dde5cd8bdbcd4c83a7b3bbddfc31bd9", null ], + [ "ConstRef", "classftxui_1_1ConstRef.html#a184e14dab2e9bca47f7d172ca7126c60", null ], + [ "ConstRef", "classftxui_1_1ConstRef.html#aa89dd79143a428e57480cda1cc7b675e", null ], + [ "~ConstRef", "classftxui_1_1ConstRef.html#a4ab7aed14f1e68d9be361d5ccfcd4e0f", null ], + [ "operator=", "classftxui_1_1ConstRef.html#ad144149e6f6f0d59610da4b28e22aef1", null ], + [ "operator=", "classftxui_1_1ConstRef.html#a834cee3b2f409135c37c188c583bce91", null ], + [ "operator()", "classftxui_1_1ConstRef.html#afdc36f6a5716b29a5d81a2dd93376d82", null ], + [ "operator*", "classftxui_1_1ConstRef.html#a241c04e3ce86e1fd5a946eb2aa8b1f22", null ], + [ "operator->", "classftxui_1_1ConstRef.html#abaade5c780b539b94de660e314cb0c90", null ] +]; \ No newline at end of file diff --git a/classftxui_1_1ConstStringListRef-members.html b/classftxui_1_1ConstStringListRef-members.html new file mode 100644 index 000000000..7b6baf576 --- /dev/null +++ b/classftxui_1_1ConstStringListRef-members.html @@ -0,0 +1,225 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
ConstStringListRef Member List
+
+
+ +

This is the complete list of members for ConstStringListRef, including all inherited members.

+ + + + + + + + + + + + + + + +
ConstStringListRef()=defaultConstStringListRef
ConstStringListRef(ConstStringListRef &&)=defaultConstStringListRef
ConstStringListRef(const ConstStringListRef &)=defaultConstStringListRef
ConstStringListRef(std::vector< std::string > value)ConstStringListRefinline
ConstStringListRef(const std::vector< std::string > *value)ConstStringListRefinline
ConstStringListRef(const std::vector< std::wstring > *value)ConstStringListRefinline
ConstStringListRef(Adapter *adapter)ConstStringListRefinline
ConstStringListRef(std::unique_ptr< AdapterType > adapter)ConstStringListRefinline
operator=(const ConstStringListRef &)=defaultConstStringListRef
operator=(ConstStringListRef &&)=defaultConstStringListRef
operator[](size_t i) constConstStringListRefinline
size() constConstStringListRefinline
Variant typedefConstStringListRef
~ConstStringListRef()=defaultConstStringListRef
+
+ + + + + diff --git a/classftxui_1_1ConstStringListRef.html b/classftxui_1_1ConstStringListRef.html new file mode 100644 index 000000000..18202933a --- /dev/null +++ b/classftxui_1_1ConstStringListRef.html @@ -0,0 +1,640 @@ + + + + + + + + +FTXUI: ConstStringListRef Class Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
ConstStringListRef Class Reference
+
+
+ +

An adapter. Reference a list of strings. + More...

+ +

#include <ref.hpp>

+ + + + +

+Classes

class  Adapter
 
+ + + +

+Public Types

using Variant
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 ConstStringListRef ()=default
 
 ~ConstStringListRef ()=default
 
ConstStringListRefoperator= (const ConstStringListRef &)=default
 
ConstStringListRefoperator= (ConstStringListRef &&)=default
 
 ConstStringListRef (ConstStringListRef &&)=default
 
 ConstStringListRef (const ConstStringListRef &)=default
 
 ConstStringListRef (std::vector< std::string > value)
 
 ConstStringListRef (const std::vector< std::string > *value)
 
 ConstStringListRef (const std::vector< std::wstring > *value)
 
 ConstStringListRef (Adapter *adapter)
 
template<typename AdapterType >
 ConstStringListRef (std::unique_ptr< AdapterType > adapter)
 
size_t size () const
 
std::string operator[] (size_t i) const
 
+

Detailed Description

+

An adapter. Reference a list of strings.

+

Supported input:

    +
  • std::vector<std::string>
  • +
  • std::vector<std::string>*
  • +
  • std::vector<std::wstring>*
  • +
  • Adapter*
  • +
  • std::unique_ptr<Adapter>
  • +
+ +

Definition at line 116 of file ref.hpp.

+

Member Typedef Documentation

+ +

◆ Variant

+ +
+
+ + + + +
using Variant
+
+Initial value:
std::variant<const std::vector<std::string>,
+
const std::vector<std::string>*,
+
const std::vector<std::wstring>*,
+
Adapter*,
+
std::unique_ptr<Adapter>
+
>
+
+

Definition at line 130 of file ref.hpp.

+ +
+
+

Constructor & Destructor Documentation

+ +

◆ ConstStringListRef() [1/8]

+ +
+
+ + + + + +
+ + + + + + + +
ConstStringListRef ()
+
+default
+
+ +
+
+ +

◆ ~ConstStringListRef()

+ +
+
+ + + + + +
+ + + + + + + +
~ConstStringListRef ()
+
+default
+
+ +
+
+ +

◆ ConstStringListRef() [2/8]

+ +
+
+ + + + + +
+ + + + + + + +
ConstStringListRef (ConstStringListRef && )
+
+default
+
+ +
+
+ +

◆ ConstStringListRef() [3/8]

+ +
+
+ + + + + +
+ + + + + + + +
ConstStringListRef (const ConstStringListRef & )
+
+default
+
+ +
+
+ +

◆ ConstStringListRef() [4/8]

+ +
+
+ + + + + +
+ + + + + + + +
ConstStringListRef (std::vector< std::string > value)
+
+inline
+
+ +

Definition at line 144 of file ref.hpp.

+ +
+
+ +

◆ ConstStringListRef() [5/8]

+ +
+
+ + + + + +
+ + + + + + + +
ConstStringListRef (const std::vector< std::string > * value)
+
+inline
+
+ +

Definition at line 148 of file ref.hpp.

+ +
+
+ +

◆ ConstStringListRef() [6/8]

+ +
+
+ + + + + +
+ + + + + + + +
ConstStringListRef (const std::vector< std::wstring > * value)
+
+inline
+
+ +

Definition at line 152 of file ref.hpp.

+ +
+
+ +

◆ ConstStringListRef() [7/8]

+ +
+
+ + + + + +
+ + + + + + + +
ConstStringListRef (Adapter * adapter)
+
+inline
+
+ +

Definition at line 156 of file ref.hpp.

+ +
+
+ +

◆ ConstStringListRef() [8/8]

+ +
+
+
+template<typename AdapterType >
+ + + + + +
+ + + + + + + +
ConstStringListRef (std::unique_ptr< AdapterType > adapter)
+
+inline
+
+ +

Definition at line 161 of file ref.hpp.

+ +
+
+

Member Function Documentation

+ +

◆ operator=() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
ConstStringListRef & operator= (const ConstStringListRef & )
+
+default
+
+ +
+
+ +

◆ operator=() [2/2]

+ +
+
+ + + + + +
+ + + + + + + +
ConstStringListRef & operator= (ConstStringListRef && )
+
+default
+
+ +
+
+ +

◆ size()

+ +
+
+ + + + + +
+ + + + + + + +
size_t size () const
+
+inline
+
+ +

Definition at line 167 of file ref.hpp.

+ +
+
+ +

◆ operator[]()

+ +
+
+ + + + + +
+ + + + + + + +
std::string operator[] (size_t i) const
+
+inline
+
+ +

Definition at line 171 of file ref.hpp.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + + diff --git a/classftxui_1_1ConstStringListRef.js b/classftxui_1_1ConstStringListRef.js new file mode 100644 index 000000000..9bf3b9ca4 --- /dev/null +++ b/classftxui_1_1ConstStringListRef.js @@ -0,0 +1,18 @@ +var classftxui_1_1ConstStringListRef = +[ + [ "Adapter", "classftxui_1_1ConstStringListRef_1_1Adapter.html", "classftxui_1_1ConstStringListRef_1_1Adapter" ], + [ "Variant", "classftxui_1_1ConstStringListRef.html#a5385a19678ef154eb13e9c8428e4d19c", null ], + [ "ConstStringListRef", "classftxui_1_1ConstStringListRef.html#a425bc6a013bf3a539794b7a874fc722f", null ], + [ "~ConstStringListRef", "classftxui_1_1ConstStringListRef.html#a517a6924cc5fa2fff3e6c08bc504f0fa", null ], + [ "ConstStringListRef", "classftxui_1_1ConstStringListRef.html#a4d5f9a6302f997c4ef51b36370b84042", null ], + [ "ConstStringListRef", "classftxui_1_1ConstStringListRef.html#abfb65b9a4a2648e7b9f110cecefa57a4", null ], + [ "ConstStringListRef", "classftxui_1_1ConstStringListRef.html#a143d850d76c8d8f8b4f8750c94ce1a52", null ], + [ "ConstStringListRef", "classftxui_1_1ConstStringListRef.html#a1dea39816b5515bb126f980ed0839d63", null ], + [ "ConstStringListRef", "classftxui_1_1ConstStringListRef.html#a8f2ca283f552f4cdd835401e3b177b4a", null ], + [ "ConstStringListRef", "classftxui_1_1ConstStringListRef.html#ae1af1937e833f81fe7013261ec0ee1ef", null ], + [ "ConstStringListRef", "classftxui_1_1ConstStringListRef.html#a79bb658d6bae69e91da078978d5ded33", null ], + [ "operator=", "classftxui_1_1ConstStringListRef.html#a616528ee5b9a372e16ae2125e8dee3b7", null ], + [ "operator=", "classftxui_1_1ConstStringListRef.html#a51744ac3bfa14639955248e51313ba1f", null ], + [ "size", "classftxui_1_1ConstStringListRef.html#a259cb5a711406a8c3e5d937eb9350cca", null ], + [ "operator[]", "classftxui_1_1ConstStringListRef.html#afa13214cc014e69f7dc95b1df7c90d4e", null ] +]; \ No newline at end of file diff --git a/classftxui_1_1ConstStringListRef_1_1Adapter-members.html b/classftxui_1_1ConstStringListRef_1_1Adapter-members.html new file mode 100644 index 000000000..2bf2ca6a7 --- /dev/null +++ b/classftxui_1_1ConstStringListRef_1_1Adapter-members.html @@ -0,0 +1,219 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
ConstStringListRef::Adapter Member List
+
+
+ +

This is the complete list of members for ConstStringListRef::Adapter, including all inherited members.

+ + + + + + + + + +
Adapter()=defaultConstStringListRef::Adapter
Adapter(const Adapter &)=defaultConstStringListRef::Adapter
Adapter(Adapter &&)=defaultConstStringListRef::Adapter
operator=(const Adapter &)=defaultConstStringListRef::Adapter
operator=(Adapter &&)=defaultConstStringListRef::Adapter
operator[](size_t i) const =0ConstStringListRef::Adapterpure virtual
size() const =0ConstStringListRef::Adapterpure virtual
~Adapter()=defaultConstStringListRef::Adaptervirtual
+
+ + + + + diff --git a/classftxui_1_1ConstStringListRef_1_1Adapter.html b/classftxui_1_1ConstStringListRef_1_1Adapter.html new file mode 100644 index 000000000..18a854cc3 --- /dev/null +++ b/classftxui_1_1ConstStringListRef_1_1Adapter.html @@ -0,0 +1,442 @@ + + + + + + + + +FTXUI: ConstStringListRef::Adapter Class Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
ConstStringListRef::Adapter Class Referenceabstract
+
+
+ +

#include <ref.hpp>

+ + + + + + + + + + + + + + + + + + +

+Public Member Functions

 Adapter ()=default
 
 Adapter (const Adapter &)=default
 
Adapteroperator= (const Adapter &)=default
 
 Adapter (Adapter &&)=default
 
Adapteroperator= (Adapter &&)=default
 
virtual ~Adapter ()=default
 
virtual size_t size () const =0
 
virtual std::string operator[] (size_t i) const =0
 
+

Detailed Description

+
+

Definition at line 119 of file ref.hpp.

+

Constructor & Destructor Documentation

+ +

◆ Adapter() [1/3]

+ +
+
+ + + + + +
+ + + + + + + +
Adapter ()
+
+default
+
+ +
+
+ +

◆ Adapter() [2/3]

+ +
+
+ + + + + +
+ + + + + + + +
Adapter (const Adapter & )
+
+default
+
+ +
+
+ +

◆ Adapter() [3/3]

+ +
+
+ + + + + +
+ + + + + + + +
Adapter (Adapter && )
+
+default
+
+ +
+
+ +

◆ ~Adapter()

+ +
+
+ + + + + +
+ + + + + + + +
virtual ~Adapter ()
+
+virtualdefault
+
+ +
+
+

Member Function Documentation

+ +

◆ operator=() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
Adapter & operator= (const Adapter & )
+
+default
+
+ +
+
+ +

◆ operator=() [2/2]

+ +
+
+ + + + + +
+ + + + + + + +
Adapter & operator= (Adapter && )
+
+default
+
+ +
+
+ +

◆ size()

+ +
+
+ + + + + +
+ + + + + + + +
virtual size_t size () const
+
+pure virtual
+
+ +
+
+ +

◆ operator[]()

+ +
+
+ + + + + +
+ + + + + + + +
virtual std::string operator[] (size_t i) const
+
+pure virtual
+
+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + + diff --git a/classftxui_1_1ConstStringListRef_1_1Adapter.js b/classftxui_1_1ConstStringListRef_1_1Adapter.js new file mode 100644 index 000000000..8cc3e2d7d --- /dev/null +++ b/classftxui_1_1ConstStringListRef_1_1Adapter.js @@ -0,0 +1,11 @@ +var classftxui_1_1ConstStringListRef_1_1Adapter = +[ + [ "Adapter", "classftxui_1_1ConstStringListRef_1_1Adapter.html#aeeff28a487da7a74856b51e966773246", null ], + [ "Adapter", "classftxui_1_1ConstStringListRef_1_1Adapter.html#afaf35b0fc91e998543942da0b2b9a3ee", null ], + [ "Adapter", "classftxui_1_1ConstStringListRef_1_1Adapter.html#a5bcc41e3dec29c90da901ab45c95774a", null ], + [ "~Adapter", "classftxui_1_1ConstStringListRef_1_1Adapter.html#acc343e0991b39fbf9b66f2faf7cb7f11", null ], + [ "operator=", "classftxui_1_1ConstStringListRef_1_1Adapter.html#a99e89ddbd26ca55a6696a12a819c8dac", null ], + [ "operator=", "classftxui_1_1ConstStringListRef_1_1Adapter.html#a159afff9273b4ba2315d0fe5c0dc3629", null ], + [ "size", "classftxui_1_1ConstStringListRef_1_1Adapter.html#aa983ddaeded5756189f46428be79c631", null ], + [ "operator[]", "classftxui_1_1ConstStringListRef_1_1Adapter.html#aaec2cde2cf71a044ba3305632c7a867c", null ] +]; \ No newline at end of file diff --git a/classftxui_1_1ConstStringRef-members.html b/classftxui_1_1ConstStringRef-members.html new file mode 100644 index 000000000..8f0e6279e --- /dev/null +++ b/classftxui_1_1ConstStringRef-members.html @@ -0,0 +1,226 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
ConstStringRef Member List
+
+
+ +

This is the complete list of members for ConstStringRef, including all inherited members.

+ + + + + + + + + + + + + + + + +
ConstRef()=defaultConstRef< std::string >
ConstRef(std::string t)ConstRef< std::string >inline
ConstRef(const std::string *t)ConstRef< std::string >inline
ConstRef(const ConstRef< std::string > &)=defaultConstRef< std::string >
ConstRef(ConstRef< std::string > &&) noexcept=defaultConstRef< std::string >
ConstStringRef(const std::wstring *ref)ConstStringRefinline
ConstStringRef(const std::wstring ref)ConstStringRefinline
ConstStringRef(const wchar_t *ref)ConstStringRefinline
ConstStringRef(const char *ref)ConstStringRefinline
operator()() constConstRef< std::string >inline
operator*() constConstRef< std::string >inline
operator->() constConstRef< std::string >inline
operator=(ConstRef &&) noexcept=defaultConstRef< std::string >
operator=(const ConstRef< std::string > &)=defaultConstRef< std::string >
~ConstRef()=defaultConstRef< std::string >
+
+ + + + + diff --git a/classftxui_1_1ConstStringRef.html b/classftxui_1_1ConstStringRef.html new file mode 100644 index 000000000..989d1a84a --- /dev/null +++ b/classftxui_1_1ConstStringRef.html @@ -0,0 +1,445 @@ + + + + + + + + +FTXUI: ConstStringRef Class Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
ConstStringRef Class Reference
+
+
+ +

An adapter. Own or reference a constant string. For convenience, this class convert multiple immutable string toward a shared representation. + More...

+ +

#include <ref.hpp>

+
+ + Inheritance diagram for ConstStringRef:
+
+
+ + + + + + + + + + + + + + + + + +

+Public Member Functions

 ConstStringRef (const std::wstring *ref)
 
 ConstStringRef (const std::wstring ref)
 
 ConstStringRef (const wchar_t *ref)
 
 ConstStringRef (const char *ref)
 
const std::string & operator() () const
 
const std::string & operator* () const
 
const std::string * operator-> () const
 
+

Detailed Description

+

An adapter. Own or reference a constant string. For convenience, this class convert multiple immutable string toward a shared representation.

+ +

Definition at line 94 of file ref.hpp.

+

Constructor & Destructor Documentation

+ +

◆ ConstStringRef() [1/4]

+ +
+
+ + + + + +
+ + + + + + + +
ConstStringRef (const std::wstring * ref)
+
+inline
+
+ +

Definition at line 98 of file ref.hpp.

+ +
+
+ +

◆ ConstStringRef() [2/4]

+ +
+
+ + + + + +
+ + + + + + + +
ConstStringRef (const std::wstring ref)
+
+inline
+
+ +

Definition at line 100 of file ref.hpp.

+ +
+
+ +

◆ ConstStringRef() [3/4]

+ +
+
+ + + + + +
+ + + + + + + +
ConstStringRef (const wchar_t * ref)
+
+inline
+
+ +

Definition at line 102 of file ref.hpp.

+ +
+
+ +

◆ ConstStringRef() [4/4]

+ +
+
+ + + + + +
+ + + + + + + +
ConstStringRef (const char * ref)
+
+inline
+
+ +

Definition at line 104 of file ref.hpp.

+ +
+
+

Member Function Documentation

+ +

◆ operator()()

+ +
+
+ + + + + +
+ + + + + + + +
const std::string & operator() () const
+
+inlineinherited
+
+ +

Definition at line 31 of file ref.hpp.

+ +
+
+ +

◆ operator*()

+ +
+
+ + + + + +
+ + + + + + + +
const std::string & operator* () const
+
+inlineinherited
+
+ +

Definition at line 32 of file ref.hpp.

+ +
+
+ +

◆ operator->()

+ +
+
+ + + + + +
+ + + + + + + +
const std::string * operator-> () const
+
+inlineinherited
+
+ +

Definition at line 33 of file ref.hpp.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + + diff --git a/classftxui_1_1ConstStringRef.js b/classftxui_1_1ConstStringRef.js new file mode 100644 index 000000000..4aab17e4c --- /dev/null +++ b/classftxui_1_1ConstStringRef.js @@ -0,0 +1,10 @@ +var classftxui_1_1ConstStringRef = +[ + [ "ConstStringRef", "classftxui_1_1ConstStringRef.html#a9a4560dc18026ec3753e87d569fa5103", null ], + [ "ConstStringRef", "classftxui_1_1ConstStringRef.html#a1e8c54776eada9969ebbadb21d8e689a", null ], + [ "ConstStringRef", "classftxui_1_1ConstStringRef.html#ad8b24bac5669d8787ac2109068094938", null ], + [ "ConstStringRef", "classftxui_1_1ConstStringRef.html#a013cd384d028ab8f67fa4cf8e9c521cd", null ], + [ "operator()", "classftxui_1_1ConstStringRef.html#afdc36f6a5716b29a5d81a2dd93376d82", null ], + [ "operator*", "classftxui_1_1ConstStringRef.html#a241c04e3ce86e1fd5a946eb2aa8b1f22", null ], + [ "operator->", "classftxui_1_1ConstStringRef.html#abaade5c780b539b94de660e314cb0c90", null ] +]; \ No newline at end of file diff --git a/classftxui_1_1ConstStringRef__inherit__graph.map b/classftxui_1_1ConstStringRef__inherit__graph.map new file mode 100644 index 000000000..95f84b7ee --- /dev/null +++ b/classftxui_1_1ConstStringRef__inherit__graph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/classftxui_1_1ConstStringRef__inherit__graph.md5 b/classftxui_1_1ConstStringRef__inherit__graph.md5 new file mode 100644 index 000000000..00f92296a --- /dev/null +++ b/classftxui_1_1ConstStringRef__inherit__graph.md5 @@ -0,0 +1 @@ +df39b357358903d3e24bbccb1f9d9676 \ No newline at end of file diff --git a/classftxui_1_1ConstStringRef__inherit__graph.png b/classftxui_1_1ConstStringRef__inherit__graph.png new file mode 100644 index 000000000..646721b2a Binary files /dev/null and b/classftxui_1_1ConstStringRef__inherit__graph.png differ diff --git a/classftxui_1_1Image__inherit__graph.map b/classftxui_1_1Image__inherit__graph.map new file mode 100644 index 000000000..b9b16cc82 --- /dev/null +++ b/classftxui_1_1Image__inherit__graph.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/classftxui_1_1Image__inherit__graph.md5 b/classftxui_1_1Image__inherit__graph.md5 new file mode 100644 index 000000000..8f24b4f3d --- /dev/null +++ b/classftxui_1_1Image__inherit__graph.md5 @@ -0,0 +1 @@ +88682c826ce02ec7a9ae980ea208abae \ No newline at end of file diff --git a/classftxui_1_1Image__inherit__graph.png b/classftxui_1_1Image__inherit__graph.png new file mode 100644 index 000000000..ec7ec920b Binary files /dev/null and b/classftxui_1_1Image__inherit__graph.png differ diff --git a/classftxui_1_1NodeDecorator-members.html b/classftxui_1_1NodeDecorator-members.html new file mode 100644 index 000000000..7f0f21fba --- /dev/null +++ b/classftxui_1_1NodeDecorator-members.html @@ -0,0 +1,229 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
NodeDecorator Member List
+
+
+ +

This is the complete list of members for NodeDecorator, including all inherited members.

+ + + + + + + + + + + + + + + + + + + +
box_Nodeprotected
Check(Status *status)Nodevirtual
children_Nodeprotected
ComputeRequirement() overrideNodeDecoratorvirtual
GetSelectedContent(Selection &selection)Nodevirtual
Node()Node
Node(Elements children)Nodeexplicit
Node(const Node &)=deleteNode
Node(const Node &&)=deleteNode
NodeDecorator(Element child)NodeDecoratorinlineexplicit
operator=(const Node &)=deleteNode
operator=(const Node &&)=deleteNode
Render(Screen &screen)Nodevirtual
requirement()Nodeinline
requirement_Nodeprotected
Select(Selection &selection)Nodevirtual
SetBox(Box box) overrideNodeDecoratorvirtual
~Node()Nodevirtual
+
+ + + + + diff --git a/classftxui_1_1NodeDecorator.html b/classftxui_1_1NodeDecorator.html new file mode 100644 index 000000000..376e6a255 --- /dev/null +++ b/classftxui_1_1NodeDecorator.html @@ -0,0 +1,570 @@ + + + + + + + + +FTXUI: NodeDecorator Class Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
NodeDecorator Class Reference
+
+
+ +

#include <node_decorator.hpp>

+
+ + Inheritance diagram for NodeDecorator:
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 NodeDecorator (Element child)
 
void ComputeRequirement () override
 Compute how much space an element needs.
 
void SetBox (Box box) override
 Assign a position and a dimension to an element for drawing.
 
Requirement requirement ()
 
virtual void Select (Selection &selection)
 Compute the selection of an element.
 
virtual void Render (Screen &screen)
 Display an element on a ftxui::Screen.
 
virtual std::string GetSelectedContent (Selection &selection)
 
virtual void Check (Status *status)
 
+ + + + + + + +

+Protected Attributes

Elements children_
 
Requirement requirement_
 
Box box_
 
+

Detailed Description

+
+

Definition at line 16 of file node_decorator.hpp.

+

Constructor & Destructor Documentation

+ +

◆ NodeDecorator()

+ +
+
+ + + + + +
+ + + + + + + +
NodeDecorator (Element child)
+
+inlineexplicit
+
+ +

Definition at line 18 of file node_decorator.hpp.

+ +
+
+

Member Function Documentation

+ +

◆ ComputeRequirement()

+ +
+
+ + + + + +
+ + + + + + + +
void ComputeRequirement ()
+
+overridevirtual
+
+ +

Compute how much space an element needs.

+ +

Reimplemented from Node.

+ +

Definition at line 12 of file node_decorator.cpp.

+ +
+
+ +

◆ SetBox()

+ +
+
+ + + + + +
+ + + + + + + +
void SetBox (Box box)
+
+overridevirtual
+
+ +

Assign a position and a dimension to an element for drawing.

+ +

Reimplemented from Node.

+ +

Definition at line 17 of file node_decorator.cpp.

+ +
+
+ +

◆ requirement()

+ +
+
+ + + + + +
+ + + + + + + +
Requirement requirement ()
+
+inlineinherited
+
+ +

Definition at line 52 of file node.hpp.

+ +
+
+ +

◆ Select()

+ +
+
+ + + + + +
+ + + + + + + +
void Select (Selection & selection)
+
+virtualinherited
+
+ +

Compute the selection of an element.

+ +

Definition at line 46 of file node.cpp.

+ +
+
+ +

◆ Render()

+ +
+
+ + + + + +
+ + + + + + + +
void Render (Screen & screen)
+
+virtualinherited
+
+ +

Display an element on a ftxui::Screen.

+ +

Definition at line 59 of file node.cpp.

+ +
+
+ +

◆ GetSelectedContent()

+ +
+
+ + + + + +
+ + + + + + + +
std::string GetSelectedContent (Selection & selection)
+
+virtualinherited
+
+ +

Definition at line 72 of file node.cpp.

+ +
+
+ +

◆ Check()

+ +
+
+ + + + + +
+ + + + + + + +
void Check (Status * status)
+
+virtualinherited
+
+ +

Definition at line 65 of file node.cpp.

+ +
+
+

Member Data Documentation

+ +

◆ children_

+ +
+
+ + + + + +
+ + + + +
Elements children_
+
+protectedinherited
+
+ +

Definition at line 79 of file node.hpp.

+ +
+
+ +

◆ requirement_

+ +
+
+ + + + + +
+ + + + +
Requirement requirement_
+
+protectedinherited
+
+ +

Definition at line 80 of file node.hpp.

+ +
+
+ +

◆ box_

+ +
+
+ + + + + +
+ + + + +
Box box_
+
+protectedinherited
+
+ +

Definition at line 81 of file node.hpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+
+ + + + + diff --git a/classftxui_1_1NodeDecorator.js b/classftxui_1_1NodeDecorator.js new file mode 100644 index 000000000..909b1c847 --- /dev/null +++ b/classftxui_1_1NodeDecorator.js @@ -0,0 +1,14 @@ +var classftxui_1_1NodeDecorator = +[ + [ "NodeDecorator", "classftxui_1_1NodeDecorator.html#a7e9d74ba5d480d87e8bfcaf2df66fbbe", null ], + [ "ComputeRequirement", "classftxui_1_1NodeDecorator.html#ac68a91492bfe8a6dd7ea2b3f7f295720", null ], + [ "SetBox", "classftxui_1_1NodeDecorator.html#aafcc9bd6538ccb37babf4d56c4c1c238", null ], + [ "requirement", "classftxui_1_1NodeDecorator.html#a39a263e8c8786dc62fcb4d734aad7fe6", null ], + [ "Select", "classftxui_1_1NodeDecorator.html#a05352f5a353f1e86630a978060e77305", null ], + [ "Render", "classftxui_1_1NodeDecorator.html#a7e286fe14880614686ceeec84a9a9702", null ], + [ "GetSelectedContent", "classftxui_1_1NodeDecorator.html#a2c5cebe05557529299e649867b499680", null ], + [ "Check", "classftxui_1_1NodeDecorator.html#a5b71d891a102197f2856f53702425581", null ], + [ "children_", "classftxui_1_1NodeDecorator.html#a2aeb117dade3254694355ab90e9fc566", null ], + [ "requirement_", "classftxui_1_1NodeDecorator.html#a3530d99687053ce0d0006b9dee9a1ca7", null ], + [ "box_", "classftxui_1_1NodeDecorator.html#aa7e7d30102945911407723a5cbcdfabc", null ] +]; \ No newline at end of file diff --git a/classftxui_1_1NodeDecorator__inherit__graph.map b/classftxui_1_1NodeDecorator__inherit__graph.map new file mode 100644 index 000000000..f3e6afcc8 --- /dev/null +++ b/classftxui_1_1NodeDecorator__inherit__graph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/classftxui_1_1NodeDecorator__inherit__graph.md5 b/classftxui_1_1NodeDecorator__inherit__graph.md5 new file mode 100644 index 000000000..ebf65f9ab --- /dev/null +++ b/classftxui_1_1NodeDecorator__inherit__graph.md5 @@ -0,0 +1 @@ +4992816a7a0349a99d3dec8c40c8c80b \ No newline at end of file diff --git a/classftxui_1_1NodeDecorator__inherit__graph.png b/classftxui_1_1NodeDecorator__inherit__graph.png new file mode 100644 index 000000000..ff8630722 Binary files /dev/null and b/classftxui_1_1NodeDecorator__inherit__graph.png differ diff --git a/classftxui_1_1Node__inherit__graph.map b/classftxui_1_1Node__inherit__graph.map new file mode 100644 index 000000000..1824e5777 --- /dev/null +++ b/classftxui_1_1Node__inherit__graph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/classftxui_1_1Node__inherit__graph.md5 b/classftxui_1_1Node__inherit__graph.md5 new file mode 100644 index 000000000..5dd4fb017 --- /dev/null +++ b/classftxui_1_1Node__inherit__graph.md5 @@ -0,0 +1 @@ +f9f15f9ccc74258a638840b395639bea \ No newline at end of file diff --git a/classftxui_1_1Node__inherit__graph.png b/classftxui_1_1Node__inherit__graph.png new file mode 100644 index 000000000..11eae96c1 Binary files /dev/null and b/classftxui_1_1Node__inherit__graph.png differ diff --git a/classftxui_1_1ReceiverImpl-members.html b/classftxui_1_1ReceiverImpl-members.html new file mode 100644 index 000000000..8690d70ed --- /dev/null +++ b/classftxui_1_1ReceiverImpl-members.html @@ -0,0 +1,217 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
ReceiverImpl< T > Member List
+
+
+ +

This is the complete list of members for ReceiverImpl< T >, including all inherited members.

+ + + + + + + +
HasPending()ReceiverImpl< T >inline
HasQuitted()ReceiverImpl< T >inline
MakeSender()ReceiverImpl< T >inline
Receive(T *t)ReceiverImpl< T >inline
ReceiveNonBlocking(T *t)ReceiverImpl< T >inline
ReceiverImpl()=defaultReceiverImpl< T >
+
+ + + + + diff --git a/classftxui_1_1ReceiverImpl.html b/classftxui_1_1ReceiverImpl.html new file mode 100644 index 000000000..6955111d1 --- /dev/null +++ b/classftxui_1_1ReceiverImpl.html @@ -0,0 +1,411 @@ + + + + + + + + +FTXUI: ReceiverImpl< T > Class Template Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
ReceiverImpl< T > Class Template Reference
+
+
+ +

#include <receiver.hpp>

+ + + + + + + + + + + + + + +

+Public Member Functions

Sender< T > MakeSender ()
 
 ReceiverImpl ()=default
 
bool Receive (T *t)
 
bool ReceiveNonBlocking (T *t)
 
bool HasPending ()
 
bool HasQuitted ()
 
+

Detailed Description

+
template<class T>
+class ftxui::ReceiverImpl< T >
+

Definition at line 81 of file receiver.hpp.

+

Constructor & Destructor Documentation

+ +

◆ ReceiverImpl()

+ +
+
+
+template<class T >
+ + + + + +
+ + + + + + + +
ReceiverImpl ()
+
+default
+
+ +
+
+

Member Function Documentation

+ +

◆ MakeSender()

+ +
+
+
+template<class T >
+ + + + + +
+ + + + + + + +
Sender< T > MakeSender ()
+
+inline
+
+ +

Definition at line 83 of file receiver.hpp.

+ +
+
+ +

◆ Receive()

+ +
+
+
+template<class T >
+ + + + + +
+ + + + + + + +
bool Receive (T * t)
+
+inline
+
+ +

Definition at line 90 of file receiver.hpp.

+ +
+
+ +

◆ ReceiveNonBlocking()

+ +
+
+
+template<class T >
+ + + + + +
+ + + + + + + +
bool ReceiveNonBlocking (T * t)
+
+inline
+
+ +

Definition at line 106 of file receiver.hpp.

+ +
+
+ +

◆ HasPending()

+ +
+
+
+template<class T >
+ + + + + +
+ + + + + + + +
bool HasPending ()
+
+inline
+
+ +

Definition at line 116 of file receiver.hpp.

+ +
+
+ +

◆ HasQuitted()

+ +
+
+
+template<class T >
+ + + + + +
+ + + + + + + +
bool HasQuitted ()
+
+inline
+
+ +

Definition at line 121 of file receiver.hpp.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + + diff --git a/classftxui_1_1ReceiverImpl.js b/classftxui_1_1ReceiverImpl.js new file mode 100644 index 000000000..bce5496af --- /dev/null +++ b/classftxui_1_1ReceiverImpl.js @@ -0,0 +1,10 @@ +var classftxui_1_1ReceiverImpl = +[ + [ "ReceiverImpl", "classftxui_1_1ReceiverImpl.html#a06cce9969ba99f4e42c24dbce9662a3a", null ], + [ "MakeSender", "classftxui_1_1ReceiverImpl.html#aee8560dccb6ab3df27f0a0fc6a1f8442", null ], + [ "Receive", "classftxui_1_1ReceiverImpl.html#a2d2bc6945a964ecb739002cc58291bee", null ], + [ "ReceiveNonBlocking", "classftxui_1_1ReceiverImpl.html#a3afe67ce4b9296787d4133866e0b2b00", null ], + [ "HasPending", "classftxui_1_1ReceiverImpl.html#a49f2a9285b485f25694f48732b0c2554", null ], + [ "HasQuitted", "classftxui_1_1ReceiverImpl.html#a0f10869cb1cad212e8885deac6960a41", null ], + [ "SenderImpl< T >", "classftxui_1_1ReceiverImpl.html#ab0e3e6a7bfedc2416a0990b09c46d8bb", null ] +]; \ No newline at end of file diff --git a/classftxui_1_1Ref-members.html b/classftxui_1_1Ref-members.html new file mode 100644 index 000000000..8acb85191 --- /dev/null +++ b/classftxui_1_1Ref-members.html @@ -0,0 +1,225 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Ref< T > Member List
+
+
+ +

This is the complete list of members for Ref< T >, including all inherited members.

+ + + + + + + + + + + + + + + +
operator()()Ref< T >inline
operator()() constRef< T >inline
operator*()Ref< T >inline
operator*() constRef< T >inline
operator->()Ref< T >inline
operator->() constRef< T >inline
operator=(Ref &&) noexcept=defaultRef< T >
operator=(const Ref< T > &)=defaultRef< T >
Ref()=defaultRef< T >
Ref(T t)Ref< T >inline
Ref(T *t)Ref< T >inline
Ref(const Ref< T > &)=defaultRef< T >
Ref(Ref< T > &&) noexcept=defaultRef< T >
~Ref()=defaultRef< T >
+
+ + + + + diff --git a/classftxui_1_1Ref.html b/classftxui_1_1Ref.html new file mode 100644 index 000000000..ef07c809b --- /dev/null +++ b/classftxui_1_1Ref.html @@ -0,0 +1,653 @@ + + + + + + + + +FTXUI: Ref< T > Class Template Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
Ref< T > Class Template Reference
+
+
+ +

An adapter. Own or reference an mutable object. + More...

+ +

#include <ref.hpp>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 Ref ()=default
 
 Ref (T t)
 
 Ref (T *t)
 
 ~Ref ()=default
 
Refoperator= (Ref &&) noexcept=default
 
 Ref (const Ref< T > &)=default
 
 Ref (Ref< T > &&) noexcept=default
 
Ref< T > & operator= (const Ref< T > &)=default
 
T & operator() ()
 
T & operator* ()
 
T * operator-> ()
 
const T & operator() () const
 
const T & operator* () const
 
const T * operator-> () const
 
+

Detailed Description

+
template<typename T>
+class ftxui::Ref< T >

An adapter. Own or reference an mutable object.

+ +

Definition at line 46 of file ref.hpp.

+

Constructor & Destructor Documentation

+ +

◆ Ref() [1/5]

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
Ref ()
+
+default
+
+ +
+
+ +

◆ Ref() [2/5]

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
Ref (T t)
+
+inline
+
+ +

Definition at line 49 of file ref.hpp.

+ +
+
+ +

◆ Ref() [3/5]

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
Ref (T * t)
+
+inline
+
+ +

Definition at line 50 of file ref.hpp.

+ +
+
+ +

◆ ~Ref()

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
~Ref ()
+
+default
+
+ +
+
+ +

◆ Ref() [4/5]

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
Ref (const Ref< T > & )
+
+default
+
+ +
+
+ +

◆ Ref() [5/5]

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
Ref (Ref< T > && )
+
+defaultnoexcept
+
+ +
+
+

Member Function Documentation

+ +

◆ operator=() [1/2]

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
Ref & operator= (Ref< T > && )
+
+defaultnoexcept
+
+ +
+
+ +

◆ operator=() [2/2]

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
Ref< T > & operator= (const Ref< T > & )
+
+default
+
+ +
+
+ +

◆ operator()() [1/2]

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
T & operator() ()
+
+inline
+
+ +

Definition at line 60 of file ref.hpp.

+ +
+
+ +

◆ operator*() [1/2]

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
T & operator* ()
+
+inline
+
+ +

Definition at line 61 of file ref.hpp.

+ +
+
+ +

◆ operator->() [1/2]

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
T * operator-> ()
+
+inline
+
+ +

Definition at line 62 of file ref.hpp.

+ +
+
+ +

◆ operator()() [2/2]

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
const T & operator() () const
+
+inline
+
+ +

Definition at line 63 of file ref.hpp.

+ +
+
+ +

◆ operator*() [2/2]

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
const T & operator* () const
+
+inline
+
+ +

Definition at line 64 of file ref.hpp.

+ +
+
+ +

◆ operator->() [2/2]

+ +
+
+
+template<typename T >
+ + + + + +
+ + + + + + + +
const T * operator-> () const
+
+inline
+
+ +

Definition at line 65 of file ref.hpp.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + + diff --git a/classftxui_1_1Ref.js b/classftxui_1_1Ref.js new file mode 100644 index 000000000..510e4ebc9 --- /dev/null +++ b/classftxui_1_1Ref.js @@ -0,0 +1,17 @@ +var classftxui_1_1Ref = +[ + [ "Ref", "classftxui_1_1Ref.html#a6170df9accd9f47736e97385233017b3", null ], + [ "Ref", "classftxui_1_1Ref.html#ab19bb3d5a2b0867c790f00f339915c56", null ], + [ "Ref", "classftxui_1_1Ref.html#ae16b183b63cb1d7ef3d11ff47c158a8b", null ], + [ "~Ref", "classftxui_1_1Ref.html#a3950a05eee649724ae206d5dd33355f5", null ], + [ "Ref", "classftxui_1_1Ref.html#aec110a549f4e384fb89896bd013cc8fe", null ], + [ "Ref", "classftxui_1_1Ref.html#af37c209213693451d05f4b089402ee07", null ], + [ "operator=", "classftxui_1_1Ref.html#abd99a8175d3ef482e70c239aef26322a", null ], + [ "operator=", "classftxui_1_1Ref.html#a2219840465715bbca4b1467132c686a5", null ], + [ "operator()", "classftxui_1_1Ref.html#a625855a4f62948f4f1ad06354be9ca09", null ], + [ "operator*", "classftxui_1_1Ref.html#a3f534efce0b043d603eb8f5653268e7d", null ], + [ "operator->", "classftxui_1_1Ref.html#a4442b1b9eab40e7939e1e01cdedcb7ae", null ], + [ "operator()", "classftxui_1_1Ref.html#afdc36f6a5716b29a5d81a2dd93376d82", null ], + [ "operator*", "classftxui_1_1Ref.html#a241c04e3ce86e1fd5a946eb2aa8b1f22", null ], + [ "operator->", "classftxui_1_1Ref.html#abaade5c780b539b94de660e314cb0c90", null ] +]; \ No newline at end of file diff --git a/classftxui_1_1ScreenInteractive_1_1Private-members.html b/classftxui_1_1ScreenInteractive_1_1Private-members.html new file mode 100644 index 000000000..b7d84af0e --- /dev/null +++ b/classftxui_1_1ScreenInteractive_1_1Private-members.html @@ -0,0 +1,212 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
ScreenInteractive::Private Member List
+
+
+ +

This is the complete list of members for ScreenInteractive::Private, including all inherited members.

+ + +
Signal(ScreenInteractive &s, int signal)ScreenInteractive::Privateinlinestatic
+
+ + + + + diff --git a/classftxui_1_1ScreenInteractive_1_1Private.html b/classftxui_1_1ScreenInteractive_1_1Private.html new file mode 100644 index 000000000..0486b1663 --- /dev/null +++ b/classftxui_1_1ScreenInteractive_1_1Private.html @@ -0,0 +1,258 @@ + + + + + + + + +FTXUI: ScreenInteractive::Private Class Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
ScreenInteractive::Private Class Reference
+
+
+ +

#include <screen_interactive.hpp>

+ + + + +

+Static Public Member Functions

static void Signal (ScreenInteractive &s, int signal)
 
+

Detailed Description

+
+

Definition at line 172 of file screen_interactive.hpp.

+

Member Function Documentation

+ +

◆ Signal()

+ +
+
+ + + + + +
+ + + + + + + + + + + +
static void Signal (ScreenInteractive & s,
int signal )
+
+inlinestatic
+
+ +

Definition at line 174 of file screen_interactive.hpp.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + + diff --git a/classftxui_1_1ScreenInteractive__inherit__graph.map b/classftxui_1_1ScreenInteractive__inherit__graph.map new file mode 100644 index 000000000..1c7abfd70 --- /dev/null +++ b/classftxui_1_1ScreenInteractive__inherit__graph.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/classftxui_1_1ScreenInteractive__inherit__graph.md5 b/classftxui_1_1ScreenInteractive__inherit__graph.md5 new file mode 100644 index 000000000..6027dfca0 --- /dev/null +++ b/classftxui_1_1ScreenInteractive__inherit__graph.md5 @@ -0,0 +1 @@ +31d882d5dc2362a690930697d5896f5e \ No newline at end of file diff --git a/classftxui_1_1ScreenInteractive__inherit__graph.png b/classftxui_1_1ScreenInteractive__inherit__graph.png new file mode 100644 index 000000000..70f3ca0d9 Binary files /dev/null and b/classftxui_1_1ScreenInteractive__inherit__graph.png differ diff --git a/classftxui_1_1Screen__inherit__graph.map b/classftxui_1_1Screen__inherit__graph.map new file mode 100644 index 000000000..4ddc326da --- /dev/null +++ b/classftxui_1_1Screen__inherit__graph.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/classftxui_1_1Screen__inherit__graph.md5 b/classftxui_1_1Screen__inherit__graph.md5 new file mode 100644 index 000000000..40e826743 --- /dev/null +++ b/classftxui_1_1Screen__inherit__graph.md5 @@ -0,0 +1 @@ +31d924148d9a13b84df370a104e60f0f \ No newline at end of file diff --git a/classftxui_1_1Screen__inherit__graph.png b/classftxui_1_1Screen__inherit__graph.png new file mode 100644 index 000000000..566fd877c Binary files /dev/null and b/classftxui_1_1Screen__inherit__graph.png differ diff --git a/classftxui_1_1SenderImpl-members.html b/classftxui_1_1SenderImpl-members.html new file mode 100644 index 000000000..41de490f7 --- /dev/null +++ b/classftxui_1_1SenderImpl-members.html @@ -0,0 +1,218 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
SenderImpl< T > Member List
+
+
+ +

This is the complete list of members for SenderImpl< T >, including all inherited members.

+ + + + + + + + +
Clone()SenderImpl< T >inline
operator=(const SenderImpl &)=deleteSenderImpl< T >
operator=(SenderImpl &&)=deleteSenderImpl< T >
Send(T t)SenderImpl< T >inline
SenderImpl(const SenderImpl &)=deleteSenderImpl< T >
SenderImpl(SenderImpl &&)=deleteSenderImpl< T >
~SenderImpl()SenderImpl< T >inline
+
+ + + + + diff --git a/classftxui_1_1SenderImpl.html b/classftxui_1_1SenderImpl.html new file mode 100644 index 000000000..9fbe3f983 --- /dev/null +++ b/classftxui_1_1SenderImpl.html @@ -0,0 +1,436 @@ + + + + + + + + +FTXUI: SenderImpl< T > Class Template Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
SenderImpl< T > Class Template Reference
+
+
+ +

#include <receiver.hpp>

+ + + + + + + + + + + + + + + + +

+Public Member Functions

 SenderImpl (const SenderImpl &)=delete
 
 SenderImpl (SenderImpl &&)=delete
 
SenderImploperator= (const SenderImpl &)=delete
 
SenderImploperator= (SenderImpl &&)=delete
 
void Send (T t)
 
 ~SenderImpl ()
 
Sender< T > Clone ()
 
+

Detailed Description

+
template<class T>
+class ftxui::SenderImpl< T >
+

Definition at line 63 of file receiver.hpp.

+

Constructor & Destructor Documentation

+ +

◆ SenderImpl() [1/2]

+ +
+
+
+template<class T >
+ + + + + +
+ + + + + + + +
SenderImpl (const SenderImpl< T > & )
+
+delete
+
+ +
+
+ +

◆ SenderImpl() [2/2]

+ +
+
+
+template<class T >
+ + + + + +
+ + + + + + + +
SenderImpl (SenderImpl< T > && )
+
+delete
+
+ +
+
+ +

◆ ~SenderImpl()

+ +
+
+
+template<class T >
+ + + + + +
+ + + + + + + +
~SenderImpl ()
+
+inline
+
+ +

Definition at line 70 of file receiver.hpp.

+ +
+
+

Member Function Documentation

+ +

◆ operator=() [1/2]

+ +
+
+
+template<class T >
+ + + + + +
+ + + + + + + +
SenderImpl & operator= (const SenderImpl< T > & )
+
+delete
+
+ +
+
+ +

◆ operator=() [2/2]

+ +
+
+
+template<class T >
+ + + + + +
+ + + + + + + +
SenderImpl & operator= (SenderImpl< T > && )
+
+delete
+
+ +
+
+ +

◆ Send()

+ +
+
+
+template<class T >
+ + + + + +
+ + + + + + + +
void Send (T t)
+
+inline
+
+ +

Definition at line 69 of file receiver.hpp.

+ +
+
+ +

◆ Clone()

+ +
+
+
+template<class T >
+ + + + + +
+ + + + + + + +
Sender< T > Clone ()
+
+inline
+
+ +

Definition at line 72 of file receiver.hpp.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + + diff --git a/classftxui_1_1SenderImpl.js b/classftxui_1_1SenderImpl.js new file mode 100644 index 000000000..01e69f443 --- /dev/null +++ b/classftxui_1_1SenderImpl.js @@ -0,0 +1,11 @@ +var classftxui_1_1SenderImpl = +[ + [ "SenderImpl", "classftxui_1_1SenderImpl.html#a7770521e8bff392402a1539bf4eb8ff4", null ], + [ "SenderImpl", "classftxui_1_1SenderImpl.html#a61b3d68c26b829848661ca875b0cdb13", null ], + [ "~SenderImpl", "classftxui_1_1SenderImpl.html#ac23f2c8d2bf8c021dcce059afd2c3405", null ], + [ "operator=", "classftxui_1_1SenderImpl.html#a571b0715efdefbfbc80bebc4ba3f16c3", null ], + [ "operator=", "classftxui_1_1SenderImpl.html#aec884eaa70eed221721d0ae963974927", null ], + [ "Send", "classftxui_1_1SenderImpl.html#af3a961fb9b4025671b6122a392a5bc3f", null ], + [ "Clone", "classftxui_1_1SenderImpl.html#a575817a7bf1afd8bc9af4973e4f38481", null ], + [ "ReceiverImpl< T >", "classftxui_1_1SenderImpl.html#a45b555ffa5b4f56dc978ab2c0e8e42ca", null ] +]; \ No newline at end of file diff --git a/classftxui_1_1StringRef-members.html b/classftxui_1_1StringRef-members.html new file mode 100644 index 000000000..2e19992b5 --- /dev/null +++ b/classftxui_1_1StringRef-members.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
StringRef Member List
+
+
+ +

This is the complete list of members for StringRef, including all inherited members.

+ + + + + + + + + + + + + + + + + +
operator()()Ref< std::string >inline
operator()() constRef< std::string >inline
operator*()Ref< std::string >inline
operator*() constRef< std::string >inline
operator->()Ref< std::string >inline
operator->() constRef< std::string >inline
operator=(Ref &&) noexcept=defaultRef< std::string >
operator=(const Ref< std::string > &)=defaultRef< std::string >
Ref()=defaultRef< std::string >
Ref(std::string t)Ref< std::string >inline
Ref(std::string *t)Ref< std::string >inline
Ref(const Ref< std::string > &)=defaultRef< std::string >
Ref(Ref< std::string > &&) noexcept=defaultRef< std::string >
StringRef(const wchar_t *ref)StringRefinline
StringRef(const char *ref)StringRefinline
~Ref()=defaultRef< std::string >
+
+ + + + + diff --git a/classftxui_1_1StringRef.html b/classftxui_1_1StringRef.html new file mode 100644 index 000000000..1fe02228b --- /dev/null +++ b/classftxui_1_1StringRef.html @@ -0,0 +1,474 @@ + + + + + + + + +FTXUI: StringRef Class Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
StringRef Class Reference
+
+
+ +

An adapter. Own or reference a constant string. For convenience, this class convert multiple mutable string toward a shared representation. + More...

+ +

#include <ref.hpp>

+
+ + Inheritance diagram for StringRef:
+
+
+ + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 StringRef (const wchar_t *ref)
 
 StringRef (const char *ref)
 
std::string & operator() ()
 
const std::string & operator() () const
 
std::string & operator* ()
 
const std::string & operator* () const
 
std::string * operator-> ()
 
const std::string * operator-> () const
 
+

Detailed Description

+

An adapter. Own or reference a constant string. For convenience, this class convert multiple mutable string toward a shared representation.

+ +

Definition at line 82 of file ref.hpp.

+

Constructor & Destructor Documentation

+ +

◆ StringRef() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
StringRef (const wchar_t * ref)
+
+inline
+
+ +

Definition at line 86 of file ref.hpp.

+ +
+
+ +

◆ StringRef() [2/2]

+ +
+
+ + + + + +
+ + + + + + + +
StringRef (const char * ref)
+
+inline
+
+ +

Definition at line 88 of file ref.hpp.

+ +
+
+

Member Function Documentation

+ +

◆ operator()() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
std::string & operator() ()
+
+inlineinherited
+
+ +

Definition at line 60 of file ref.hpp.

+ +
+
+ +

◆ operator()() [2/2]

+ +
+
+ + + + + +
+ + + + + + + +
const std::string & operator() () const
+
+inlineinherited
+
+ +

Definition at line 63 of file ref.hpp.

+ +
+
+ +

◆ operator*() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
std::string & operator* ()
+
+inlineinherited
+
+ +

Definition at line 61 of file ref.hpp.

+ +
+
+ +

◆ operator*() [2/2]

+ +
+
+ + + + + +
+ + + + + + + +
const std::string & operator* () const
+
+inlineinherited
+
+ +

Definition at line 64 of file ref.hpp.

+ +
+
+ +

◆ operator->() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
std::string * operator-> ()
+
+inlineinherited
+
+ +

Definition at line 62 of file ref.hpp.

+ +
+
+ +

◆ operator->() [2/2]

+ +
+
+ + + + + +
+ + + + + + + +
const std::string * operator-> () const
+
+inlineinherited
+
+ +

Definition at line 65 of file ref.hpp.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + + diff --git a/classftxui_1_1StringRef.js b/classftxui_1_1StringRef.js new file mode 100644 index 000000000..dc7131ad8 --- /dev/null +++ b/classftxui_1_1StringRef.js @@ -0,0 +1,11 @@ +var classftxui_1_1StringRef = +[ + [ "StringRef", "classftxui_1_1StringRef.html#ad3cfa31525e075cbd5f50c2476e665ce", null ], + [ "StringRef", "classftxui_1_1StringRef.html#a9133717e5c00b480a4a4a120ba7fb886", null ], + [ "operator()", "classftxui_1_1StringRef.html#a625855a4f62948f4f1ad06354be9ca09", null ], + [ "operator()", "classftxui_1_1StringRef.html#afdc36f6a5716b29a5d81a2dd93376d82", null ], + [ "operator*", "classftxui_1_1StringRef.html#a3f534efce0b043d603eb8f5653268e7d", null ], + [ "operator*", "classftxui_1_1StringRef.html#a241c04e3ce86e1fd5a946eb2aa8b1f22", null ], + [ "operator->", "classftxui_1_1StringRef.html#a4442b1b9eab40e7939e1e01cdedcb7ae", null ], + [ "operator->", "classftxui_1_1StringRef.html#abaade5c780b539b94de660e314cb0c90", null ] +]; \ No newline at end of file diff --git a/classftxui_1_1StringRef__inherit__graph.map b/classftxui_1_1StringRef__inherit__graph.map new file mode 100644 index 000000000..3e05f2ca6 --- /dev/null +++ b/classftxui_1_1StringRef__inherit__graph.map @@ -0,0 +1,5 @@ + + + + + diff --git a/classftxui_1_1StringRef__inherit__graph.md5 b/classftxui_1_1StringRef__inherit__graph.md5 new file mode 100644 index 000000000..b2d25cd78 --- /dev/null +++ b/classftxui_1_1StringRef__inherit__graph.md5 @@ -0,0 +1 @@ +b72244c33e11b7dd47b30ee05bf16c9f \ No newline at end of file diff --git a/classftxui_1_1StringRef__inherit__graph.png b/classftxui_1_1StringRef__inherit__graph.png new file mode 100644 index 000000000..6f426145a Binary files /dev/null and b/classftxui_1_1StringRef__inherit__graph.png differ diff --git a/classftxui_1_1TableSelection-members.html b/classftxui_1_1TableSelection-members.html new file mode 100644 index 000000000..9ea4d9eef --- /dev/null +++ b/classftxui_1_1TableSelection-members.html @@ -0,0 +1,225 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
TableSelection Member List
+
+
+ +

This is the complete list of members for TableSelection, including all inherited members.

+ + + + + + + + + + + + + + + +
Border(BorderStyle border=LIGHT)TableSelection
BorderBottom(BorderStyle border=LIGHT)TableSelection
BorderLeft(BorderStyle border=LIGHT)TableSelection
BorderRight(BorderStyle border=LIGHT)TableSelection
BorderTop(BorderStyle border=LIGHT)TableSelection
Decorate(Decorator)TableSelection
DecorateAlternateColumn(Decorator, int modulo=2, int shift=0)TableSelection
DecorateAlternateRow(Decorator, int modulo=2, int shift=0)TableSelection
DecorateCells(Decorator)TableSelection
DecorateCellsAlternateColumn(Decorator, int modulo=2, int shift=0)TableSelection
DecorateCellsAlternateRow(Decorator, int modulo=2, int shift=0)TableSelection
Separator(BorderStyle border=LIGHT)TableSelection
SeparatorHorizontal(BorderStyle border=LIGHT)TableSelection
SeparatorVertical(BorderStyle border=LIGHT)TableSelection
+
+ + + + + diff --git a/classftxui_1_1TableSelection.html b/classftxui_1_1TableSelection.html new file mode 100644 index 000000000..817dba7f0 --- /dev/null +++ b/classftxui_1_1TableSelection.html @@ -0,0 +1,692 @@ + + + + + + + + +FTXUI: TableSelection Class Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
TableSelection Class Reference
+
+
+ +

#include <table.hpp>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

void Decorate (Decorator)
 Apply the decorator to the selection. This decorate both the cells, the lines and the corners.
 
void DecorateAlternateRow (Decorator, int modulo=2, int shift=0)
 Apply the decorator to the selection. This decorate only the lines modulo modulo with a shift of shift.
 
void DecorateAlternateColumn (Decorator, int modulo=2, int shift=0)
 Apply the decorator to the selection. This decorate only the lines modulo modulo with a shift of shift.
 
void DecorateCells (Decorator)
 Apply the decorator to the selection.
 
void DecorateCellsAlternateColumn (Decorator, int modulo=2, int shift=0)
 Apply the decorator to the selection. This decorate only the corners modulo modulo with a shift of shift.
 
void DecorateCellsAlternateRow (Decorator, int modulo=2, int shift=0)
 Apply the decorator to the selection. This decorate only the corners modulo modulo with a shift of shift.
 
void Border (BorderStyle border=LIGHT)
 Apply a border around the selection.
 
void BorderLeft (BorderStyle border=LIGHT)
 Draw some separator lines to the left side of the selection.
 
void BorderRight (BorderStyle border=LIGHT)
 Draw some separator lines to the right side of the selection.
 
void BorderTop (BorderStyle border=LIGHT)
 Draw some separator lines to the top side of the selection.
 
void BorderBottom (BorderStyle border=LIGHT)
 Draw some separator lines to the bottom side of the selection.
 
void Separator (BorderStyle border=LIGHT)
 Draw some separator lines in the selection.
 
void SeparatorVertical (BorderStyle border=LIGHT)
 Draw some vertical separator lines in the selection.
 
void SeparatorHorizontal (BorderStyle border=LIGHT)
 Draw some horizontal separator lines in the selection.
 
+

Detailed Description

+
+

Definition at line 64 of file table.hpp.

+

Member Function Documentation

+ +

◆ Decorate()

+ +
+
+ + + + + + + +
void Decorate (Decorator decorator)
+
+ +

Apply the decorator to the selection. This decorate both the cells, the lines and the corners.

+
Parameters
+ + +
decoratorThe decorator to apply.
+
+
+ +

Definition at line 242 of file src/ftxui/dom/table.cpp.

+ +
+
+ +

◆ DecorateAlternateRow()

+ +
+
+ + + + + + + + + + + + + + + + +
void DecorateAlternateRow (Decorator decorator,
int modulo = 2,
int shift = 0 )
+
+ +

Apply the decorator to the selection. This decorate only the lines modulo modulo with a shift of shift.

+
Parameters
+ + + + +
decoratorThe decorator to apply.
moduloThe modulo of the lines to decorate.
shiftThe shift of the lines to decorate.
+
+
+ +

Definition at line 291 of file src/ftxui/dom/table.cpp.

+ +
+
+ +

◆ DecorateAlternateColumn()

+ +
+
+ + + + + + + + + + + + + + + + +
void DecorateAlternateColumn (Decorator decorator,
int modulo = 2,
int shift = 0 )
+
+ +

Apply the decorator to the selection. This decorate only the lines modulo modulo with a shift of shift.

+
Parameters
+ + + + +
decoratorThe decorator to apply.
moduloThe modulo of the lines to decorate.
shiftThe shift of the lines to decorate.
+
+
+ +

Definition at line 272 of file src/ftxui/dom/table.cpp.

+ +
+
+ +

◆ DecorateCells()

+ +
+
+ + + + + + + +
void DecorateCells (Decorator decorator)
+
+ +

Apply the decorator to the selection.

+
Parameters
+ + +
decoratorThe decorator to apply. This decorate only the cells.
+
+
+ +

Definition at line 255 of file src/ftxui/dom/table.cpp.

+ +
+
+ +

◆ DecorateCellsAlternateColumn()

+ +
+
+ + + + + + + + + + + + + + + + +
void DecorateCellsAlternateColumn (Decorator decorator,
int modulo = 2,
int shift = 0 )
+
+ +

Apply the decorator to the selection. This decorate only the corners modulo modulo with a shift of shift.

+
Parameters
+ + + + +
decoratorThe decorator to apply.
moduloThe modulo of the corners to decorate.
shiftThe shift of the corners to decorate.
+
+
+ +

Definition at line 310 of file src/ftxui/dom/table.cpp.

+ +
+
+ +

◆ DecorateCellsAlternateRow()

+ +
+
+ + + + + + + + + + + + + + + + +
void DecorateCellsAlternateRow (Decorator decorator,
int modulo = 2,
int shift = 0 )
+
+ +

Apply the decorator to the selection. This decorate only the corners modulo modulo with a shift of shift.

+
Parameters
+ + + + +
decoratorThe decorator to apply.
moduloThe modulo of the corners to decorate.
shiftThe shift of the corners to decorate.
+
+
+ +

Definition at line 329 of file src/ftxui/dom/table.cpp.

+ +
+
+ +

◆ Border()

+ +
+
+ + + + + + + +
void Border (BorderStyle border = LIGHT)
+
+ +

Apply a border around the selection.

+
Parameters
+ + +
borderThe border style to apply.
+
+
+
Examples
examples/dom/table.cpp.
+
+ +

Definition at line 344 of file src/ftxui/dom/table.cpp.

+ +
+
+ +

◆ BorderLeft()

+ +
+
+ + + + + + + +
void BorderLeft (BorderStyle border = LIGHT)
+
+ +

Draw some separator lines to the left side of the selection.

+
Parameters
+ + +
borderThe border style to apply.
+
+
+ +

Definition at line 403 of file src/ftxui/dom/table.cpp.

+ +
+
+ +

◆ BorderRight()

+ +
+
+ + + + + + + +
void BorderRight (BorderStyle border = LIGHT)
+
+ +

Draw some separator lines to the right side of the selection.

+
Parameters
+ + +
borderThe border style to apply.
+
+
+ +

Definition at line 412 of file src/ftxui/dom/table.cpp.

+ +
+
+ +

◆ BorderTop()

+ +
+
+ + + + + + + +
void BorderTop (BorderStyle border = LIGHT)
+
+ +

Draw some separator lines to the top side of the selection.

+
Parameters
+ + +
borderThe border style to apply.
+
+
+ +

Definition at line 421 of file src/ftxui/dom/table.cpp.

+ +
+
+ +

◆ BorderBottom()

+ +
+
+ + + + + + + +
void BorderBottom (BorderStyle border = LIGHT)
+
+ +

Draw some separator lines to the bottom side of the selection.

+
Parameters
+ + +
borderThe border style to apply.
+
+
+ +

Definition at line 430 of file src/ftxui/dom/table.cpp.

+ +
+
+ +

◆ Separator()

+ +
+
+ + + + + + + +
void Separator (BorderStyle border = LIGHT)
+
+ +

Draw some separator lines in the selection.

+
Parameters
+ + +
borderThe border style to apply.
+
+
+ +

Definition at line 362 of file src/ftxui/dom/table.cpp.

+ +
+
+ +

◆ SeparatorVertical()

+ +
+
+ + + + + + + +
void SeparatorVertical (BorderStyle border = LIGHT)
+
+ +

Draw some vertical separator lines in the selection.

+
Parameters
+ + +
borderThe border style to apply.
+
+
+ +

Definition at line 377 of file src/ftxui/dom/table.cpp.

+ +
+
+ +

◆ SeparatorHorizontal()

+ +
+
+ + + + + + + +
void SeparatorHorizontal (BorderStyle border = LIGHT)
+
+ +

Draw some horizontal separator lines in the selection.

+
Parameters
+ + +
borderThe border style to apply.
+
+
+ +

Definition at line 390 of file src/ftxui/dom/table.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+
+ + + + + diff --git a/classftxui_1_1TableSelection.js b/classftxui_1_1TableSelection.js new file mode 100644 index 000000000..376091f61 --- /dev/null +++ b/classftxui_1_1TableSelection.js @@ -0,0 +1,17 @@ +var classftxui_1_1TableSelection = +[ + [ "Decorate", "classftxui_1_1TableSelection.html#a8e7e9329ee7f557eef6d037fef8003e0", null ], + [ "DecorateAlternateRow", "classftxui_1_1TableSelection.html#a9cadee0ff95e66e2ca90e15648ad592d", null ], + [ "DecorateAlternateColumn", "classftxui_1_1TableSelection.html#a00b7d84571ed47043e55cd879ed851a3", null ], + [ "DecorateCells", "classftxui_1_1TableSelection.html#a335808a6c8beb4744bfe91b359ebf0bb", null ], + [ "DecorateCellsAlternateColumn", "classftxui_1_1TableSelection.html#a751593eb3bc2e704eb6667ed518f614e", null ], + [ "DecorateCellsAlternateRow", "classftxui_1_1TableSelection.html#ac2810f38a5f722916f364f354c204cb7", null ], + [ "Border", "classftxui_1_1TableSelection.html#af47b05e5a3f01cafc419ce94388cae51", null ], + [ "BorderLeft", "classftxui_1_1TableSelection.html#a5b822ad80ff44922a9d6551743f64259", null ], + [ "BorderRight", "classftxui_1_1TableSelection.html#af36f1d9893a26293f24da431c5a344cc", null ], + [ "BorderTop", "classftxui_1_1TableSelection.html#aa9002be87d1fc0c5c6416b8006a902e4", null ], + [ "BorderBottom", "classftxui_1_1TableSelection.html#ab3efbe517730170703eba50cf23b150d", null ], + [ "Separator", "classftxui_1_1TableSelection.html#ab1c6e11d86131eddb095c8211b824b18", null ], + [ "SeparatorVertical", "classftxui_1_1TableSelection.html#a2334aed76610138905c96dc298b7e9df", null ], + [ "SeparatorHorizontal", "classftxui_1_1TableSelection.html#affd2ab7143cb388fdedad3bd51995802", null ] +]; \ No newline at end of file diff --git a/classftxui_1_1TerminalInputParser-members.html b/classftxui_1_1TerminalInputParser-members.html new file mode 100644 index 000000000..a3f8bff08 --- /dev/null +++ b/classftxui_1_1TerminalInputParser-members.html @@ -0,0 +1,214 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
TerminalInputParser Member List
+
+
+ +

This is the complete list of members for TerminalInputParser, including all inherited members.

+ + + + +
Add(char c)TerminalInputParser
TerminalInputParser(std::function< void(Event)> out)TerminalInputParserexplicit
Timeout(int time)TerminalInputParser
+
+ + + + + diff --git a/classftxui_1_1TerminalInputParser.html b/classftxui_1_1TerminalInputParser.html new file mode 100644 index 000000000..aa3590922 --- /dev/null +++ b/classftxui_1_1TerminalInputParser.html @@ -0,0 +1,298 @@ + + + + + + + + +FTXUI: TerminalInputParser Class Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
TerminalInputParser Class Reference
+
+
+ +

#include <terminal_input_parser.hpp>

+ + + + + + + + +

+Public Member Functions

 TerminalInputParser (std::function< void(Event)> out)
 
void Timeout (int time)
 
void Add (char c)
 
+

Detailed Description

+
+

Definition at line 17 of file terminal_input_parser.hpp.

+

Constructor & Destructor Documentation

+ +

◆ TerminalInputParser()

+ +
+
+ + + + + +
+ + + + + + + +
TerminalInputParser (std::function< void(Event)> out)
+
+explicit
+
+ +

Definition at line 93 of file terminal_input_parser.cpp.

+ +
+
+

Member Function Documentation

+ +

◆ Timeout()

+ +
+
+ + + + + + + +
void Timeout (int time)
+
+ +

Definition at line 96 of file terminal_input_parser.cpp.

+ +
+
+ +

◆ Add()

+ +
+
+ + + + + + + +
void Add (char c)
+
+ +

Definition at line 108 of file terminal_input_parser.cpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+
+ + + + + diff --git a/classftxui_1_1TerminalInputParser.js b/classftxui_1_1TerminalInputParser.js new file mode 100644 index 000000000..9ddbd86a2 --- /dev/null +++ b/classftxui_1_1TerminalInputParser.js @@ -0,0 +1,6 @@ +var classftxui_1_1TerminalInputParser = +[ + [ "TerminalInputParser", "classftxui_1_1TerminalInputParser.html#acbc8ed784fd28db571aece82b20c9855", null ], + [ "Timeout", "classftxui_1_1TerminalInputParser.html#a9e4aeeff8f55e0b1c7a8f9c282a77823", null ], + [ "Add", "classftxui_1_1TerminalInputParser.html#a4b2f1e271dd6ebbf5bad2418d960832a", null ] +]; \ No newline at end of file diff --git a/classftxui_1_1animation_1_1Animator-members.html b/classftxui_1_1animation_1_1Animator-members.html new file mode 100644 index 000000000..962dbd624 --- /dev/null +++ b/classftxui_1_1animation_1_1Animator-members.html @@ -0,0 +1,214 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Animator Member List
+
+
+ +

This is the complete list of members for Animator, including all inherited members.

+ + + + +
Animator(float *from, float to=0.f, Duration duration=std::chrono::milliseconds(250), easing::Function easing_function=easing::Linear, Duration delay=std::chrono::milliseconds(0))Animatorexplicit
OnAnimation(Params &)Animator
to() constAnimatorinline
+
+ + + + + diff --git a/classftxui_1_1animation_1_1Animator.html b/classftxui_1_1animation_1_1Animator.html new file mode 100644 index 000000000..111f00b38 --- /dev/null +++ b/classftxui_1_1animation_1_1Animator.html @@ -0,0 +1,325 @@ + + + + + + + + +FTXUI: Animator Class Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
Animator Class Reference
+
+
+ +

#include <animation.hpp>

+ + + + + + + + +

+Public Member Functions

 Animator (float *from, float to=0.f, Duration duration=std::chrono::milliseconds(250), easing::Function easing_function=easing::Linear, Duration delay=std::chrono::milliseconds(0))
 
void OnAnimation (Params &)
 
float to () const
 
+

Detailed Description

+
+

Definition at line 100 of file animation.hpp.

+

Constructor & Destructor Documentation

+ +

◆ Animator()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Animator (float * from,
float to = 0.f,
Duration duration = std::chrono::milliseconds(250),
easing::Function easing_function = easing::Linear,
Duration delay = std::chrono::milliseconds(0) )
+
+explicit
+
+ +

Definition at line 253 of file animation.cpp.

+ +
+
+

Member Function Documentation

+ +

◆ OnAnimation()

+ +
+
+ + + + + + + +
void OnAnimation (Params & params)
+
+ +

Definition at line 267 of file animation.cpp.

+ +
+
+ +

◆ to()

+ +
+
+ + + + + +
+ + + + + + + +
float to () const
+
+inline
+
+ +

Definition at line 110 of file animation.hpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+
+ + + + + diff --git a/classftxui_1_1animation_1_1Animator.js b/classftxui_1_1animation_1_1Animator.js new file mode 100644 index 000000000..526b8fa2d --- /dev/null +++ b/classftxui_1_1animation_1_1Animator.js @@ -0,0 +1,6 @@ +var classftxui_1_1animation_1_1Animator = +[ + [ "Animator", "classftxui_1_1animation_1_1Animator.html#a03909a0243b559e18e21996ccacdc8b6", null ], + [ "OnAnimation", "classftxui_1_1animation_1_1Animator.html#ac956aa7c105ad418392f69219711117d", null ], + [ "to", "classftxui_1_1animation_1_1Animator.html#a5d3b8db14f3f21f9169cfbebf247d854", null ] +]; \ No newline at end of file diff --git a/classftxui_1_1animation_1_1Params-members.html b/classftxui_1_1animation_1_1Params-members.html new file mode 100644 index 000000000..fc365f2c0 --- /dev/null +++ b/classftxui_1_1animation_1_1Params-members.html @@ -0,0 +1,213 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Params Member List
+
+
+ +

This is the complete list of members for Params, including all inherited members.

+ + + +
duration() constParamsinline
Params(Duration duration)Paramsinlineexplicit
+
+ + + + + diff --git a/classftxui_1_1animation_1_1Params.html b/classftxui_1_1animation_1_1Params.html new file mode 100644 index 000000000..55d6277d7 --- /dev/null +++ b/classftxui_1_1animation_1_1Params.html @@ -0,0 +1,287 @@ + + + + + + + + +FTXUI: Params Class Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
Params Class Reference
+
+
+ +

#include <animation.hpp>

+ + + + + + + +

+Public Member Functions

 Params (Duration duration)
 
Duration duration () const
 The duration this animation step represents.
 
+

Detailed Description

+
+

Definition at line 33 of file animation.hpp.

+

Constructor & Destructor Documentation

+ +

◆ Params()

+ +
+
+ + + + + +
+ + + + + + + +
Params (Duration duration)
+
+inlineexplicit
+
+ +

Definition at line 35 of file animation.hpp.

+ +
+
+

Member Function Documentation

+ +

◆ duration()

+ +
+
+ + + + + +
+ + + + + + + +
Duration duration () const
+
+inline
+
+ +

The duration this animation step represents.

+ +

Definition at line 38 of file animation.hpp.

+ +
+
+
The documentation for this class was generated from the following file: +
+
+ + + + + diff --git a/classftxui_1_1animation_1_1Params.js b/classftxui_1_1animation_1_1Params.js new file mode 100644 index 000000000..a2a7a3199 --- /dev/null +++ b/classftxui_1_1animation_1_1Params.js @@ -0,0 +1,5 @@ +var classftxui_1_1animation_1_1Params = +[ + [ "Params", "classftxui_1_1animation_1_1Params.html#a27854a0925475df9b926b03808cc8d8c", null ], + [ "duration", "classftxui_1_1animation_1_1Params.html#a2cf2e0a4288915aee8f100d2f0ee3e50", null ] +]; \ No newline at end of file diff --git a/classftxui_1_1task_1_1TaskRunner-members.html b/classftxui_1_1task_1_1TaskRunner-members.html new file mode 100644 index 000000000..e0f8a240b --- /dev/null +++ b/classftxui_1_1task_1_1TaskRunner-members.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
TaskRunner Member List
+
+
+ +

This is the complete list of members for TaskRunner, including all inherited members.

+ + + + + + + + + + +
Current() -> TaskRunner *TaskRunnerstatic
ExecutedTasks() constTaskRunnerinline
HasImmediateTasks() constTaskRunnerinline
PostDelayedTask(Task task, std::chrono::steady_clock::duration duration) -> voidTaskRunner
PostTask(Task task) -> voidTaskRunner
Run() -> voidTaskRunner
RunUntilIdle() -> std::optional< std::chrono::steady_clock::duration >TaskRunner
TaskRunner()TaskRunner
~TaskRunner()TaskRunner
+
+ + + + + diff --git a/classftxui_1_1task_1_1TaskRunner.html b/classftxui_1_1task_1_1TaskRunner.html new file mode 100644 index 000000000..de3e8ae97 --- /dev/null +++ b/classftxui_1_1task_1_1TaskRunner.html @@ -0,0 +1,458 @@ + + + + + + + + +FTXUI: TaskRunner Class Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ +

#include <task_runner.hpp>

+ + + + + + + + + + + + + + + + + + + + + +

+Public Member Functions

 TaskRunner ()
 
 ~TaskRunner ()
 
auto PostTask (Task task) -> void
 Schedules a task to be executed immediately.
 
auto PostDelayedTask (Task task, std::chrono::steady_clock::duration duration) -> void
 Schedules a task to be executed after a certain duration.
 
auto RunUntilIdle () -> std::optional< std::chrono::steady_clock::duration >
 Runs the tasks in the queue.
 
auto Run () -> void
 
bool HasImmediateTasks () const
 
size_t ExecutedTasks () const
 
+ + + +

+Static Public Member Functions

static auto Current () -> TaskRunner *
 
+

Detailed Description

+
+

Definition at line 12 of file task_runner.hpp.

+

Constructor & Destructor Documentation

+ +

◆ TaskRunner()

+ +
+
+ + + + + + + +
TaskRunner ()
+
+ +

Definition at line 13 of file task_runner.cpp.

+ +
+
+ +

◆ ~TaskRunner()

+ +
+
+ + + + + + + +
~TaskRunner ()
+
+ +

Definition at line 19 of file task_runner.cpp.

+ +
+
+

Member Function Documentation

+ +

◆ Current()

+ +
+
+ + + + + +
+ + + + + + + +
auto Current () -> TaskRunner*
+
+static
+
+ +

Definition at line 24 of file task_runner.cpp.

+ +
+
+ +

◆ PostTask()

+ +
+
+ + + + + + + +
auto PostTask (Task task) -> void
+
+ +

Schedules a task to be executed immediately.

+ +

Definition at line 29 of file task_runner.cpp.

+ +
+
+ +

◆ PostDelayedTask()

+ +
+
+ + + + + + + + + + + +
auto PostDelayedTask (Task task,
std::chrono::steady_clock::duration duration ) -> void
+
+ +

Schedules a task to be executed after a certain duration.

+ +

Definition at line 33 of file task_runner.cpp.

+ +
+
+ +

◆ RunUntilIdle()

+ +
+
+ + + + + + + +
auto RunUntilIdle () -> std::optional<std::chrono::steady_clock::duration>
+
+ +

Runs the tasks in the queue.

+

Runs the tasks in the queue, return the delay until the next delayed task can be executed.

+ +

Definition at line 40 of file task_runner.cpp.

+ +
+
+ +

◆ Run()

+ +
+
+ + + + + + + +
auto Run () -> void
+
+ +

Definition at line 62 of file task_runner.cpp.

+ +
+
+ +

◆ HasImmediateTasks()

+ +
+
+ + + + + +
+ + + + + + + +
bool HasImmediateTasks () const
+
+inline
+
+ +

Definition at line 34 of file task_runner.hpp.

+ +
+
+ +

◆ ExecutedTasks()

+ +
+
+ + + + + +
+ + + + + + + +
size_t ExecutedTasks () const
+
+inline
+
+ +

Definition at line 36 of file task_runner.hpp.

+ +
+
+
The documentation for this class was generated from the following files: +
+
+ + + + + diff --git a/classftxui_1_1task_1_1TaskRunner.js b/classftxui_1_1task_1_1TaskRunner.js new file mode 100644 index 000000000..63adef148 --- /dev/null +++ b/classftxui_1_1task_1_1TaskRunner.js @@ -0,0 +1,11 @@ +var classftxui_1_1task_1_1TaskRunner = +[ + [ "TaskRunner", "classftxui_1_1task_1_1TaskRunner.html#aa2a63894916e321a8a93add257aad2c7", null ], + [ "~TaskRunner", "classftxui_1_1task_1_1TaskRunner.html#afab0128a700661663463c90c9a33d71d", null ], + [ "PostTask", "classftxui_1_1task_1_1TaskRunner.html#a6265a2d99ef09d491365c21a4a703c71", null ], + [ "PostDelayedTask", "classftxui_1_1task_1_1TaskRunner.html#a9ed72fa10b2d44bb1af7bd8af64dd28b", null ], + [ "RunUntilIdle", "classftxui_1_1task_1_1TaskRunner.html#a7865ea610276e71d61633de0aab71753", null ], + [ "Run", "classftxui_1_1task_1_1TaskRunner.html#a58f2f0e6ed3d38c3e6a081f7c99a544f", null ], + [ "HasImmediateTasks", "classftxui_1_1task_1_1TaskRunner.html#a257afcb3d4b649b1a39a697cea2843ce", null ], + [ "ExecutedTasks", "classftxui_1_1task_1_1TaskRunner.html#aab6716a5f504f5985e73fb6d2b0dd677", null ] +]; \ No newline at end of file diff --git a/clear__under_8cpp.html b/clear__under_8cpp.html new file mode 100644 index 000000000..592b7db6d --- /dev/null +++ b/clear__under_8cpp.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: clear_under.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
clear_under.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+ + + + +

+Functions

Element clear_under (Element element)
 Before drawing |child|, clear the pixels below. This is useful in combination with dbox.
 
+
+
+ + + + + diff --git a/clear__under_8cpp.js b/clear__under_8cpp.js new file mode 100644 index 000000000..58f5ba5fb --- /dev/null +++ b/clear__under_8cpp.js @@ -0,0 +1,4 @@ +var clear__under_8cpp = +[ + [ "clear_under", "clear__under_8cpp.html#ga17a89519e6b87e12b1e5811a702f7847", null ] +]; \ No newline at end of file diff --git a/clear__under_8cpp_source.html b/clear__under_8cpp_source.html new file mode 100644 index 000000000..13cd8cd78 --- /dev/null +++ b/clear__under_8cpp_source.html @@ -0,0 +1,265 @@ + + + + + + + + +FTXUI: clear_under.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
clear_under.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <memory> // for make_shared
+
5#include <utility> // for move
+
6
+
7#include "ftxui/dom/elements.hpp" // for Element, clear_under
+
8#include "ftxui/dom/node.hpp" // for Node
+
9#include "ftxui/dom/node_decorator.hpp" // for NodeDecorator
+
10#include "ftxui/screen/box.hpp" // for Box
+
11#include "ftxui/screen/screen.hpp" // for Pixel, Screen
+
12
+
13namespace ftxui {
+
14
+
15namespace {
+
16using ftxui::Screen;
+
17
+
18class ClearUnder : public NodeDecorator {
+
19 public:
+ +
21
+
22 void Render(Screen& screen) override {
+
23 for (int y = box_.y_min; y <= box_.y_max; ++y) {
+
24 for (int x = box_.x_min; x <= box_.x_max; ++x) {
+
25 screen.PixelAt(x, y) = Pixel();
+
26 screen.PixelAt(x, y).character = " "; // Consider the pixel written.
+
27 }
+
28 }
+
29 Node::Render(screen);
+
30 }
+
31};
+
32} // namespace
+
33
+
34/// @brief Before drawing |child|, clear the pixels below. This is useful in
+
35/// combination with dbox.
+
36/// @see ftxui::dbox
+
37/// @ingroup dom
+
+ +
39 return std::make_shared<ClearUnder>(std::move(element));
+
40}
+
+
41
+
42} // namespace ftxui
+ +
NodeDecorator(Element child)
+ +
friend void Render(Screen &screen, Node *node, Selection &selection)
Definition node.cpp:96
+
Element clear_under(Element element)
Before drawing |child|, clear the pixels below. This is useful in combination with dbox.
+
void Render(Screen &screen, const Element &element)
Display an element on a ftxui::Screen.
Definition node.cpp:84
+
A rectangular grid of Pixel.
Definition screen.hpp:26
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+ + + +
+
+ + + + + diff --git a/closed.png b/closed.png new file mode 100644 index 000000000..d29ae8e70 Binary files /dev/null and b/closed.png differ diff --git a/color_8cppm.html b/color_8cppm.html new file mode 100644 index 000000000..c8f19cf86 --- /dev/null +++ b/color_8cppm.html @@ -0,0 +1,222 @@ + + + + + + + + +FTXUI: color.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
color.cppm File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
namespace  ftxui::literals
 
+
+
+ + + + + diff --git a/color_8cppm_source.html b/color_8cppm_source.html new file mode 100644 index 000000000..b06b0fffb --- /dev/null +++ b/color_8cppm_source.html @@ -0,0 +1,233 @@ + + + + + + + + +FTXUI: color.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
color.cppm
+
+
+Go to the documentation of this file.
1/// @module ftxui.screen.color
+
2/// @brief Module file for the Color class of the Screen module
+
3
+
4module;
+
5
+ +
7
+
8export module ftxui.screen.color;
+
9
+
10/**
+
11 * @namespace ftxui
+
12 * @brief The FTXUI ftxui:: namespace
+
13 */
+
14export namespace ftxui {
+
15 using ftxui::Color;
+
16
+
17 inline namespace literals {
+
18 using ftxui::literals::operator""_rgb;
+
19 }
+
20}
+ +
Color is a class that represents a color in the terminal user interface.
Definition color.hpp:22
+
Module file for the Color class of the Screen module.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
+
+ + + + + diff --git a/color_8hpp.html b/color_8hpp.html new file mode 100644 index 000000000..7b85c1f4a --- /dev/null +++ b/color_8hpp.html @@ -0,0 +1,236 @@ + + + + + + + + +FTXUI: color.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
color.hpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Classes

class  Color
 Color is a class that represents a color in the terminal user interface. More...
 
+ + + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
namespace  ftxui::literals
 
+ + + + +

+Functions

Color operator""_rgb (unsigned long long int combined)
 Creates a color from a combined hex RGB representation, e.g. 0x808000_rgb.
 
+
+
+ + + + + diff --git a/color_8hpp.js b/color_8hpp.js new file mode 100644 index 000000000..c5782ee61 --- /dev/null +++ b/color_8hpp.js @@ -0,0 +1,4 @@ +var color_8hpp = +[ + [ "operator\"\"_rgb", "color_8hpp.html#a66d988ecc082819b1671ee2bbadebccd", null ] +]; \ No newline at end of file diff --git a/color_8hpp_source.html b/color_8hpp_source.html new file mode 100644 index 000000000..4ef42eb72 --- /dev/null +++ b/color_8hpp_source.html @@ -0,0 +1,839 @@ + + + + + + + + +FTXUI: color.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
color.hpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#ifndef FTXUI_SCREEN_COLOR_HPP
+
5#define FTXUI_SCREEN_COLOR_HPP
+
6
+
7#include <cstdint> // for uint8_t
+
8#include <string> // for string
+
9
+
10#ifdef RGB
+
11// Workaround for wingdi.h (via Windows.h) defining macros that break things.
+
12// https://docs.microsoft.com/en-us/windows/win32/api/wingdi/nf-wingdi-rgb
+
13#undef RGB
+
14#endif
+
15
+
16namespace ftxui {
+
17
+
18/// @brief Color is a class that represents a color in the terminal user
+
19/// interface.
+
20///
+
21/// @ingroup screen
+
+
22class Color {
+
23 public:
+
24 enum Palette1 : uint8_t;
+
25 enum Palette16 : uint8_t;
+
26 enum Palette256 : uint8_t;
+
27
+
28 // NOLINTBEGIN
+
29 Color(); // Transparent.
+
30 Color(Palette1 index); // Transparent.
+
31 Color(Palette16 index); // Implicit conversion from index to Color.
+
32 Color(Palette256 index); // Implicit conversion from index to Color.
+
33 // NOLINTEND
+
34 Color(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha = 255);
+
35 static Color RGB(uint8_t red, uint8_t green, uint8_t blue);
+
36 static Color HSV(uint8_t hue, uint8_t saturation, uint8_t value);
+
37 static Color RGBA(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha);
+
38 static Color HSVA(uint8_t hue,
+
39 uint8_t saturation,
+
40 uint8_t value,
+
41 uint8_t alpha);
+
42 static Color Interpolate(float t, const Color& a, const Color& b);
+
43 static Color Blend(const Color& lhs, const Color& rhs);
+
44
+
45 //---------------------------
+
46 // List of colors:
+
47 //---------------------------
+
48 // clang-format off
+
+
49 enum Palette1 : uint8_t{
+
50 Default, // Transparent
+
51 };
+
+
52
+
+
53 enum Palette16 : uint8_t {
+
54 Black = 0,
+
55 Red = 1,
+
56 Green = 2,
+
57 Yellow = 3,
+
58 Blue = 4,
+ +
60 Cyan = 6,
+ + + + + + + + +
69 White = 15,
+
70 };
+
+
71
+
+
72 enum Palette256 : uint8_t {
+ + + +
76 Blue1 = 21,
+
77 Blue3 = 19,
+ + + + + + + + + + + +
89 Cornsilk1 = 230,
+
90 Cyan1 = 51,
+
91 Cyan2 = 50,
+
92 Cyan3 = 43,
+ + + + +
97 DarkKhaki = 143,
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
144 Gold1 = 220,
+
145 Gold3 = 142,
+
146 Gold3Bis = 178,
+
147 Green1 = 46,
+
148 Green3 = 34,
+ +
150 Green4 = 28,
+ +
152 Grey0 = 16,
+
153 Grey100 = 231,
+
154 Grey11 = 234,
+
155 Grey15 = 235,
+
156 Grey19 = 236,
+
157 Grey23 = 237,
+
158 Grey27 = 238,
+
159 Grey3 = 232,
+
160 Grey30 = 239,
+
161 Grey35 = 240,
+
162 Grey37 = 59,
+
163 Grey39 = 241,
+
164 Grey42 = 242,
+
165 Grey46 = 243,
+
166 Grey50 = 244,
+
167 Grey53 = 102,
+
168 Grey54 = 245,
+
169 Grey58 = 246,
+
170 Grey62 = 247,
+
171 Grey63 = 139,
+
172 Grey66 = 248,
+
173 Grey69 = 145,
+
174 Grey7 = 233,
+
175 Grey70 = 249,
+
176 Grey74 = 250,
+
177 Grey78 = 251,
+
178 Grey82 = 252,
+
179 Grey84 = 188,
+
180 Grey85 = 253,
+
181 Grey89 = 254,
+
182 Grey93 = 255,
+ +
184 HotPink = 205,
+
185 HotPink2 = 169,
+
186 HotPink3 = 132,
+ + + + + + +
193 Khaki1 = 228,
+
194 Khaki3 = 185,
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
221 Magenta1 = 201,
+
222 Magenta2 = 165,
+ +
224 Magenta3 = 127,
+ + + + + + + + + + + + + + + + + + + + + +
246 Orange1 = 214,
+
247 Orange3 = 172,
+ + + +
251 Orchid = 170,
+
252 Orchid1 = 213,
+
253 Orchid2 = 212,
+ + + + + + + +
261 Pink1 = 218,
+
262 Pink3 = 175,
+
263 Plum1 = 219,
+
264 Plum2 = 183,
+
265 Plum3 = 176,
+
266 Plum4 = 96,
+
267 Purple = 129,
+ + + + +
272 Red1 = 196,
+
273 Red3 = 124,
+
274 Red3Bis = 160,
+ + +
277 Salmon1 = 209,
+ + + + + +
283 SkyBlue1 = 117,
+
284 SkyBlue2 = 111,
+ + + + + + + + + + + + + + +
299 Tan = 180,
+
300 Thistle1 = 225,
+
301 Thistle3 = 182,
+ + +
304 Violet = 177,
+
305 Wheat1 = 229,
+
306 Wheat4 = 101,
+
307 Yellow1 = 226,
+
308 Yellow2 = 190,
+
309 Yellow3 = 148,
+ +
311 Yellow4 = 100,
+ +
313 };
+
+
314 // clang-format on
+
315
+
316 // --- Operators ------
+
317 bool operator==(const Color& rhs) const;
+
318 bool operator!=(const Color& rhs) const;
+
319
+
320 std::string Print(bool is_background_color) const;
+
321 bool IsOpaque() const { return alpha_ == 255; }
+
322
+
323 private:
+
324 enum class ColorType : uint8_t {
+
325 Palette1,
+
326 Palette16,
+ +
328 TrueColor,
+
329 };
+
330 ColorType type_ = ColorType::Palette1;
+
331 uint8_t red_ = 0;
+
332 uint8_t green_ = 0;
+
333 uint8_t blue_ = 0;
+
334 uint8_t alpha_ = 0;
+
335};
+
+
336
+
+
337inline namespace literals {
+
338
+
339/// @brief Creates a color from a combined hex RGB representation,
+
340/// e.g. 0x808000_rgb
+
341Color operator""_rgb(unsigned long long int combined);
+
342
+
343} // namespace literals
+
+
344
+
345} // namespace ftxui
+
346
+
347#endif // FTXUI_SCREEN_COLOR_HPP
+
Color()
Build a transparent color.
+
static Color HSV(uint8_t hue, uint8_t saturation, uint8_t value)
Build a Color from its HSV representation. https://en.wikipedia.org/wiki/HSL_and_HSV.
+
static Color RGBA(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha)
Build a Color from its RGBA representation. https://en.wikipedia.org/wiki/RGB_color_model.
+
static Color Blend(const Color &lhs, const Color &rhs)
Blend two colors together using the alpha channel.
+
bool operator!=(const Color &rhs) const
+
bool operator==(const Color &rhs) const
+
bool IsOpaque() const
Definition color.hpp:321
+ + +
static Color RGB(uint8_t red, uint8_t green, uint8_t blue)
Build a Color from its RGB representation. https://en.wikipedia.org/wiki/RGB_color_model.
+ + + + + + +
@ LightGoldenrod2
Definition color.hpp:199
+
@ MediumOrchid1Bis
Definition color.hpp:229
+ + + + + + + + + + + + + +
@ DarkMagentaBis
Definition color.hpp:99
+ + + + + + + + + + + + + + + +
@ Chartreuse3Bis
Definition color.hpp:86
+ + +
@ LightGoldenrod1
Definition color.hpp:198
+ + + + + + + + + +
@ MediumPurple3Bis
Definition color.hpp:236
+ + + + + +
@ LightGoldenrod3
Definition color.hpp:202
+ + + + + + + + +
@ DarkSeaGreen4Bis
Definition color.hpp:119
+
@ LightSkyBlue3Bis
Definition color.hpp:214
+ + + + + + + + +
@ DarkOliveGreen1
Definition color.hpp:100
+ +
@ Aquamarine1Bis
Definition color.hpp:74
+
@ DarkOliveGreen1Bis
Definition color.hpp:101
+
@ MediumPurple2Bis
Definition color.hpp:234
+ + + + + + + + + +
@ Chartreuse2Bis
Definition color.hpp:84
+ + + + + + + + + + +
@ DarkSeaGreen1Bis
Definition color.hpp:113
+ + + + + + + + + + + + +
@ MediumTurquoise
Definition color.hpp:239
+ + + + +
@ DarkOliveGreen3Ter
Definition color.hpp:105
+
@ DarkSeaGreen3Bis
Definition color.hpp:117
+ + +
@ LightSteelBlue1
Definition color.hpp:218
+ + + +
@ DeepSkyBlue3Bis
Definition color.hpp:137
+ + + +
@ MediumVioletRed
Definition color.hpp:240
+ + + + + + + + + +
@ LightGoldenrod2Ter
Definition color.hpp:201
+ + +
@ DeepSkyBlue4Ter
Definition color.hpp:140
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
@ DarkOliveGreen2
Definition color.hpp:102
+ + + + +
@ CornflowerBlue
Definition color.hpp:88
+
@ DarkGoldenrod
Definition color.hpp:95
+ + + + + + +
@ LightGoldenrod2Bis
Definition color.hpp:200
+ + + + + + +
@ DarkSeaGreen2Bis
Definition color.hpp:115
+ + + + + + + +
@ LightSalmon3Bis
Definition color.hpp:210
+ + + + + +
@ SpringGreen2Bis
Definition color.hpp:291
+ +
@ DeepSkyBlue4Bis
Definition color.hpp:139
+ + + +
@ DarkOliveGreen3Bis
Definition color.hpp:104
+ + + + + + + + +
@ MediumSpringGreen
Definition color.hpp:238
+ + + + + +
@ DarkOliveGreen3
Definition color.hpp:103
+ + + + +
@ SpringGreen3Bis
Definition color.hpp:293
+ + + + +
@ LightSteelBlue3
Definition color.hpp:219
+ + + + +
std::string Print(bool is_background_color) const
+ + + + + + + + + + + + + + + + + +
static Color Interpolate(float t, const Color &a, const Color &b)
+
static Color HSVA(uint8_t hue, uint8_t saturation, uint8_t value, uint8_t alpha)
Build a Color from its HSV representation. https://en.wikipedia.org/wiki/HSL_and_HSV.
+
Color is a class that represents a color in the terminal user interface.
Definition color.hpp:22
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
+
+ + + + + diff --git a/color__gallery_8cpp.html b/color__gallery_8cpp.html new file mode 100644 index 000000000..c48bad1a9 --- /dev/null +++ b/color__gallery_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: color_gallery.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
color_gallery.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 18 of file color_gallery.cpp.

+ +
+
+
+
+ + + + + diff --git a/color__gallery_8cpp.js b/color__gallery_8cpp.js new file mode 100644 index 000000000..6fba9c7e6 --- /dev/null +++ b/color__gallery_8cpp.js @@ -0,0 +1,4 @@ +var color__gallery_8cpp = +[ + [ "main", "color__gallery_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/color__gallery_8cpp_source.html b/color__gallery_8cpp_source.html new file mode 100644 index 000000000..d7005ead6 --- /dev/null +++ b/color__gallery_8cpp_source.html @@ -0,0 +1,392 @@ + + + + + + + + +FTXUI: color_gallery.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
color_gallery.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <ftxui/screen/color_info.hpp> // for ColorInfo
+
5#include <ftxui/screen/screen.hpp> // for Full, Screen
+
6#include <ftxui/screen/terminal.hpp> // for ColorSupport, Color, Palette16, Palette256, TrueColor
+
7#include <memory> // for allocator, shared_ptr
+
8#include <utility> // for move
+
9#include <vector> // for vector
+
10
+
11#include "ftxui/dom/elements.hpp" // for text, bgcolor, color, vbox, hbox, separator, operator|, Elements, Element, Fit, border
+
12#include "ftxui/dom/node.hpp" // for Render
+
13#include "ftxui/screen/color.hpp" // for Color, Color::Black, Color::Blue, Color::BlueLight, Color::Cyan, Color::CyanLight, Color::Default, Color::GrayDark, Color::GrayLight, Color::Green, Color::GreenLight, Color::Magenta, Color::MagentaLight, Color::Red, Color::RedLight, Color::White, Color::Yellow, Color::YellowLight, Color::Palette256, ftxui
+
14
+
15using namespace ftxui;
+
16#include "./color_info_sorted_2d.ipp" // for ColorInfoSorted2D
+
17
+
+
18int main() {
+
19 // clang-format off
+
20 auto basic_color_display =
+
21 vbox(
+
22 text("16 color palette:"),
+
23 separator(),
+
24 hbox(
+
25 vbox(
+
26 color(Color::Default, text("Default")),
+
27 color(Color::Black, text("Black")),
+
28 color(Color::GrayDark, text("GrayDark")),
+
29 color(Color::GrayLight, text("GrayLight")),
+
30 color(Color::White, text("White")),
+
31 color(Color::Blue, text("Blue")),
+
32 color(Color::BlueLight, text("BlueLight")),
+
33 color(Color::Cyan, text("Cyan")),
+
34 color(Color::CyanLight, text("CyanLight")),
+
35 color(Color::Green, text("Green")),
+
36 color(Color::GreenLight, text("GreenLight")),
+
37 color(Color::Magenta, text("Magenta")),
+
38 color(Color::MagentaLight, text("MagentaLight")),
+
39 color(Color::Red, text("Red")),
+
40 color(Color::RedLight, text("RedLight")),
+
41 color(Color::Yellow, text("Yellow")),
+
42 color(Color::YellowLight, text("YellowLight"))
+
43 ),
+
44 vbox(
+
45 bgcolor(Color::Default, text("Default")),
+
46 bgcolor(Color::Black, text("Black")),
+
47 bgcolor(Color::GrayDark, text("GrayDark")),
+
48 bgcolor(Color::GrayLight, text("GrayLight")),
+
49 bgcolor(Color::White, text("White")),
+
50 bgcolor(Color::Blue, text("Blue")),
+
51 bgcolor(Color::BlueLight, text("BlueLight")),
+
52 bgcolor(Color::Cyan, text("Cyan")),
+
53 bgcolor(Color::CyanLight, text("CyanLight")),
+
54 bgcolor(Color::Green, text("Green")),
+
55 bgcolor(Color::GreenLight, text("GreenLight")),
+
56 bgcolor(Color::Magenta, text("Magenta")),
+
57 bgcolor(Color::MagentaLight, text("MagentaLight")),
+
58 bgcolor(Color::Red, text("Red")),
+
59 bgcolor(Color::RedLight, text("RedLight")),
+
60 bgcolor(Color::Yellow, text("Yellow")),
+
61 bgcolor(Color::YellowLight, text("YellowLight"))
+
62 )
+
63 )
+
64 );
+
65
+
66 // clang-format on
+
67 auto palette_256_color_display = text("256 colors palette:");
+
68 {
+
69 std::vector<std::vector<ColorInfo>> info_columns = ColorInfoSorted2D();
+
70 Elements columns;
+
71 for (auto& column : info_columns) {
+
72 Elements column_elements;
+
73 for (auto& it : column) {
+
74 column_elements.push_back(
+
75 text(" ") | bgcolor(Color(Color::Palette256(it.index_256))));
+
76 }
+
77 columns.push_back(hbox(std::move(column_elements)));
+
78 }
+
79 palette_256_color_display = vbox({
+
80 palette_256_color_display,
+
81 separator(),
+
82 vbox(columns),
+
83 });
+
84 }
+
85
+
86 // True color display.
+
87 auto true_color_display = text("TrueColors: 24bits:");
+
88 {
+
89 const int max_value = 255;
+
90 const int value_increment = 8;
+
91 const int hue_increment = 6;
+
92 int saturation = max_value;
+
93 Elements array;
+
94 for (int value = 0; value < max_value; value += 2 * value_increment) {
+
95 Elements line;
+
96 for (int hue = 0; hue < max_value; hue += hue_increment) {
+
97 line.push_back(
+
98 text("▀") //
+
99 | color(Color::HSV(hue, saturation, value)) //
+
100 | bgcolor(Color::HSV(hue, saturation, value + value_increment)));
+
101 }
+
102 array.push_back(hbox(std::move(line)));
+
103 }
+
104 true_color_display = vbox({
+
105 true_color_display,
+
106 separator(),
+
107 vbox(std::move(array)),
+
108 });
+
109 }
+
110
+
111 auto terminal_info =
+
112 vbox({
+
113 Terminal::ColorSupport() >= Terminal::Color::Palette16
+
114 ? text(" 16 color palette support : Yes")
+
115 : text(" 16 color palette support : No"),
+
116 Terminal::ColorSupport() >= Terminal::Color::Palette256
+
117 ? text("256 color palette support : Yes")
+
118 : text("256 color palette support : No"),
+
119 Terminal::ColorSupport() >= Terminal::Color::TrueColor
+
120 ? text(" True color support : Yes")
+
121 : text(" True color support : No"),
+
122 }) |
+
123 border;
+
124
+
125 auto document = vbox({hbox({
+
126 basic_color_display,
+
127 text(" "),
+
128 palette_256_color_display,
+
129 text(" "),
+
130 true_color_display,
+
131 }),
+
132 terminal_info});
+
133 // clang-format on
+
134
+
135 auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
136 Render(screen, document);
+
137
+
138 screen.Print();
+
139
+
140 return 0;
+
141}
+
+ + + + +
std::vector< std::vector< ftxui::ColorInfo > > ColorInfoSorted2D()
+ +
Decorator bgcolor(Color)
Decorate using a background color.
+
Element text(std::wstring text)
Display a piece of unicode text.
Definition text.cpp:160
+
Element separator()
Draw a vertical or horizontal separation in between two other elements.
+
void Render(Screen &screen, const Element &element)
Display an element on a ftxui::Screen.
Definition node.cpp:84
+
Decorator color(Color)
Decorate using a foreground color.
+
Element vbox(Elements)
A container displaying elements vertically one by one.
Definition vbox.cpp:96
+
static Color HSV(uint8_t hue, uint8_t saturation, uint8_t value)
Build a Color from its HSV representation. https://en.wikipedia.org/wiki/HSL_and_HSV.
+
static Screen Create(Dimensions dimension)
Create a screen with the given dimension.
Definition screen.cpp:395
+ + + + + + + + + + + + + + + + + + +
Color is a class that represents a color in the terminal user interface.
Definition color.hpp:22
+
Color ColorSupport()
Get the color support of the terminal.
Definition terminal.cpp:130
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
Element hbox(Elements)
A container displaying elements horizontally one by one.
Definition hbox.cpp:94
+
std::vector< Element > Elements
Definition elements.hpp:23
+ + + +
+
+ + + + + diff --git a/color__info_8cpp.html b/color__info_8cpp.html new file mode 100644 index 000000000..2e69bd00d --- /dev/null +++ b/color__info_8cpp.html @@ -0,0 +1,234 @@ + + + + + + + + +FTXUI: color_info.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
color_info.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+ + + + + +

+Functions

ColorInfo GetColorInfo (Color::Palette256 index)
 
ColorInfo GetColorInfo (Color::Palette16 index)
 
+ + + +

+Variables

const std::array< ColorInfo, 256 > palette256
 
+
+
+ + + + + diff --git a/color__info_8cpp.js b/color__info_8cpp.js new file mode 100644 index 000000000..8cffdc766 --- /dev/null +++ b/color__info_8cpp.js @@ -0,0 +1,6 @@ +var color__info_8cpp = +[ + [ "GetColorInfo", "color__info_8cpp.html#a883a81f30fb771a82f6c87b77ac3658e", null ], + [ "GetColorInfo", "color__info_8cpp.html#ad5dd7fa2651003bf7c9f8b58de9b0a93", null ], + [ "palette256", "color__info_8cpp.html#acc77ce2876ca75e8d5fe8925a45592d1", null ] +]; \ No newline at end of file diff --git a/color__info_8cpp_source.html b/color__info_8cpp_source.html new file mode 100644 index 000000000..ab80bb5c6 --- /dev/null +++ b/color__info_8cpp_source.html @@ -0,0 +1,504 @@ + + + + + + + + +FTXUI: color_info.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
color_info.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+ +
5
+
6#include <array>
+
7
+
8#include "ftxui/screen/color.hpp" // for Color, Color::Palette16, Color::Palette256
+
9
+
10namespace ftxui {
+
11
+
12// clang-format off
+
+
13const std::array<ColorInfo, 256> palette256 = {{
+
14 {"Black" , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ,
+
15 {"Red" , 1 , 1 , 128 , 0 , 0 , 0 , 255 , 128 } ,
+
16 {"Green" , 2 , 2 , 0 , 128 , 0 , 85 , 255 , 128 } ,
+
17 {"Yellow" , 3 , 3 , 128 , 128 , 0 , 43 , 255 , 128 } ,
+
18 {"Blue" , 4 , 4 , 0 , 0 , 128 , 171 , 255 , 128 } ,
+
19 {"Magenta" , 5 , 5 , 128 , 0 , 128 , 213 , 255 , 128 } ,
+
20 {"Cyan" , 6 , 6 , 0 , 128 , 128 , 128 , 255 , 128 } ,
+
21 {"GrayLight" , 7 , 7 , 192 , 192 , 192 , 0 , 0 , 192 } ,
+
22 {"GrayDark" , 8 , 8 , 128 , 128 , 128 , 0 , 0 , 128 } ,
+
23 {"RedLight" , 9 , 9 , 255 , 0 , 0 , 0 , 255 , 255 } ,
+
24 {"GreenLight" , 10 , 10 , 0 , 255 , 0 , 85 , 255 , 255 } ,
+
25 {"YellowLight" , 11 , 11 , 255 , 255 , 0 , 43 , 255 , 255 } ,
+
26 {"BlueLight" , 12 , 12 , 0 , 0 , 255 , 171 , 255 , 255 } ,
+
27 {"MagentaLight" , 13 , 13 , 255 , 0 , 255 , 213 , 255 , 255 } ,
+
28 {"CyanLight" , 14 , 14 , 0 , 255 , 255 , 128 , 255 , 255 } ,
+
29 {"White" , 15 , 15 , 255 , 255 , 255 , 0 , 0 , 255 } ,
+
30 {"Grey0" , 16 , 0 , 0 , 0 , 0 , 0 , 0 , 0 } ,
+
31 {"NavyBlue" , 17 , 4 , 0 , 0 , 95 , 171 , 255 , 95 } ,
+
32 {"DarkBlue" , 18 , 4 , 0 , 0 , 135 , 171 , 255 , 135 } ,
+
33 {"Blue3" , 19 , 4 , 0 , 0 , 175 , 171 , 255 , 175 } ,
+
34 {"Blue3Bis" , 20 , 12 , 0 , 0 , 215 , 171 , 255 , 215 } ,
+
35 {"Blue1" , 21 , 12 , 0 , 0 , 255 , 171 , 255 , 255 } ,
+
36 {"DarkGreen" , 22 , 2 , 0 , 95 , 0 , 85 , 255 , 95 } ,
+
37 {"DeepSkyBlue4" , 23 , 6 , 0 , 95 , 95 , 128 , 255 , 95 } ,
+
38 {"DeepSkyBlue4Bis" , 24 , 6 , 0 , 95 , 135 , 141 , 255 , 135 } ,
+
39 {"DeepSkyBlue4Ter" , 25 , 6 , 0 , 95 , 175 , 148 , 255 , 175 } ,
+
40 {"DodgerBlue3" , 26 , 12 , 0 , 95 , 215 , 152 , 255 , 215 } ,
+
41 {"DodgerBlue2" , 27 , 12 , 0 , 95 , 255 , 155 , 255 , 255 } ,
+
42 {"Green4" , 28 , 2 , 0 , 135 , 0 , 85 , 255 , 135 } ,
+
43 {"SpringGreen4" , 29 , 6 , 0 , 135 , 95 , 115 , 255 , 135 } ,
+
44 {"Turquoise4" , 30 , 6 , 0 , 135 , 135 , 128 , 255 , 135 } ,
+
45 {"DeepSkyBlue3" , 31 , 6 , 0 , 135 , 175 , 138 , 255 , 175 } ,
+
46 {"DeepSkyBlue3Bis" , 32 , 14 , 0 , 135 , 215 , 144 , 255 , 215 } ,
+
47 {"DodgerBlue1" , 33 , 14 , 0 , 135 , 255 , 149 , 255 , 255 } ,
+
48 {"Green3" , 34 , 2 , 0 , 175 , 0 , 85 , 255 , 175 } ,
+
49 {"SpringGreen3" , 35 , 6 , 0 , 175 , 95 , 108 , 255 , 175 } ,
+
50 {"DarkCyan" , 36 , 6 , 0 , 175 , 135 , 118 , 255 , 175 } ,
+
51 {"LightSeaGreen" , 37 , 6 , 0 , 175 , 175 , 128 , 255 , 175 } ,
+
52 {"DeepSkyBlue2" , 38 , 14 , 0 , 175 , 215 , 136 , 255 , 215 } ,
+
53 {"DeepSkyBlue1" , 39 , 14 , 0 , 175 , 255 , 142 , 255 , 255 } ,
+
54 {"Green3Bis" , 40 , 10 , 0 , 215 , 0 , 85 , 255 , 215 } ,
+
55 {"SpringGreen3Bis" , 41 , 10 , 0 , 215 , 95 , 104 , 255 , 215 } ,
+
56 {"SpringGreen2" , 42 , 14 , 0 , 215 , 135 , 112 , 255 , 215 } ,
+
57 {"Cyan3" , 43 , 14 , 0 , 215 , 175 , 120 , 255 , 215 } ,
+
58 {"DarkTurquoise" , 44 , 14 , 0 , 215 , 215 , 128 , 255 , 215 } ,
+
59 {"Turquoise2" , 45 , 14 , 0 , 215 , 255 , 135 , 255 , 255 } ,
+
60 {"Green1" , 46 , 10 , 0 , 255 , 0 , 85 , 255 , 255 } ,
+
61 {"SpringGreen2Bis" , 47 , 10 , 0 , 255 , 95 , 101 , 255 , 255 } ,
+
62 {"SpringGreen1" , 48 , 14 , 0 , 255 , 135 , 107 , 255 , 255 } ,
+
63 {"MediumSpringGreen" , 49 , 14 , 0 , 255 , 175 , 114 , 255 , 255 } ,
+
64 {"Cyan2" , 50 , 14 , 0 , 255 , 215 , 121 , 255 , 255 } ,
+
65 {"Cyan1" , 51 , 14 , 0 , 255 , 255 , 128 , 255 , 255 } ,
+
66 {"DarkRed" , 52 , 1 , 95 , 0 , 0 , 0 , 255 , 95 } ,
+
67 {"DeepPink4Ter" , 53 , 5 , 95 , 0 , 95 , 213 , 255 , 95 } ,
+
68 {"Purple4" , 54 , 5 , 95 , 0 , 135 , 201 , 255 , 135 } ,
+
69 {"Purple4Bis" , 55 , 5 , 95 , 0 , 175 , 194 , 255 , 175 } ,
+
70 {"Purple3" , 56 , 12 , 95 , 0 , 215 , 190 , 255 , 215 } ,
+
71 {"BlueViolet" , 57 , 12 , 95 , 0 , 255 , 187 , 255 , 255 } ,
+
72 {"Orange4" , 58 , 3 , 95 , 95 , 0 , 43 , 255 , 95 } ,
+
73 {"Grey37" , 59 , 8 , 95 , 95 , 95 , 0 , 0 , 95 } ,
+
74 {"MediumPurple4" , 60 , 4 , 95 , 95 , 135 , 171 , 75 , 135 } ,
+
75 {"SlateBlue3" , 61 , 4 , 95 , 95 , 175 , 171 , 116 , 175 } ,
+
76 {"SlateBlue3Bis" , 62 , 12 , 95 , 95 , 215 , 171 , 142 , 215 } ,
+
77 {"RoyalBlue1" , 63 , 12 , 95 , 95 , 255 , 171 , 160 , 255 } ,
+
78 {"Chartreuse4" , 64 , 3 , 95 , 135 , 0 , 55 , 255 , 135 } ,
+
79 {"DarkSeaGreen4" , 65 , 8 , 95 , 135 , 95 , 85 , 75 , 135 } ,
+
80 {"PaleTurquoise4" , 66 , 6 , 95 , 135 , 135 , 128 , 75 , 135 } ,
+
81 {"SteelBlue" , 67 , 4 , 95 , 135 , 175 , 150 , 116 , 175 } ,
+
82 {"SteelBlue3" , 68 , 12 , 95 , 135 , 215 , 157 , 142 , 215 } ,
+
83 {"CornflowerBlue" , 69 , 12 , 95 , 135 , 255 , 161 , 160 , 255 } ,
+
84 {"Chartreuse3" , 70 , 3 , 95 , 175 , 0 , 62 , 255 , 175 } ,
+
85 {"DarkSeaGreen4Bis" , 71 , 2 , 95 , 175 , 95 , 85 , 116 , 175 } ,
+
86 {"CadetBlue" , 72 , 2 , 95 , 175 , 135 , 106 , 116 , 175 } ,
+
87 {"CadetBlueBis" , 73 , 6 , 95 , 175 , 175 , 128 , 116 , 175 } ,
+
88 {"SkyBlue3" , 74 , 14 , 95 , 175 , 215 , 143 , 142 , 215 } ,
+
89 {"SteelBlue1" , 75 , 12 , 95 , 175 , 255 , 150 , 160 , 255 } ,
+
90 {"Chartreuse3Bis" , 76 , 10 , 95 , 215 , 0 , 66 , 255 , 215 } ,
+
91 {"PaleGreen3Bis" , 77 , 10 , 95 , 215 , 95 , 85 , 142 , 215 } ,
+
92 {"SeaGreen3" , 78 , 10 , 95 , 215 , 135 , 99 , 142 , 215 } ,
+
93 {"Aquamarine3" , 79 , 14 , 95 , 215 , 175 , 113 , 142 , 215 } ,
+
94 {"MediumTurquoise" , 80 , 14 , 95 , 215 , 215 , 128 , 142 , 215 } ,
+
95 {"SteelBlue1Bis" , 81 , 14 , 95 , 215 , 255 , 139 , 160 , 255 } ,
+
96 {"Chartreuse2Bis" , 82 , 10 , 95 , 255 , 0 , 69 , 255 , 255 } ,
+
97 {"SeaGreen2" , 83 , 10 , 95 , 255 , 95 , 85 , 160 , 255 } ,
+
98 {"SeaGreen1" , 84 , 10 , 95 , 255 , 135 , 95 , 160 , 255 } ,
+
99 {"SeaGreen1Bis" , 85 , 10 , 95 , 255 , 175 , 106 , 160 , 255 } ,
+
100 {"Aquamarine1Bis" , 86 , 14 , 95 , 255 , 215 , 117 , 160 , 255 } ,
+
101 {"DarkSlateGray2" , 87 , 14 , 95 , 255 , 255 , 128 , 160 , 255 } ,
+
102 {"DarkRedBis" , 88 , 1 , 135 , 0 , 0 , 0 , 255 , 135 } ,
+
103 {"DeepPink4Bis" , 89 , 5 , 135 , 0 , 95 , 226 , 255 , 135 } ,
+
104 {"DarkMagenta" , 90 , 5 , 135 , 0 , 135 , 213 , 255 , 135 } ,
+
105 {"DarkMagentaBis" , 91 , 5 , 135 , 0 , 175 , 204 , 255 , 175 } ,
+
106 {"DarkVioletBis" , 92 , 13 , 135 , 0 , 215 , 198 , 255 , 215 } ,
+
107 {"PurpleBis" , 93 , 13 , 135 , 0 , 255 , 193 , 255 , 255 } ,
+
108 {"Orange4Bis" , 94 , 3 , 135 , 95 , 0 , 30 , 255 , 135 } ,
+
109 {"LightPink4" , 95 , 8 , 135 , 95 , 95 , 0 , 75 , 135 } ,
+
110 {"Plum4" , 96 , 5 , 135 , 95 , 135 , 213 , 75 , 135 } ,
+
111 {"MediumPurple3" , 97 , 4 , 135 , 95 , 175 , 192 , 116 , 175 } ,
+
112 {"MediumPurple3Bis" , 98 , 12 , 135 , 95 , 215 , 185 , 142 , 215 } ,
+
113 {"SlateBlue1" , 99 , 12 , 135 , 95 , 255 , 181 , 160 , 255 } ,
+
114 {"Yellow4" , 100 , 3 , 135 , 135 , 0 , 43 , 255 , 135 } ,
+
115 {"Wheat4" , 101 , 8 , 135 , 135 , 95 , 43 , 75 , 135 } ,
+
116 {"Grey53" , 102 , 8 , 135 , 135 , 135 , 0 , 0 , 135 } ,
+
117 {"LightSlateGrey" , 103 , 4 , 135 , 135 , 175 , 171 , 58 , 175 } ,
+
118 {"MediumPurple" , 104 , 12 , 135 , 135 , 215 , 171 , 94 , 215 } ,
+
119 {"LightSlateBlue" , 105 , 12 , 135 , 135 , 255 , 171 , 120 , 255 } ,
+
120 {"Yellow4Bis" , 106 , 3 , 135 , 175 , 0 , 52 , 255 , 175 } ,
+
121 {"DarkOliveGreen3" , 107 , 7 , 135 , 175 , 95 , 64 , 116 , 175 } ,
+
122 {"DarkSeaGreen" , 108 , 7 , 135 , 175 , 135 , 85 , 58 , 175 } ,
+
123 {"LightSkyBlue3" , 109 , 7 , 135 , 175 , 175 , 128 , 58 , 175 } ,
+
124 {"LightSkyBlue3Bis" , 110 , 12 , 135 , 175 , 215 , 150 , 94 , 215 } ,
+
125 {"SkyBlue2" , 111 , 12 , 135 , 175 , 255 , 157 , 120 , 255 } ,
+
126 {"Chartreuse2" , 112 , 11 , 135 , 215 , 0 , 58 , 255 , 215 } ,
+
127 {"DarkOliveGreen3Bis" , 113 , 10 , 135 , 215 , 95 , 71 , 142 , 215 } ,
+
128 {"PaleGreen3" , 114 , 7 , 135 , 215 , 135 , 85 , 94 , 215 } ,
+
129 {"DarkSeaGreen3" , 115 , 10 , 135 , 215 , 175 , 106 , 94 , 215 } ,
+
130 {"DarkSlateGray3" , 116 , 14 , 135 , 215 , 215 , 128 , 94 , 215 } ,
+
131 {"SkyBlue1" , 117 , 14 , 135 , 215 , 255 , 143 , 120 , 255 } ,
+
132 {"Chartreuse1" , 118 , 11 , 135 , 255 , 0 , 63 , 255 , 255 } ,
+
133 {"LightGreen" , 119 , 10 , 135 , 255 , 95 , 75 , 160 , 255 } ,
+
134 {"LightGreenBis" , 120 , 10 , 135 , 255 , 135 , 85 , 120 , 255 } ,
+
135 {"PaleGreen1" , 121 , 10 , 135 , 255 , 175 , 99 , 120 , 255 } ,
+
136 {"Aquamarine1" , 122 , 14 , 135 , 255 , 215 , 113 , 120 , 255 } ,
+
137 {"DarkSlateGray1" , 123 , 14 , 135 , 255 , 255 , 128 , 120 , 255 } ,
+
138 {"Red3" , 124 , 1 , 175 , 0 , 0 , 0 , 255 , 175 } ,
+
139 {"DeepPink4" , 125 , 5 , 175 , 0 , 95 , 233 , 255 , 175 } ,
+
140 {"MediumVioletRed" , 126 , 5 , 175 , 0 , 135 , 223 , 255 , 175 } ,
+
141 {"Magenta3" , 127 , 5 , 175 , 0 , 175 , 213 , 255 , 175 } ,
+
142 {"DarkViolet" , 128 , 13 , 175 , 0 , 215 , 206 , 255 , 215 } ,
+
143 {"Purple" , 129 , 13 , 175 , 0 , 255 , 200 , 255 , 255 } ,
+
144 {"DarkOrange3" , 130 , 3 , 175 , 95 , 0 , 23 , 255 , 175 } ,
+
145 {"IndianRed" , 131 , 7 , 175 , 95 , 95 , 0 , 116 , 175 } ,
+
146 {"HotPink3" , 132 , 5 , 175 , 95 , 135 , 235 , 116 , 175 } ,
+
147 {"MediumOrchid3" , 133 , 5 , 175 , 95 , 175 , 213 , 116 , 175 } ,
+
148 {"MediumOrchid" , 134 , 13 , 175 , 95 , 215 , 199 , 142 , 215 } ,
+
149 {"MediumPurple2" , 135 , 12 , 175 , 95 , 255 , 192 , 160 , 255 } ,
+
150 {"DarkGoldenrod" , 136 , 3 , 175 , 135 , 0 , 33 , 255 , 175 } ,
+
151 {"LightSalmon3" , 137 , 7 , 175 , 135 , 95 , 21 , 116 , 175 } ,
+
152 {"RosyBrown" , 138 , 7 , 175 , 135 , 135 , 0 , 58 , 175 } ,
+
153 {"Grey63" , 139 , 5 , 175 , 135 , 175 , 213 , 58 , 175 } ,
+
154 {"MediumPurple2Bis" , 140 , 12 , 175 , 135 , 215 , 192 , 94 , 215 } ,
+
155 {"MediumPurple1" , 141 , 12 , 175 , 135 , 255 , 185 , 120 , 255 } ,
+
156 {"Gold3" , 142 , 3 , 175 , 175 , 0 , 43 , 255 , 175 } ,
+
157 {"DarkKhaki" , 143 , 7 , 175 , 175 , 95 , 43 , 116 , 175 } ,
+
158 {"NavajoWhite3" , 144 , 7 , 175 , 175 , 135 , 43 , 58 , 175 } ,
+
159 {"Grey69" , 145 , 7 , 175 , 175 , 175 , 0 , 0 , 175 } ,
+
160 {"LightSteelBlue3" , 146 , 12 , 175 , 175 , 215 , 171 , 47 , 215 } ,
+
161 {"LightSteelBlue" , 147 , 12 , 175 , 175 , 255 , 171 , 80 , 255 } ,
+
162 {"Yellow3" , 148 , 11 , 175 , 215 , 0 , 50 , 255 , 215 } ,
+
163 {"DarkOliveGreen3Ter" , 149 , 11 , 175 , 215 , 95 , 57 , 142 , 215 } ,
+
164 {"DarkSeaGreen3Bis" , 150 , 7 , 175 , 215 , 135 , 64 , 94 , 215 } ,
+
165 {"DarkSeaGreen2" , 151 , 7 , 175 , 215 , 175 , 85 , 47 , 215 } ,
+
166 {"LightCyan3" , 152 , 7 , 175 , 215 , 215 , 128 , 47 , 215 } ,
+
167 {"LightSkyBlue1" , 153 , 12 , 175 , 215 , 255 , 150 , 80 , 255 } ,
+
168 {"GreenYellow" , 154 , 11 , 175 , 255 , 0 , 56 , 255 , 255 } ,
+
169 {"DarkOliveGreen2" , 155 , 10 , 175 , 255 , 95 , 64 , 160 , 255 } ,
+
170 {"PaleGreen1Bis" , 156 , 10 , 175 , 255 , 135 , 71 , 120 , 255 } ,
+
171 {"DarkSeaGreen2Bis" , 157 , 15 , 175 , 255 , 175 , 85 , 80 , 255 } ,
+
172 {"DarkSeaGreen1" , 158 , 15 , 175 , 255 , 215 , 106 , 80 , 255 } ,
+
173 {"PaleTurquoise1" , 159 , 14 , 175 , 255 , 255 , 128 , 80 , 255 } ,
+
174 {"Red3Bis" , 160 , 9 , 215 , 0 , 0 , 0 , 255 , 215 } ,
+
175 {"DeepPink3" , 161 , 13 , 215 , 0 , 95 , 237 , 255 , 215 } ,
+
176 {"DeepPink3Bis" , 162 , 13 , 215 , 0 , 135 , 229 , 255 , 215 } ,
+
177 {"Magenta3Bis" , 163 , 13 , 215 , 0 , 175 , 221 , 255 , 215 } ,
+
178 {"Magenta3Ter" , 164 , 13 , 215 , 0 , 215 , 213 , 255 , 215 } ,
+
179 {"Magenta2" , 165 , 13 , 215 , 0 , 255 , 207 , 255 , 255 } ,
+
180 {"DarkOrange3Bis" , 166 , 9 , 215 , 95 , 0 , 19 , 255 , 215 } ,
+
181 {"IndianRedBis" , 167 , 9 , 215 , 95 , 95 , 0 , 142 , 215 } ,
+
182 {"HotPink3Bis" , 168 , 13 , 215 , 95 , 135 , 242 , 142 , 215 } ,
+
183 {"HotPink2" , 169 , 13 , 215 , 95 , 175 , 228 , 142 , 215 } ,
+
184 {"Orchid" , 170 , 13 , 215 , 95 , 215 , 213 , 142 , 215 } ,
+
185 {"MediumOrchid1" , 171 , 13 , 215 , 95 , 255 , 203 , 160 , 255 } ,
+
186 {"Orange3" , 172 , 11 , 215 , 135 , 0 , 27 , 255 , 215 } ,
+
187 {"LightSalmon3" , 173 , 9 , 215 , 135 , 95 , 14 , 142 , 215 } ,
+
188 {"LightPink3" , 174 , 7 , 215 , 135 , 135 , 0 , 94 , 215 } ,
+
189 {"Pink3" , 175 , 13 , 215 , 135 , 175 , 235 , 94 , 215 } ,
+
190 {"Plum3" , 176 , 13 , 215 , 135 , 215 , 213 , 94 , 215 } ,
+
191 {"Violet" , 177 , 13 , 215 , 135 , 255 , 199 , 120 , 255 } ,
+
192 {"Gold3Bis" , 178 , 11 , 215 , 175 , 0 , 35 , 255 , 215 } ,
+
193 {"LightGoldenrod3" , 179 , 11 , 215 , 175 , 95 , 28 , 142 , 215 } ,
+
194 {"Tan" , 180 , 7 , 215 , 175 , 135 , 21 , 94 , 215 } ,
+
195 {"MistyRose3" , 181 , 7 , 215 , 175 , 175 , 0 , 47 , 215 } ,
+
196 {"Thistle3" , 182 , 13 , 215 , 175 , 215 , 213 , 47 , 215 } ,
+
197 {"Plum2" , 183 , 12 , 215 , 175 , 255 , 192 , 80 , 255 } ,
+
198 {"Yellow3Bis" , 184 , 11 , 215 , 215 , 0 , 43 , 255 , 215 } ,
+
199 {"Khaki3" , 185 , 11 , 215 , 215 , 95 , 43 , 142 , 215 } ,
+
200 {"LightGoldenrod2" , 186 , 7 , 215 , 215 , 135 , 43 , 94 , 215 } ,
+
201 {"LightYellow3" , 187 , 7 , 215 , 215 , 175 , 43 , 47 , 215 } ,
+
202 {"Grey84" , 188 , 7 , 215 , 215 , 215 , 0 , 0 , 215 } ,
+
203 {"LightSteelBlue1" , 189 , 12 , 215 , 215 , 255 , 171 , 40 , 255 } ,
+
204 {"Yellow2" , 190 , 11 , 215 , 255 , 0 , 49 , 255 , 255 } ,
+
205 {"DarkOliveGreen1" , 191 , 11 , 215 , 255 , 95 , 53 , 160 , 255 } ,
+
206 {"DarkOliveGreen1Bis" , 192 , 11 , 215 , 255 , 135 , 57 , 120 , 255 } ,
+
207 {"DarkSeaGreen1Bis" , 193 , 15 , 215 , 255 , 175 , 64 , 80 , 255 } ,
+
208 {"Honeydew2" , 194 , 15 , 215 , 255 , 215 , 85 , 40 , 255 } ,
+
209 {"LightCyan1Bis" , 195 , 15 , 215 , 255 , 255 , 128 , 40 , 255 } ,
+
210 {"Red1" , 196 , 9 , 255 , 0 , 0 , 0 , 255 , 255 } ,
+
211 {"DeepPink2" , 197 , 13 , 255 , 0 , 95 , 240 , 255 , 255 } ,
+
212 {"DeepPink1" , 198 , 13 , 255 , 0 , 135 , 234 , 255 , 255 } ,
+
213 {"DeepPink1Bis" , 199 , 13 , 255 , 0 , 175 , 227 , 255 , 255 } ,
+
214 {"Magenta2Bis" , 200 , 13 , 255 , 0 , 215 , 220 , 255 , 255 } ,
+
215 {"Magenta1" , 201 , 13 , 255 , 0 , 255 , 213 , 255 , 255 } ,
+
216 {"OrangeRed1" , 202 , 9 , 255 , 95 , 0 , 16 , 255 , 255 } ,
+
217 {"IndianRed1" , 203 , 9 , 255 , 95 , 95 , 0 , 160 , 255 } ,
+
218 {"IndianRed1Bis" , 204 , 13 , 255 , 95 , 135 , 246 , 160 , 255 } ,
+
219 {"HotPink" , 205 , 13 , 255 , 95 , 175 , 235 , 160 , 255 } ,
+
220 {"HotPinkBis" , 206 , 13 , 255 , 95 , 215 , 224 , 160 , 255 } ,
+
221 {"MediumOrchid1Bis" , 207 , 13 , 255 , 95 , 255 , 213 , 160 , 255 } ,
+
222 {"DarkOrange" , 208 , 11 , 255 , 135 , 0 , 22 , 255 , 255 } ,
+
223 {"Salmon1" , 209 , 9 , 255 , 135 , 95 , 10 , 160 , 255 } ,
+
224 {"LightCoral" , 210 , 15 , 255 , 135 , 135 , 0 , 120 , 255 } ,
+
225 {"PaleVioletRed1" , 211 , 13 , 255 , 135 , 175 , 242 , 120 , 255 } ,
+
226 {"Orchid2" , 212 , 13 , 255 , 135 , 215 , 228 , 120 , 255 } ,
+
227 {"Orchid1" , 213 , 13 , 255 , 135 , 255 , 213 , 120 , 255 } ,
+
228 {"Orange1" , 214 , 11 , 255 , 175 , 0 , 29 , 255 , 255 } ,
+
229 {"SandyBrown" , 215 , 9 , 255 , 175 , 95 , 21 , 160 , 255 } ,
+
230 {"LightSalmon1" , 216 , 15 , 255 , 175 , 135 , 14 , 120 , 255 } ,
+
231 {"LightPink1" , 217 , 15 , 255 , 175 , 175 , 0 , 80 , 255 } ,
+
232 {"Pink1" , 218 , 13 , 255 , 175 , 215 , 235 , 80 , 255 } ,
+
233 {"Plum1" , 219 , 13 , 255 , 175 , 255 , 213 , 80 , 255 } ,
+
234 {"Gold1" , 220 , 11 , 255 , 215 , 0 , 36 , 255 , 255 } ,
+
235 {"LightGoldenrod2Bis" , 221 , 11 , 255 , 215 , 95 , 32 , 160 , 255 } ,
+
236 {"LightGoldenrod2Ter" , 222 , 15 , 255 , 215 , 135 , 28 , 120 , 255 } ,
+
237 {"NavajoWhite1" , 223 , 15 , 255 , 215 , 175 , 21 , 80 , 255 } ,
+
238 {"MistyRose1" , 224 , 15 , 255 , 215 , 215 , 0 , 40 , 255 } ,
+
239 {"Thistle1" , 225 , 13 , 255 , 215 , 255 , 213 , 40 , 255 } ,
+
240 {"Yellow1" , 226 , 11 , 255 , 255 , 0 , 43 , 255 , 255 } ,
+
241 {"LightGoldenrod1" , 227 , 11 , 255 , 255 , 95 , 43 , 160 , 255 } ,
+
242 {"Khaki1" , 228 , 15 , 255 , 255 , 135 , 43 , 120 , 255 } ,
+
243 {"Wheat1" , 229 , 15 , 255 , 255 , 175 , 43 , 80 , 255 } ,
+
244 {"Cornsilk1" , 230 , 15 , 255 , 255 , 215 , 43 , 40 , 255 } ,
+
245 {"Grey100" , 231 , 15 , 255 , 255 , 255 , 0 , 0 , 255 } ,
+
246 {"Grey3" , 232 , 0 , 8 , 8 , 8 , 0 , 0 , 8 } ,
+
247 {"Grey7" , 233 , 0 , 18 , 18 , 18 , 0 , 0 , 18 } ,
+
248 {"Grey11" , 234 , 0 , 28 , 28 , 28 , 0 , 0 , 28 } ,
+
249 {"Grey15" , 235 , 0 , 38 , 38 , 38 , 0 , 0 , 38 } ,
+
250 {"Grey19" , 236 , 0 , 48 , 48 , 48 , 0 , 0 , 48 } ,
+
251 {"Grey23" , 237 , 0 , 58 , 58 , 58 , 0 , 0 , 58 } ,
+
252 {"Grey27" , 238 , 8 , 68 , 68 , 68 , 0 , 0 , 68 } ,
+
253 {"Grey30" , 239 , 8 , 78 , 78 , 78 , 0 , 0 , 78 } ,
+
254 {"Grey35" , 240 , 8 , 88 , 88 , 88 , 0 , 0 , 88 } ,
+
255 {"Grey39" , 241 , 8 , 98 , 98 , 98 , 0 , 0 , 98 } ,
+
256 {"Grey42" , 242 , 8 , 108 , 108 , 108 , 0 , 0 , 108 } ,
+
257 {"Grey46" , 243 , 8 , 118 , 118 , 118 , 0 , 0 , 118 } ,
+
258 {"Grey50" , 244 , 8 , 128 , 128 , 128 , 0 , 0 , 128 } ,
+
259 {"Grey54" , 245 , 8 , 138 , 138 , 138 , 0 , 0 , 138 } ,
+
260 {"Grey58" , 246 , 8 , 148 , 148 , 148 , 0 , 0 , 148 } ,
+
261 {"Grey62" , 247 , 8 , 158 , 158 , 158 , 0 , 0 , 158 } ,
+
262 {"Grey66" , 248 , 7 , 168 , 168 , 168 , 0 , 0 , 168 } ,
+
263 {"Grey70" , 249 , 7 , 178 , 178 , 178 , 0 , 0 , 178 } ,
+
264 {"Grey74" , 250 , 7 , 188 , 188 , 188 , 0 , 0 , 188 } ,
+
265 {"Grey78" , 251 , 7 , 198 , 198 , 198 , 0 , 0 , 198 } ,
+
266 {"Grey82" , 252 , 7 , 208 , 208 , 208 , 0 , 0 , 208 } ,
+
267 {"Grey85" , 253 , 7 , 218 , 218 , 218 , 0 , 0 , 218 } ,
+
268 {"Grey89" , 254 , 15 , 228 , 228 , 228 , 0 , 0 , 228 } ,
+
269 {"Grey93" , 255 , 15 , 238 , 238 , 238 , 0 , 0 , 238 } ,
+
270}};
+
+
271
+
+ +
273 return palette256[index]; // NOLINT;
+
274}
+
+
275
+
+ +
277 return palette256[index]; // NOLINT;
+
278}
+
+
279// clang-format off
+
280
+
281}
+ + + + +
ColorInfo is a structure that contains information about the terminal color palette.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
ColorInfo GetColorInfo(Color::Palette256 index)
+
const std::array< ColorInfo, 256 > palette256
+
+
+ + + + + diff --git a/color__info_8cppm.html b/color__info_8cppm.html new file mode 100644 index 000000000..0f8bf0632 --- /dev/null +++ b/color__info_8cppm.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: color_info.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
color_info.cppm File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+
+
+ + + + + diff --git a/color__info_8cppm_source.html b/color__info_8cppm_source.html new file mode 100644 index 000000000..ff4f891a0 --- /dev/null +++ b/color__info_8cppm_source.html @@ -0,0 +1,231 @@ + + + + + + + + +FTXUI: color_info.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
color_info.cppm
+
+
+Go to the documentation of this file.
1/// @module ftxui.screen.color_info
+
2/// @brief Module file for the ColorInfo struct of the Screen module
+
3
+
4module;
+
5
+ +
7
+
8export module ftxui.screen.color_info;
+
9
+
10/**
+
11 * @namespace ftxui
+
12 * @brief The FTXUI ftxui:: namespace
+
13 */
+
14export namespace ftxui {
+
15 using ftxui::ColorInfo;
+
16
+
17 using ftxui::GetColorInfo;
+
18}
+ +
ColorInfo is a structure that contains information about the terminal color palette.
+
Module file for the ColorInfo struct of the Screen module.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
+
+ + + + + diff --git a/color__info_8hpp.html b/color__info_8hpp.html new file mode 100644 index 000000000..0316c2fed --- /dev/null +++ b/color__info_8hpp.html @@ -0,0 +1,235 @@ + + + + + + + + +FTXUI: color_info.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
color_info.hpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Classes

struct  ColorInfo
 ColorInfo is a structure that contains information about the terminal color palette. More...
 
+ + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+ + + + + +

+Functions

ColorInfo GetColorInfo (Color::Palette256 index)
 
ColorInfo GetColorInfo (Color::Palette16 index)
 
+
+
+ + + + + diff --git a/color__info_8hpp.js b/color__info_8hpp.js new file mode 100644 index 000000000..4964cf188 --- /dev/null +++ b/color__info_8hpp.js @@ -0,0 +1,5 @@ +var color__info_8hpp = +[ + [ "GetColorInfo", "color__info_8hpp.html#a883a81f30fb771a82f6c87b77ac3658e", null ], + [ "GetColorInfo", "color__info_8hpp.html#ad5dd7fa2651003bf7c9f8b58de9b0a93", null ] +]; \ No newline at end of file diff --git a/color__info_8hpp_source.html b/color__info_8hpp_source.html new file mode 100644 index 000000000..ac1111a53 --- /dev/null +++ b/color__info_8hpp_source.html @@ -0,0 +1,259 @@ + + + + + + + + +FTXUI: color_info.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
color_info.hpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#ifndef FTXUI_SCREEN_COLOR_INFO_HPP
+
5#define FTXUI_SCREEN_COLOR_INFO_HPP
+
6
+
7#include <cstdint>
+ +
9
+
10namespace ftxui {
+
11
+
12/// @brief ColorInfo is a structure that contains information about the terminal
+
13/// color palette.
+
14///
+
15/// @ingroup screen
+
+
16struct ColorInfo {
+
17 const char* name;
+
18 uint8_t index_256;
+
19 uint8_t index_16;
+
20 uint8_t red;
+
21 uint8_t green;
+
22 uint8_t blue;
+
23 uint8_t hue;
+
24 uint8_t saturation;
+
25 uint8_t value;
+
26};
+
+
27
+ + +
30
+
31} // namespace ftxui
+
32
+
33#endif // FTXUI_SCREEN_COLOR_INFO_HPP
+ + + + + +
const char * name
+ + + + + + +
ColorInfo is a structure that contains information about the terminal color palette.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
ColorInfo GetColorInfo(Color::Palette256 index)
+
+
+ + + + + diff --git a/color__info__palette256_8cpp.html b/color__info__palette256_8cpp.html new file mode 100644 index 000000000..b4abf9250 --- /dev/null +++ b/color__info__palette256_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: color_info_palette256.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
color_info_palette256.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 16 of file color_info_palette256.cpp.

+ +
+
+
+
+ + + + + diff --git a/color__info__palette256_8cpp.js b/color__info__palette256_8cpp.js new file mode 100644 index 000000000..aaee37697 --- /dev/null +++ b/color__info__palette256_8cpp.js @@ -0,0 +1,4 @@ +var color__info__palette256_8cpp = +[ + [ "main", "color__info__palette256_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/color__info__palette256_8cpp_source.html b/color__info__palette256_8cpp_source.html new file mode 100644 index 000000000..351926e89 --- /dev/null +++ b/color__info__palette256_8cpp_source.html @@ -0,0 +1,268 @@ + + + + + + + + +FTXUI: color_info_palette256.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
color_info_palette256.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <ftxui/dom/elements.hpp> // for text, bgcolor, hbox, operator|, Elements, Fit, vbox, Element
+
5#include <ftxui/screen/color_info.hpp> // for ColorInfo
+
6#include <ftxui/screen/screen.hpp> // for Full, Screen
+
7#include <utility> // for move
+
8#include <vector> // for vector, allocator
+
9
+
10#include "ftxui/dom/node.hpp" // for Render
+
11#include "ftxui/screen/color.hpp" // for Color, Color::Palette256, ftxui
+
12
+
13using namespace ftxui;
+
14#include "./color_info_sorted_2d.ipp" // for ColorInfoSorted2D
+
15
+
+
16int main() {
+
17 std::vector<std::vector<ColorInfo>> info_columns = ColorInfoSorted2D();
+
18
+
19 // Draw every columns
+
20 Elements columns_elements;
+
21 for (auto& column : info_columns) {
+
22 Elements column_elements;
+
23 for (auto& it : column) {
+
24 column_elements.push_back(hbox({
+
25 text(" ") | bgcolor(Color(Color::Palette256(it.index_256))),
+
26 text(it.name),
+
27 }));
+
28 }
+
29 columns_elements.push_back(vbox(std::move(column_elements)));
+
30 }
+
31 auto document = hbox(std::move(columns_elements));
+
32
+
33 auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
34 Render(screen, document);
+
35
+
36 screen.Print();
+
37
+
38 return 0;
+
39}
+
+ + + + +
std::vector< std::vector< ftxui::ColorInfo > > ColorInfoSorted2D()
+ +
Decorator bgcolor(Color)
Decorate using a background color.
+
Element text(std::wstring text)
Display a piece of unicode text.
Definition text.cpp:160
+
void Render(Screen &screen, const Element &element)
Display an element on a ftxui::Screen.
Definition node.cpp:84
+
Element vbox(Elements)
A container displaying elements vertically one by one.
Definition vbox.cpp:96
+
static Screen Create(Dimensions dimension)
Create a screen with the given dimension.
Definition screen.cpp:395
+ +
Color is a class that represents a color in the terminal user interface.
Definition color.hpp:22
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
Element hbox(Elements)
A container displaying elements horizontally one by one.
Definition hbox.cpp:94
+
std::vector< Element > Elements
Definition elements.hpp:23
+ + +
+
+ + + + + diff --git a/color__info__sorted__2d_8ipp.html b/color__info__sorted__2d_8ipp.html new file mode 100644 index 000000000..b5c0509f1 --- /dev/null +++ b/color__info__sorted__2d_8ipp.html @@ -0,0 +1,241 @@ + + + + + + + + +FTXUI: color_info_sorted_2d.ipp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
color_info_sorted_2d.ipp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

std::vector< std::vector< ftxui::ColorInfo > > ColorInfoSorted2D ()
 
+

Function Documentation

+ +

◆ ColorInfoSorted2D()

+ +
+
+ + + + + + + +
std::vector< std::vector< ftxui::ColorInfo > > ColorInfoSorted2D ()
+
+
+
+
+ + + + + diff --git a/color__info__sorted__2d_8ipp.js b/color__info__sorted__2d_8ipp.js new file mode 100644 index 000000000..e13bfcfc2 --- /dev/null +++ b/color__info__sorted__2d_8ipp.js @@ -0,0 +1,4 @@ +var color__info__sorted__2d_8ipp = +[ + [ "ColorInfoSorted2D", "color__info__sorted__2d_8ipp.html#a0f08918d6064cd2a0e56cb9ec74033ca", null ] +]; \ No newline at end of file diff --git a/color__info__sorted__2d_8ipp_source.html b/color__info__sorted__2d_8ipp_source.html new file mode 100644 index 000000000..6b3368f83 --- /dev/null +++ b/color__info__sorted__2d_8ipp_source.html @@ -0,0 +1,269 @@ + + + + + + + + +FTXUI: color_info_sorted_2d.ipp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
color_info_sorted_2d.ipp
+
+
+Go to the documentation of this file.
1#include <algorithm>
+
2#include <cmath>
+
3#include <ftxui/screen/color_info.hpp> // for ftxui::ColorInfo
+
4
+
+
5std::vector<std::vector<ftxui::ColorInfo>> ColorInfoSorted2D() {
+
6 // Acquire the color information for the palette256.
+
7 std::vector<ftxui::ColorInfo> info_gray;
+
8 std::vector<ftxui::ColorInfo> info_color;
+
9 for (int i = 16; i < 256; ++i) {
+
10 ftxui::ColorInfo info = GetColorInfo(ftxui::Color::Palette256(i));
+
11 if (info.saturation == 0)
+
12 info_gray.push_back(info);
+
13 else
+
14 info_color.push_back(info);
+
15 }
+
16
+
17 // Sort info_color by hue.
+
18 std::sort(
+
19 info_color.begin(), info_color.end(),
+
20 [](const ftxui::ColorInfo& A, const ftxui::ColorInfo& B) { return A.hue < B.hue; });
+
21
+
22 // Make 8 colums, one gray and seven colored.
+
23 std::vector<std::vector<ftxui::ColorInfo>> info_columns(8);
+
24 info_columns[0] = info_gray;
+
25 for (size_t i = 0; i < info_color.size(); ++i) {
+
26 info_columns[1 + 7 * i / info_color.size()].push_back(info_color[i]);
+
27 }
+
28
+
29 // Minimize discontinuities for every columns.
+
30 for (auto& column : info_columns) {
+
31 std::sort(column.begin(), column.end(),
+
32 [](const ftxui::ColorInfo& A, const ftxui::ColorInfo& B) {
+
33 return A.value < B.value;
+
34 });
+
35 for (int i = 0; i < int(column.size()) - 1; ++i) {
+
36 int best_index = i + 1;
+
37 int best_distance = 255 * 255 * 3;
+
38 for (int j = i + 1; j < column.size(); ++j) {
+
39 int dx = column[i].red - column[j].red;
+
40 int dy = column[i].green - column[j].green;
+
41 int dz = column[i].blue - column[j].blue;
+
42 int distance = dx * dx + dy * dy + dz * dz;
+
43 if (best_distance > distance) {
+
44 best_distance = distance;
+
45 best_index = j;
+
46 }
+
47 }
+
48 std::swap(column[i + 1], column[best_index]);
+
49 }
+
50 }
+
51
+
52 return std::move(info_columns);
+
53}
+
+ +
std::vector< std::vector< ftxui::ColorInfo > > ColorInfoSorted2D()
+ + +
ColorInfo is a structure that contains information about the terminal color palette.
+
+
+ + + + + diff --git a/color__truecolor__HSV_8cpp.html b/color__truecolor__HSV_8cpp.html new file mode 100644 index 000000000..5eb7f2c73 --- /dev/null +++ b/color__truecolor__HSV_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: color_truecolor_HSV.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
color_truecolor_HSV.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 12 of file color_truecolor_HSV.cpp.

+ +
+
+
+
+ + + + + diff --git a/color__truecolor__HSV_8cpp.js b/color__truecolor__HSV_8cpp.js new file mode 100644 index 000000000..3b6b1074d --- /dev/null +++ b/color__truecolor__HSV_8cpp.js @@ -0,0 +1,4 @@ +var color__truecolor__HSV_8cpp = +[ + [ "main", "color__truecolor__HSV_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/color__truecolor__HSV_8cpp_source.html b/color__truecolor__HSV_8cpp_source.html new file mode 100644 index 000000000..213c5528d --- /dev/null +++ b/color__truecolor__HSV_8cpp_source.html @@ -0,0 +1,253 @@ + + + + + + + + +FTXUI: color_truecolor_HSV.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
color_truecolor_HSV.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <ftxui/dom/elements.hpp> // for operator|, Elements, Fit, bgcolor, color, hbox, text, vbox, Element
+
5#include <ftxui/screen/screen.hpp> // for Full, Screen
+
6#include <memory> // for allocator
+
7#include <utility> // for move
+
8
+
9#include "ftxui/dom/node.hpp" // for Render
+
10#include "ftxui/screen/color.hpp" // for Color, ftxui
+
11
+
+
12int main() {
+
13 using namespace ftxui;
+
14
+
15 int saturation = 255;
+
16 Elements array;
+
17 for (int value = 0; value < 255; value += 20) {
+
18 Elements line;
+
19 for (int hue = 0; hue < 255; hue += 2) {
+
20 line.push_back(text("▀") //
+
21 | color(Color::HSV(hue, saturation, value)) //
+
22 | bgcolor(Color::HSV(hue, saturation, value + 10)));
+
23 }
+
24 array.push_back(hbox(std::move(line)));
+
25 }
+
26
+
27 auto document = vbox(std::move(array));
+
28
+
29 auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
30 Render(screen, document);
+
31
+
32 screen.Print();
+
33
+
34 return 0;
+
35}
+
+ +
int main()
+ +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::vector< Element > Elements
Definition elements.hpp:23
+ + +
+
+ + + + + diff --git a/color__truecolor__RGB_8cpp.html b/color__truecolor__RGB_8cpp.html new file mode 100644 index 000000000..49b0e8811 --- /dev/null +++ b/color__truecolor__RGB_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: color_truecolor_RGB.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
color_truecolor_RGB.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 12 of file color_truecolor_RGB.cpp.

+ +
+
+
+
+ + + + + diff --git a/color__truecolor__RGB_8cpp.js b/color__truecolor__RGB_8cpp.js new file mode 100644 index 000000000..4e1f0be85 --- /dev/null +++ b/color__truecolor__RGB_8cpp.js @@ -0,0 +1,4 @@ +var color__truecolor__RGB_8cpp = +[ + [ "main", "color__truecolor__RGB_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/color__truecolor__RGB_8cpp_source.html b/color__truecolor__RGB_8cpp_source.html new file mode 100644 index 000000000..67537eb36 --- /dev/null +++ b/color__truecolor__RGB_8cpp_source.html @@ -0,0 +1,271 @@ + + + + + + + + +FTXUI: color_truecolor_RGB.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
color_truecolor_RGB.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <ftxui/dom/elements.hpp> // for hbox, text, bgcolor, operator|, vbox, Elements, window, Element, Fit
+
5#include <ftxui/screen/screen.hpp> // for Full, Screen
+
6#include <memory> // for allocator
+
7#include <utility> // for move
+
8
+
9#include "ftxui/dom/node.hpp" // for Render
+
10#include "ftxui/screen/color.hpp" // for Color, ftxui
+
11
+
+
12int main() {
+
13 using namespace ftxui;
+
14
+
15 Elements red_line;
+
16 Elements green_line;
+
17 Elements blue_line;
+
18 Elements cyan_line;
+
19 Elements magenta_line;
+
20 Elements yellow_line;
+
21
+
22 for (int value = 0; value < 255; value += 3) {
+
23 int v = value * value / 255;
+
24 red_line.push_back(text(" ") | bgcolor(Color::RGB(v, 0, 0)));
+
25 green_line.push_back(text(" ") | bgcolor(Color::RGB(0, v, 0)));
+
26 blue_line.push_back(text(" ") | bgcolor(Color::RGB(0, 0, v)));
+
27 cyan_line.push_back(text(" ") | bgcolor(Color::RGB(0, v, v)));
+
28 magenta_line.push_back(text(" ") | bgcolor(Color::RGB(v, 0, v)));
+
29 yellow_line.push_back(text(" ") | bgcolor(Color::RGB(v, v, 0)));
+
30 }
+
31
+
32 auto document = vbox({
+
33 window(text("Primary colors"),
+
34 vbox({
+
35 hbox({text("Red line :"), hbox(std::move(red_line))}),
+
36 hbox({text("Green line :"), hbox(std::move(green_line))}),
+
37 hbox({text("Blue line :"), hbox(std::move(blue_line))}),
+
38 })),
+
39 window(text("Secondary colors"),
+
40 vbox({
+
41 hbox({text("cyan line :"), hbox(std::move(cyan_line))}),
+
42 hbox({text("magenta line:"), hbox(std::move(magenta_line))}),
+
43 hbox({text("Yellow line :"), hbox(std::move(yellow_line))}),
+
44 })),
+
45 });
+
46
+
47 auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
48 Render(screen, document);
+
49
+
50 screen.Print();
+
51
+
52 return 0;
+
53}
+
+ +
int main()
+ +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::vector< Element > Elements
Definition elements.hpp:23
+ + +
+
+ + + + + diff --git a/component_2component_8cppm.html b/component_2component_8cppm.html new file mode 100644 index 000000000..06ee8bbc9 --- /dev/null +++ b/component_2component_8cppm.html @@ -0,0 +1,222 @@ + + + + + + + + +FTXUI: component.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
component.cppm File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
namespace  ftxui::Container
 
+
+
+ + + + + diff --git a/component_2component_8cppm_source.html b/component_2component_8cppm_source.html new file mode 100644 index 000000000..534b5077a --- /dev/null +++ b/component_2component_8cppm_source.html @@ -0,0 +1,280 @@ + + + + + + + + +FTXUI: component.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
component/component.cppm
+
+
+Go to the documentation of this file.
1/// @module ftxui.component.component
+
2/// @brief Module file for the Component classes of the Component module
+
3
+
4module;
+
5
+ +
7
+
8export module ftxui.component.component;
+
9
+
10/**
+
11 * @namespace ftxui
+
12 * @brief The FTXUI ftxui:: namespace
+
13 */
+
14export namespace ftxui {
+ + +
17 using ftxui::Event;
+ + + + +
22
+
23 using ftxui::Make;
+
24
+ + +
27
+
28 using ftxui::operator|;
+
29 using ftxui::operator|=;
+
30
+
31 namespace Container {
+
32 using ftxui::Container::Vertical;
+
33 using ftxui::Container::Horizontal;
+
34 using ftxui::Container::Tab;
+
35 using ftxui::Container::Stacked;
+
36 }
+
37
+
38 using ftxui::Button;
+
39 using ftxui::Checkbox;
+
40 using ftxui::Input;
+
41 using ftxui::Menu;
+
42 using ftxui::MenuEntry;
+
43 using ftxui::Radiobox;
+
44 using ftxui::Dropdown;
+
45 using ftxui::Toggle;
+
46 using ftxui::Slider;
+
47 using ftxui::ResizableSplit;
+
48 using ftxui::ResizableSplitLeft;
+
49 using ftxui::ResizableSplitRight;
+
50 using ftxui::ResizableSplitTop;
+
51 using ftxui::ResizableSplitBottom;
+
52 using ftxui::Renderer;
+
53 using ftxui::CatchEvent;
+
54 using ftxui::Maybe;
+
55 using ftxui::Modal;
+
56 using ftxui::Collapsible;
+
57 using ftxui::Hoverable;
+
58 using ftxui::Window;
+
59}
+ +
Option for the AnimatedButton component.
+
Option for the Checkbox component.
+
Represent an event. It can be key press event, a terminal resize, or more ...
Definition event.hpp:29
+
Option for the Input component.
+
Option for the MenuEntry component.
+
Option for the Menu component.
+
Option for the Radiobox component.
+
Module file for the Component classes of the Component module.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::function< Element(Element)> ElementDecorator
Definition component.hpp:33
+
std::function< Component(Component)> ComponentDecorator
Definition component.hpp:32
+
+
+ + + + + diff --git a/component_2util_8cpp.html b/component_2util_8cpp.html new file mode 100644 index 000000000..f16b98a2f --- /dev/null +++ b/component_2util_8cpp.html @@ -0,0 +1,232 @@ + + + + + + + + +FTXUI: util.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
util.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+ + + + + + + + + +

+Functions

Component operator| (Component component, ComponentDecorator decorator)
 
Component operator| (Component component, ElementDecorator decorator)
 
Componentoperator|= (Component &component, ComponentDecorator decorator)
 
Componentoperator|= (Component &component, ElementDecorator decorator)
 
+
+
+ + + + + diff --git a/component_2util_8cpp.js b/component_2util_8cpp.js new file mode 100644 index 000000000..9bb8296e2 --- /dev/null +++ b/component_2util_8cpp.js @@ -0,0 +1,7 @@ +var component_2util_8cpp = +[ + [ "operator|", "component_2util_8cpp.html#a65a2e15f64ae3bc205c485abc3a5aeb9", null ], + [ "operator|", "component_2util_8cpp.html#a9c4cf8bcb7012f740b146bfe89cbd3eb", null ], + [ "operator|=", "component_2util_8cpp.html#ade35e69d695327db85be01c9787c39f8", null ], + [ "operator|=", "component_2util_8cpp.html#aa480c58bcaeae204fbe68b192c5ede92", null ] +]; \ No newline at end of file diff --git a/component_2util_8cpp_source.html b/component_2util_8cpp_source.html new file mode 100644 index 000000000..408a14b97 --- /dev/null +++ b/component_2util_8cpp_source.html @@ -0,0 +1,259 @@ + + + + + + + + +FTXUI: util.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
component/util.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2022 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <functional> // for function
+
5
+
6#include "ftxui/component/component.hpp" // for Renderer, ComponentDecorator, ElementDecorator, operator|, operator|=
+
7#include "ftxui/component/component_base.hpp" // for Component
+
8
+
9namespace ftxui {
+
10
+
11// NOLINTNEXTLINE
+
+ +
13 return decorator(component); // NOLINT
+
14}
+
+
15
+
16// NOLINTNEXTLINE
+
+ +
18 return component | Renderer(decorator); // NOLINT
+
19}
+
+
20
+
21// NOLINTNEXTLINE
+
+ +
23 component = component | decorator; // NOLINT
+
24 return component;
+
25}
+
+
26
+
27// NOLINTNEXTLINE
+
+ +
29 component = component | decorator; // NOLINT
+
30 return component;
+
31}
+
+
32
+
33} // namespace ftxui
+ + +
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::function< Element(Element)> ElementDecorator
Definition component.hpp:33
+
Component operator|(Component component, ComponentDecorator decorator)
+
Component & operator|=(Component &component, ComponentDecorator decorator)
+
std::function< Component(Component)> ComponentDecorator
Definition component.hpp:32
+
std::shared_ptr< ComponentBase > Component
+
+
+ + + + + diff --git a/component_8cpp.html b/component_8cpp.html new file mode 100644 index 000000000..29e60f0ee --- /dev/null +++ b/component_8cpp.html @@ -0,0 +1,223 @@ + + + + + + + + +FTXUI: component.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
component.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
namespace  ftxui::animation
 The FTXUI ftxui::animation:: namespace.
 
+
+
+ + + + + diff --git a/component_8cpp_source.html b/component_8cpp_source.html new file mode 100644 index 000000000..35a0153f8 --- /dev/null +++ b/component_8cpp_source.html @@ -0,0 +1,525 @@ + + + + + + + + +FTXUI: component.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
component.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <algorithm> // for find_if
+
5#include <cassert> // for assert
+
6#include <cstddef> // for size_t
+
7#include <iterator> // for begin, end
+
8#include <memory> // for unique_ptr, make_unique
+
9#include <utility> // for move
+
10#include <vector> // for vector, __alloc_traits<>::value_type
+
11
+
12#include "ftxui/component/captured_mouse.hpp" // for CapturedMouse, CapturedMouseInterface
+ +
14#include "ftxui/component/component_base.hpp" // for ComponentBase, Components
+
15#include "ftxui/component/event.hpp" // for Event
+
16#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
+
17#include "ftxui/dom/elements.hpp" // for text, Element
+
18#include "ftxui/dom/node.hpp" // for Node, Elements
+
19#include "ftxui/screen/box.hpp" // for Box
+
20
+
21namespace ftxui::animation {
+
22class Params;
+
23} // namespace ftxui::animation
+
24
+
25namespace ftxui {
+
26
+
27namespace {
+
28class CaptureMouseImpl : public CapturedMouseInterface {};
+
29} // namespace
+
30
+ +
34
+
35/// @brief Return the parent ComponentBase, or nul if any.
+
36/// @see Detach
+
37/// @see Parent
+
+ +
39 return parent_;
+
40}
+
+
41
+
42/// @brief Access the child at index `i`.
+
+ +
44 assert(i < ChildCount()); // NOLINT
+
45 return children_[i];
+
46}
+
+
47
+
48/// @brief Returns the number of children.
+
+ +
50 return children_.size();
+
51}
+
+
52
+
53/// @brief Return index of the component in its parent. -1 if no parent.
+
+ +
55 if (parent_ == nullptr) {
+
56 return -1;
+
57 }
+
58 int index = 0;
+
59 for (const Component& child : parent_->children_) {
+
60 if (child.get() == this) {
+
61 return index;
+
62 }
+
63 index++;
+
64 }
+
65 return -1; // Not reached.
+
66}
+
+
67
+
68/// @brief Add a child.
+
69/// @@param child The child to be attached.
+
+ +
71 child->Detach();
+
72 child->parent_ = this;
+
73 children_.push_back(std::move(child));
+
74}
+
+
75
+
76/// @brief Detach this child from its parent.
+
77/// @see Detach
+
78/// @see Parent
+
+ +
80 if (parent_ == nullptr) {
+
81 return;
+
82 }
+
83 auto it = std::find_if(std::begin(parent_->children_), //
+
84 std::end(parent_->children_), //
+
85 [this](const Component& that) { //
+
86 return this == that.get();
+
87 });
+
88 ComponentBase* parent = parent_;
+
89 parent_ = nullptr;
+
90 parent->children_.erase(it); // Might delete |this|.
+
91}
+
+
92
+
93/// @brief Remove all children.
+
+ +
95 while (!children_.empty()) {
+
96 children_[0]->Detach();
+
97 }
+
98}
+
+
99
+
100/// @brief Draw the component.
+
101/// Build a ftxui::Element to be drawn on the ftxui::Screen representing this
+
102/// ftxui::ComponentBase. Please override OnRender() to modify the rendering.
+
+ +
104 // Some users might call `ComponentBase::Render()` from
+
105 // `T::OnRender()`. To avoid infinite recursion, we use a flag.
+
106 if (in_render) {
+ +
108 }
+
109
+
110 in_render = true;
+
111 Element element = OnRender();
+
112 in_render = false;
+
113
+
114 class Wrapper : public Node {
+
115 public:
+
116 bool active_ = false;
+
117
+
118 Wrapper(Element child, bool active)
+
119 : Node({std::move(child)}), active_(active) {}
+
120
+
121 void SetBox(Box box) override {
+
122 Node::SetBox(box);
+
123 children_[0]->SetBox(box);
+
124 }
+
125
+
126 void ComputeRequirement() override {
+
127 Node::ComputeRequirement();
+
128 requirement_.focused.component_active = active_;
+
129 }
+
130 };
+
131
+
132 return std::make_shared<Wrapper>(std::move(element), Active());
+
133}
+
+
134
+
135/// @brief Draw the component.
+
136/// Build a ftxui::Element to be drawn on the ftxi::Screen representing this
+
137/// ftxui::ComponentBase. This function is means to be overridden.
+
+ +
139 if (children_.size() == 1) {
+
140 return children_.front()->Render();
+
141 }
+
142
+
143 return text("Not implemented component");
+
144}
+
+
145
+
146/// @brief Called in response to an event.
+
147/// @param event The event.
+
148/// @return True when the event has been handled.
+
149/// The default implementation called OnEvent on every child until one return
+
150/// true. If none returns true, return false.
+
+
151bool ComponentBase::OnEvent(Event event) { // NOLINT
+
152 for (Component& child : children_) { // NOLINT
+
153 if (child->OnEvent(event)) {
+
154 return true;
+
155 }
+
156 }
+
157 return false;
+
158}
+
+
159
+
160/// @brief Called in response to an animation event.
+
161/// @param params the parameters of the animation
+
162/// The default implementation dispatch the event to every child.
+
+ +
164 for (const Component& child : children_) {
+
165 child->OnAnimation(params);
+
166 }
+
167}
+
+
168
+
169/// @brief Return the currently Active child.
+
170/// @return the currently Active child.
+
+ +
172 for (auto& child : children_) {
+
173 if (child->Focusable()) {
+
174 return child;
+
175 }
+
176 }
+
177 return nullptr;
+
178}
+
+
179
+
180/// @brief Return true when the component contains focusable elements.
+
181/// The non focusable Components will be skipped when navigating using the
+
182/// keyboard.
+
+ +
184 for (const Component& child : children_) { // NOLINT
+
185 if (child->Focusable()) {
+
186 return true;
+
187 }
+
188 }
+
189 return false;
+
190}
+
+
191
+
192/// @brief Returns if the element if the currently active child of its parent.
+
+ +
194 return parent_ == nullptr || parent_->ActiveChild().get() == this;
+
195}
+
+
196
+
197/// @brief Returns if the elements if focused by the user.
+
198/// True when the ComponentBase is focused by the user. An element is Focused
+
199/// when it is with all its ancestors the ActiveChild() of their parents, and it
+
200/// Focusable().
+
+ +
202 const auto* current = this;
+
203 while (current && current->Active()) {
+
204 current = current->parent_;
+
205 }
+
206 return !current && Focusable();
+
207}
+
+
208
+
209/// @brief Make the |child| to be the "active" one.
+
210/// @param child the child to become active.
+
211void ComponentBase::SetActiveChild([[maybe_unused]] ComponentBase* child) {}
+
212
+
213/// @brief Make the |child| to be the "active" one.
+
214/// @param child the child to become active.
+
+ +
216 SetActiveChild(child.get());
+
217}
+
+
218
+
219/// @brief Configure all the ancestors to give focus to this component.
+
+ +
221 ComponentBase* child = this;
+
222 while (ComponentBase* parent = child->parent_) {
+
223 parent->SetActiveChild(child);
+
224 child = parent;
+
225 }
+
226}
+
+
227
+
228/// @brief Take the CapturedMouse if available. There is only one component of
+
229/// them. It represents a component taking priority over others.
+
230/// @param event The event
+
+ +
232 if (event.screen_) {
+
233 return event.screen_->CaptureMouse();
+
234 }
+
235 return std::make_unique<CaptureMouseImpl>();
+
236}
+
+
237
+
238} // namespace ftxui
+ + + + + + + +
virtual bool Focusable() const
Return true when the component contains focusable elements. The non focusable Components will be skip...
+
bool Focused() const
Returns if the elements if focused by the user. True when the ComponentBase is focused by the user....
+
CapturedMouse CaptureMouse(const Event &event)
Take the CapturedMouse if available. There is only one component of them. It represents a component t...
+
void Add(Component children)
Add a child. @param child The child to be attached.
Definition component.cpp:70
+ +
Element Render()
Draw the component. Build a ftxui::Element to be drawn on the ftxui::Screen representing this ftxui::...
+
void TakeFocus()
Configure all the ancestors to give focus to this component.
+
bool Active() const
Returns if the element if the currently active child of its parent.
+
ScreenInteractive * screen_
Definition event.hpp:124
+
virtual Component ActiveChild()
Return the currently Active child.
+
void DetachAllChildren()
Remove all children.
Definition component.cpp:94
+
virtual void SetActiveChild(ComponentBase *child)
Make the |child| to be the "active" one.
+
int Index() const
Return index of the component in its parent. -1 if no parent.
Definition component.cpp:54
+
size_t ChildCount() const
Returns the number of children.
Definition component.cpp:49
+
ComponentBase * Parent() const
Return the parent ComponentBase, or nul if any.
Definition component.cpp:38
+
virtual Element OnRender()
Draw the component. Build a ftxui::Element to be drawn on the ftxi::Screen representing this ftxui::C...
+
virtual bool OnEvent(Event)
Called in response to an event.
+
void Detach()
Detach this child from its parent.
Definition component.cpp:79
+
Component & ChildAt(size_t i)
Access the child at index i.
Definition component.cpp:43
+
virtual ~ComponentBase()
Definition component.cpp:31
+
virtual void OnAnimation(animation::Params &params)
Called in response to an animation event.
+
It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ft...
+
Represent an event. It can be key press event, a terminal resize, or more ...
Definition event.hpp:29
+
Node is the base class for all elements in the DOM tree.
Definition node.hpp:37
+
Element text(std::wstring text)
Display a piece of unicode text.
Definition text.cpp:160
+
Box is a structure that represents a rectangular area in a 2D space.
Definition box.hpp:16
+
The FTXUI ftxui::animation:: namespace.
Definition animation.hpp:10
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::unique_ptr< CapturedMouseInterface > CapturedMouse
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+
std::shared_ptr< ComponentBase > Component
+ + +
+
+ + + + + diff --git a/component_8cppm.html b/component_8cppm.html new file mode 100644 index 000000000..2f87aa27d --- /dev/null +++ b/component_8cppm.html @@ -0,0 +1,211 @@ + + + + + + + + +FTXUI: component.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
component.cppm File Reference
+
+ +
+ + + + + diff --git a/component_8cppm_source.html b/component_8cppm_source.html new file mode 100644 index 000000000..52b3f063a --- /dev/null +++ b/component_8cppm_source.html @@ -0,0 +1,237 @@ + + + + + + + + +FTXUI: component.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
component.cppm
+
+
+Go to the documentation of this file.
1/// @module ftxui.component
+
2/// @brief Module file for FTXUI component operations.
+
3
+
4export module ftxui.component;
+
5
+
6export import ftxui.component.animation;
+ +
8export import ftxui.component.component;
+ + +
11export import ftxui.component.event;
+
12export import ftxui.component.loop;
+
13export import ftxui.component.mouse;
+
14export import ftxui.component.receiver;
+ +
16export import ftxui.component.task;
+
C++20 module interface for the Animation namespace of the Component module.
+
Module file for the CapturedMouseInterface class of the Component module.
+
Module file for the ComponentBase class of the Component module.
+
Module file for options for the Component class of the Component module.
+
Module file for the Component classes of the Component module.
+
Module file for the Event struct of the Component module.
+
Module file for the Loop class of the Component module.
+
Module file for the Mouse struct of the Component module.
+
Module file for the Receiver class of the Component module.
+
Module file for the ScreenInteractive class of the Component module.
+
Module file for the Task class of the Component module.
+
Module file for FTXUI component operations.
+
+
+ + + + + diff --git a/component_8hpp.html b/component_8hpp.html new file mode 100644 index 000000000..785182666 --- /dev/null +++ b/component_8hpp.html @@ -0,0 +1,394 @@ + + + + + + + + +FTXUI: component.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
component.hpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
namespace  ftxui::Container
 
+ + + + + +

+Typedefs

using ComponentDecorator = std::function<Component(Component)>
 
using ElementDecorator = std::function<Element(Element)>
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

template<class T , class... Args>
std::shared_ptr< T > Make (Args &&... args)
 
Component operator| (Component component, ComponentDecorator decorator)
 
Component operator| (Component component, ElementDecorator decorator)
 
Componentoperator|= (Component &component, ComponentDecorator decorator)
 
Componentoperator|= (Component &component, ElementDecorator decorator)
 
Component Vertical (Components children)
 A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or 'j'/'k' keys.
 
Component Vertical (Components children, int *selector)
 A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or 'j'/'k' keys. This is useful for implementing a Menu for instance.
 
Component Horizontal (Components children)
 A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow key or 'h'/'l' keys.
 
Component Horizontal (Components children, int *selector)
 A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow key or 'h'/'l' keys.
 
Component Tab (Components children, int *selector)
 A list of components, where only one is drawn and interacted with at a time. The |selector| gives the index of the selected component. This is useful to implement tabs.
 
Component Stacked (Components children)
 A list of components to be stacked on top of each other. Events are propagated to the first component, then the second if not handled, etc. The components are drawn in the reverse order they are given. When a component take focus, it is put at the front, without changing the relative order of the other elements.
 
Component Button (ButtonOption option)
 Draw a button. Execute a function when clicked.
 
Component Button (ConstStringRef label, std::function< void()> on_click, ButtonOption option)
 Draw a button. Execute a function when clicked.
 
Component Checkbox (CheckboxOption option)
 Draw checkable element.
 
Component Checkbox (ConstStringRef label, bool *checked, CheckboxOption option)
 Draw checkable element.
 
Component Input (InputOption option)
 An input box for editing text.
 
Component Input (StringRef content, InputOption option)
 An input box for editing text.
 
Component Input (StringRef content, StringRef placeholder, InputOption option)
 An input box for editing text.
 
Component Menu (MenuOption option)
 A list of text. The focused element is selected.
 
Component Menu (ConstStringListRef entries, int *selected, MenuOption option)
 A list of text. The focused element is selected.
 
Component MenuEntry (MenuEntryOption option)
 A specific menu entry. They can be put into a Container::Vertical to form a menu.
 
Component MenuEntry (ConstStringRef label, MenuEntryOption option)
 A specific menu entry. They can be put into a Container::Vertical to form a menu.
 
Component Radiobox (RadioboxOption option)
 A list of element, where only one can be selected.
 
Component Radiobox (ConstStringListRef entries, int *selected, RadioboxOption option)
 A list of element, where only one can be selected.
 
Component Dropdown (ConstStringListRef entries, int *selected)
 A dropdown menu.
 
Component Dropdown (DropdownOption option)
 A dropdown menu.
 
Component Toggle (ConstStringListRef entries, int *selected)
 An horizontal list of elements. The user can navigate through them.
 
template<typename T >
Component Slider (SliderOption< T > options)
 A slider in any direction.
 
Component Slider (ConstStringRef label, Ref< int > value, ConstRef< int > min, ConstRef< int > max, ConstRef< int > increment)
 An horizontal slider.
 
Component Slider (ConstStringRef label, Ref< float > value, ConstRef< float > min=0.f, ConstRef< float > max=100.f, ConstRef< float > increment=5.f)
 
Component Slider (ConstStringRef label, Ref< long > value, ConstRef< long > min=0L, ConstRef< long > max=100L, ConstRef< long > increment=5L)
 
Component ResizableSplit (ResizableSplitOption options)
 A split in between two components.
 
Component ResizableSplitLeft (Component main, Component back, int *main_size)
 An horizontal split in between two components, configurable using the mouse.
 
Component ResizableSplitRight (Component main, Component back, int *main_size)
 An horizontal split in between two components, configurable using the mouse.
 
Component ResizableSplitTop (Component main, Component back, int *main_size)
 An vertical split in between two components, configurable using the mouse.
 
Component ResizableSplitBottom (Component main, Component back, int *main_size)
 An vertical split in between two components, configurable using the mouse.
 
Component Renderer (Component child, std::function< Element()> render)
 Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
 
Component Renderer (std::function< Element()> render)
 Return a component, using |render| to render its interface.
 
Component Renderer (std::function< Element(bool)> render)
 Return a focusable component, using |render| to render its interface.
 
ComponentDecorator Renderer (ElementDecorator decorator)
 Decorate a component, by decorating what it renders.
 
Component CatchEvent (Component child, std::function< bool(Event)>)
 
ComponentDecorator CatchEvent (std::function< bool(Event)> on_event)
 Decorate a component, using |on_event| to catch events. This function must returns true when the event has been handled, false otherwise.
 
Component Maybe (Component child, const bool *show)
 Decorate a component |child|. It is shown only when |show| is true.
 
Component Maybe (Component child, std::function< bool()> show)
 Decorate a component |child|. It is shown only when |show| returns true.
 
ComponentDecorator Maybe (const bool *show)
 Decorate a component. It is shown only when |show| is true.
 
ComponentDecorator Maybe (std::function< bool()> show)
 Decorate a component. It is shown only when the |show| function returns true.
 
Component Modal (Component main, Component modal, const bool *show_modal)
 
ComponentDecorator Modal (Component modal, const bool *show_modal)
 
Component Collapsible (ConstStringRef label, Component child, Ref< bool > show)
 A collapsible component. It displays a checkbox with an arrow. Once activated, the child is displayed.
 
Component Hoverable (Component component, bool *hover)
 Wrap a component. Gives the ability to know if it is hovered by the mouse.
 
Component Hoverable (Component component, std::function< void()> on_enter, std::function< void()> on_leave)
 Wrap a component. Uses callbacks.
 
Component Hoverable (Component component, std::function< void(bool)> on_change)
 Wrap a component. Gives the ability to know if it is hovered by the mouse.
 
ComponentDecorator Hoverable (bool *hover)
 Wrap a component. Gives the ability to know if it is hovered by the mouse.
 
ComponentDecorator Hoverable (std::function< void()> on_enter, std::function< void()> on_leave)
 Wrap a component. Gives the ability to know if it is hovered by the mouse.
 
ComponentDecorator Hoverable (std::function< void(bool)> on_change)
 Wrap a component. Gives the ability to know if it is hovered by the mouse.
 
Component Window (WindowOptions option)
 A draggeable / resizeable window. To use multiple of them, they must be stacked using Container::Stacked({...}) component;.
 
+
+
+ + + + + diff --git a/component_8hpp.js b/component_8hpp.js new file mode 100644 index 000000000..2e9987b6d --- /dev/null +++ b/component_8hpp.js @@ -0,0 +1,61 @@ +var component_8hpp = +[ + [ "ComponentDecorator", "component_8hpp.html#af07b496fe512e3a4863ee546f19e9a6c", null ], + [ "ElementDecorator", "component_8hpp.html#a2d5012891073dbf196bfada5f702f382", null ], + [ "Make", "component_8hpp.html#a2b8973dc71334f1d98e2e6f55de8b5ae", null ], + [ "operator|", "component_8hpp.html#a65a2e15f64ae3bc205c485abc3a5aeb9", null ], + [ "operator|", "component_8hpp.html#a9c4cf8bcb7012f740b146bfe89cbd3eb", null ], + [ "operator|=", "component_8hpp.html#ade35e69d695327db85be01c9787c39f8", null ], + [ "operator|=", "component_8hpp.html#aa480c58bcaeae204fbe68b192c5ede92", null ], + [ "Vertical", "component_8hpp.html#ga6471e39f5664d059144746c5801d37e6", null ], + [ "Vertical", "component_8hpp.html#ga25099e2d2ead8a46c8d9a899982070b7", null ], + [ "Horizontal", "component_8hpp.html#ga01563bae9454fe64c0b29b0eb3755e68", null ], + [ "Horizontal", "component_8hpp.html#ga337564f8a13c98222025d8fe7e47df4c", null ], + [ "Tab", "component_8hpp.html#gaea9fe244eeeb420276bcc5760b46953d", null ], + [ "Stacked", "component_8hpp.html#gaafd394665b0c231380a143b810339d8e", null ], + [ "Button", "component_8hpp.html#ga4e8295ec77dd31b0acc5063b134473e7", null ], + [ "Button", "component_8hpp.html#ga0488e28ee9388e0ddca26f1d03d827d1", null ], + [ "Checkbox", "component_8hpp.html#gae0d441d2c83740f187f62db566bbefcd", null ], + [ "Checkbox", "component_8hpp.html#ga5e9dbb03c44d549f10c96f134269366f", null ], + [ "Input", "component_8hpp.html#ga7f285fcbc4dd0a0767b89a255fd062dc", null ], + [ "Input", "component_8hpp.html#ga9d118d596e33bf5bee9d5eccb6265d15", null ], + [ "Input", "component_8hpp.html#ga82ba18065d2c29514f034c7278dead74", null ], + [ "Menu", "component_8hpp.html#ga27828fc39da10a18478ba84b1b162039", null ], + [ "Menu", "component_8hpp.html#gad793a3a507766ffa711c4332a3815e24", null ], + [ "MenuEntry", "component_8hpp.html#ga2c0a27959e6a5d90109f6d4506e00f69", null ], + [ "MenuEntry", "component_8hpp.html#gafca94c5cdae5fbf3c6aa81fc1cd7b1c0", null ], + [ "Radiobox", "component_8hpp.html#ga3e7a44f321fa910f07aef5879e67af95", null ], + [ "Radiobox", "component_8hpp.html#gac73eebf15ff6b5386b7ee6c6cb4a4890", null ], + [ "Dropdown", "component_8hpp.html#gaa22bddff4aeed66e20f30d0715596999", null ], + [ "Dropdown", "component_8hpp.html#gaa4b353566017558bac648ee1409930de", null ], + [ "Toggle", "component_8hpp.html#ga3537fccac66b07cd792874c9a6086811", null ], + [ "Slider", "component_8hpp.html#aa3558d992a72679e5e9c9c7b67abd727", null ], + [ "Slider", "component_8hpp.html#gafdce74ff1421c2f1bda336c8dacefcbd", null ], + [ "Slider", "component_8hpp.html#a8bfa2757905a4fb50e0ec263976d1f96", null ], + [ "Slider", "component_8hpp.html#aba34419b025c881c07808816c81c5230", null ], + [ "ResizableSplit", "component_8hpp.html#a5ce41caeafc35dedc5c7da5347386e80", null ], + [ "ResizableSplitLeft", "component_8hpp.html#gae2205fc172615b43e1e3307bb614be4c", null ], + [ "ResizableSplitRight", "component_8hpp.html#ga9030d0beb64f653603cab382b02750a8", null ], + [ "ResizableSplitTop", "component_8hpp.html#ga238b4b650aca14716b82b2198695e008", null ], + [ "ResizableSplitBottom", "component_8hpp.html#gacb75e6e61a021829893f7b57aeb7e3a2", null ], + [ "Renderer", "component_8hpp.html#ga533e883e2aeea28de2b60564fcaf0361", null ], + [ "Renderer", "component_8hpp.html#gaf03d3df7243bf71bb1a73686628f7f2b", null ], + [ "Renderer", "component_8hpp.html#ga099cb57274a99396ee10f38acbfe62a7", null ], + [ "Renderer", "component_8hpp.html#ga41d63b7af41dee1570b54915821abd30", null ], + [ "CatchEvent", "component_8hpp.html#afa5872ba3f9889c7487e57e745e56857", null ], + [ "CatchEvent", "component_8hpp.html#gad2948235799c010c76c6de861c050c59", null ], + [ "Maybe", "component_8hpp.html#ga20b66a70c1cd4ff3f0ff571a4507d2b4", null ], + [ "Maybe", "component_8hpp.html#ga70afe9695167fb736631173201969730", null ], + [ "Maybe", "component_8hpp.html#ga83b6fd5e1524023722a7450f987f15d0", null ], + [ "Maybe", "component_8hpp.html#gae39ad8b223e6bb7704c77a3708571a7d", null ], + [ "Modal", "component_8hpp.html#ga5185342fbba215496cb8a6805f36089c", null ], + [ "Modal", "component_8hpp.html#ga5babae0bb25f8cada57784cc5d27fb74", null ], + [ "Collapsible", "component_8hpp.html#a760cd5eb9a72c008ca18f1e6b366c796", null ], + [ "Hoverable", "component_8hpp.html#ga562d984d3830d63285643565cd55d16f", null ], + [ "Hoverable", "component_8hpp.html#ga92ec2f5ccb509da2e2c24ae6a1f6b12b", null ], + [ "Hoverable", "component_8hpp.html#ga91cac81077c483efdb952268aee9a523", null ], + [ "Hoverable", "component_8hpp.html#ga9d94b37352be13d3551a9d5785f75439", null ], + [ "Hoverable", "component_8hpp.html#ga34adfc9c76cf3603156cba32ad5d7142", null ], + [ "Hoverable", "component_8hpp.html#gafd7cbaef5378a907111a64ee69aed56a", null ], + [ "Window", "component_8hpp.html#ga638693abef9289912f5fa39606390b20", null ] +]; \ No newline at end of file diff --git a/component_8hpp_source.html b/component_8hpp_source.html new file mode 100644 index 000000000..7abebc0b4 --- /dev/null +++ b/component_8hpp_source.html @@ -0,0 +1,406 @@ + + + + + + + + +FTXUI: component.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
component.hpp
+
+
+Go to the documentation of this file.
1// Copyright 2021 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#ifndef FTXUI_COMPONENT_HPP
+
5#define FTXUI_COMPONENT_HPP
+
6
+
7#include <functional> // for function
+
8#include <memory> // for make_shared, shared_ptr
+
9#include <utility> // for forward
+
10
+ +
12#include "ftxui/component/component_base.hpp" // for Component, Components
+
13#include "ftxui/component/component_options.hpp" // for ButtonOption, CheckboxOption, MenuOption
+
14#include "ftxui/dom/elements.hpp" // for Element
+
15#include "ftxui/util/ref.hpp" // for ConstRef, Ref, ConstStringRef, ConstStringListRef, StringRef
+
16
+
17namespace ftxui {
+
18struct ButtonOption;
+
19struct CheckboxOption;
+
20struct Event;
+
21struct InputOption;
+
22struct MenuOption;
+
23struct RadioboxOption;
+
24struct MenuEntryOption;
+
25
+
26template <class T, class... Args>
+
+
27std::shared_ptr<T> Make(Args&&... args) {
+
28 return std::make_shared<T>(std::forward<Args>(args)...);
+
29}
+
+
30
+
31// Pipe operator to decorate components.
+
32using ComponentDecorator = std::function<Component(Component)>;
+
33using ElementDecorator = std::function<Element(Element)>;
+ +
35Component operator|(Component component, ElementDecorator decorator);
+
36Component& operator|=(Component& component, ComponentDecorator decorator);
+
37Component& operator|=(Component& component, ElementDecorator decorator);
+
38
+
+
39namespace Container {
+ +
41Component Vertical(Components children, int* selector);
+ +
43Component Horizontal(Components children, int* selector);
+
44Component Tab(Components children, int* selector);
+ +
46} // namespace Container
+
+
47
+ + +
50 std::function<void()> on_click,
+ +
52
+ + +
55 bool* checked,
+ +
57
+
58Component Input(InputOption options = {});
+
59Component Input(StringRef content, InputOption options = {});
+
60Component Input(StringRef content,
+
61 StringRef placeholder,
+
62 InputOption options = {});
+
63
+
64Component Menu(MenuOption options);
+
65Component Menu(ConstStringListRef entries,
+
66 int* selected_,
+
67 MenuOption options = MenuOption::Vertical());
+
68Component MenuEntry(MenuEntryOption options);
+
69Component MenuEntry(ConstStringRef label, MenuEntryOption options = {});
+
70
+
71Component Radiobox(RadioboxOption options);
+
72Component Radiobox(ConstStringListRef entries,
+
73 int* selected_,
+
74 RadioboxOption options = {});
+
75
+
76Component Dropdown(ConstStringListRef entries, int* selected);
+
77Component Dropdown(DropdownOption options);
+
78
+
79Component Toggle(ConstStringListRef entries, int* selected);
+
80
+
81// General slider constructor:
+
82template <typename T>
+
83Component Slider(SliderOption<T> options);
+
84
+
85// Shorthand without the `SliderOption` constructor:
+
86Component Slider(ConstStringRef label,
+
87 Ref<int> value,
+
88 ConstRef<int> min = 0,
+
89 ConstRef<int> max = 100,
+
90 ConstRef<int> increment = 5);
+
91Component Slider(ConstStringRef label,
+
92 Ref<float> value,
+
93 ConstRef<float> min = 0.f,
+
94 ConstRef<float> max = 100.f,
+
95 ConstRef<float> increment = 5.f);
+
96Component Slider(ConstStringRef label,
+
97 Ref<long> value,
+
98 ConstRef<long> min = 0L,
+
99 ConstRef<long> max = 100L,
+
100 ConstRef<long> increment = 5L);
+
101
+
102Component ResizableSplit(ResizableSplitOption options);
+ + +
105Component ResizableSplitTop(Component main, Component back, int* main_size);
+ +
107
+
108Component Renderer(Component child, std::function<Element()>);
+
109Component Renderer(std::function<Element()>);
+
110Component Renderer(std::function<Element(bool /* focused */)>);
+ +
112
+
113Component CatchEvent(Component child, std::function<bool(Event)>);
+
114ComponentDecorator CatchEvent(std::function<bool(Event)> on_event);
+
115
+
116Component Maybe(Component, const bool* show);
+
117Component Maybe(Component, std::function<bool()>);
+
118ComponentDecorator Maybe(const bool* show);
+
119ComponentDecorator Maybe(std::function<bool()>);
+
120
+
121Component Modal(Component main, Component modal, const bool* show_modal);
+
122ComponentDecorator Modal(Component modal, const bool* show_modal);
+
123
+ +
125 Component child,
+
126 Ref<bool> show = false);
+
127
+
128Component Hoverable(Component component, bool* hover);
+ +
130 std::function<void()> on_enter,
+
131 std::function<void()> on_leave);
+
132Component Hoverable(Component component, //
+
133 std::function<void(bool)> on_change);
+
134ComponentDecorator Hoverable(bool* hover);
+
135ComponentDecorator Hoverable(std::function<void()> on_enter,
+
136 std::function<void()> on_leave);
+
137ComponentDecorator Hoverable(std::function<void(bool)> on_change);
+
138
+ +
140
+
141} // namespace ftxui
+
142
+
143#endif /* end of include guard: FTXUI_COMPONENT_HPP */
+
An adapter. Own or reference a constant string. For convenience, this class convert multiple immutabl...
Definition ref.hpp:94
+
An adapter. Own or reference an mutable object.
Definition ref.hpp:46
+ + + + +
static CheckboxOption Simple()
Option for standard Checkbox.
+
static ButtonOption Simple()
Create a ButtonOption, inverted when focused.
+
static MenuOption Vertical()
Standard options for a vertical menu. This can be useful to implement a list of selectable items.
+
Component Horizontal(Components children)
A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow...
+
Component Maybe(Component, const bool *show)
Decorate a component |child|. It is shown only when |show| is true.
+
Component ResizableSplitTop(Component main, Component back, int *main_size)
An vertical split in between two components, configurable using the mouse.
+
Component Menu(MenuOption options)
A list of text. The focused element is selected.
+
Component MenuEntry(MenuEntryOption options)
A specific menu entry. They can be put into a Container::Vertical to form a menu.
+
Component Toggle(ConstStringListRef entries, int *selected)
An horizontal list of elements. The user can navigate through them.
+
Component Radiobox(RadioboxOption options)
A list of element, where only one can be selected.
+
Component Button(ButtonOption options)
Draw a button. Execute a function when clicked.
+
Component Modal(Component main, Component modal, const bool *show_modal)
Definition modal.cpp:18
+
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
+
Component Hoverable(Component component, bool *hover)
Wrap a component. Gives the ability to know if it is hovered by the mouse.
Definition hoverable.cpp:43
+
Component Window(WindowOptions option)
A draggeable / resizeable window. To use multiple of them, they must be stacked using Container::Stac...
+
Component Vertical(Components children)
A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
+
Component Input(InputOption options={})
An input box for editing text.
+
Component ResizableSplitRight(Component main, Component back, int *main_size)
An horizontal split in between two components, configurable using the mouse.
+
Component Dropdown(ConstStringListRef entries, int *selected)
A dropdown menu.
+
Component Stacked(Components children)
A list of components to be stacked on top of each other. Events are propagated to the first component...
+
Component ResizableSplitBottom(Component main, Component back, int *main_size)
An vertical split in between two components, configurable using the mouse.
+
Component Checkbox(CheckboxOption options)
Draw checkable element.
+
Component ResizableSplitLeft(Component main, Component back, int *main_size)
An horizontal split in between two components, configurable using the mouse.
+
Component Tab(Components children, int *selector)
A list of components, where only one is drawn and interacted with at a time. The |selector| gives the...
+
Option for the AnimatedButton component.
+
Option for the Checkbox component.
+
Represent an event. It can be key press event, a terminal resize, or more ...
Definition event.hpp:29
+
Option for the Input component.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< T > Make(Args &&... args)
Definition component.hpp:27
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+
std::function< Element(Element)> ElementDecorator
Definition component.hpp:33
+
std::vector< Component > Components
+
Component ResizableSplit(ResizableSplitOption options)
A split in between two components.
+
Component operator|(Component component, ComponentDecorator decorator)
+
Component Collapsible(ConstStringRef label, Component child, Ref< bool > show=false)
A collapsible component. It displays a checkbox with an arrow. Once activated, the child is displayed...
+
Component Slider(SliderOption< T > options)
A slider in any direction.
+
Component & operator|=(Component &component, ComponentDecorator decorator)
+
std::function< Component(Component)> ComponentDecorator
Definition component.hpp:32
+
std::shared_ptr< ComponentBase > Component
+
Component CatchEvent(Component child, std::function< bool(Event)>)
+ + + +
+
+ + + + + diff --git a/component__base_8cppm.html b/component__base_8cppm.html new file mode 100644 index 000000000..332f4b161 --- /dev/null +++ b/component__base_8cppm.html @@ -0,0 +1,223 @@ + + + + + + + + +FTXUI: component_base.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
component_base.cppm File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
namespace  ftxui::animation
 The FTXUI ftxui::animation:: namespace.
 
+
+
+ + + + + diff --git a/component__base_8cppm_source.html b/component__base_8cppm_source.html new file mode 100644 index 000000000..1ec463811 --- /dev/null +++ b/component__base_8cppm_source.html @@ -0,0 +1,243 @@ + + + + + + + + +FTXUI: component_base.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
component_base.cppm
+
+
+Go to the documentation of this file.
1/// @module ftxui.component.component_base
+
2/// @brief Module file for the ComponentBase class of the Component module
+
3
+
4module;
+
5
+ +
7
+ +
9
+
10/**
+
11 * @namespace ftxui
+
12 * @brief The FTXUI ftxui:: namespace
+
13 */
+
14export namespace ftxui {
+
15 using ftxui::Delegate;
+
16 using ftxui::Focus;
+
17 using ftxui::Event;
+
18
+
19 namespace animation {
+ +
21 }
+
22
+ +
24 using ftxui::Component;
+ +
26}
+ + +
It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ft...
+
Represent an event. It can be key press event, a terminal resize, or more ...
Definition event.hpp:29
+
Module file for the ComponentBase class of the Component module.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::vector< Component > Components
+
std::shared_ptr< ComponentBase > Component
+
+
+ + + + + diff --git a/component__base_8hpp.html b/component__base_8hpp.html new file mode 100644 index 000000000..0c6f871dc --- /dev/null +++ b/component__base_8hpp.html @@ -0,0 +1,238 @@ + + + + + + + + +FTXUI: component_base.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
component_base.hpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Classes

class  ComponentBase
 It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ftxui::Event. More...
 
+ + + + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
namespace  ftxui::animation
 The FTXUI ftxui::animation:: namespace.
 
+ + + + + +

+Typedefs

using Component = std::shared_ptr<ComponentBase>
 
using Components = std::vector<Component>
 
+
+
+ + + + + diff --git a/component__base_8hpp.js b/component__base_8hpp.js new file mode 100644 index 000000000..08d3e93db --- /dev/null +++ b/component__base_8hpp.js @@ -0,0 +1,5 @@ +var component__base_8hpp = +[ + [ "Component", "component__base_8hpp.html#af1479ede01dbf087342534ab4ada11d3", null ], + [ "Components", "component__base_8hpp.html#a3d4ccad0c8a07d5b0cb4b2e690ffc90c", null ] +]; \ No newline at end of file diff --git a/component__base_8hpp_source.html b/component__base_8hpp_source.html new file mode 100644 index 000000000..789441e0c --- /dev/null +++ b/component__base_8hpp_source.html @@ -0,0 +1,354 @@ + + + + + + + + +FTXUI: component_base.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
component_base.hpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#ifndef FTXUI_COMPONENT_BASE_HPP
+
5#define FTXUI_COMPONENT_BASE_HPP
+
6
+
7#include <memory> // for unique_ptr
+
8#include <vector> // for vector
+
9
+
10#include "ftxui/component/captured_mouse.hpp" // for CaptureMouse
+
11#include "ftxui/dom/elements.hpp" // for Element
+
12
+
13namespace ftxui {
+
14
+
15class Delegate;
+
16class Focus;
+
17struct Event;
+
18
+
19namespace animation {
+
20class Params;
+
21} // namespace animation
+
22
+
23class ComponentBase;
+
24using Component = std::shared_ptr<ComponentBase>;
+
25using Components = std::vector<Component>;
+
26
+
27/// @brief It implement rendering itself as ftxui::Element. It implement
+
28/// keyboard navigation by responding to ftxui::Event.
+
29/// @ingroup component
+
+ +
31 public:
+
+
32 explicit ComponentBase(Components children)
+
33 : children_(std::move(children)) {}
+
+
34 virtual ~ComponentBase();
+
35 ComponentBase() = default;
+
36
+
37 // A component is not copyable/movable.
+
38 ComponentBase(const ComponentBase&) = delete;
+ + + +
42
+
43 // Component hierarchy:
+
44 ComponentBase* Parent() const;
+
45 Component& ChildAt(size_t i);
+
46 size_t ChildCount() const;
+
47 int Index() const;
+
48 void Add(Component children);
+
49 void Detach();
+
50 void DetachAllChildren();
+
51
+
52 // Renders the component.
+ +
54
+
55 // Override this function modify how `Render` works.
+
56 virtual Element OnRender();
+
57
+
58 // Handles an event.
+
59 // By default, reduce on children with a lazy OR.
+
60 //
+
61 // Returns whether the event was handled or not.
+
62 virtual bool OnEvent(Event);
+
63
+
64 // Handle an animation step.
+
65 virtual void OnAnimation(animation::Params& params);
+
66
+
67 // Focus management ----------------------------------------------------------
+
68 //
+
69 // If this component contains children, this indicates which one is active,
+
70 // nullptr if none is active.
+
71 //
+
72 // We say an element has the focus if the chain of ActiveChild() from the
+
73 // root component contains this object.
+
74 virtual Component ActiveChild();
+
75
+
76 // Return true when the component contains focusable elements.
+
77 // The non focusable Component will be skipped when navigating using the
+
78 // keyboard.
+
79 virtual bool Focusable() const;
+
80
+
81 // Whether this is the active child of its parent.
+
82 bool Active() const;
+
83 // Whether all the ancestors are active.
+
84 bool Focused() const;
+
85
+
86 // Make the |child| to be the "active" one.
+
87 virtual void SetActiveChild(ComponentBase* child);
+
88 void SetActiveChild(Component child);
+
89
+
90 // Configure all the ancestors to give focus to this component.
+
91 void TakeFocus();
+
92
+
93 protected:
+
94 CapturedMouse CaptureMouse(const Event& event);
+
95
+ +
97
+
98 private:
+
99 ComponentBase* parent_ = nullptr;
+
100 bool in_render = false;
+
101};
+
+
102
+
103} // namespace ftxui
+
104
+
105#endif /* end of include guard: FTXUI_COMPONENT_BASE_HPP */
+ + + +
virtual bool Focusable() const
Return true when the component contains focusable elements. The non focusable Components will be skip...
+
bool Focused() const
Returns if the elements if focused by the user. True when the ComponentBase is focused by the user....
+
CapturedMouse CaptureMouse(const Event &event)
Take the CapturedMouse if available. There is only one component of them. It represents a component t...
+
void Add(Component children)
Add a child. @param child The child to be attached.
Definition component.cpp:70
+ +
Element Render()
Draw the component. Build a ftxui::Element to be drawn on the ftxui::Screen representing this ftxui::...
+
void TakeFocus()
Configure all the ancestors to give focus to this component.
+
bool Active() const
Returns if the element if the currently active child of its parent.
+
virtual Component ActiveChild()
Return the currently Active child.
+
void DetachAllChildren()
Remove all children.
Definition component.cpp:94
+
virtual void SetActiveChild(ComponentBase *child)
Make the |child| to be the "active" one.
+
int Index() const
Return index of the component in its parent. -1 if no parent.
Definition component.cpp:54
+
size_t ChildCount() const
Returns the number of children.
Definition component.cpp:49
+
ComponentBase(ComponentBase &&)=delete
+
ComponentBase & operator=(ComponentBase &&)=delete
+
ComponentBase * Parent() const
Return the parent ComponentBase, or nul if any.
Definition component.cpp:38
+
virtual Element OnRender()
Draw the component. Build a ftxui::Element to be drawn on the ftxi::Screen representing this ftxui::C...
+
virtual bool OnEvent(Event)
Called in response to an event.
+
void Detach()
Detach this child from its parent.
Definition component.cpp:79
+
ComponentBase(const ComponentBase &)=delete
+
ComponentBase & operator=(const ComponentBase &)=delete
+ +
Component & ChildAt(size_t i)
Access the child at index i.
Definition component.cpp:43
+
ComponentBase(Components children)
+
virtual ~ComponentBase()
Definition component.cpp:31
+
virtual void OnAnimation(animation::Params &params)
Called in response to an animation event.
+
It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ft...
+
Represent an event. It can be key press event, a terminal resize, or more ...
Definition event.hpp:29
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::unique_ptr< CapturedMouseInterface > CapturedMouse
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+
std::vector< Component > Components
+
std::shared_ptr< ComponentBase > Component
+
+
+ + + + + diff --git a/component__examples_8md.html b/component__examples_8md.html new file mode 100644 index 000000000..31f8a2e1d --- /dev/null +++ b/component__examples_8md.html @@ -0,0 +1,209 @@ + + + + + + + + +FTXUI: component_examples.md File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
component_examples.md File Reference
+
+
+
+
+ + + + + diff --git a/component__fuzzer_8cpp.html b/component__fuzzer_8cpp.html new file mode 100644 index 000000000..9c925b155 --- /dev/null +++ b/component__fuzzer_8cpp.html @@ -0,0 +1,243 @@ + + + + + + + + +FTXUI: component_fuzzer.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
component_fuzzer.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int LLVMFuzzerTestOneInput (const char *data, size_t size)
 
+

Function Documentation

+ +

◆ LLVMFuzzerTestOneInput()

+ +
+
+ + + + + + + + + + + +
int LLVMFuzzerTestOneInput (const char * data,
size_t size )
+
+ +

Definition at line 197 of file component_fuzzer.cpp.

+ +
+
+
+
+ + + + + diff --git a/component__fuzzer_8cpp.js b/component__fuzzer_8cpp.js new file mode 100644 index 000000000..7e7930645 --- /dev/null +++ b/component__fuzzer_8cpp.js @@ -0,0 +1,4 @@ +var component__fuzzer_8cpp = +[ + [ "LLVMFuzzerTestOneInput", "component__fuzzer_8cpp.html#af5589fffd86439465eeb19c9774d1982", null ] +]; \ No newline at end of file diff --git a/component__fuzzer_8cpp_source.html b/component__fuzzer_8cpp_source.html new file mode 100644 index 000000000..98766aefc --- /dev/null +++ b/component__fuzzer_8cpp_source.html @@ -0,0 +1,500 @@ + + + + + + + + +FTXUI: component_fuzzer.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
component_fuzzer.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2021 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <cassert>
+ +
6#include <vector>
+ + +
9
+
10using namespace ftxui;
+
11namespace {
+
12
+
13bool GeneratorBool(const char*& data, size_t& size) {
+
14 if (size == 0) {
+
15 return false;
+
16 }
+
17
+
18 auto out = bool(data[0] % 2);
+
19 data++;
+
20 size--;
+
21 return out;
+
22}
+
23
+
24std::string GeneratorString(const char*& data, size_t& size) {
+
25 int index = 0;
+
26 while (index < size && data[index]) {
+
27 ++index;
+
28 }
+
29
+
30 auto out = std::string(data, data + index);
+
31 data += index;
+
32 size -= index;
+
33
+
34 // The input component do not support invalid UTF8 yet.
+
35 try {
+
36 to_wstring(out);
+
37 } catch (...) {
+
38 return "0";
+
39 }
+
40 return std::move(out);
+
41}
+
42
+
43int GeneratorInt(const char* data, size_t size) {
+
44 if (size == 0) {
+
45 return 0;
+
46 }
+
47 auto out = int(data[0]);
+
48 data++;
+
49 size--;
+
50 return out;
+
51}
+
52
+
53Color GeneratorColor(const char* data, size_t size) {
+
54 return Color::RGB(GeneratorInt(data, size), GeneratorInt(data, size),
+
55 GeneratorInt(data, size));
+
56}
+
57
+
58AnimatedColorOption GeneratorAnimatedColorOption(const char* data,
+
59 size_t size) {
+ +
61 option.enabled = GeneratorBool(data, size);
+
62 option.inactive = GeneratorColor(data, size);
+
63 option.active = GeneratorColor(data, size);
+
64 option.duration = std::chrono::milliseconds(GeneratorInt(data, size));
+
65 return option;
+
66}
+
67
+
68AnimatedColorsOption GeneratorAnimatedColorsOptions(const char* data,
+
69 size_t size) {
+ +
71 option.background = GeneratorAnimatedColorOption(data, size);
+
72 option.foreground = GeneratorAnimatedColorOption(data, size);
+
73 return option;
+
74}
+
75
+
76ButtonOption GeneratorButtonOption(const char* data, size_t size) {
+
77 ButtonOption option;
+
78 option.animated_colors = GeneratorAnimatedColorsOptions(data, size);
+
79 return option;
+
80}
+
81
+
82UnderlineOption GeneratorUnderlineOption(const char* data, size_t size) {
+
83 UnderlineOption option;
+
84 option.enabled = GeneratorBool(data, size);
+
85 option.color_active = GeneratorColor(data, size);
+
86 option.color_inactive = GeneratorColor(data, size);
+
87 option.leader_duration = std::chrono::milliseconds(GeneratorInt(data, size));
+
88 option.follower_duration =
+
89 std::chrono::milliseconds(GeneratorInt(data, size));
+
90 option.leader_delay = std::chrono::milliseconds(GeneratorInt(data, size));
+
91 option.follower_delay = std::chrono::milliseconds(GeneratorInt(data, size));
+
92 return option;
+
93}
+
94
+
95MenuEntryOption GeneratorMenuEntryOption(const char* data, size_t size) {
+
96 MenuEntryOption option;
+
97 option.animated_colors = GeneratorAnimatedColorsOptions(data, size);
+
98 return option;
+
99}
+
100
+
101MenuOption GeneratorMenuOption(const char* data, size_t size) {
+
102 MenuOption option;
+
103 option.underline = GeneratorUnderlineOption(data, size);
+
104 option.entries_option = GeneratorMenuEntryOption(data, size);
+
105 option.direction = static_cast<Direction>(GeneratorInt(data, size) % 4);
+
106 return option;
+
107}
+
108
+
109bool g_bool;
+
110int g_int;
+
111std::vector<std::string> g_list;
+
112
+
113Components GeneratorComponents(const char*& data, size_t& size, int depth);
+
114
+
115Component GeneratorComponent(const char*& data, size_t& size, int depth) {
+
116 depth--;
+
117 int value = GeneratorInt(data, size);
+
118 if (depth <= 0) {
+
119 return Button(GeneratorString(data, size), [] {});
+
120 }
+
121
+
122 constexpr int value_max = 19;
+
123 value = (value % value_max + value_max) % value_max;
+
124 switch (value) {
+
125 case 0:
+
126 return Button(
+
127 GeneratorString(data, size), [] {},
+
128 GeneratorButtonOption(data, size));
+
129 case 1:
+
130 return Checkbox(GeneratorString(data, size), &g_bool);
+
131 case 2:
+
132 return Input(GeneratorString(data, size), GeneratorString(data, size));
+
133 case 3:
+
134 return Menu(&g_list, &g_int, GeneratorMenuOption(data, size));
+
135 case 4:
+
136 return Radiobox(&g_list, &g_int);
+
137 case 5:
+
138 return Toggle(&g_list, &g_int);
+
139 case 6:
+
140 return Slider(GeneratorString(data, size), &g_int,
+
141 GeneratorInt(data, size), GeneratorInt(data, size),
+
142 GeneratorInt(data, size));
+
143 case 7:
+
144 return ResizableSplitLeft(GeneratorComponent(data, size, depth - 1),
+
145 GeneratorComponent(data, size, depth - 1),
+
146 &g_int);
+
147 case 8:
+
148 return ResizableSplitRight(GeneratorComponent(data, size, depth - 1),
+
149 GeneratorComponent(data, size, depth - 1),
+
150 &g_int);
+
151 case 9:
+
152 return ResizableSplitTop(GeneratorComponent(data, size, depth - 1),
+
153 GeneratorComponent(data, size, depth - 1),
+
154 &g_int);
+
155 case 10:
+
156 return ResizableSplitBottom(GeneratorComponent(data, size, depth - 1),
+
157 GeneratorComponent(data, size, depth - 1),
+
158 &g_int);
+
159 case 11:
+
160 return Container::Vertical(GeneratorComponents(data, size, depth - 1));
+
161
+
162 case 12:
+
163 return Container::Vertical(GeneratorComponents(data, size, depth - 1),
+
164 &g_int);
+
165
+
166 case 13:
+
167 return Container::Horizontal(GeneratorComponents(data, size, depth - 1));
+
168 case 14:
+
169 return Container::Horizontal(GeneratorComponents(data, size, depth - 1),
+
170 &g_int);
+
171 case 15:
+
172 return Container::Tab(GeneratorComponents(data, size, depth - 1), &g_int);
+
173 case 16:
+
174 return Maybe(GeneratorComponent(data, size, depth - 1), &g_bool);
+
175 case 17:
+
176 return Dropdown(&g_list, &g_int);
+
177 case 18:
+
178 return Collapsible(GeneratorString(data, size),
+
179 GeneratorComponent(data, size, depth - 1),
+
180 GeneratorBool(data, size));
+
181 default:
+
182 assert(false);
+
183 }
+
184}
+
185
+
186Components GeneratorComponents(const char*& data, size_t& size, int depth) {
+
187 Components out;
+
188 if (depth > 0) {
+
189 while (size && GeneratorInt(data, size) % 2) {
+
190 out.push_back(GeneratorComponent(data, size, depth - 1));
+
191 }
+
192 }
+
193 return std::move(out);
+
194}
+
195
+
196} // namespace
+
+
197extern "C" int LLVMFuzzerTestOneInput(const char* data, size_t size) {
+
198 g_bool = GeneratorBool(data, size);
+
199 g_int = GeneratorInt(data, size);
+
200 g_list = {
+
201 "test_1", "test_2", "test_3", "test_4", "test_5",
+
202 };
+
203
+
204 int depth = 10;
+
205 auto component = GeneratorComponent(data, size, depth);
+
206
+
207 int width = GeneratorInt(data, size);
+
208 int height = GeneratorInt(data, size);
+
209
+
210 width %= 500;
+
211 width += 500;
+
212
+
213 height %= 500;
+
214 height += 500;
+
215
+
216 auto screen =
+
217 Screen::Create(Dimension::Fixed(width), Dimension::Fixed(height));
+
218
+
219 // Generate some events.
+
220 std::vector<Event> events;
+
221 auto parser =
+
222 TerminalInputParser([&](const Event& event) { events.push_back(event); });
+
223
+
224 for (size_t i = 0; i < size; ++i) {
+
225 parser.Add(data[i]);
+
226 }
+
227
+
228 for (const auto& event : events) {
+
229 component->OnEvent(event);
+
230 auto document = component->Render();
+
231 Render(screen, document);
+
232 }
+
233 return 0; // Non-zero return values are reserved for future use.
+
234}
+
+ + +
int LLVMFuzzerTestOneInput(const char *data, size_t size)
+ +
animation::Duration follower_duration
+
MenuEntryOption entries_option
+
animation::Duration follower_delay
+ +
UnderlineOption underline
+ + +
animation::Duration leader_duration
+ + + +
AnimatedColorsOption animated_colors
+ +
animation::Duration leader_delay
+
Component Horizontal(Components children)
A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow...
+
Component Maybe(Component, const bool *show)
Decorate a component |child|. It is shown only when |show| is true.
+
Component ResizableSplitTop(Component main, Component back, int *main_size)
An vertical split in between two components, configurable using the mouse.
+
Component Menu(MenuOption options)
A list of text. The focused element is selected.
+
Component Toggle(ConstStringListRef entries, int *selected)
An horizontal list of elements. The user can navigate through them.
+
Component Radiobox(RadioboxOption options)
A list of element, where only one can be selected.
+
Component Button(ButtonOption options)
Draw a button. Execute a function when clicked.
+
Component Vertical(Components children)
A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
+
Component Input(InputOption options={})
An input box for editing text.
+
Component ResizableSplitRight(Component main, Component back, int *main_size)
An horizontal split in between two components, configurable using the mouse.
+
Component Dropdown(ConstStringListRef entries, int *selected)
A dropdown menu.
+
Component ResizableSplitBottom(Component main, Component back, int *main_size)
An vertical split in between two components, configurable using the mouse.
+
Component Checkbox(CheckboxOption options)
Draw checkable element.
+
Component ResizableSplitLeft(Component main, Component back, int *main_size)
An horizontal split in between two components, configurable using the mouse.
+
Component Tab(Components children, int *selector)
A list of components, where only one is drawn and interacted with at a time. The |selector| gives the...
+
Option about a potentially animated color.
+
Option for the AnimatedButton component.
+
Represent an event. It can be key press event, a terminal resize, or more ...
Definition event.hpp:29
+
Option for the MenuEntry component.
+
Option for the Menu component.
+
Option for the underline effect.
+
Decorator size(WidthOrHeight, Constraint, int value)
Apply a constraint on the size of an element.
+
Direction
Direction is an enumeration that represents the four cardinal directions.
Definition direction.hpp:13
+
void Render(Screen &screen, const Element &element)
Display an element on a ftxui::Screen.
Definition node.cpp:84
+
static Screen Create(Dimensions dimension)
Create a screen with the given dimension.
Definition screen.cpp:395
+
static Color RGB(uint8_t red, uint8_t green, uint8_t blue)
Build a Color from its RGB representation. https://en.wikipedia.org/wiki/RGB_color_model.
+
Color is a class that represents a color in the terminal user interface.
Definition color.hpp:22
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::vector< Component > Components
+
std::wstring to_wstring(const std::string &s)
Convert a UTF8 std::string into a std::wstring.
Definition string.cpp:1638
+
Component Collapsible(ConstStringRef label, Component child, Ref< bool > show=false)
A collapsible component. It displays a checkbox with an arrow. Once activated, the child is displayed...
+
Component Slider(SliderOption< T > options)
A slider in any direction.
+
std::shared_ptr< ComponentBase > Component
+ + + + +
+
+ + + + + diff --git a/component__options_8cpp.html b/component__options_8cpp.html new file mode 100644 index 000000000..ab248337d --- /dev/null +++ b/component__options_8cpp.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: component_options.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
component_options.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+
+
+ + + + + diff --git a/component__options_8cpp_source.html b/component__options_8cpp_source.html new file mode 100644 index 000000000..9edc39225 --- /dev/null +++ b/component__options_8cpp_source.html @@ -0,0 +1,657 @@ + + + + + + + + +FTXUI: component_options.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
component_options.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2022 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+ +
5
+
6#include <ftxui/screen/color.hpp> // for Color, Color::White, Color::Black, Color::GrayDark, Color::Blue, Color::GrayLight, Color::Red
+
7#include <memory> // for shared_ptr
+
8#include <utility> // for move
+
9#include "ftxui/component/animation.hpp" // for Function, Duration
+ +
11#include "ftxui/dom/elements.hpp" // for operator|=, Element, text, bgcolor, inverted, bold, dim, operator|, color, borderEmpty, hbox, automerge, border, borderLight
+
12
+
13namespace ftxui {
+
14
+
15/// @brief A color option that can be animated.
+
16/// @params _inactive The color when the component is inactive.
+
17/// @params _active The color when the component is active.
+
18/// @params _duration The duration of the animation.
+
19/// @params _function The easing function of the animation.
+
+ +
21 Color _active,
+
22 animation::Duration _duration,
+ +
24 enabled = true;
+
25 inactive = _inactive;
+
26 active = _active;
+
27 duration = _duration;
+
28 function = std::move(_function);
+
29}
+
+
30
+
31/// @brief Set how the underline should animate.
+
32/// @param d The duration of the animation.
+
33/// @param f The easing function of the animation.
+ +
39
+
40/// @brief Set how the underline should animate.
+
41/// @param d The duration of the animation.
+ +
46
+
47/// @brief Set how the underline should animate.
+
48/// @param f The easing function of the animation.
+ +
53
+
54/// @brief Set how the underline should animate.
+
55/// This is useful to desynchronize the animation of the leader and the
+
56/// follower.
+
57/// @param f_leader The duration of the animation for the leader.
+
58/// @param f_follower The duration of the animation for the follower.
+
+ + +
61 animation::easing::Function f_follower) {
+
62 leader_function = std::move(f_leader);
+
63 follower_function = std::move(f_follower);
+
64}
+
+
65
+
66/// @brief Standard options for a horizontal menu.
+
67/// This can be useful to implement a tab bar.
+
68// static
+
+ +
70 MenuOption option;
+ +
72 option.entries_option.transform = [](const EntryState& state) {
+
73 Element e = text(state.label);
+
74 if (state.focused) {
+
75 e |= inverted;
+
76 }
+
77 if (state.active) {
+
78 e |= bold;
+
79 }
+
80 if (!state.focused && !state.active) {
+
81 e |= dim;
+
82 }
+
83 return e;
+
84 };
+
85 option.elements_infix = [] { return text(" "); };
+
86
+
87 return option;
+
88}
+
+
89
+
90/// @brief Standard options for an animated horizontal menu.
+
91/// This can be useful to implement a tab bar.
+
92// static
+
+ +
94 auto option = Horizontal();
+
95 option.underline.enabled = true;
+
96 return option;
+
97}
+
+
98
+
99/// @brief Standard options for a vertical menu.
+
100/// This can be useful to implement a list of selectable items.
+
101// static
+
+ +
103 MenuOption option;
+
104 option.entries_option.transform = [](const EntryState& state) {
+
105 Element e = text((state.active ? "> " : " ") + state.label); // NOLINT
+
106 if (state.focused) {
+
107 e |= inverted;
+
108 }
+
109 if (state.active) {
+
110 e |= bold;
+
111 }
+
112 if (!state.focused && !state.active) {
+
113 e |= dim;
+
114 }
+
115 return e;
+
116 };
+
117 return option;
+
118}
+
+
119
+
120/// @brief Standard options for an animated vertical menu.
+
121/// This can be useful to implement a list of selectable items.
+
122// static
+
+ +
124 auto option = MenuOption::Vertical();
+
125 option.entries_option.transform = [](const EntryState& state) {
+
126 Element e = text(state.label);
+
127 if (state.focused) {
+
128 e |= inverted;
+
129 }
+
130 if (state.active) {
+
131 e |= bold;
+
132 }
+
133 if (!state.focused && !state.active) {
+
134 e |= dim;
+
135 }
+
136 return e;
+
137 };
+
138 option.underline.enabled = true;
+
139 return option;
+
140}
+
+
141
+
142/// @brief Standard options for a horizontal menu with some separator.
+
143/// This can be useful to implement a tab bar.
+
144// static
+
+ +
146 auto option = MenuOption::Horizontal();
+
147 option.elements_infix = [] { return text("│") | automerge; };
+
148 return option;
+
149}
+
+
150
+
151/// @brief Create a ButtonOption, highlighted using [] characters.
+
152// static
+
+ +
154 ButtonOption option;
+
155 option.transform = [](const EntryState& s) {
+
156 const std::string t = s.focused ? "[" + s.label + "]" //
+
157 : " " + s.label + " ";
+
158 return text(t);
+
159 };
+
160 return option;
+
161}
+
+
162
+
163/// @brief Create a ButtonOption, inverted when focused.
+
164// static
+
+ +
166 ButtonOption option;
+
167 option.transform = [](const EntryState& s) {
+
168 auto element = text(s.label) | borderLight;
+
169 if (s.focused) {
+
170 element |= inverted;
+
171 }
+
172 return element;
+
173 };
+
174 return option;
+
175}
+
+
176
+
177/// @brief Create a ButtonOption. The button is shown using a border, inverted
+
178/// when focused. This is the current default.
+
+ +
180 ButtonOption option;
+
181 option.transform = [](const EntryState& s) {
+
182 auto element = text(s.label) | border;
+
183 if (s.active) {
+
184 element |= bold;
+
185 }
+
186 if (s.focused) {
+
187 element |= inverted;
+
188 }
+
189 return element;
+
190 };
+
191 return option;
+
192}
+
+
193
+
194/// @brief Create a ButtonOption, using animated colors.
+
195// static
+ +
200
+
201/// @brief Create a ButtonOption, using animated colors.
+
202// static
+
+ + +
205 Color::Interpolate(0.85F, color, Color::Black), // NOLINT
+
206 Color::Interpolate(0.10F, color, Color::White), // NOLINT
+
207 Color::Interpolate(0.10F, color, Color::Black), // NOLINT
+
208 Color::Interpolate(0.85F, color, Color::White)); // NOLINT
+
209}
+
+
210
+
211/// @brief Create a ButtonOption, using animated colors.
+
212// static
+
+ +
214 // NOLINTBEGIN
+ +
216 /*bakground=*/background,
+
217 /*foreground=*/foreground,
+
218 /*background_active=*/foreground,
+
219 /*foreground_active=*/background);
+
220 // NOLINTEND
+
221}
+
+
222
+
223/// @brief Create a ButtonOption, using animated colors.
+
224// static
+
+ +
226 Color foreground,
+
227 Color background_active,
+
228 Color foreground_active) {
+
229 ButtonOption option;
+
230 option.transform = [](const EntryState& s) {
+
231 auto element = text(s.label) | borderEmpty;
+
232 if (s.focused) {
+
233 element |= bold;
+
234 }
+
235 return element;
+
236 };
+
237 option.animated_colors.foreground.Set(foreground, foreground_active);
+
238 option.animated_colors.background.Set(background, background_active);
+
239 return option;
+
240}
+
+
241
+
242/// @brief Option for standard Checkbox.
+
243// static
+
+ +
245 auto option = CheckboxOption();
+
246 option.transform = [](const EntryState& s) {
+
247#if defined(FTXUI_MICROSOFT_TERMINAL_FALLBACK)
+
248 // Microsoft terminal do not use fonts able to render properly the default
+
249 // radiobox glyph.
+
250 auto prefix = text(s.state ? "[X] " : "[ ] "); // NOLINT
+
251#else
+
252 auto prefix = text(s.state ? "▣ " : "☐ "); // NOLINT
+
253#endif
+
254 auto t = text(s.label);
+
255 if (s.active) {
+
256 t |= bold;
+
257 }
+
258 if (s.focused) {
+
259 t |= inverted;
+
260 }
+
261 return hbox({prefix, t});
+
262 };
+
263 return option;
+
264}
+
+
265
+
266/// @brief Option for standard Radiobox
+
267// static
+
+ +
269 auto option = RadioboxOption();
+
270 option.transform = [](const EntryState& s) {
+
271#if defined(FTXUI_MICROSOFT_TERMINAL_FALLBACK)
+
272 // Microsoft terminal do not use fonts able to render properly the default
+
273 // radiobox glyph.
+
274 auto prefix = text(s.state ? "(*) " : "( ) "); // NOLINT
+
275#else
+
276 auto prefix = text(s.state ? "◉ " : "○ "); // NOLINT
+
277#endif
+
278 auto t = text(s.label);
+
279 if (s.active) {
+
280 t |= bold;
+
281 }
+
282 if (s.focused) {
+
283 t |= inverted;
+
284 }
+
285 return hbox({prefix, t});
+
286 };
+
287 return option;
+
288}
+
+
289
+
290/// @brief Standard options for the input component.
+
291// static
+
+ +
293 InputOption option;
+
294 option.transform = [](InputState state) {
+
295 state.element |= color(Color::White);
+
296
+
297 if (state.is_placeholder) {
+
298 state.element |= dim;
+
299 }
+
300
+
301 if (state.focused) {
+
302 state.element |= inverted;
+
303 } else if (state.hovered) {
+
304 state.element |= bgcolor(Color::GrayDark);
+
305 }
+
306
+
307 return state.element;
+
308 };
+
309 return option;
+
310}
+
+
311
+
312/// @brief Standard options for a more beautiful input component.
+
313// static
+
+ +
315 InputOption option;
+
316 option.transform = [](InputState state) {
+
317 state.element |= borderEmpty;
+
318 state.element |= color(Color::White);
+
319
+
320 if (state.is_placeholder) {
+
321 state.element |= dim;
+
322 }
+
323
+
324 if (state.focused) {
+
325 state.element |= bgcolor(Color::Black);
+
326 }
+
327
+
328 if (state.hovered) {
+
329 state.element |= bgcolor(Color::GrayDark);
+
330 }
+
331
+
332 return state.element;
+
333 };
+
334 return option;
+
335}
+
+
336
+
337} // namespace ftxui
+ + + + + +
static ButtonOption Animated()
Create a ButtonOption, using animated colors.
+
static MenuOption Toggle()
Standard options for a horizontal menu with some separator. This can be useful to implement a tab bar...
+
animation::Duration follower_duration
+
animation::easing::Function leader_function
+
MenuEntryOption entries_option
+
static InputOption Default()
Create the default input style:
+
animation::easing::Function function
+
static ButtonOption Border()
Create a ButtonOption. The button is shown using a border, inverted when focused. This is the current...
+
void SetAnimationFunction(animation::easing::Function f)
Set how the underline should animate.
+
static InputOption Spacious()
A white on black style with high margins:
+
static CheckboxOption Simple()
Option for standard Checkbox.
+ +
static ButtonOption Simple()
Create a ButtonOption, inverted when focused.
+
std::function< Element(const EntryState &state)> transform
+ +
static MenuOption Horizontal()
Standard options for a horizontal menu. This can be useful to implement a tab bar.
+
static MenuOption VerticalAnimated()
Standard options for an animated vertical menu. This can be useful to implement a list of selectable ...
+
animation::Duration leader_duration
+
static MenuOption Vertical()
Standard options for a vertical menu. This can be useful to implement a list of selectable items.
+
static ButtonOption Ascii()
Create a ButtonOption, highlighted using [] characters.
+ +
void SetAnimation(animation::Duration d, animation::easing::Function f)
Set how the underline should animate.
+
void SetAnimationDuration(animation::Duration d)
Set how the underline should animate.
+
animation::easing::Function follower_function
+ + +
std::function< Element(InputState)> transform
+
std::function< Element()> elements_infix
+
AnimatedColorsOption animated_colors
+
void Set(Color inactive, Color active, animation::Duration duration=std::chrono::milliseconds(250), animation::easing::Function function=animation::easing::QuadraticInOut)
A color option that can be animated. @params _inactive The color when the component is inactive....
+
static MenuOption HorizontalAnimated()
Standard options for an animated horizontal menu. This can be useful to implement a tab bar.
+
static RadioboxOption Simple()
Option for standard Radiobox.
+
std::function< Element(const EntryState &)> transform
+
Option for the AnimatedButton component.
+
Option for the Checkbox component.
+
Option for the Input component.
+
Option for the Menu component.
+
Option for the Radiobox component.
+
Decorator bgcolor(Color)
Decorate using a background color.
+
Element bold(Element)
Use a bold font, for elements with more emphasis.
Definition bold.cpp:33
+
Element inverted(Element)
Add a filter that will invert the foreground and the background colors.
Definition inverted.cpp:34
+
Element text(std::wstring text)
Display a piece of unicode text.
Definition text.cpp:160
+
Element borderLight(Element)
Draw a light border around the element.
+
Element dim(Element)
Use a light font, for elements with less emphasis.
Definition dim.cpp:33
+
Element automerge(Element child)
Enable character to be automatically merged with others nearby.
Definition automerge.cpp:17
+
Element border(Element)
Draw a border around the element.
+
Element borderEmpty(Element)
Draw an empty border around the element.
+
Decorator color(Color)
Decorate using a foreground color.
+ + + + + +
static Color Interpolate(float t, const Color &a, const Color &b)
+
Color is a class that represents a color in the terminal user interface.
Definition color.hpp:22
+
std::function< float(float)> Function
Definition animation.hpp:45
+
std::chrono::duration< float > Duration
Definition animation.hpp:30
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+
Element hbox(Elements)
A container displaying elements horizontally one by one.
Definition hbox.cpp:94
+ + +
arguments for transform from |ButtonOption|, |CheckboxOption|, |RadioboxOption|, |MenuEntryOption|,...
+
Used to define style for the Input component.
+
+
+ + + + + diff --git a/component__options_8cppm.html b/component__options_8cppm.html new file mode 100644 index 000000000..a9bfb8def --- /dev/null +++ b/component__options_8cppm.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: component_options.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
component_options.cppm File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+
+
+ + + + + diff --git a/component__options_8cppm_source.html b/component__options_8cppm_source.html new file mode 100644 index 000000000..16f20c46a --- /dev/null +++ b/component__options_8cppm_source.html @@ -0,0 +1,259 @@ + + + + + + + + +FTXUI: component_options.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
component_options.cppm
+
+
+Go to the documentation of this file.
1/// @module ftxui.component.component_options
+
2/// @brief Module file for options for the Component class of the Component module
+
3
+
4module;
+
5
+ +
7
+ +
9
+
10/**
+
11 * @namespace ftxui
+
12 * @brief The FTXUI ftxui:: namespace
+
13 */
+
14export namespace ftxui {
+ + + + + + + + + + + + + + + + +
31}
+ +
Option about a potentially animated color.
+
Option for the AnimatedButton component.
+
Option for the Checkbox component.
+
Option for the Dropdown component.A dropdown menu is a checkbox opening/closing a radiobox.
+
Option for the Input component.
+
Option for the MenuEntry component.
+
Option for the Menu component.
+
Option for the Radiobox component.
+
Option for the underline effect.
+
State passed to the Window component's render function.
+
Module file for options for the Component class of the Component module.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
arguments for transform from |ButtonOption|, |CheckboxOption|, |RadioboxOption|, |MenuEntryOption|,...
+
Used to define style for the Input component.
+ + + +
+
+ + + + + diff --git a/component__options_8hpp.html b/component__options_8hpp.html new file mode 100644 index 000000000..de9ca8071 --- /dev/null +++ b/component__options_8hpp.html @@ -0,0 +1,268 @@ + + + + + + + + +FTXUI: component_options.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
component_options.hpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Classes

struct  EntryState
 arguments for transform from |ButtonOption|, |CheckboxOption|, |RadioboxOption|, |MenuEntryOption|, |MenuOption|. More...
 
struct  UnderlineOption
 Option for the underline effect. More...
 
struct  AnimatedColorOption
 Option about a potentially animated color. More...
 
struct  AnimatedColorsOption
 
struct  MenuEntryOption
 Option for the MenuEntry component. More...
 
struct  MenuOption
 Option for the Menu component. More...
 
struct  ButtonOption
 Option for the AnimatedButton component. More...
 
struct  CheckboxOption
 Option for the Checkbox component. More...
 
struct  InputState
 Used to define style for the Input component. More...
 
struct  InputOption
 Option for the Input component. More...
 
struct  RadioboxOption
 Option for the Radiobox component. More...
 
struct  ResizableSplitOption
 
struct  SliderOption< T >
 
struct  WindowRenderState
 State passed to the Window component's render function. More...
 
struct  WindowOptions
 
struct  DropdownOption
 Option for the Dropdown component.A dropdown menu is a checkbox opening/closing a radiobox. More...
 
+ + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+
+
+ + + + + diff --git a/component__options_8hpp.js b/component__options_8hpp.js new file mode 100644 index 000000000..10d02a7b1 --- /dev/null +++ b/component__options_8hpp.js @@ -0,0 +1,9 @@ +var component__options_8hpp = +[ + [ "EntryState", "structftxui_1_1EntryState.html", "structftxui_1_1EntryState" ], + [ "AnimatedColorsOption", "structftxui_1_1AnimatedColorsOption.html", "structftxui_1_1AnimatedColorsOption" ], + [ "InputState", "structftxui_1_1InputState.html", "structftxui_1_1InputState" ], + [ "ResizableSplitOption", "structftxui_1_1ResizableSplitOption.html", "structftxui_1_1ResizableSplitOption" ], + [ "SliderOption< T >", "structftxui_1_1SliderOption.html", "structftxui_1_1SliderOption" ], + [ "WindowOptions", "structftxui_1_1WindowOptions.html", "structftxui_1_1WindowOptions" ] +]; \ No newline at end of file diff --git a/component__options_8hpp_source.html b/component__options_8hpp_source.html new file mode 100644 index 000000000..abcbfaf42 --- /dev/null +++ b/component__options_8hpp_source.html @@ -0,0 +1,671 @@ + + + + + + + + +FTXUI: component_options.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
component_options.hpp
+
+
+Go to the documentation of this file.
1// Copyright 2021 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#ifndef FTXUI_COMPONENT_COMPONENT_OPTIONS_HPP
+
5#define FTXUI_COMPONENT_COMPONENT_OPTIONS_HPP
+
6
+
7#include <chrono> // for milliseconds
+
8#include <ftxui/component/animation.hpp> // for Duration, QuadraticInOut, Function
+
9#include <ftxui/dom/direction.hpp> // for Direction, Direction::Left, Direction::Right, Direction::Down
+
10#include <ftxui/dom/elements.hpp> // for Element, separator
+
11#include <ftxui/util/ref.hpp> // for Ref, ConstRef, StringRef
+ +
13#include <functional> // for function
+
14#include <string> // for string
+
15
+
16#include "ftxui/component/component_base.hpp" // for Component
+
17#include "ftxui/screen/color.hpp" // for Color, Color::GrayDark, Color::White
+
18
+
19namespace ftxui {
+
20
+
21/// @brief arguments for transform from |ButtonOption|, |CheckboxOption|,
+
22/// |RadioboxOption|, |MenuEntryOption|, |MenuOption|.
+
+
23struct EntryState {
+
24 std::string label; ///< The label to display.
+
25 bool state; ///< The state of the button/checkbox/radiobox
+
26 bool active; ///< Whether the entry is the active one.
+
27 bool focused; ///< Whether the entry is one focused by the user.
+
28 int index; ///< Index of the entry when applicable or -1.
+
29};
+
+
30
+
31/// @brief Option for the underline effect.
+
32/// @ingroup component
+ +
55
+
56/// @brief Option about a potentially animated color.
+
57/// @ingroup component
+
+ +
59 void Set(
+ + +
62 animation::Duration duration = std::chrono::milliseconds(250),
+
63 animation::easing::Function function = animation::easing::QuadraticInOut);
+
64
+
65 bool enabled = false;
+ + +
68 animation::Duration duration = std::chrono::milliseconds(250);
+ +
70};
+
+
71
+ +
76
+
77/// @brief Option for the MenuEntry component.
+
78/// @ingroup component
+
+ +
80 ConstStringRef label = "MenuEntry";
+
81 std::function<Element(const EntryState& state)> transform;
+ +
83};
+
+
84
+
85/// @brief Option for the Menu component.
+
86/// @ingroup component
+
+
87struct MenuOption {
+
88 // Standard constructors:
+
89 static MenuOption Horizontal();
+ +
91 static MenuOption Vertical();
+ +
93 static MenuOption Toggle();
+
94
+
95 ConstStringListRef entries; ///> The list of entries.
+
96 Ref<int> selected = 0; ///> The index of the selected entry.
+
97
+
98 // Style:
+ + + +
102 std::function<Element()> elements_prefix;
+
103 std::function<Element()> elements_infix;
+
104 std::function<Element()> elements_postfix;
+
105
+
106 // Observers:
+
107 std::function<void()> on_change; ///> Called when the selected entry changes.
+
108 std::function<void()> on_enter; ///> Called when the user presses enter.
+ +
110};
+
+
111
+
112/// @brief Option for the AnimatedButton component.
+
113/// @ingroup component
+
+ +
115 // Standard constructors:
+
116 static ButtonOption Ascii();
+
117 static ButtonOption Simple();
+
118 static ButtonOption Border();
+
119 static ButtonOption Animated();
+
120 static ButtonOption Animated(Color color);
+
121 static ButtonOption Animated(Color background, Color foreground);
+
122 static ButtonOption Animated(Color background,
+
123 Color foreground,
+
124 Color background_active,
+
125 Color foreground_active);
+
126
+ +
128 std::function<void()> on_click = [] {};
+
129
+
130 // Style:
+
131 std::function<Element(const EntryState&)> transform;
+ +
133};
+
+
134
+
135/// @brief Option for the Checkbox component.
+
136/// @ingroup component
+
+ +
138 // Standard constructors:
+
139 static CheckboxOption Simple();
+
140
+
141 ConstStringRef label = "Checkbox";
+
142
+ +
144
+
145 // Style:
+
146 std::function<Element(const EntryState&)> transform;
+
147
+
148 // Observer:
+
149 /// Called when the user change the state.
+
150 std::function<void()> on_change = [] {};
+
151};
+
+
152
+
153/// @brief Used to define style for the Input component.
+
+ + +
156 bool hovered; ///< Whether the input is hovered by the mouse.
+
157 bool focused; ///< Whether the input is focused by the user.
+
158 bool is_placeholder; ///< Whether the input is empty and displaying the
+
159 ///< placeholder.
+
160};
+
+
161
+
162/// @brief Option for the Input component.
+
163/// @ingroup component
+
+ +
165 // A set of predefined styles:
+
166
+
167 /// @brief Create the default input style:
+
168 static InputOption Default();
+
169 /// @brief A white on black style with high margins:
+
170 static InputOption Spacious();
+
171
+
172 /// The content of the input.
+ +
174
+
175 /// The content of the input when it's empty.
+ +
177
+
178 // Style:
+
179 std::function<Element(InputState)> transform;
+
180 Ref<bool> password = false; ///< Obscure the input content using '*'.
+
181 Ref<bool> multiline = true; ///< Whether the input can be multiline.
+
182 Ref<bool> insert = true; ///< Insert or overtype character mode.
+
183
+
184 /// Called when the content changes.
+
185 std::function<void()> on_change = [] {};
+
186 /// Called when the user presses enter.
+
187 std::function<void()> on_enter = [] {};
+
188
+
189 // The char position of the cursor:
+ +
191};
+
+
192
+
193/// @brief Option for the Radiobox component.
+
194/// @ingroup component
+
+ +
196 // Standard constructors:
+
197 static RadioboxOption Simple();
+
198
+
199 // Content:
+ + +
202
+
203 // Style:
+
204 std::function<Element(const EntryState&)> transform;
+
205
+
206 // Observers:
+
207 /// Called when the selected entry changes.
+
208 std::function<void()> on_change = [] {};
+ +
210};
+
+
211
+
+ + + + + + +
218 : 10;
+
219 std::function<Element()> separator_func = [] { return ::ftxui::separator(); };
+
220};
+
+
221
+
222// @brief Option for the `Slider` component.
+
223// @ingroup component
+
224template <typename T>
+
+ + + +
228 ConstRef<T> max = T(100);
+
229 ConstRef<T> increment = (max() - min()) / 20;
+ + + +
233 std::function<void()> on_change; ///> Called when `value` is updated.
+
234};
+
+
235
+
236/// @brief State passed to the `Window` component's render function.
+
237/// @ingroup component
+
+ +
239 Element inner; ///< The element wrapped inside this window.
+
240 const std::string& title; ///< The title of the window.
+
241 bool active = false; ///< Whether the window is the active one.
+
242 bool drag = false; ///< Whether the window is being dragged.
+
243 bool resize = false; ///< Whether the window is being resized.
+
244 bool hover_left = false; ///< Whether the resizeable left side is hovered.
+
245 bool hover_right = false; ///< Whether the resizeable right side is hovered.
+
246 bool hover_top = false; ///< Whether the resizeable top side is hovered.
+
247 bool hover_down = false; ///< Whether the resizeable down side is hovered.
+
248};
+
+
249
+
250// @brief Option for the `Window` component.
+
251// @ingroup component
+
+ +
253 Component inner; ///< The component wrapped by this window.
+
254 ConstStringRef title = ""; ///< The title displayed by this window.
+
255
+
256 Ref<int> left = 0; ///< The left side position of the window.
+
257 Ref<int> top = 0; ///< The top side position of the window.
+
258 Ref<int> width = 20; ///< The width of the window.
+
259 Ref<int> height = 10; ///< The height of the window.
+
260
+
261 Ref<bool> resize_left = true; ///< Can the left side be resized?
+
262 Ref<bool> resize_right = true; ///< Can the right side be resized?
+
263 Ref<bool> resize_top = true; ///< Can the top side be resized?
+
264 Ref<bool> resize_down = true; ///< Can the down side be resized?
+
265
+
266 /// An optional function to customize how the window looks like:
+
267 std::function<Element(const WindowRenderState&)> render;
+
268};
+
+
269
+
270/// @brief Option for the Dropdown component.
+
271/// @ingroup component
+
272/// A dropdown menu is a checkbox opening/closing a radiobox.
+
+ +
274 /// Whether the dropdown is open or closed:
+ +
276 // The options for the checkbox:
+ +
278 // The options for the radiobox:
+ +
280 // The transformation function:
+
281 std::function<Element(bool open, Element checkbox, Element radiobox)>
+ +
283};
+
+
284
+
285} // namespace ftxui
+
286
+
287#endif /* end of include guard: FTXUI_COMPONENT_COMPONENT_OPTIONS_HPP */
+ +
An adapter. Own or reference an immutable object.
Definition ref.hpp:17
+
An adapter. Reference a list of strings.
Definition ref.hpp:116
+
An adapter. Own or reference a constant string. For convenience, this class convert multiple immutabl...
Definition ref.hpp:94
+
An adapter. Own or reference an mutable object.
Definition ref.hpp:46
+
An adapter. Own or reference a constant string. For convenience, this class convert multiple mutable ...
Definition ref.hpp:82
+ + + + +
static ButtonOption Animated()
Create a ButtonOption, using animated colors.
+
bool active
Whether the window is the active one.
+ +
std::function< void()> on_click
+
std::function< Element()> elements_prefix
+
static MenuOption Toggle()
Standard options for a horizontal menu with some separator. This can be useful to implement a tab bar...
+
animation::Duration follower_duration
+
animation::easing::Function leader_function
+
MenuEntryOption entries_option
+
bool drag
Whether the window is being dragged.
+
static InputOption Default()
Create the default input style:
+
animation::easing::Function function
+
animation::Duration follower_delay
+
static ButtonOption Border()
Create a ButtonOption. The button is shown using a border, inverted when focused. This is the current...
+
bool hover_down
Whether the resizeable down side is hovered.
+
const std::string & title
The title of the window.
+ +
void SetAnimationFunction(animation::easing::Function f)
Set how the underline should animate.
+
static InputOption Spacious()
A white on black style with high margins:
+
Ref< bool > insert
Insert or overtype character mode.
+
static CheckboxOption Simple()
Option for standard Checkbox.
+
bool resize
Whether the window is being resized.
+
std::function< void()> on_enter
+ +
Element inner
The element wrapped inside this window.
+
static ButtonOption Simple()
Create a ButtonOption, inverted when focused.
+
UnderlineOption underline
+
std::function< Element(const EntryState &state)> transform
+ + +
static MenuOption Horizontal()
Standard options for a horizontal menu. This can be useful to implement a tab bar.
+
static MenuOption VerticalAnimated()
Standard options for an animated vertical menu. This can be useful to implement a list of selectable ...
+
animation::Duration leader_duration
+
static MenuOption Vertical()
Standard options for a vertical menu. This can be useful to implement a list of selectable items.
+
static ButtonOption Ascii()
Create a ButtonOption, highlighted using [] characters.
+ + +
void SetAnimation(animation::Duration d, animation::easing::Function f)
Set how the underline should animate.
+
void SetAnimationDuration(animation::Duration d)
Set how the underline should animate.
+
ConstStringListRef entries
+
animation::easing::Function follower_function
+ + + +
bool hover_right
Whether the resizeable right side is hovered.
+
Ref< bool > password
Obscure the input content using '*'.
+
std::function< Element(InputState)> transform
+ +
std::function< Element()> elements_infix
+
Ref< bool > open
Whether the dropdown is open or closed:
+
StringRef placeholder
The content of the input when it's empty.
+
std::function< Element()> elements_postfix
+
AnimatedColorsOption animated_colors
+ +
bool hover_left
Whether the resizeable left side is hovered.
+
std::function< void()> on_change
+ +
StringRef content
The content of the input.
+
bool hover_top
Whether the resizeable top side is hovered.
+
void Set(Color inactive, Color active, animation::Duration duration=std::chrono::milliseconds(250), animation::easing::Function function=animation::easing::QuadraticInOut)
A color option that can be animated. @params _inactive The color when the component is inactive....
+ +
animation::Duration leader_delay
+
std::function< Element(bool open, Element checkbox, Element radiobox)> transform
+
static MenuOption HorizontalAnimated()
Standard options for an animated horizontal menu. This can be useful to implement a tab bar.
+
Ref< bool > multiline
Whether the input can be multiline.
+
static RadioboxOption Simple()
Option for standard Radiobox.
+
std::function< Element(const EntryState &)> transform
+
Option about a potentially animated color.
+
Option for the AnimatedButton component.
+
Option for the Checkbox component.
+
Option for the Dropdown component.A dropdown menu is a checkbox opening/closing a radiobox.
+
Option for the Input component.
+
Option for the MenuEntry component.
+
Option for the Menu component.
+
Option for the Radiobox component.
+
Option for the underline effect.
+
State passed to the Window component's render function.
+
Direction
Direction is an enumeration that represents the four cardinal directions.
Definition direction.hpp:13
+ + + + + +
Color is a class that represents a color in the terminal user interface.
Definition color.hpp:22
+
float QuadraticInOut(float p)
Definition animation.cpp:46
+
std::function< float(float)> Function
Definition animation.hpp:45
+
std::chrono::duration< float > Duration
Definition animation.hpp:30
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+
std::shared_ptr< ComponentBase > Component
+ + + + +
arguments for transform from |ButtonOption|, |CheckboxOption|, |RadioboxOption|, |MenuEntryOption|,...
+
bool active
Whether the entry is the active one.
+
std::string label
The label to display.
+
bool focused
Whether the entry is one focused by the user.
+
int index
Index of the entry when applicable or -1.
+
bool state
The state of the button/checkbox/radiobox.
+
Used to define style for the Input component.
+
bool focused
Whether the input is focused by the user.
+
bool hovered
Whether the input is hovered by the mouse.
+ + + +
std::function< Element()> separator_func
+ + + + + + + + + + + +
std::function< void()> on_change
+ + +
Ref< bool > resize_down
Can the down side be resized?
+
Component inner
The component wrapped by this window.
+
Ref< bool > resize_left
Can the left side be resized?
+
Ref< int > height
The height of the window.
+
Ref< bool > resize_top
Can the top side be resized?
+
Ref< int > width
The width of the window.
+
std::function< Element(const WindowRenderState &)> render
An optional function to customize how the window looks like:
+
ConstStringRef title
The title displayed by this window.
+
Ref< bool > resize_right
Can the right side be resized?
+
Ref< int > left
The left side position of the window.
+
Ref< int > top
The top side position of the window.
+ +
+
+ + + + + diff --git a/composite__decorator_8cpp.html b/composite__decorator_8cpp.html new file mode 100644 index 000000000..756993b65 --- /dev/null +++ b/composite__decorator_8cpp.html @@ -0,0 +1,236 @@ + + + + + + + + +FTXUI: composite_decorator.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
composite_decorator.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+ + + + + + + + + + + + + +

+Functions

Element hcenter (Element child)
 Center an element horizontally.
 
Element vcenter (Element child)
 Center an element vertically.
 
Element center (Element child)
 Center an element horizontally and vertically.
 
Element align_right (Element child)
 Align an element on the right side.
 
+
+
+ + + + + diff --git a/composite__decorator_8cpp.js b/composite__decorator_8cpp.js new file mode 100644 index 000000000..3acfaff4a --- /dev/null +++ b/composite__decorator_8cpp.js @@ -0,0 +1,7 @@ +var composite__decorator_8cpp = +[ + [ "hcenter", "composite__decorator_8cpp.html#gaf7d0d1e44c1a5424e42a5cddceacf7f7", null ], + [ "vcenter", "composite__decorator_8cpp.html#gad907a8a48bb9f9dfdb06402e9fc12316", null ], + [ "center", "composite__decorator_8cpp.html#ga5b11656305fce8427b81daf1c35883f1", null ], + [ "align_right", "composite__decorator_8cpp.html#ga778e52afe28f1978f1f7ef065ed92d6d", null ] +]; \ No newline at end of file diff --git a/composite__decorator_8cpp_source.html b/composite__decorator_8cpp_source.html new file mode 100644 index 000000000..0f597095e --- /dev/null +++ b/composite__decorator_8cpp_source.html @@ -0,0 +1,270 @@ + + + + + + + + +FTXUI: composite_decorator.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
composite_decorator.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4
+
5#include <utility> // for move
+
6
+
7#include "ftxui/dom/elements.hpp" // for Element, filler, operator|, hbox, flex_grow, vbox, xflex_grow, yflex_grow, align_right, center, hcenter, vcenter
+
8
+
9namespace ftxui {
+
10
+
11/// @brief Center an element horizontally.
+
12/// @param child The decorated element.
+
13/// @return The centered element.
+
14/// @ingroup dom
+
+ +
16 return hbox(filler(), std::move(child), filler());
+
17}
+
+
18
+
19/// @brief Center an element vertically.
+
20/// @param child The decorated element.
+
21/// @return The centered element.
+
22/// @ingroup dom
+
+ +
24 return vbox(filler(), std::move(child), filler());
+
25}
+
+
26
+
27/// @brief Center an element horizontally and vertically.
+
28/// @param child The decorated element.
+
29/// @return The centered element.
+
30/// @ingroup dom
+
+ +
32 return hcenter(vcenter(std::move(child)));
+
33}
+
+
34
+
35/// @brief Align an element on the right side.
+
36/// @param child The decorated element.
+
37/// @return The right aligned element.
+
38/// @ingroup dom
+
+ +
40 return hbox(filler(), std::move(child));
+
41}
+
+
42
+
43} // namespace ftxui
+ +
Element center(Element)
Center an element horizontally and vertically.
+
Element align_right(Element)
Align an element on the right side.
+
Element filler()
An element that will take expand proportionally to the space left in a container.
Definition flex.cpp:98
+
Element vcenter(Element)
Center an element vertically.
+
Element hcenter(Element)
Center an element horizontally.
+
Element vbox(Elements)
A container displaying elements vertically one by one.
Definition vbox.cpp:96
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+
Element hbox(Elements)
A container displaying elements horizontally one by one.
Definition hbox.cpp:94
+
+
+ + + + + diff --git a/composition_8cpp.html b/composition_8cpp.html new file mode 100644 index 000000000..7d3f90fed --- /dev/null +++ b/composition_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: composition.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
composition.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 17 of file composition.cpp.

+ +
+
+
+
+ + + + + diff --git a/composition_8cpp.js b/composition_8cpp.js new file mode 100644 index 000000000..b772ed124 --- /dev/null +++ b/composition_8cpp.js @@ -0,0 +1,4 @@ +var composition_8cpp = +[ + [ "main", "composition_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/composition_8cpp_source.html b/composition_8cpp_source.html new file mode 100644 index 000000000..6168408a3 --- /dev/null +++ b/composition_8cpp_source.html @@ -0,0 +1,289 @@ + + + + + + + + +FTXUI: composition.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
composition.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2021 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <memory> // for allocator, shared_ptr, __shared_ptr_access
+
5#include <string> // for operator+, to_string
+
6
+
7#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
8#include "ftxui/component/component.hpp" // for Button, Horizontal, Renderer
+
9#include "ftxui/component/component_base.hpp" // for ComponentBase
+
10#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
11#include "ftxui/dom/elements.hpp" // for text, separator, Element, operator|, vbox, border
+
12
+
13using namespace ftxui;
+
14
+
15// An example of how to compose multiple components into one and maintain their
+
16// interactiveness.
+
+
17int main() {
+
18 auto left_count = 0;
+
19 auto right_count = 0;
+
20
+
21 auto left_buttons = Container::Horizontal({
+
22 Button("Decrease", [&] { left_count--; }),
+
23 Button("Increase", [&] { left_count++; }),
+
24 });
+
25
+
26 auto right_buttons = Container::Horizontal({
+
27 Button("Decrease", [&] { right_count--; }),
+
28 Button("Increase", [&] { right_count++; }),
+
29 });
+
30
+
31 // Renderer decorates its child with a new rendering function. The way the
+
32 // children reacts to events is maintained.
+
33 auto leftpane = Renderer(left_buttons, [&] {
+
34 return vbox({
+
35 text("This is the left control"),
+
36 separator(),
+
37 text("Left button count: " + std::to_string(left_count)),
+
38 left_buttons->Render(),
+
39 }) |
+
40 border;
+
41 });
+
42
+
43 auto rightpane = Renderer(right_buttons, [&] {
+
44 return vbox({
+
45 text("This is the right control"),
+
46 separator(),
+
47 text("Right button count: " + std::to_string(right_count)),
+
48 right_buttons->Render(),
+
49 }) |
+
50 border;
+
51 });
+
52
+
53 // Container groups components togethers. To render a Container::Horizontal,
+
54 // it render its children side by side. It maintains their interactiveness and
+
55 // provide the logic to navigate from one to the other using the arrow keys.
+
56 auto composition = Container::Horizontal({leftpane, rightpane});
+
57
+
58 auto screen = ScreenInteractive::FitComponent();
+
59 screen.Loop(composition);
+
60 return 0;
+
61}
+
+
62
+
63// Thanks to Chris Morgan for this example!
+ + + +
int main()
+ +
static ScreenInteractive FitComponent()
+
Component Horizontal(Components children)
A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow...
+
Component Button(ButtonOption options)
Draw a button. Execute a function when clicked.
+
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
+
virtual void Render(Screen &screen)
Display an element on a ftxui::Screen.
Definition node.cpp:59
+
Element text(std::wstring text)
Display a piece of unicode text.
Definition text.cpp:160
+
Element separator()
Draw a vertical or horizontal separation in between two other elements.
+
Element vbox(Elements)
A container displaying elements vertically one by one.
Definition vbox.cpp:96
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/container_8cpp.html b/container_8cpp.html new file mode 100644 index 000000000..5e99e71f6 --- /dev/null +++ b/container_8cpp.html @@ -0,0 +1,244 @@ + + + + + + + + +FTXUI: container.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
container.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
namespace  ftxui::Container
 
+ + + + + + + + + + + + + + + + + + + +

+Functions

Component Vertical (Components children)
 A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or 'j'/'k' keys.
 
Component Vertical (Components children, int *selector)
 A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or 'j'/'k' keys. This is useful for implementing a Menu for instance.
 
Component Horizontal (Components children)
 A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow key or 'h'/'l' keys.
 
Component Horizontal (Components children, int *selector)
 A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow key or 'h'/'l' keys.
 
Component Tab (Components children, int *selector)
 A list of components, where only one is drawn and interacted with at a time. The |selector| gives the index of the selected component. This is useful to implement tabs.
 
Component Stacked (Components children)
 A list of components to be stacked on top of each other. Events are propagated to the first component, then the second if not handled, etc. The components are drawn in the reverse order they are given. When a component take focus, it is put at the front, without changing the relative order of the other elements.
 
+
+
+ + + + + diff --git a/container_8cpp.js b/container_8cpp.js new file mode 100644 index 000000000..c35d9a919 --- /dev/null +++ b/container_8cpp.js @@ -0,0 +1,9 @@ +var container_8cpp = +[ + [ "Vertical", "container_8cpp.html#ga6471e39f5664d059144746c5801d37e6", null ], + [ "Vertical", "container_8cpp.html#ga25099e2d2ead8a46c8d9a899982070b7", null ], + [ "Horizontal", "container_8cpp.html#ga01563bae9454fe64c0b29b0eb3755e68", null ], + [ "Horizontal", "container_8cpp.html#ga337564f8a13c98222025d8fe7e47df4c", null ], + [ "Tab", "container_8cpp.html#gaea9fe244eeeb420276bcc5760b46953d", null ], + [ "Stacked", "container_8cpp.html#gaafd394665b0c231380a143b810339d8e", null ] +]; \ No newline at end of file diff --git a/container_8cpp_source.html b/container_8cpp_source.html new file mode 100644 index 000000000..5f59d7dc2 --- /dev/null +++ b/container_8cpp_source.html @@ -0,0 +1,700 @@ + + + + + + + + +FTXUI: container.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
container.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <algorithm> // for max, min
+
5#include <cstddef> // for size_t
+
6#include <memory> // for make_shared, __shared_ptr_access, allocator, shared_ptr, allocator_traits<>::value_type
+
7#include <utility> // for move
+
8
+
9#include "ftxui/component/component.hpp" // for Horizontal, Vertical, Tab
+
10#include "ftxui/component/component_base.hpp" // for Components, Component, ComponentBase
+
11#include "ftxui/component/event.hpp" // for Event, Event::Tab, Event::TabReverse, Event::ArrowDown, Event::ArrowLeft, Event::ArrowRight, Event::ArrowUp, Event::End, Event::Home, Event::PageDown, Event::PageUp
+
12#include "ftxui/component/mouse.hpp" // for Mouse, Mouse::WheelDown, Mouse::WheelUp
+
13#include "ftxui/dom/elements.hpp" // for text, Elements, operator|, reflect, Element, hbox, vbox
+
14#include "ftxui/screen/box.hpp" // for Box
+
15
+
16namespace ftxui {
+
17
+
18class ContainerBase : public ComponentBase {
+
19 public:
+
20 ContainerBase(Components children, int* selector)
+
21 : selector_(selector ? selector : &selected_) {
+
22 for (Component& child : children) {
+
23 Add(std::move(child));
+
24 }
+
25 }
+
26
+
27 // Component override.
+
28 bool OnEvent(Event event) override {
+
29 if (event.is_mouse()) {
+
30 return OnMouseEvent(event);
+
31 }
+
32
+
33 if (!Focused()) {
+
34 return false;
+
35 }
+
36
+
37 if (ActiveChild() && ActiveChild()->OnEvent(event)) {
+
38 return true;
+
39 }
+
40
+
41 return EventHandler(event);
+
42 }
+
43
+
44 Component ActiveChild() override {
+
45 if (children_.empty()) {
+
46 return nullptr;
+
47 }
+
48
+
49 return children_[static_cast<size_t>(*selector_) % children_.size()];
+
50 }
+
51
+
52 void SetActiveChild(ComponentBase* child) override {
+
53 for (size_t i = 0; i < children_.size(); ++i) {
+
54 if (children_[i].get() == child) {
+
55 *selector_ = static_cast<int>(i);
+
56 return;
+
57 }
+
58 }
+
59 }
+
60
+
61 protected:
+
62 // Handlers
+
63 virtual bool EventHandler(Event /*unused*/) { return false; } // NOLINT
+
64
+
65 virtual bool OnMouseEvent(Event event) {
+
66 return ComponentBase::OnEvent(std::move(event));
+
67 }
+
68
+
69 int selected_ = 0;
+
70 int* selector_ = nullptr;
+
71
+
72 void MoveSelector(int dir) {
+
73 for (int i = *selector_ + dir; i >= 0 && i < int(children_.size());
+
74 i += dir) {
+
75 if (children_[i]->Focusable()) {
+
76 *selector_ = i;
+
77 return;
+
78 }
+
79 }
+
80 }
+
81
+
82 void MoveSelectorWrap(int dir) {
+
83 if (children_.empty()) {
+
84 return;
+
85 }
+
86 for (size_t offset = 1; offset < children_.size(); ++offset) {
+
87 const size_t i =
+
88 (*selector_ + offset * dir + children_.size()) % children_.size();
+
89 if (children_[i]->Focusable()) {
+
90 *selector_ = int(i);
+
91 return;
+
92 }
+
93 }
+
94 }
+
95};
+
96
+
97class VerticalContainer : public ContainerBase {
+
98 public:
+
99 using ContainerBase::ContainerBase;
+
100
+
101 Element OnRender() override {
+
102 Elements elements;
+
103 elements.reserve(children_.size());
+
104 for (auto& it : children_) {
+
105 elements.push_back(it->Render());
+
106 }
+
107 if (elements.empty()) {
+
108 return text("Empty container") | reflect(box_);
+
109 }
+
110 return vbox(std::move(elements)) | reflect(box_);
+
111 }
+
112
+
113 bool EventHandler(Event event) override {
+
114 const int old_selected = *selector_;
+
115 if (event == Event::ArrowUp || event == Event::Character('k')) {
+
116 MoveSelector(-1);
+
117 }
+
118 if (event == Event::ArrowDown || event == Event::Character('j')) {
+
119 MoveSelector(+1);
+
120 }
+
121 if (event == Event::PageUp) {
+
122 for (int i = 0; i < box_.y_max - box_.y_min; ++i) {
+
123 MoveSelector(-1);
+
124 }
+
125 }
+
126 if (event == Event::PageDown) {
+
127 for (int i = 0; i < box_.y_max - box_.y_min; ++i) {
+
128 MoveSelector(1);
+
129 }
+
130 }
+
131 if (event == Event::Home) {
+
132 for (size_t i = 0; i < children_.size(); ++i) {
+
133 MoveSelector(-1);
+
134 }
+
135 }
+
136 if (event == Event::End) {
+
137 for (size_t i = 0; i < children_.size(); ++i) {
+
138 MoveSelector(1);
+
139 }
+
140 }
+
141 if (event == Event::Tab) {
+
142 MoveSelectorWrap(+1);
+
143 }
+
144 if (event == Event::TabReverse) {
+
145 MoveSelectorWrap(-1);
+
146 }
+
147
+
148 *selector_ = std::max(0, std::min(int(children_.size()) - 1, *selector_));
+
149 return old_selected != *selector_;
+
150 }
+
151
+
152 bool OnMouseEvent(Event event) override {
+
153 if (ContainerBase::OnMouseEvent(event)) {
+
154 return true;
+
155 }
+
156
+
157 if (event.mouse().button != Mouse::WheelUp &&
+
158 event.mouse().button != Mouse::WheelDown) {
+
159 return false;
+
160 }
+
161
+
162 if (!box_.Contain(event.mouse().x, event.mouse().y)) {
+
163 return false;
+
164 }
+
165
+
166 const int old_selected = *selector_;
+
167 if (event.mouse().button == Mouse::WheelUp) {
+
168 MoveSelector(-1);
+
169 }
+
170 if (event.mouse().button == Mouse::WheelDown) {
+
171 MoveSelector(+1);
+
172 }
+
173 *selector_ = std::max(0, std::min(int(children_.size()) - 1, *selector_));
+
174
+
175 return old_selected != *selector_;
+
176 }
+
177
+
178 Box box_;
+
179};
+
180
+
181class HorizontalContainer : public ContainerBase {
+
182 public:
+
183 using ContainerBase::ContainerBase;
+
184
+
185 Element OnRender() override {
+
186 Elements elements;
+
187 elements.reserve(children_.size());
+
188 for (auto& it : children_) {
+
189 elements.push_back(it->Render());
+
190 }
+
191 if (elements.empty()) {
+
192 return text("Empty container");
+
193 }
+
194 return hbox(std::move(elements));
+
195 }
+
196
+
197 bool EventHandler(Event event) override {
+
198 const int old_selected = *selector_;
+
199 if (event == Event::ArrowLeft || event == Event::Character('h')) {
+
200 MoveSelector(-1);
+
201 }
+
202 if (event == Event::ArrowRight || event == Event::Character('l')) {
+
203 MoveSelector(+1);
+
204 }
+
205 if (event == Event::Tab) {
+
206 MoveSelectorWrap(+1);
+
207 }
+
208 if (event == Event::TabReverse) {
+
209 MoveSelectorWrap(-1);
+
210 }
+
211
+
212 *selector_ = std::max(0, std::min(int(children_.size()) - 1, *selector_));
+
213 return old_selected != *selector_;
+
214 }
+
215};
+
216
+
217class TabContainer : public ContainerBase {
+
218 public:
+
219 using ContainerBase::ContainerBase;
+
220
+
221 Element OnRender() override {
+
222 const Component active_child = ActiveChild();
+
223 if (active_child) {
+
224 return active_child->Render();
+
225 }
+
226 return text("Empty container");
+
227 }
+
228
+
229 bool Focusable() const override {
+
230 if (children_.empty()) {
+
231 return false;
+
232 }
+
233 return children_[size_t(*selector_) % children_.size()]->Focusable();
+
234 }
+
235
+
236 bool OnMouseEvent(Event event) override {
+
237 return ActiveChild() && ActiveChild()->OnEvent(event);
+
238 }
+
239};
+
240
+
241class StackedContainer : public ContainerBase {
+
242 public:
+
243 explicit StackedContainer(Components children)
+
244 : ContainerBase(std::move(children), nullptr) {}
+
245
+
246 private:
+
247 Element OnRender() final {
+
248 Elements elements;
+
249 for (auto& child : children_) {
+
250 elements.push_back(child->Render());
+
251 }
+
252 // Reverse the order of the elements.
+
253 std::reverse(elements.begin(), elements.end());
+
254 return dbox(std::move(elements));
+
255 }
+
256
+
257 bool Focusable() const final {
+
258 for (const auto& child : children_) {
+
259 if (child->Focusable()) {
+
260 return true;
+
261 }
+
262 }
+
263 return false;
+
264 }
+
265
+
266 Component ActiveChild() final {
+
267 if (children_.empty()) {
+
268 return nullptr;
+
269 }
+
270 return children_[0];
+
271 }
+
272
+
273 void SetActiveChild(ComponentBase* child) final {
+
274 if (children_.empty()) {
+
275 return;
+
276 }
+
277
+
278 // Find `child` and put it at the beginning without change the order of the
+
279 // other children.
+
280 auto it =
+
281 std::find_if(children_.begin(), children_.end(),
+
282 [child](const Component& c) { return c.get() == child; });
+
283 if (it == children_.end()) {
+
284 return;
+
285 }
+
286 std::rotate(children_.begin(), it, it + 1);
+
287 }
+
288
+
289 bool OnEvent(Event event) final {
+
290 for (auto& child : children_) {
+
291 if (child->OnEvent(event)) {
+
292 return true;
+
293 }
+
294 }
+
295 return false;
+
296 }
+
297};
+
298
+
299namespace Container {
+
300
+
301/// @brief A list of components, drawn one by one vertically and navigated
+
302/// vertically using up/down arrow key or 'j'/'k' keys.
+
303/// @param children the list of components.
+
304/// @ingroup component
+
305/// @see ContainerBase
+
306///
+
307/// ### Example
+
308///
+
309/// ```cpp
+
310/// auto container = Container::Vertical({
+
311/// children_1,
+
312/// children_2,
+
313/// children_3,
+
314/// children_4,
+
315/// });
+
316/// ```
+
+ +
318 return Vertical(std::move(children), nullptr);
+
319}
+
+
320
+
321/// @brief A list of components, drawn one by one vertically and navigated
+
322/// vertically using up/down arrow key or 'j'/'k' keys.
+
323/// This is useful for implementing a Menu for instance.
+
324/// @param children the list of components.
+
325/// @param selector A reference to the index of the selected children.
+
326/// @ingroup component
+
327/// @see ContainerBase
+
328///
+
329/// ### Example
+
330///
+
331/// ```cpp
+
332/// auto container = Container::Vertical({
+
333/// children_1,
+
334/// children_2,
+
335/// children_3,
+
336/// children_4,
+
337/// }, &selected_children);
+
338/// ```
+
+
339Component Vertical(Components children, int* selector) {
+
340 return std::make_shared<VerticalContainer>(std::move(children), selector);
+
341}
+
+
342
+
343/// @brief A list of components, drawn one by one horizontally and navigated
+
344/// horizontally using left/right arrow key or 'h'/'l' keys.
+
345/// @param children the list of components.
+
346/// @ingroup component
+
347/// @see ContainerBase
+
348///
+
349/// ### Example
+
350///
+
351/// ```cpp
+
352/// int selected_children = 2;
+
353/// auto container = Container::Horizontal({
+
354/// children_1,
+
355/// children_2,
+
356/// children_3,
+
357/// children_4,
+
358/// });
+
359/// ```
+
+ +
361 return Horizontal(std::move(children), nullptr);
+
362}
+
+
363
+
364/// @brief A list of components, drawn one by one horizontally and navigated
+
365/// horizontally using left/right arrow key or 'h'/'l' keys.
+
366/// @param children the list of components.
+
367/// @param selector A reference to the index of the selected children.
+
368/// @ingroup component
+
369/// @see ContainerBase
+
370///
+
371/// ### Example
+
372///
+
373/// ```cpp
+
374/// int selected_children = 2;
+
375/// auto container = Container::Horizontal({
+
376/// children_1,
+
377/// children_2,
+
378/// children_3,
+
379/// children_4,
+
380/// }, selected_children);
+
381/// ```
+
+
382Component Horizontal(Components children, int* selector) {
+
383 return std::make_shared<HorizontalContainer>(std::move(children), selector);
+
384}
+
+
385
+
386/// @brief A list of components, where only one is drawn and interacted with at
+
387/// a time. The |selector| gives the index of the selected component. This is
+
388/// useful to implement tabs.
+
389/// @param children The list of components.
+
390/// @param selector The index of the drawn children.
+
391/// @ingroup component
+
392/// @see ContainerBase
+
393///
+
394/// ### Example
+
395///
+
396/// ```cpp
+
397/// int tab_drawn = 0;
+
398/// auto container = Container::Tab({
+
399/// children_1,
+
400/// children_2,
+
401/// children_3,
+
402/// children_4,
+
403/// }, &tab_drawn);
+
404/// ```
+
+
405Component Tab(Components children, int* selector) {
+
406 return std::make_shared<TabContainer>(std::move(children), selector);
+
407}
+
+
408
+
409/// @brief A list of components to be stacked on top of each other.
+
410/// Events are propagated to the first component, then the second if not
+
411/// handled, etc.
+
412/// The components are drawn in the reverse order they are given.
+
413/// When a component take focus, it is put at the front, without changing the
+
414/// relative order of the other elements.
+
415///
+
416/// This should be used with the `Window` component.
+
417///
+
418/// @param children The list of components.
+
419/// @ingroup component
+
420/// @see Window
+
421///
+
422/// ### Example
+
423///
+
424/// ```cpp
+
425/// auto container = Container::Stacked({
+
426/// children_1,
+
427/// children_2,
+
428/// children_3,
+
429/// children_4,
+
430/// });
+
431/// ```
+
+ +
433 return std::make_shared<StackedContainer>(std::move(children));
+
434}
+
+
435
+
436} // namespace Container
+
437
+
438} // namespace ftxui
+ + + + + +
static const Event TabReverse
Definition event.hpp:56
+
virtual bool Focusable() const
Return true when the component contains focusable elements. The non focusable Components will be skip...
+ + +
bool Focused() const
Returns if the elements if focused by the user. True when the ComponentBase is focused by the user....
+
static const Event PageUp
Definition event.hpp:62
+
void Add(Component children)
Add a child. @param child The child to be attached.
Definition component.cpp:70
+ +
static const Event ArrowUp
Definition event.hpp:42
+
static const Event Tab
Definition event.hpp:55
+
static const Event ArrowDown
Definition event.hpp:43
+
static const Event End
Definition event.hpp:61
+
static const Event Home
Definition event.hpp:60
+
virtual bool OnEvent(Event)
Called in response to an event.
+
static const Event PageDown
Definition event.hpp:63
+ +
static const Event ArrowLeft
Definition event.hpp:40
+
static const Event ArrowRight
Definition event.hpp:41
+
Component Horizontal(Components children)
A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow...
+
Component Vertical(Components children)
A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
+
Component Stacked(Components children)
A list of components to be stacked on top of each other. Events are propagated to the first component...
+
Component Tab(Components children, int *selector)
A list of components, where only one is drawn and interacted with at a time. The |selector| gives the...
+
Element text(std::wstring text)
Display a piece of unicode text.
Definition text.cpp:160
+
Element dbox(Elements)
Stack several element on top of each other.
+
Element vbox(Elements)
A container displaying elements vertically one by one.
Definition vbox.cpp:96
+
bool Contain(int x, int y) const
Definition box.cpp:42
+
int y_min
Definition box.hpp:19
+
int y_max
Definition box.hpp:20
+ +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+
std::vector< Component > Components
+
Element hbox(Elements)
A container displaying elements horizontally one by one.
Definition hbox.cpp:94
+
std::vector< Element > Elements
Definition elements.hpp:23
+
Decorator reflect(Box &box)
Definition reflect.cpp:43
+
std::shared_ptr< ComponentBase > Component
+
+
+ + + + + diff --git a/cookie.js b/cookie.js new file mode 100644 index 000000000..53ad21d98 --- /dev/null +++ b/cookie.js @@ -0,0 +1,58 @@ +/*! + Cookie helper functions + Copyright (c) 2023 Dimitri van Heesch + Released under MIT license. +*/ +let Cookie = { + cookie_namespace: 'doxygen_', + + readSetting(cookie,defVal) { + if (window.chrome) { + const val = localStorage.getItem(this.cookie_namespace+cookie) || + sessionStorage.getItem(this.cookie_namespace+cookie); + if (val) return val; + } else { + let myCookie = this.cookie_namespace+cookie+"="; + if (document.cookie) { + const index = document.cookie.indexOf(myCookie); + if (index != -1) { + const valStart = index + myCookie.length; + let valEnd = document.cookie.indexOf(";", valStart); + if (valEnd == -1) { + valEnd = document.cookie.length; + } + return document.cookie.substring(valStart, valEnd); + } + } + } + return defVal; + }, + + writeSetting(cookie,val,days=10*365) { // default days='forever', 0=session cookie, -1=delete + if (window.chrome) { + if (days==0) { + sessionStorage.setItem(this.cookie_namespace+cookie,val); + } else { + localStorage.setItem(this.cookie_namespace+cookie,val); + } + } else { + let date = new Date(); + date.setTime(date.getTime()+(days*24*60*60*1000)); + const expiration = days!=0 ? "expires="+date.toGMTString()+";" : ""; + document.cookie = this.cookie_namespace + cookie + "=" + + val + "; SameSite=Lax;" + expiration + "path=/"; + } + }, + + eraseSetting(cookie) { + if (window.chrome) { + if (localStorage.getItem(this.cookie_namespace+cookie)) { + localStorage.removeItem(this.cookie_namespace+cookie); + } else if (sessionStorage.getItem(this.cookie_namespace+cookie)) { + sessionStorage.removeItem(this.cookie_namespace+cookie); + } + } else { + this.writeSetting(cookie,'',-1); + } + }, +} diff --git a/cpp20-modules.html b/cpp20-modules.html new file mode 100644 index 000000000..48314f01a --- /dev/null +++ b/cpp20-modules.html @@ -0,0 +1,299 @@ + + + + + + + + +FTXUI: C++20 Modules + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
C++20 Modules
+
+
+
Warning
This feature is still in development, and the API may change in future releases. Your contribution is needed to help us improve the compatibility and usability of C++20 modules in FTXUI. If you encounter any issues or have suggestions, please open an issue.
+

FTXUI experimentally supports C++20 modules to reduce compilation times and improve code organization. Each header has a corresponding module.

+

Use the FTXUI_BUILD_MODULES option to build the FTXUI project itself to provide C++ 20 modules, for example with CMake and Ninja:

+
cmake \
+
-DCMAKE_GENERATOR=Ninja \
+
-DFTXUI_BUILD_MODULES=ON \
+
..
+
+
ninja
+
Note
To use modules, you need a C++20 compatible compiler, CMake version 3.20 or higher, and use a compatible generator like Ninja. Note that Makefile generators do not support modules.
+

Then, in your own code you can consume the modules and code as normal:

+
import ftxui;
+
+
int main() {
+ +
auto button = ftxui::Button("Click me", screen.QuitClosure());
+
screen.Loop(button);
+
return 0;
+
}
+ +
static ScreenInteractive TerminalOutput()
+
Component Button(ButtonOption options)
Draw a button. Execute a function when clicked.
+
Module file re-exporting all FTXUI submodules.
+

Note, the ftxui convenience module which simply pulls together all the modules:

+
export import ftxui.component;
+
export import ftxui.dom;
+
export import ftxui.screen;
+
export import ftxui.util;
+
Module file for FTXUI component operations.
+
Module file for FTXUI main operations.
+
Module file for FTXUI screen operations.
+
Module file for FTXUI utility operations.
+

You can instead import only the module(s) you need if desired.

+

To properly find and link the modules with CMake, use target_link_libraries to get the right compiler, linker, etc. flags.

+
target_link_libraries(my_executable
+
#...whatever...
+
PRIVATE ftxui::modules
+
)
+

+Module list

+

The modules directly reference the corresponding header, or a group of related headers to provide a more convenient interface. The following modules are available:

+
    +
  • ftxui
      +
    • ftxui.component
        +
      • ftxui.component.Animation
      • +
      • ftxui.component.CapturedMouse
      • +
      • ftxui.component.Component
      • +
      • ftxui.component.ComponentBase
      • +
      • ftxui.component.ComponentOptions
      • +
      • ftxui.component.Event
      • +
      • ftxui.component.Loop
      • +
      • ftxui.component.Mouse
      • +
      • ftxui.component.Receiver
      • +
      • ftxui.component.ScreenInteractive
      • +
      • ftxui.component.Task
      • +
      +
    • +
    +
  • +
  • ftxui.dom
      +
    • ftxui.dom.Canvas
    • +
    • ftxui.dom.Deprecated
    • +
    • ftxui.dom.Direction
    • +
    • ftxui.dom.Elements
    • +
    • ftxui.dom.FlexboxConfig
    • +
    • ftxui.dom.LinearGradient
    • +
    • ftxui.dom.Node
    • +
    • ftxui.dom.Requirement
    • +
    • ftxui.dom.Selection
    • +
    • ftxui.dom.Table
    • +
    +
  • +
  • ftxui.screen
      +
    • ftxui.screen.Box
    • +
    • ftxui.screen.Color
    • +
    • ftxui.screen.ColorInfo
    • +
    • ftxui.screen.Deprecated
    • +
    • ftxui.screen.Image
    • +
    • ftxui.screen.Pixel
    • +
    • ftxui.screen.Screen
    • +
    • ftxui.screen.String
    • +
    • ftxui.screen.Terminal
    • +
    +
  • +
  • ftxui.util
      +
    • ftxui.util.AutoReset
    • +
    • ftxui.util.Ref
    • +
    +
  • +
+
+
+
+ + + + + diff --git a/cpp20-modules_8md.html b/cpp20-modules_8md.html new file mode 100644 index 000000000..edc7e3c49 --- /dev/null +++ b/cpp20-modules_8md.html @@ -0,0 +1,209 @@ + + + + + + + + +FTXUI: cpp20-modules.md File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
cpp20-modules.md File Reference
+
+
+
+
+ + + + + diff --git a/custom__loop_8cpp.html b/custom__loop_8cpp.html new file mode 100644 index 000000000..6d769f69a --- /dev/null +++ b/custom__loop_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: custom_loop.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
custom_loop.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 17 of file custom_loop.cpp.

+ +
+
+
+
+ + + + + diff --git a/custom__loop_8cpp.js b/custom__loop_8cpp.js new file mode 100644 index 000000000..210f08098 --- /dev/null +++ b/custom__loop_8cpp.js @@ -0,0 +1,4 @@ +var custom__loop_8cpp = +[ + [ "main", "custom__loop_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/custom__loop_8cpp_source.html b/custom__loop_8cpp_source.html new file mode 100644 index 000000000..970eee739 --- /dev/null +++ b/custom__loop_8cpp_source.html @@ -0,0 +1,275 @@ + + + + + + + + +FTXUI: custom_loop.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
custom_loop.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <stdlib.h> // for EXIT_SUCCESS
+
5#include <chrono> // for milliseconds
+
6#include <ftxui/component/event.hpp> // for Event
+
7#include <ftxui/component/mouse.hpp> // for ftxui
+
8#include <ftxui/dom/elements.hpp> // for text, separator, Element, operator|, vbox, border
+
9#include <memory> // for allocator, shared_ptr
+
10#include <string> // for operator+, to_string
+
11#include <thread> // for sleep_for
+
12
+
13#include "ftxui/component/component.hpp" // for CatchEvent, Renderer, operator|=
+
14#include "ftxui/component/loop.hpp" // for Loop
+
15#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
16
+
+
17int main() {
+
18 using namespace ftxui;
+
19 auto screen = ScreenInteractive::FitComponent();
+
20
+
21 // Create a component counting the number of frames drawn and event handled.
+
22 int custom_loop_count = 0;
+
23 int frame_count = 0;
+
24 int event_count = 0;
+
25 auto component = Renderer([&] {
+
26 frame_count++;
+
27 return vbox({
+
28 text("This demonstrates using a custom ftxui::Loop. It "),
+
29 text("runs at 100 iterations per seconds. The FTXUI events "),
+
30 text("are all processed once per iteration and a new frame "),
+
31 text("is rendered as needed"),
+
32 separator(),
+
33 text("ftxui event count: " + std::to_string(event_count)),
+
34 text("ftxui frame count: " + std::to_string(frame_count)),
+
35 text("Custom loop count: " + std::to_string(custom_loop_count)),
+
36 }) |
+
37 border;
+
38 });
+
39
+
40 component |= CatchEvent([&](Event) -> bool {
+
41 event_count++;
+
42 return false;
+
43 });
+
44
+
45 Loop loop(&screen, component);
+
46
+
47 while (!loop.HasQuitted()) {
+
48 custom_loop_count++;
+
49 loop.RunOnce();
+
50 std::this_thread::sleep_for(std::chrono::milliseconds(10));
+
51 }
+
52
+
53 return EXIT_SUCCESS;
+
54}
+
+ +
int main()
+ + +
Loop is a class that manages the event loop for a component.
Definition loop.hpp:56
+
Represent an event. It can be key press event, a terminal resize, or more ...
Definition event.hpp:29
+ + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/dim_8cpp.html b/dim_8cpp.html new file mode 100644 index 000000000..4005ce07f --- /dev/null +++ b/dim_8cpp.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: dim.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
dim.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+ + + + +

+Functions

Element dim (Element child)
 Use a light font, for elements with less emphasis.
 
+
+
+ + + + + diff --git a/dim_8cpp.js b/dim_8cpp.js new file mode 100644 index 000000000..f3e4b0d54 --- /dev/null +++ b/dim_8cpp.js @@ -0,0 +1,4 @@ +var dim_8cpp = +[ + [ "dim", "dim_8cpp.html#gac6a3b77604739516e809369810896646", null ] +]; \ No newline at end of file diff --git a/dim_8cpp_source.html b/dim_8cpp_source.html new file mode 100644 index 000000000..8b163e6a4 --- /dev/null +++ b/dim_8cpp_source.html @@ -0,0 +1,259 @@ + + + + + + + + +FTXUI: dim.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
dim.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <memory> // for make_shared
+
5#include <utility> // for move
+
6
+
7#include "ftxui/dom/elements.hpp" // for Element, dim
+
8#include "ftxui/dom/node.hpp" // for Node
+
9#include "ftxui/dom/node_decorator.hpp" // for NodeDecorator
+
10#include "ftxui/screen/box.hpp" // for Box
+
11#include "ftxui/screen/screen.hpp" // for Pixel, Screen
+
12
+
13namespace ftxui {
+
14
+
15namespace {
+
16class Dim : public NodeDecorator {
+
17 public:
+ +
19
+
20 void Render(Screen& screen) override {
+
21 Node::Render(screen);
+
22 for (int y = box_.y_min; y <= box_.y_max; ++y) {
+
23 for (int x = box_.x_min; x <= box_.x_max; ++x) {
+
24 screen.PixelAt(x, y).dim = true;
+
25 }
+
26 }
+
27 }
+
28};
+
29} // namespace
+
30
+
31/// @brief Use a light font, for elements with less emphasis.
+
32/// @ingroup dom
+
+ +
34 return std::make_shared<Dim>(std::move(child));
+
35}
+
+
36
+
37} // namespace ftxui
+ +
NodeDecorator(Element child)
+ +
friend void Render(Screen &screen, Node *node, Selection &selection)
Definition node.cpp:96
+
Element dim(Element)
Use a light font, for elements with less emphasis.
Definition dim.cpp:33
+
void Render(Screen &screen, const Element &element)
Display an element on a ftxui::Screen.
Definition node.cpp:84
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+ + + +
+
+ + + + + diff --git a/dir_000000_000005.html b/dir_000000_000005.html new file mode 100644 index 000000000..56bf9bf30 --- /dev/null +++ b/dir_000000_000005.html @@ -0,0 +1,206 @@ + + + + + + + + +FTXUI: component -> dom Relation + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+

component → dom Relation

File in examples/componentIncludes file in examples/dom
homescreen.cppcolor_info_sorted_2d.ipp
+
+ + + + + diff --git a/dir_000000_000011.html b/dir_000000_000011.html new file mode 100644 index 000000000..6079c6ca2 --- /dev/null +++ b/dir_000000_000011.html @@ -0,0 +1,206 @@ + + + + + + + + +FTXUI: component -> include Relation + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+

component → include Relation

File in examples/componentIncludes file in include
button_animated.cppftxui / component / captured_mouse.hpp
button_animated.cppftxui / screen / color.hpp
button_animated.cppftxui / component / component.hpp
button_animated.cppftxui / component / component_base.hpp
button_animated.cppftxui / component / component_options.hpp
button_animated.cppftxui / dom / elements.hpp
button_animated.cppftxui / component / screen_interactive.hpp
button_in_frame.cppftxui / component / captured_mouse.hpp
button_in_frame.cppftxui / screen / color.hpp
button_in_frame.cppftxui / component / component.hpp
button_in_frame.cppftxui / component / component_base.hpp
button_in_frame.cppftxui / component / component_options.hpp
button_in_frame.cppftxui / dom / elements.hpp
button_in_frame.cppftxui / component / screen_interactive.hpp
button_style.cppftxui / component / captured_mouse.hpp
button_style.cppftxui / screen / color.hpp
button_style.cppftxui / component / component.hpp
button_style.cppftxui / component / component_base.hpp
button_style.cppftxui / component / component_options.hpp
button_style.cppftxui / dom / elements.hpp
button_style.cppftxui / component / screen_interactive.hpp
canvas_animated.cppftxui / dom / canvas.hpp
canvas_animated.cppftxui / screen / color.hpp
canvas_animated.cppftxui / component / component.hpp
canvas_animated.cppftxui / component / component_base.hpp
canvas_animated.cppftxui / dom / elements.hpp
canvas_animated.cppftxui / component / event.hpp
canvas_animated.cppftxui / component / mouse.hpp
canvas_animated.cppftxui / screen / screen.hpp
canvas_animated.cppftxui / component / screen_interactive.hpp
checkbox_in_frame.cppftxui / component / captured_mouse.hpp
checkbox_in_frame.cppftxui / component / component.hpp
checkbox_in_frame.cppftxui / component / component_base.hpp
checkbox_in_frame.cppftxui / dom / elements.hpp
checkbox_in_frame.cppftxui / component / screen_interactive.hpp
composition.cppftxui / component / captured_mouse.hpp
composition.cppftxui / component / component.hpp
composition.cppftxui / component / component_base.hpp
composition.cppftxui / dom / elements.hpp
composition.cppftxui / component / screen_interactive.hpp
custom_loop.cppftxui / component / component.hpp
custom_loop.cppftxui / dom / elements.hpp
custom_loop.cppftxui / component / event.hpp
custom_loop.cppftxui / component / loop.hpp
custom_loop.cppftxui / component / mouse.hpp
custom_loop.cppftxui / component / screen_interactive.hpp
dropdown_custom.cppftxui / component / captured_mouse.hpp
dropdown_custom.cppftxui / component / component.hpp
dropdown_custom.cppftxui / component / screen_interactive.hpp
examples/component/button.cppftxui / component / captured_mouse.hpp
examples/component/button.cppftxui / component / component.hpp
examples/component/button.cppftxui / component / component_base.hpp
examples/component/button.cppftxui / dom / elements.hpp
examples/component/button.cppftxui / component / screen_interactive.hpp
examples/component/checkbox.cppftxui / component / captured_mouse.hpp
examples/component/checkbox.cppftxui / component / component.hpp
examples/component/checkbox.cppftxui / component / component_base.hpp
examples/component/checkbox.cppftxui / dom / elements.hpp
examples/component/checkbox.cppftxui / component / screen_interactive.hpp
examples/component/collapsible.cppftxui / component / captured_mouse.hpp
examples/component/collapsible.cppftxui / component / component.hpp
examples/component/collapsible.cppftxui / component / component_base.hpp
examples/component/collapsible.cppftxui / dom / elements.hpp
examples/component/collapsible.cppftxui / component / screen_interactive.hpp
examples/component/dropdown.cppftxui / component / captured_mouse.hpp
examples/component/dropdown.cppftxui / component / component.hpp
examples/component/dropdown.cppftxui / component / screen_interactive.hpp
examples/component/focus.cppftxui / component / captured_mouse.hpp
examples/component/focus.cppftxui / screen / color.hpp
examples/component/focus.cppftxui / component / component.hpp
examples/component/focus.cppftxui / component / component_base.hpp
examples/component/focus.cppftxui / dom / elements.hpp
examples/component/focus.cppftxui / component / screen_interactive.hpp
examples/component/input.cppftxui / component / captured_mouse.hpp
examples/component/input.cppftxui / component / component.hpp
examples/component/input.cppftxui / component / component_base.hpp
examples/component/input.cppftxui / component / component_options.hpp
examples/component/input.cppftxui / dom / elements.hpp
examples/component/input.cppftxui / util / ref.hpp
examples/component/input.cppftxui / component / screen_interactive.hpp
examples/component/maybe.cppftxui / component / captured_mouse.hpp
examples/component/maybe.cppftxui / screen / color.hpp
examples/component/maybe.cppftxui / component / component.hpp
examples/component/maybe.cppftxui / component / component_base.hpp
examples/component/maybe.cppftxui / dom / elements.hpp
examples/component/maybe.cppftxui / component / screen_interactive.hpp
examples/component/menu.cppftxui / component / captured_mouse.hpp
examples/component/menu.cppftxui / component / component.hpp
examples/component/menu.cppftxui / component / component_options.hpp
examples/component/menu.cppftxui / component / screen_interactive.hpp
examples/component/radiobox.cppftxui / component / captured_mouse.hpp
examples/component/radiobox.cppftxui / component / component.hpp
examples/component/radiobox.cppftxui / component / screen_interactive.hpp
examples/component/renderer.cppftxui / component / captured_mouse.hpp
examples/component/renderer.cppftxui / screen / color.hpp
examples/component/renderer.cppftxui / component / component.hpp
examples/component/renderer.cppftxui / component / component_base.hpp
examples/component/renderer.cppftxui / dom / elements.hpp
examples/component/renderer.cppftxui / component / screen_interactive.hpp
examples/component/resizable_split.cppftxui / component / captured_mouse.hpp
examples/component/resizable_split.cppftxui / component / component.hpp
examples/component/resizable_split.cppftxui / component / component_base.hpp
examples/component/resizable_split.cppftxui / dom / elements.hpp
examples/component/resizable_split.cppftxui / component / screen_interactive.hpp
examples/component/selection.cppftxui / component / component.hpp
examples/component/selection.cppftxui / component / component_base.hpp
examples/component/selection.cppftxui / component / component_options.hpp
examples/component/selection.cppftxui / dom / elements.hpp
examples/component/selection.cppftxui / util / ref.hpp
examples/component/selection.cppftxui / component / screen_interactive.hpp
examples/component/slider.cppftxui / component / captured_mouse.hpp
examples/component/slider.cppftxui / component / component.hpp
examples/component/slider.cppftxui / component / screen_interactive.hpp
examples/component/window.cppftxui / component / component.hpp
examples/component/window.cppftxui / component / screen_interactive.hpp
flexbox_gallery.cppftxui / component / captured_mouse.hpp
flexbox_gallery.cppftxui / screen / color.hpp
flexbox_gallery.cppftxui / component / component.hpp
flexbox_gallery.cppftxui / component / component_base.hpp
flexbox_gallery.cppftxui / dom / elements.hpp
flexbox_gallery.cppftxui / dom / flexbox_config.hpp
flexbox_gallery.cppftxui / component / screen_interactive.hpp
focus_cursor.cppftxui / component / captured_mouse.hpp
focus_cursor.cppftxui / component / component.hpp
focus_cursor.cppftxui / dom / elements.hpp
focus_cursor.cppftxui / component / screen_interactive.hpp
gallery.cppftxui / component / captured_mouse.hpp
gallery.cppftxui / component / component.hpp
gallery.cppftxui / component / component_base.hpp
gallery.cppftxui / dom / elements.hpp
gallery.cppftxui / component / screen_interactive.hpp
homescreen.cppftxui / screen / color.hpp
homescreen.cppftxui / screen / color_info.hpp
homescreen.cppftxui / component / component.hpp
homescreen.cppftxui / component / component_base.hpp
homescreen.cppftxui / component / component_options.hpp
homescreen.cppftxui / dom / elements.hpp
homescreen.cppftxui / component / event.hpp
homescreen.cppftxui / dom / flexbox_config.hpp
homescreen.cppftxui / component / loop.hpp
homescreen.cppftxui / component / screen_interactive.hpp
homescreen.cppftxui / screen / terminal.hpp
input_in_frame.cppftxui / component / captured_mouse.hpp
input_in_frame.cppftxui / component / component.hpp
input_in_frame.cppftxui / component / component_base.hpp
input_in_frame.cppftxui / dom / elements.hpp
input_in_frame.cppftxui / component / screen_interactive.hpp
input_style.cppftxui / screen / color.hpp
input_style.cppftxui / component / component.hpp
input_style.cppftxui / component / component_base.hpp
input_style.cppftxui / component / component_options.hpp
input_style.cppftxui / dom / elements.hpp
input_style.cppftxui / dom / linear_gradient.hpp
input_style.cppftxui / component / screen_interactive.hpp
linear_gradient_gallery.cppftxui / component / captured_mouse.hpp
linear_gradient_gallery.cppftxui / screen / color.hpp
linear_gradient_gallery.cppftxui / component / component.hpp
linear_gradient_gallery.cppftxui / component / component_base.hpp
linear_gradient_gallery.cppftxui / dom / elements.hpp
linear_gradient_gallery.cppftxui / dom / linear_gradient.hpp
linear_gradient_gallery.cppftxui / component / screen_interactive.hpp
menu2.cppftxui / component / captured_mouse.hpp
menu2.cppftxui / component / component.hpp
menu2.cppftxui / component / component_base.hpp
menu2.cppftxui / component / component_options.hpp
menu2.cppftxui / dom / elements.hpp
menu2.cppftxui / component / screen_interactive.hpp
menu_entries.cppftxui / component / captured_mouse.hpp
menu_entries.cppftxui / screen / color.hpp
menu_entries.cppftxui / component / component.hpp
menu_entries.cppftxui / component / component_base.hpp
menu_entries.cppftxui / component / component_options.hpp
menu_entries.cppftxui / dom / elements.hpp
menu_entries.cppftxui / component / screen_interactive.hpp
menu_entries_animated.cppftxui / component / captured_mouse.hpp
menu_entries_animated.cppftxui / screen / color.hpp
menu_entries_animated.cppftxui / component / component.hpp
menu_entries_animated.cppftxui / component / component_base.hpp
menu_entries_animated.cppftxui / component / component_options.hpp
menu_entries_animated.cppftxui / dom / elements.hpp
menu_entries_animated.cppftxui / component / screen_interactive.hpp
menu_in_frame.cppftxui / component / captured_mouse.hpp
menu_in_frame.cppftxui / component / component.hpp
menu_in_frame.cppftxui / component / component_base.hpp
menu_in_frame.cppftxui / dom / elements.hpp
menu_in_frame.cppftxui / component / screen_interactive.hpp
menu_in_frame_horizontal.cppftxui / component / captured_mouse.hpp
menu_in_frame_horizontal.cppftxui / component / component.hpp
menu_in_frame_horizontal.cppftxui / component / component_base.hpp
menu_in_frame_horizontal.cppftxui / dom / elements.hpp
menu_in_frame_horizontal.cppftxui / component / screen_interactive.hpp
menu_multiple.cppftxui / component / captured_mouse.hpp
menu_multiple.cppftxui / component / component.hpp
menu_multiple.cppftxui / component / component_base.hpp
menu_multiple.cppftxui / dom / elements.hpp
menu_multiple.cppftxui / component / screen_interactive.hpp
menu_style.cppftxui / component / animation.hpp
menu_style.cppftxui / screen / color.hpp
menu_style.cppftxui / component / component.hpp
menu_style.cppftxui / component / component_base.hpp
menu_style.cppftxui / component / component_options.hpp
menu_style.cppftxui / dom / elements.hpp
menu_style.cppftxui / component / mouse.hpp
menu_style.cppftxui / component / screen_interactive.hpp
menu_underline_animated_gallery.cppftxui / component / animation.hpp
menu_underline_animated_gallery.cppftxui / screen / color.hpp
menu_underline_animated_gallery.cppftxui / component / component.hpp
menu_underline_animated_gallery.cppftxui / component / component_base.hpp
menu_underline_animated_gallery.cppftxui / component / component_options.hpp
menu_underline_animated_gallery.cppftxui / dom / elements.hpp
menu_underline_animated_gallery.cppftxui / component / mouse.hpp
menu_underline_animated_gallery.cppftxui / component / screen_interactive.hpp
modal_dialog.cppftxui / component / component.hpp
modal_dialog.cppftxui / component / component_options.hpp
modal_dialog.cppftxui / dom / elements.hpp
modal_dialog.cppftxui / component / mouse.hpp
modal_dialog.cppftxui / component / screen_interactive.hpp
modal_dialog_custom.cppftxui / component / captured_mouse.hpp
modal_dialog_custom.cppftxui / component / component.hpp
modal_dialog_custom.cppftxui / component / component_base.hpp
modal_dialog_custom.cppftxui / dom / elements.hpp
modal_dialog_custom.cppftxui / component / screen_interactive.hpp
nested_screen.cppftxui / component / captured_mouse.hpp
nested_screen.cppftxui / component / component.hpp
nested_screen.cppftxui / component / component_base.hpp
nested_screen.cppftxui / dom / elements.hpp
nested_screen.cppftxui / component / screen_interactive.hpp
print_key_press.cppftxui / component / captured_mouse.hpp
print_key_press.cppftxui / component / component.hpp
print_key_press.cppftxui / dom / elements.hpp
print_key_press.cppftxui / component / event.hpp
print_key_press.cppftxui / component / mouse.hpp
print_key_press.cppftxui / component / screen_interactive.hpp
radiobox_in_frame.cppftxui / component / captured_mouse.hpp
radiobox_in_frame.cppftxui / component / component.hpp
radiobox_in_frame.cppftxui / component / component_base.hpp
radiobox_in_frame.cppftxui / dom / elements.hpp
radiobox_in_frame.cppftxui / component / screen_interactive.hpp
scrollbar.cppftxui / component / component.hpp
scrollbar.cppftxui / component / screen_interactive.hpp
slider_direction.cppftxui / component / captured_mouse.hpp
slider_direction.cppftxui / component / component.hpp
slider_direction.cppftxui / component / component_base.hpp
slider_direction.cppftxui / component / component_options.hpp
slider_direction.cppftxui / dom / direction.hpp
slider_direction.cppftxui / dom / elements.hpp
slider_direction.cppftxui / util / ref.hpp
slider_direction.cppftxui / component / screen_interactive.hpp
slider_rgb.cppftxui / component / captured_mouse.hpp
slider_rgb.cppftxui / screen / color.hpp
slider_rgb.cppftxui / component / component.hpp
slider_rgb.cppftxui / component / component_base.hpp
slider_rgb.cppftxui / dom / elements.hpp
slider_rgb.cppftxui / component / screen_interactive.hpp
tab_horizontal.cppftxui / component / captured_mouse.hpp
tab_horizontal.cppftxui / component / component.hpp
tab_horizontal.cppftxui / component / component_base.hpp
tab_horizontal.cppftxui / dom / elements.hpp
tab_horizontal.cppftxui / component / screen_interactive.hpp
tab_vertical.cppftxui / component / captured_mouse.hpp
tab_vertical.cppftxui / component / component.hpp
tab_vertical.cppftxui / component / component_base.hpp
tab_vertical.cppftxui / dom / elements.hpp
tab_vertical.cppftxui / component / screen_interactive.hpp
textarea.cppftxui / component / captured_mouse.hpp
textarea.cppftxui / component / component.hpp
textarea.cppftxui / component / component_base.hpp
textarea.cppftxui / dom / elements.hpp
textarea.cppftxui / component / screen_interactive.hpp
toggle.cppftxui / component / captured_mouse.hpp
toggle.cppftxui / component / component.hpp
toggle.cppftxui / component / component_base.hpp
toggle.cppftxui / dom / elements.hpp
toggle.cppftxui / component / screen_interactive.hpp
with_restored_io.cppftxui / component / captured_mouse.hpp
with_restored_io.cppftxui / component / component.hpp
with_restored_io.cppftxui / component / component_base.hpp
with_restored_io.cppftxui / dom / elements.hpp
with_restored_io.cppftxui / component / screen_interactive.hpp
+
+ + + + + diff --git a/dir_000001_000006.html b/dir_000001_000006.html new file mode 100644 index 000000000..9f4442bfd --- /dev/null +++ b/dir_000001_000006.html @@ -0,0 +1,206 @@ + + + + + + + + +FTXUI: component -> dom Relation + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + + diff --git a/dir_000001_000012.html b/dir_000001_000012.html new file mode 100644 index 000000000..77445d8d3 --- /dev/null +++ b/dir_000001_000012.html @@ -0,0 +1,206 @@ + + + + + + + + +FTXUI: component -> screen Relation + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+

component → screen Relation

File in include/ftxui/componentIncludes file in include/ftxui/screen
component_options.hppcolor.hpp
screen_interactive.hppscreen.hpp
+
+ + + + + diff --git a/dir_000001_000015.html b/dir_000001_000015.html new file mode 100644 index 000000000..90b15b517 --- /dev/null +++ b/dir_000001_000015.html @@ -0,0 +1,206 @@ + + + + + + + + +FTXUI: component -> util Relation + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + + diff --git a/dir_000002_000007.html b/dir_000002_000007.html new file mode 100644 index 000000000..3c9482499 --- /dev/null +++ b/dir_000002_000007.html @@ -0,0 +1,206 @@ + + + + + + + + +FTXUI: component -> dom Relation + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+

component → dom Relation

File in src/ftxui/componentIncludes file in src/ftxui/dom
src/ftxui/component/window.cppnode_decorator.hpp
+
+ + + + + diff --git a/dir_000002_000011.html b/dir_000002_000011.html new file mode 100644 index 000000000..c751a614c --- /dev/null +++ b/dir_000002_000011.html @@ -0,0 +1,206 @@ + + + + + + + + +FTXUI: component -> include Relation + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+

component → include Relation

File in src/ftxui/componentIncludes file in include
animation.cppftxui / component / animation.hpp
animation.cppmftxui / component / animation.hpp
captured_mouse.cppmftxui / component / captured_mouse.hpp
catch_event.cppftxui / component / component.hpp
catch_event.cppftxui / component / component_base.hpp
catch_event.cppftxui / component / event.hpp
component.cppftxui / screen / box.hpp
component.cppftxui / component / captured_mouse.hpp
component.cppftxui / component / component.hpp
component.cppftxui / component / component_base.hpp
component.cppftxui / dom / elements.hpp
component.cppftxui / component / event.hpp
component.cppftxui / dom / node.hpp
component.cppftxui / component / screen_interactive.hpp
component/component.cppmftxui / component / component.hpp
component/util.cppftxui / component / component.hpp
component/util.cppftxui / component / component_base.hpp
component_base.cppmftxui / component / component_base.hpp
component_fuzzer.cppftxui / component / component.hpp
component_fuzzer.cppftxui / component / event.hpp
component_options.cppftxui / component / animation.hpp
component_options.cppftxui / screen / color.hpp
component_options.cppftxui / component / component_options.hpp
component_options.cppftxui / dom / direction.hpp
component_options.cppftxui / dom / elements.hpp
component_options.cppmftxui / component / component_options.hpp
container.cppftxui / screen / box.hpp
container.cppftxui / component / component.hpp
container.cppftxui / component / component_base.hpp
container.cppftxui / dom / elements.hpp
container.cppftxui / component / event.hpp
container.cppftxui / component / mouse.hpp
event.cppftxui / component / event.hpp
event.cppftxui / component / mouse.hpp
event.cppftxui / screen / string.hpp
event.cppmftxui / component / event.hpp
hoverable.cppftxui / screen / box.hpp
hoverable.cppftxui / component / component.hpp
hoverable.cppftxui / component / component_base.hpp
hoverable.cppftxui / dom / elements.hpp
hoverable.cppftxui / component / event.hpp
hoverable.cppftxui / component / mouse.hpp
hoverable.cppftxui / component / screen_interactive.hpp
loop.cppftxui / component / loop.hpp
loop.cppftxui / component / screen_interactive.hpp
loop.cppmftxui / component / loop.hpp
modal.cppftxui / component / component.hpp
modal.cppftxui / component / component_base.hpp
modal.cppftxui / dom / elements.hpp
modal.cppftxui / component / event.hpp
mouse.cppmftxui / component / mouse.hpp
receiver.cppmftxui / component / receiver.hpp
screen_interactive.cppftxui / component / animation.hpp
screen_interactive.cppftxui / util / autoreset.hpp
screen_interactive.cppftxui / component / captured_mouse.hpp
screen_interactive.cppftxui / component / component_base.hpp
screen_interactive.cppftxui / component / event.hpp
screen_interactive.cppftxui / component / loop.hpp
screen_interactive.cppftxui / dom / node.hpp
screen_interactive.cppftxui / screen / screen.hpp
screen_interactive.cppftxui / component / screen_interactive.hpp
screen_interactive.cppftxui / component / task.hpp
screen_interactive.cppftxui / screen / terminal.hpp
screen_interactive.cppmftxui / component / screen_interactive.hpp
src/ftxui/component/button.cppftxui / component / animation.hpp
src/ftxui/component/button.cppftxui / screen / box.hpp
src/ftxui/component/button.cppftxui / screen / color.hpp
src/ftxui/component/button.cppftxui / component / component.hpp
src/ftxui/component/button.cppftxui / component / component_base.hpp
src/ftxui/component/button.cppftxui / component / component_options.hpp
src/ftxui/component/button.cppftxui / dom / elements.hpp
src/ftxui/component/button.cppftxui / component / event.hpp
src/ftxui/component/button.cppftxui / component / mouse.hpp
src/ftxui/component/button.cppftxui / util / ref.hpp
src/ftxui/component/button.cppftxui / component / screen_interactive.hpp
src/ftxui/component/checkbox.cppftxui / screen / box.hpp
src/ftxui/component/checkbox.cppftxui / component / component.hpp
src/ftxui/component/checkbox.cppftxui / component / component_base.hpp
src/ftxui/component/checkbox.cppftxui / component / component_options.hpp
src/ftxui/component/checkbox.cppftxui / dom / elements.hpp
src/ftxui/component/checkbox.cppftxui / component / event.hpp
src/ftxui/component/checkbox.cppftxui / component / mouse.hpp
src/ftxui/component/checkbox.cppftxui / util / ref.hpp
src/ftxui/component/collapsible.cppftxui / component / component.hpp
src/ftxui/component/collapsible.cppftxui / component / component_base.hpp
src/ftxui/component/collapsible.cppftxui / component / component_options.hpp
src/ftxui/component/collapsible.cppftxui / dom / elements.hpp
src/ftxui/component/collapsible.cppftxui / util / ref.hpp
src/ftxui/component/dropdown.cppftxui / component / component.hpp
src/ftxui/component/dropdown.cppftxui / component / component_base.hpp
src/ftxui/component/dropdown.cppftxui / component / component_options.hpp
src/ftxui/component/dropdown.cppftxui / dom / elements.hpp
src/ftxui/component/dropdown.cppftxui / component / event.hpp
src/ftxui/component/dropdown.cppftxui / util / ref.hpp
src/ftxui/component/input.cppftxui / screen / box.hpp
src/ftxui/component/input.cppftxui / component / component.hpp
src/ftxui/component/input.cppftxui / component / component_base.hpp
src/ftxui/component/input.cppftxui / component / component_options.hpp
src/ftxui/component/input.cppftxui / dom / elements.hpp
src/ftxui/component/input.cppftxui / component / event.hpp
src/ftxui/component/input.cppftxui / component / mouse.hpp
src/ftxui/component/input.cppftxui / util / ref.hpp
src/ftxui/component/input.cppftxui / component / screen_interactive.hpp
src/ftxui/component/input.cppftxui / screen / string.hpp
src/ftxui/component/maybe.cppftxui / component / component.hpp
src/ftxui/component/maybe.cppftxui / component / component_base.hpp
src/ftxui/component/maybe.cppftxui / dom / elements.hpp
src/ftxui/component/maybe.cppftxui / component / event.hpp
src/ftxui/component/maybe.cppftxui / dom / node.hpp
src/ftxui/component/menu.cppftxui / component / animation.hpp
src/ftxui/component/menu.cppftxui / screen / box.hpp
src/ftxui/component/menu.cppftxui / screen / color.hpp
src/ftxui/component/menu.cppftxui / component / component.hpp
src/ftxui/component/menu.cppftxui / component / component_base.hpp
src/ftxui/component/menu.cppftxui / component / component_options.hpp
src/ftxui/component/menu.cppftxui / dom / direction.hpp
src/ftxui/component/menu.cppftxui / dom / elements.hpp
src/ftxui/component/menu.cppftxui / component / event.hpp
src/ftxui/component/menu.cppftxui / component / mouse.hpp
src/ftxui/component/menu.cppftxui / util / ref.hpp
src/ftxui/component/menu.cppftxui / component / screen_interactive.hpp
src/ftxui/component/radiobox.cppftxui / screen / box.hpp
src/ftxui/component/radiobox.cppftxui / component / component.hpp
src/ftxui/component/radiobox.cppftxui / component / component_base.hpp
src/ftxui/component/radiobox.cppftxui / component / component_options.hpp
src/ftxui/component/radiobox.cppftxui / dom / elements.hpp
src/ftxui/component/radiobox.cppftxui / component / event.hpp
src/ftxui/component/radiobox.cppftxui / component / mouse.hpp
src/ftxui/component/radiobox.cppftxui / util / ref.hpp
src/ftxui/component/radiobox.cppftxui / component / screen_interactive.hpp
src/ftxui/component/renderer.cppftxui / screen / box.hpp
src/ftxui/component/renderer.cppftxui / component / component.hpp
src/ftxui/component/renderer.cppftxui / component / component_base.hpp
src/ftxui/component/renderer.cppftxui / dom / elements.hpp
src/ftxui/component/renderer.cppftxui / component / event.hpp
src/ftxui/component/renderer.cppftxui / component / mouse.hpp
src/ftxui/component/resizable_split.cppftxui / screen / box.hpp
src/ftxui/component/resizable_split.cppftxui / component / captured_mouse.hpp
src/ftxui/component/resizable_split.cppftxui / component / component.hpp
src/ftxui/component/resizable_split.cppftxui / component / component_base.hpp
src/ftxui/component/resizable_split.cppftxui / component / component_options.hpp
src/ftxui/component/resizable_split.cppftxui / dom / direction.hpp
src/ftxui/component/resizable_split.cppftxui / dom / elements.hpp
src/ftxui/component/resizable_split.cppftxui / component / event.hpp
src/ftxui/component/resizable_split.cppftxui / component / mouse.hpp
src/ftxui/component/resizable_split.cppftxui / util / ref.hpp
src/ftxui/component/slider.cppftxui / screen / box.hpp
src/ftxui/component/slider.cppftxui / component / captured_mouse.hpp
src/ftxui/component/slider.cppftxui / screen / color.hpp
src/ftxui/component/slider.cppftxui / component / component.hpp
src/ftxui/component/slider.cppftxui / component / component_base.hpp
src/ftxui/component/slider.cppftxui / component / component_options.hpp
src/ftxui/component/slider.cppftxui / dom / direction.hpp
src/ftxui/component/slider.cppftxui / dom / elements.hpp
src/ftxui/component/slider.cppftxui / component / event.hpp
src/ftxui/component/slider.cppftxui / component / mouse.hpp
src/ftxui/component/slider.cppftxui / util / ref.hpp
src/ftxui/component/slider.cppftxui / component / screen_interactive.hpp
src/ftxui/component/window.cppftxui / screen / color.hpp
src/ftxui/component/window.cppftxui / component / component.hpp
src/ftxui/component/window.cppftxui / component / component_base.hpp
src/ftxui/component/window.cppftxui / component / component_options.hpp
src/ftxui/component/window.cppftxui / dom / elements.hpp
src/ftxui/component/window.cppftxui / screen / screen.hpp
src/ftxui/component/window.cppftxui / component / screen_interactive.hpp
task.cppmftxui / component / task.hpp
terminal_input_parser.cppftxui / component / event.hpp
terminal_input_parser.cppftxui / component / mouse.hpp
terminal_input_parser.cppftxui / component / task.hpp
terminal_input_parser.hppftxui / component / mouse.hpp
terminal_input_parser_test_fuzzer.cppftxui / component / event.hpp
+
+ + + + + diff --git a/dir_000002_000013.html b/dir_000002_000013.html new file mode 100644 index 000000000..5a05b75a6 --- /dev/null +++ b/dir_000002_000013.html @@ -0,0 +1,206 @@ + + + + + + + + +FTXUI: component -> screen Relation + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + + diff --git a/dir_000005_000011.html b/dir_000005_000011.html new file mode 100644 index 000000000..f1c4c9f18 --- /dev/null +++ b/dir_000005_000011.html @@ -0,0 +1,206 @@ + + + + + + + + +FTXUI: dom -> include Relation + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+

dom → include Relation

File in examples/domIncludes file in include
border_colored.cppftxui / screen / color.hpp
border_colored.cppftxui / dom / elements.hpp
border_colored.cppftxui / dom / node.hpp
border_colored.cppftxui / screen / screen.hpp
border_style.cppftxui / screen / color.hpp
border_style.cppftxui / dom / elements.hpp
border_style.cppftxui / dom / node.hpp
border_style.cppftxui / screen / screen.hpp
color_gallery.cppftxui / screen / color.hpp
color_gallery.cppftxui / screen / color_info.hpp
color_gallery.cppftxui / dom / elements.hpp
color_gallery.cppftxui / dom / node.hpp
color_gallery.cppftxui / screen / screen.hpp
color_gallery.cppftxui / screen / terminal.hpp
color_info_palette256.cppftxui / screen / color.hpp
color_info_palette256.cppftxui / screen / color_info.hpp
color_info_palette256.cppftxui / dom / elements.hpp
color_info_palette256.cppftxui / dom / node.hpp
color_info_palette256.cppftxui / screen / screen.hpp
color_info_sorted_2d.ippftxui / screen / color_info.hpp
color_truecolor_HSV.cppftxui / screen / color.hpp
color_truecolor_HSV.cppftxui / dom / elements.hpp
color_truecolor_HSV.cppftxui / dom / node.hpp
color_truecolor_HSV.cppftxui / screen / screen.hpp
color_truecolor_RGB.cppftxui / screen / color.hpp
color_truecolor_RGB.cppftxui / dom / elements.hpp
color_truecolor_RGB.cppftxui / dom / node.hpp
color_truecolor_RGB.cppftxui / screen / screen.hpp
examples/dom/border.cppftxui / screen / color.hpp
examples/dom/border.cppftxui / dom / elements.hpp
examples/dom/border.cppftxui / dom / node.hpp
examples/dom/border.cppftxui / screen / screen.hpp
examples/dom/canvas.cppftxui / dom / canvas.hpp
examples/dom/canvas.cppftxui / screen / color.hpp
examples/dom/canvas.cppftxui / dom / elements.hpp
examples/dom/canvas.cppftxui / dom / node.hpp
examples/dom/canvas.cppftxui / screen / screen.hpp
examples/dom/dbox.cppftxui / screen / color.hpp
examples/dom/dbox.cppftxui / dom / elements.hpp
examples/dom/dbox.cppftxui / dom / node.hpp
examples/dom/dbox.cppftxui / screen / screen.hpp
examples/dom/gauge.cppftxui / screen / color.hpp
examples/dom/gauge.cppftxui / dom / elements.hpp
examples/dom/gauge.cppftxui / dom / node.hpp
examples/dom/gauge.cppftxui / screen / screen.hpp
examples/dom/graph.cppftxui / screen / color.hpp
examples/dom/graph.cppftxui / dom / elements.hpp
examples/dom/graph.cppftxui / dom / node.hpp
examples/dom/graph.cppftxui / screen / screen.hpp
examples/dom/gridbox.cppftxui / screen / color.hpp
examples/dom/gridbox.cppftxui / dom / elements.hpp
examples/dom/gridbox.cppftxui / dom / node.hpp
examples/dom/gridbox.cppftxui / screen / screen.hpp
examples/dom/linear_gradient.cppftxui / screen / color.hpp
examples/dom/linear_gradient.cppftxui / dom / elements.hpp
examples/dom/linear_gradient.cppftxui / dom / linear_gradient.hpp
examples/dom/linear_gradient.cppftxui / dom / node.hpp
examples/dom/linear_gradient.cppftxui / screen / screen.hpp
examples/dom/paragraph.cppftxui / screen / box.hpp
examples/dom/paragraph.cppftxui / dom / elements.hpp
examples/dom/paragraph.cppftxui / dom / node.hpp
examples/dom/paragraph.cppftxui / screen / screen.hpp
examples/dom/separator.cppftxui / screen / color.hpp
examples/dom/separator.cppftxui / dom / elements.hpp
examples/dom/separator.cppftxui / dom / node.hpp
examples/dom/separator.cppftxui / screen / screen.hpp
examples/dom/size.cppftxui / screen / color.hpp
examples/dom/size.cppftxui / dom / elements.hpp
examples/dom/size.cppftxui / dom / node.hpp
examples/dom/size.cppftxui / screen / screen.hpp
examples/dom/spinner.cppftxui / screen / color.hpp
examples/dom/spinner.cppftxui / dom / elements.hpp
examples/dom/spinner.cppftxui / dom / node.hpp
examples/dom/spinner.cppftxui / screen / screen.hpp
examples/dom/table.cppftxui / screen / color.hpp
examples/dom/table.cppftxui / dom / elements.hpp
examples/dom/table.cppftxui / dom / node.hpp
examples/dom/table.cppftxui / screen / screen.hpp
examples/dom/table.cppftxui / dom / table.hpp
gauge_direction.cppftxui / screen / color.hpp
gauge_direction.cppftxui / dom / elements.hpp
gauge_direction.cppftxui / dom / node.hpp
gauge_direction.cppftxui / screen / screen.hpp
hflow.cppftxui / screen / color.hpp
hflow.cppftxui / dom / elements.hpp
hflow.cppftxui / dom / node.hpp
hflow.cppftxui / screen / screen.hpp
html_like.cppftxui / screen / box.hpp
html_like.cppftxui / screen / color.hpp
html_like.cppftxui / dom / elements.hpp
html_like.cppftxui / dom / node.hpp
html_like.cppftxui / screen / screen.hpp
package_manager.cppftxui / screen / color.hpp
package_manager.cppftxui / dom / elements.hpp
package_manager.cppftxui / dom / node.hpp
package_manager.cppftxui / screen / screen.hpp
separator_style.cppftxui / screen / box.hpp
separator_style.cppftxui / dom / elements.hpp
separator_style.cppftxui / dom / node.hpp
separator_style.cppftxui / screen / screen.hpp
style_blink.cppftxui / screen / color.hpp
style_blink.cppftxui / dom / elements.hpp
style_blink.cppftxui / dom / node.hpp
style_blink.cppftxui / screen / screen.hpp
style_bold.cppftxui / screen / color.hpp
style_bold.cppftxui / dom / elements.hpp
style_bold.cppftxui / dom / node.hpp
style_bold.cppftxui / screen / screen.hpp
style_color.cppftxui / screen / color.hpp
style_color.cppftxui / dom / elements.hpp
style_color.cppftxui / dom / linear_gradient.hpp
style_color.cppftxui / dom / node.hpp
style_color.cppftxui / screen / screen.hpp
style_dim.cppftxui / screen / color.hpp
style_dim.cppftxui / dom / elements.hpp
style_dim.cppftxui / dom / node.hpp
style_dim.cppftxui / screen / screen.hpp
style_gallery.cppftxui / screen / color.hpp
style_gallery.cppftxui / dom / elements.hpp
style_gallery.cppftxui / dom / node.hpp
style_gallery.cppftxui / screen / screen.hpp
style_hyperlink.cppftxui / screen / color.hpp
style_hyperlink.cppftxui / dom / elements.hpp
style_hyperlink.cppftxui / dom / node.hpp
style_hyperlink.cppftxui / screen / screen.hpp
style_inverted.cppftxui / screen / color.hpp
style_inverted.cppftxui / dom / elements.hpp
style_inverted.cppftxui / dom / node.hpp
style_inverted.cppftxui / screen / screen.hpp
style_italic.cppftxui / screen / color.hpp
style_italic.cppftxui / dom / elements.hpp
style_italic.cppftxui / dom / node.hpp
style_italic.cppftxui / screen / screen.hpp
style_strikethrough.cppftxui / screen / color.hpp
style_strikethrough.cppftxui / dom / elements.hpp
style_strikethrough.cppftxui / dom / node.hpp
style_strikethrough.cppftxui / screen / screen.hpp
style_underlined.cppftxui / screen / color.hpp
style_underlined.cppftxui / dom / elements.hpp
style_underlined.cppftxui / dom / node.hpp
style_underlined.cppftxui / screen / screen.hpp
style_underlined_double.cppftxui / screen / color.hpp
style_underlined_double.cppftxui / dom / elements.hpp
style_underlined_double.cppftxui / dom / node.hpp
style_underlined_double.cppftxui / screen / screen.hpp
vbox_hbox.cppftxui / screen / color.hpp
vbox_hbox.cppftxui / dom / elements.hpp
vbox_hbox.cppftxui / dom / node.hpp
vbox_hbox.cppftxui / screen / screen.hpp
vflow.cppftxui / screen / color.hpp
vflow.cppftxui / dom / elements.hpp
vflow.cppftxui / dom / node.hpp
vflow.cppftxui / screen / screen.hpp
+
+ + + + + diff --git a/dir_000006_000012.html b/dir_000006_000012.html new file mode 100644 index 000000000..accb649cf --- /dev/null +++ b/dir_000006_000012.html @@ -0,0 +1,206 @@ + + + + + + + + +FTXUI: dom -> screen Relation + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + + diff --git a/dir_000006_000015.html b/dir_000006_000015.html new file mode 100644 index 000000000..ede0e5e2e --- /dev/null +++ b/dir_000006_000015.html @@ -0,0 +1,206 @@ + + + + + + + + +FTXUI: dom -> util Relation + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+

dom → util Relation

File in include/ftxui/domIncludes file in include/ftxui/util
elements.hppref.hpp
+
+ + + + + diff --git a/dir_000007_000011.html b/dir_000007_000011.html new file mode 100644 index 000000000..9daf5ee96 --- /dev/null +++ b/dir_000007_000011.html @@ -0,0 +1,206 @@ + + + + + + + + +FTXUI: dom -> include Relation + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+

dom → include Relation

File in src/ftxui/domIncludes file in include
automerge.cppftxui / screen / box.hpp
automerge.cppftxui / dom / elements.hpp
automerge.cppftxui / dom / node.hpp
automerge.cppftxui / screen / screen.hpp
blink.cppftxui / screen / box.hpp
blink.cppftxui / dom / elements.hpp
blink.cppftxui / dom / node.hpp
blink.cppftxui / screen / screen.hpp
bold.cppftxui / screen / box.hpp
bold.cppftxui / dom / elements.hpp
bold.cppftxui / dom / node.hpp
bold.cppftxui / screen / screen.hpp
box_helper.hppftxui / dom / requirement.hpp
canvas.cppmftxui / dom / canvas.hpp
clear_under.cppftxui / screen / box.hpp
clear_under.cppftxui / dom / elements.hpp
clear_under.cppftxui / dom / node.hpp
clear_under.cppftxui / screen / screen.hpp
composite_decorator.cppftxui / dom / elements.hpp
dim.cppftxui / screen / box.hpp
dim.cppftxui / dom / elements.hpp
dim.cppftxui / dom / node.hpp
dim.cppftxui / screen / screen.hpp
direction.cppmftxui / dom / direction.hpp
dom/color.cppftxui / screen / box.hpp
dom/color.cppftxui / screen / color.hpp
dom/color.cppftxui / dom / elements.hpp
dom/color.cppftxui / screen / screen.hpp
dom/deprecated.cppmftxui / dom / dom/deprecated.hpp
dom/util.cppftxui / screen / box.hpp
dom/util.cppftxui / dom / elements.hpp
dom/util.cppftxui / dom / node.hpp
dom/util.cppftxui / dom / requirement.hpp
dom/util.cppftxui / screen / screen.hpp
dom/util.cppftxui / screen / terminal.hpp
elements.cppmftxui / dom / elements.hpp
flex.cppftxui / screen / box.hpp
flex.cppftxui / dom / elements.hpp
flex.cppftxui / dom / node.hpp
flex.cppftxui / dom / requirement.hpp
flexbox.cppftxui / screen / box.hpp
flexbox.cppftxui / dom / elements.hpp
flexbox.cppftxui / dom / flexbox_config.hpp
flexbox.cppftxui / dom / node.hpp
flexbox.cppftxui / dom / requirement.hpp
flexbox.cppftxui / dom / selection.hpp
flexbox_config.cppftxui / dom / flexbox_config.hpp
flexbox_config.cppmftxui / dom / flexbox_config.hpp
flexbox_helper.cppftxui / dom / flexbox_config.hpp
flexbox_helper.hppftxui / dom / flexbox_config.hpp
frame.cppftxui / util / autoreset.hpp
frame.cppftxui / screen / box.hpp
frame.cppftxui / dom / elements.hpp
frame.cppftxui / dom / node.hpp
frame.cppftxui / dom / requirement.hpp
frame.cppftxui / screen / screen.hpp
hbox.cppftxui / screen / box.hpp
hbox.cppftxui / dom / elements.hpp
hbox.cppftxui / dom / node.hpp
hbox.cppftxui / dom / requirement.hpp
hbox.cppftxui / dom / selection.hpp
hyperlink.cppftxui / screen / box.hpp
hyperlink.cppftxui / dom / elements.hpp
hyperlink.cppftxui / screen / screen.hpp
inverted.cppftxui / screen / box.hpp
inverted.cppftxui / dom / elements.hpp
inverted.cppftxui / dom / node.hpp
inverted.cppftxui / screen / screen.hpp
italic.cppftxui / screen / box.hpp
italic.cppftxui / dom / elements.hpp
italic.cppftxui / dom / node.hpp
italic.cppftxui / screen / screen.hpp
linear_gradient.cppmftxui / dom / linear_gradient.hpp
node.cppftxui / screen / box.hpp
node.cppftxui / dom / node.hpp
node.cppftxui / screen / screen.hpp
node.cppftxui / dom / selection.hpp
node.cppmftxui / dom / node.hpp
node_decorator.cppftxui / screen / box.hpp
node_decorator.cppftxui / dom / node.hpp
node_decorator.cppftxui / dom / requirement.hpp
node_decorator.hppftxui / dom / elements.hpp
node_decorator.hppftxui / dom / node.hpp
reflect.cppftxui / screen / box.hpp
reflect.cppftxui / dom / elements.hpp
reflect.cppftxui / dom / node.hpp
reflect.cppftxui / dom / requirement.hpp
reflect.cppftxui / screen / screen.hpp
requirement.cppmftxui / dom / requirement.hpp
scroll_indicator.cppftxui / screen / box.hpp
scroll_indicator.cppftxui / dom / elements.hpp
scroll_indicator.cppftxui / dom / node.hpp
scroll_indicator.cppftxui / dom / requirement.hpp
scroll_indicator.cppftxui / screen / screen.hpp
selection.cppmftxui / dom / selection.hpp
selection_style.cppftxui / screen / color.hpp
selection_style.cppftxui / dom / elements.hpp
selection_style.cppftxui / screen / pixel.hpp
selection_style.cppftxui / screen / screen.hpp
src/ftxui/dom/border.cppftxui / screen / box.hpp
src/ftxui/dom/border.cppftxui / screen / color.hpp
src/ftxui/dom/border.cppftxui / dom / elements.hpp
src/ftxui/dom/border.cppftxui / dom / node.hpp
src/ftxui/dom/border.cppftxui / screen / pixel.hpp
src/ftxui/dom/border.cppftxui / dom / requirement.hpp
src/ftxui/dom/border.cppftxui / screen / screen.hpp
src/ftxui/dom/canvas.cppftxui / screen / box.hpp
src/ftxui/dom/canvas.cppftxui / dom / canvas.hpp
src/ftxui/dom/canvas.cppftxui / screen / color.hpp
src/ftxui/dom/canvas.cppftxui / dom / elements.hpp
src/ftxui/dom/canvas.cppftxui / screen / image.hpp
src/ftxui/dom/canvas.cppftxui / dom / node.hpp
src/ftxui/dom/canvas.cppftxui / screen / pixel.hpp
src/ftxui/dom/canvas.cppftxui / util / ref.hpp
src/ftxui/dom/canvas.cppftxui / dom / requirement.hpp
src/ftxui/dom/canvas.cppftxui / screen / screen.hpp
src/ftxui/dom/canvas.cppftxui / screen / string.hpp
src/ftxui/dom/dbox.cppftxui / screen / box.hpp
src/ftxui/dom/dbox.cppftxui / dom / elements.hpp
src/ftxui/dom/dbox.cppftxui / dom / node.hpp
src/ftxui/dom/dbox.cppftxui / screen / pixel.hpp
src/ftxui/dom/dbox.cppftxui / dom / requirement.hpp
src/ftxui/dom/focus.cppftxui / screen / box.hpp
src/ftxui/dom/focus.cppftxui / dom / elements.hpp
src/ftxui/dom/focus.cppftxui / dom / requirement.hpp
src/ftxui/dom/gauge.cppftxui / screen / box.hpp
src/ftxui/dom/gauge.cppftxui / dom / direction.hpp
src/ftxui/dom/gauge.cppftxui / dom / elements.hpp
src/ftxui/dom/gauge.cppftxui / dom / node.hpp
src/ftxui/dom/gauge.cppftxui / dom / requirement.hpp
src/ftxui/dom/gauge.cppftxui / screen / screen.hpp
src/ftxui/dom/graph.cppftxui / screen / box.hpp
src/ftxui/dom/graph.cppftxui / dom / elements.hpp
src/ftxui/dom/graph.cppftxui / dom / node.hpp
src/ftxui/dom/graph.cppftxui / dom / requirement.hpp
src/ftxui/dom/graph.cppftxui / screen / screen.hpp
src/ftxui/dom/gridbox.cppftxui / screen / box.hpp
src/ftxui/dom/gridbox.cppftxui / dom / elements.hpp
src/ftxui/dom/gridbox.cppftxui / dom / node.hpp
src/ftxui/dom/gridbox.cppftxui / dom / requirement.hpp
src/ftxui/dom/linear_gradient.cppftxui / screen / box.hpp
src/ftxui/dom/linear_gradient.cppftxui / screen / color.hpp
src/ftxui/dom/linear_gradient.cppftxui / dom / elements.hpp
src/ftxui/dom/linear_gradient.cppftxui / dom / linear_gradient.hpp
src/ftxui/dom/linear_gradient.cppftxui / screen / screen.hpp
src/ftxui/dom/paragraph.cppftxui / dom / elements.hpp
src/ftxui/dom/paragraph.cppftxui / dom / flexbox_config.hpp
src/ftxui/dom/selection.cppftxui / dom / selection.hpp
src/ftxui/dom/separator.cppftxui / screen / box.hpp
src/ftxui/dom/separator.cppftxui / screen / color.hpp
src/ftxui/dom/separator.cppftxui / dom / elements.hpp
src/ftxui/dom/separator.cppftxui / dom / node.hpp
src/ftxui/dom/separator.cppftxui / screen / pixel.hpp
src/ftxui/dom/separator.cppftxui / dom / requirement.hpp
src/ftxui/dom/separator.cppftxui / screen / screen.hpp
src/ftxui/dom/size.cppftxui / screen / box.hpp
src/ftxui/dom/size.cppftxui / dom / elements.hpp
src/ftxui/dom/size.cppftxui / dom / node.hpp
src/ftxui/dom/size.cppftxui / dom / requirement.hpp
src/ftxui/dom/spinner.cppftxui / dom / elements.hpp
src/ftxui/dom/table.cppftxui / dom / elements.hpp
src/ftxui/dom/table.cppftxui / dom / table.hpp
strikethrough.cppftxui / screen / box.hpp
strikethrough.cppftxui / dom / elements.hpp
strikethrough.cppftxui / dom / node.hpp
strikethrough.cppftxui / screen / screen.hpp
table.cppmftxui / dom / table.hpp
text.cppftxui / screen / box.hpp
text.cppftxui / dom / dom/deprecated.hpp
text.cppftxui / dom / elements.hpp
text.cppftxui / dom / node.hpp
text.cppftxui / dom / requirement.hpp
text.cppftxui / screen / screen.hpp
text.cppftxui / dom / selection.hpp
text.cppftxui / screen / string.hpp
underlined.cppftxui / screen / box.hpp
underlined.cppftxui / dom / elements.hpp
underlined.cppftxui / dom / node.hpp
underlined.cppftxui / screen / screen.hpp
underlined_double.cppftxui / screen / box.hpp
underlined_double.cppftxui / dom / elements.hpp
underlined_double.cppftxui / dom / node.hpp
underlined_double.cppftxui / screen / screen.hpp
vbox.cppftxui / screen / box.hpp
vbox.cppftxui / dom / elements.hpp
vbox.cppftxui / dom / node.hpp
vbox.cppftxui / dom / requirement.hpp
vbox.cppftxui / dom / selection.hpp
+
+ + + + + diff --git a/dir_000010_000002.html b/dir_000010_000002.html new file mode 100644 index 000000000..4d53f5146 --- /dev/null +++ b/dir_000010_000002.html @@ -0,0 +1,206 @@ + + + + + + + + +FTXUI: ftxui -> component Relation + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + + diff --git a/dir_000010_000007.html b/dir_000010_000007.html new file mode 100644 index 000000000..e27da45dd --- /dev/null +++ b/dir_000010_000007.html @@ -0,0 +1,206 @@ + + + + + + + + +FTXUI: ftxui -> dom Relation + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + + diff --git a/dir_000010_000011.html b/dir_000010_000011.html new file mode 100644 index 000000000..c4b1a7e71 --- /dev/null +++ b/dir_000010_000011.html @@ -0,0 +1,206 @@ + + + + + + + + +FTXUI: ftxui -> include Relation + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+

ftxui → include Relation

File in src/ftxuiIncludes file in include
component / animation.cppftxui / component / animation.hpp
component / animation.cppmftxui / component / animation.hpp
dom / automerge.cppftxui / screen / box.hpp
dom / automerge.cppftxui / dom / elements.hpp
dom / automerge.cppftxui / dom / node.hpp
dom / automerge.cppftxui / screen / screen.hpp
dom / blink.cppftxui / screen / box.hpp
dom / blink.cppftxui / dom / elements.hpp
dom / blink.cppftxui / dom / node.hpp
dom / blink.cppftxui / screen / screen.hpp
dom / bold.cppftxui / screen / box.hpp
dom / bold.cppftxui / dom / elements.hpp
dom / bold.cppftxui / dom / node.hpp
dom / bold.cppftxui / screen / screen.hpp
dom / box_helper.hppftxui / dom / requirement.hpp
dom / canvas.cppmftxui / dom / canvas.hpp
component / captured_mouse.cppmftxui / component / captured_mouse.hpp
component / catch_event.cppftxui / component / component.hpp
component / catch_event.cppftxui / component / component_base.hpp
component / catch_event.cppftxui / component / event.hpp
dom / clear_under.cppftxui / screen / box.hpp
dom / clear_under.cppftxui / dom / elements.hpp
dom / clear_under.cppftxui / dom / node.hpp
dom / clear_under.cppftxui / screen / screen.hpp
component / component.cppftxui / screen / box.hpp
component / component.cppftxui / component / captured_mouse.hpp
component / component.cppftxui / component / component.hpp
component / component.cppftxui / component / component_base.hpp
component / component.cppftxui / dom / elements.hpp
component / component.cppftxui / component / event.hpp
component / component.cppftxui / dom / node.hpp
component / component.cppftxui / component / screen_interactive.hpp
component / component/component.cppmftxui / component / component.hpp
component / component/util.cppftxui / component / component.hpp
component / component/util.cppftxui / component / component_base.hpp
component / component_base.cppmftxui / component / component_base.hpp
component / component_fuzzer.cppftxui / component / component.hpp
component / component_fuzzer.cppftxui / component / event.hpp
component / component_options.cppftxui / component / animation.hpp
component / component_options.cppftxui / screen / color.hpp
component / component_options.cppftxui / component / component_options.hpp
component / component_options.cppftxui / dom / direction.hpp
component / component_options.cppftxui / dom / elements.hpp
component / component_options.cppmftxui / component / component_options.hpp
dom / composite_decorator.cppftxui / dom / elements.hpp
component / container.cppftxui / screen / box.hpp
component / container.cppftxui / component / component.hpp
component / container.cppftxui / component / component_base.hpp
component / container.cppftxui / dom / elements.hpp
component / container.cppftxui / component / event.hpp
component / container.cppftxui / component / mouse.hpp
dom / dim.cppftxui / screen / box.hpp
dom / dim.cppftxui / dom / elements.hpp
dom / dim.cppftxui / dom / node.hpp
dom / dim.cppftxui / screen / screen.hpp
dom / direction.cppmftxui / dom / direction.hpp
dom / dom/color.cppftxui / screen / box.hpp
dom / dom/color.cppftxui / screen / color.hpp
dom / dom/color.cppftxui / dom / elements.hpp
dom / dom/color.cppftxui / screen / screen.hpp
dom / dom/deprecated.cppmftxui / dom / dom/deprecated.hpp
dom / dom/util.cppftxui / screen / box.hpp
dom / dom/util.cppftxui / dom / elements.hpp
dom / dom/util.cppftxui / dom / node.hpp
dom / dom/util.cppftxui / dom / requirement.hpp
dom / dom/util.cppftxui / screen / screen.hpp
dom / dom/util.cppftxui / screen / terminal.hpp
dom / elements.cppmftxui / dom / elements.hpp
component / event.cppftxui / component / event.hpp
component / event.cppftxui / component / mouse.hpp
component / event.cppftxui / screen / string.hpp
component / event.cppmftxui / component / event.hpp
dom / flex.cppftxui / screen / box.hpp
dom / flex.cppftxui / dom / elements.hpp
dom / flex.cppftxui / dom / node.hpp
dom / flex.cppftxui / dom / requirement.hpp
dom / flexbox.cppftxui / screen / box.hpp
dom / flexbox.cppftxui / dom / elements.hpp
dom / flexbox.cppftxui / dom / flexbox_config.hpp
dom / flexbox.cppftxui / dom / node.hpp
dom / flexbox.cppftxui / dom / requirement.hpp
dom / flexbox.cppftxui / dom / selection.hpp
dom / flexbox_config.cppftxui / dom / flexbox_config.hpp
dom / flexbox_config.cppmftxui / dom / flexbox_config.hpp
dom / flexbox_helper.cppftxui / dom / flexbox_config.hpp
dom / flexbox_helper.hppftxui / dom / flexbox_config.hpp
dom / frame.cppftxui / util / autoreset.hpp
dom / frame.cppftxui / screen / box.hpp
dom / frame.cppftxui / dom / elements.hpp
dom / frame.cppftxui / dom / node.hpp
dom / frame.cppftxui / dom / requirement.hpp
dom / frame.cppftxui / screen / screen.hpp
dom / hbox.cppftxui / screen / box.hpp
dom / hbox.cppftxui / dom / elements.hpp
dom / hbox.cppftxui / dom / node.hpp
dom / hbox.cppftxui / dom / requirement.hpp
dom / hbox.cppftxui / dom / selection.hpp
component / hoverable.cppftxui / screen / box.hpp
component / hoverable.cppftxui / component / component.hpp
component / hoverable.cppftxui / component / component_base.hpp
component / hoverable.cppftxui / dom / elements.hpp
component / hoverable.cppftxui / component / event.hpp
component / hoverable.cppftxui / component / mouse.hpp
component / hoverable.cppftxui / component / screen_interactive.hpp
dom / hyperlink.cppftxui / screen / box.hpp
dom / hyperlink.cppftxui / dom / elements.hpp
dom / hyperlink.cppftxui / screen / screen.hpp
dom / inverted.cppftxui / screen / box.hpp
dom / inverted.cppftxui / dom / elements.hpp
dom / inverted.cppftxui / dom / node.hpp
dom / inverted.cppftxui / screen / screen.hpp
dom / italic.cppftxui / screen / box.hpp
dom / italic.cppftxui / dom / elements.hpp
dom / italic.cppftxui / dom / node.hpp
dom / italic.cppftxui / screen / screen.hpp
dom / linear_gradient.cppmftxui / dom / linear_gradient.hpp
component / loop.cppftxui / component / loop.hpp
component / loop.cppftxui / component / screen_interactive.hpp
component / loop.cppmftxui / component / loop.hpp
component / modal.cppftxui / component / component.hpp
component / modal.cppftxui / component / component_base.hpp
component / modal.cppftxui / dom / elements.hpp
component / modal.cppftxui / component / event.hpp
component / mouse.cppmftxui / component / mouse.hpp
dom / node.cppftxui / screen / box.hpp
dom / node.cppftxui / dom / node.hpp
dom / node.cppftxui / screen / screen.hpp
dom / node.cppftxui / dom / selection.hpp
dom / node.cppmftxui / dom / node.hpp
dom / node_decorator.cppftxui / screen / box.hpp
dom / node_decorator.cppftxui / dom / node.hpp
dom / node_decorator.cppftxui / dom / requirement.hpp
dom / node_decorator.hppftxui / dom / elements.hpp
dom / node_decorator.hppftxui / dom / node.hpp
component / receiver.cppmftxui / component / receiver.hpp
dom / reflect.cppftxui / screen / box.hpp
dom / reflect.cppftxui / dom / elements.hpp
dom / reflect.cppftxui / dom / node.hpp
dom / reflect.cppftxui / dom / requirement.hpp
dom / reflect.cppftxui / screen / screen.hpp
dom / requirement.cppmftxui / dom / requirement.hpp
component / screen_interactive.cppftxui / component / animation.hpp
component / screen_interactive.cppftxui / util / autoreset.hpp
component / screen_interactive.cppftxui / component / captured_mouse.hpp
component / screen_interactive.cppftxui / component / component_base.hpp
component / screen_interactive.cppftxui / component / event.hpp
component / screen_interactive.cppftxui / component / loop.hpp
component / screen_interactive.cppftxui / dom / node.hpp
component / screen_interactive.cppftxui / screen / screen.hpp
component / screen_interactive.cppftxui / component / screen_interactive.hpp
component / screen_interactive.cppftxui / component / task.hpp
component / screen_interactive.cppftxui / screen / terminal.hpp
component / screen_interactive.cppmftxui / component / screen_interactive.hpp
dom / scroll_indicator.cppftxui / screen / box.hpp
dom / scroll_indicator.cppftxui / dom / elements.hpp
dom / scroll_indicator.cppftxui / dom / node.hpp
dom / scroll_indicator.cppftxui / dom / requirement.hpp
dom / scroll_indicator.cppftxui / screen / screen.hpp
dom / selection.cppmftxui / dom / selection.hpp
dom / selection_style.cppftxui / screen / color.hpp
dom / selection_style.cppftxui / dom / elements.hpp
dom / selection_style.cppftxui / screen / pixel.hpp
dom / selection_style.cppftxui / screen / screen.hpp
component / src/ftxui/component/button.cppftxui / component / animation.hpp
component / src/ftxui/component/button.cppftxui / screen / box.hpp
component / src/ftxui/component/button.cppftxui / screen / color.hpp
component / src/ftxui/component/button.cppftxui / component / component.hpp
component / src/ftxui/component/button.cppftxui / component / component_base.hpp
component / src/ftxui/component/button.cppftxui / component / component_options.hpp
component / src/ftxui/component/button.cppftxui / dom / elements.hpp
component / src/ftxui/component/button.cppftxui / component / event.hpp
component / src/ftxui/component/button.cppftxui / component / mouse.hpp
component / src/ftxui/component/button.cppftxui / util / ref.hpp
component / src/ftxui/component/button.cppftxui / component / screen_interactive.hpp
component / src/ftxui/component/checkbox.cppftxui / screen / box.hpp
component / src/ftxui/component/checkbox.cppftxui / component / component.hpp
component / src/ftxui/component/checkbox.cppftxui / component / component_base.hpp
component / src/ftxui/component/checkbox.cppftxui / component / component_options.hpp
component / src/ftxui/component/checkbox.cppftxui / dom / elements.hpp
component / src/ftxui/component/checkbox.cppftxui / component / event.hpp
component / src/ftxui/component/checkbox.cppftxui / component / mouse.hpp
component / src/ftxui/component/checkbox.cppftxui / util / ref.hpp
component / src/ftxui/component/collapsible.cppftxui / component / component.hpp
component / src/ftxui/component/collapsible.cppftxui / component / component_base.hpp
component / src/ftxui/component/collapsible.cppftxui / component / component_options.hpp
component / src/ftxui/component/collapsible.cppftxui / dom / elements.hpp
component / src/ftxui/component/collapsible.cppftxui / util / ref.hpp
component / src/ftxui/component/dropdown.cppftxui / component / component.hpp
component / src/ftxui/component/dropdown.cppftxui / component / component_base.hpp
component / src/ftxui/component/dropdown.cppftxui / component / component_options.hpp
component / src/ftxui/component/dropdown.cppftxui / dom / elements.hpp
component / src/ftxui/component/dropdown.cppftxui / component / event.hpp
component / src/ftxui/component/dropdown.cppftxui / util / ref.hpp
component / src/ftxui/component/input.cppftxui / screen / box.hpp
component / src/ftxui/component/input.cppftxui / component / component.hpp
component / src/ftxui/component/input.cppftxui / component / component_base.hpp
component / src/ftxui/component/input.cppftxui / component / component_options.hpp
component / src/ftxui/component/input.cppftxui / dom / elements.hpp
component / src/ftxui/component/input.cppftxui / component / event.hpp
component / src/ftxui/component/input.cppftxui / component / mouse.hpp
component / src/ftxui/component/input.cppftxui / util / ref.hpp
component / src/ftxui/component/input.cppftxui / component / screen_interactive.hpp
component / src/ftxui/component/input.cppftxui / screen / string.hpp
component / src/ftxui/component/maybe.cppftxui / component / component.hpp
component / src/ftxui/component/maybe.cppftxui / component / component_base.hpp
component / src/ftxui/component/maybe.cppftxui / dom / elements.hpp
component / src/ftxui/component/maybe.cppftxui / component / event.hpp
component / src/ftxui/component/maybe.cppftxui / dom / node.hpp
component / src/ftxui/component/menu.cppftxui / component / animation.hpp
component / src/ftxui/component/menu.cppftxui / screen / box.hpp
component / src/ftxui/component/menu.cppftxui / screen / color.hpp
component / src/ftxui/component/menu.cppftxui / component / component.hpp
component / src/ftxui/component/menu.cppftxui / component / component_base.hpp
component / src/ftxui/component/menu.cppftxui / component / component_options.hpp
component / src/ftxui/component/menu.cppftxui / dom / direction.hpp
component / src/ftxui/component/menu.cppftxui / dom / elements.hpp
component / src/ftxui/component/menu.cppftxui / component / event.hpp
component / src/ftxui/component/menu.cppftxui / component / mouse.hpp
component / src/ftxui/component/menu.cppftxui / util / ref.hpp
component / src/ftxui/component/menu.cppftxui / component / screen_interactive.hpp
component / src/ftxui/component/radiobox.cppftxui / screen / box.hpp
component / src/ftxui/component/radiobox.cppftxui / component / component.hpp
component / src/ftxui/component/radiobox.cppftxui / component / component_base.hpp
component / src/ftxui/component/radiobox.cppftxui / component / component_options.hpp
component / src/ftxui/component/radiobox.cppftxui / dom / elements.hpp
component / src/ftxui/component/radiobox.cppftxui / component / event.hpp
component / src/ftxui/component/radiobox.cppftxui / component / mouse.hpp
component / src/ftxui/component/radiobox.cppftxui / util / ref.hpp
component / src/ftxui/component/radiobox.cppftxui / component / screen_interactive.hpp
component / src/ftxui/component/renderer.cppftxui / screen / box.hpp
component / src/ftxui/component/renderer.cppftxui / component / component.hpp
component / src/ftxui/component/renderer.cppftxui / component / component_base.hpp
component / src/ftxui/component/renderer.cppftxui / dom / elements.hpp
component / src/ftxui/component/renderer.cppftxui / component / event.hpp
component / src/ftxui/component/renderer.cppftxui / component / mouse.hpp
component / src/ftxui/component/resizable_split.cppftxui / screen / box.hpp
component / src/ftxui/component/resizable_split.cppftxui / component / captured_mouse.hpp
component / src/ftxui/component/resizable_split.cppftxui / component / component.hpp
component / src/ftxui/component/resizable_split.cppftxui / component / component_base.hpp
component / src/ftxui/component/resizable_split.cppftxui / component / component_options.hpp
component / src/ftxui/component/resizable_split.cppftxui / dom / direction.hpp
component / src/ftxui/component/resizable_split.cppftxui / dom / elements.hpp
component / src/ftxui/component/resizable_split.cppftxui / component / event.hpp
component / src/ftxui/component/resizable_split.cppftxui / component / mouse.hpp
component / src/ftxui/component/resizable_split.cppftxui / util / ref.hpp
component / src/ftxui/component/slider.cppftxui / screen / box.hpp
component / src/ftxui/component/slider.cppftxui / component / captured_mouse.hpp
component / src/ftxui/component/slider.cppftxui / screen / color.hpp
component / src/ftxui/component/slider.cppftxui / component / component.hpp
component / src/ftxui/component/slider.cppftxui / component / component_base.hpp
component / src/ftxui/component/slider.cppftxui / component / component_options.hpp
component / src/ftxui/component/slider.cppftxui / dom / direction.hpp
component / src/ftxui/component/slider.cppftxui / dom / elements.hpp
component / src/ftxui/component/slider.cppftxui / component / event.hpp
component / src/ftxui/component/slider.cppftxui / component / mouse.hpp
component / src/ftxui/component/slider.cppftxui / util / ref.hpp
component / src/ftxui/component/slider.cppftxui / component / screen_interactive.hpp
component / src/ftxui/component/window.cppftxui / screen / color.hpp
component / src/ftxui/component/window.cppftxui / component / component.hpp
component / src/ftxui/component/window.cppftxui / component / component_base.hpp
component / src/ftxui/component/window.cppftxui / component / component_options.hpp
component / src/ftxui/component/window.cppftxui / dom / elements.hpp
component / src/ftxui/component/window.cppftxui / screen / screen.hpp
component / src/ftxui/component/window.cppftxui / component / screen_interactive.hpp
dom / src/ftxui/dom/border.cppftxui / screen / box.hpp
dom / src/ftxui/dom/border.cppftxui / screen / color.hpp
dom / src/ftxui/dom/border.cppftxui / dom / elements.hpp
dom / src/ftxui/dom/border.cppftxui / dom / node.hpp
dom / src/ftxui/dom/border.cppftxui / screen / pixel.hpp
dom / src/ftxui/dom/border.cppftxui / dom / requirement.hpp
dom / src/ftxui/dom/border.cppftxui / screen / screen.hpp
dom / src/ftxui/dom/canvas.cppftxui / screen / box.hpp
dom / src/ftxui/dom/canvas.cppftxui / dom / canvas.hpp
dom / src/ftxui/dom/canvas.cppftxui / screen / color.hpp
dom / src/ftxui/dom/canvas.cppftxui / dom / elements.hpp
dom / src/ftxui/dom/canvas.cppftxui / screen / image.hpp
dom / src/ftxui/dom/canvas.cppftxui / dom / node.hpp
dom / src/ftxui/dom/canvas.cppftxui / screen / pixel.hpp
dom / src/ftxui/dom/canvas.cppftxui / util / ref.hpp
dom / src/ftxui/dom/canvas.cppftxui / dom / requirement.hpp
dom / src/ftxui/dom/canvas.cppftxui / screen / screen.hpp
dom / src/ftxui/dom/canvas.cppftxui / screen / string.hpp
dom / src/ftxui/dom/dbox.cppftxui / screen / box.hpp
dom / src/ftxui/dom/dbox.cppftxui / dom / elements.hpp
dom / src/ftxui/dom/dbox.cppftxui / dom / node.hpp
dom / src/ftxui/dom/dbox.cppftxui / screen / pixel.hpp
dom / src/ftxui/dom/dbox.cppftxui / dom / requirement.hpp
dom / src/ftxui/dom/focus.cppftxui / screen / box.hpp
dom / src/ftxui/dom/focus.cppftxui / dom / elements.hpp
dom / src/ftxui/dom/focus.cppftxui / dom / requirement.hpp
dom / src/ftxui/dom/gauge.cppftxui / screen / box.hpp
dom / src/ftxui/dom/gauge.cppftxui / dom / direction.hpp
dom / src/ftxui/dom/gauge.cppftxui / dom / elements.hpp
dom / src/ftxui/dom/gauge.cppftxui / dom / node.hpp
dom / src/ftxui/dom/gauge.cppftxui / dom / requirement.hpp
dom / src/ftxui/dom/gauge.cppftxui / screen / screen.hpp
dom / src/ftxui/dom/graph.cppftxui / screen / box.hpp
dom / src/ftxui/dom/graph.cppftxui / dom / elements.hpp
dom / src/ftxui/dom/graph.cppftxui / dom / node.hpp
dom / src/ftxui/dom/graph.cppftxui / dom / requirement.hpp
dom / src/ftxui/dom/graph.cppftxui / screen / screen.hpp
dom / src/ftxui/dom/gridbox.cppftxui / screen / box.hpp
dom / src/ftxui/dom/gridbox.cppftxui / dom / elements.hpp
dom / src/ftxui/dom/gridbox.cppftxui / dom / node.hpp
dom / src/ftxui/dom/gridbox.cppftxui / dom / requirement.hpp
dom / src/ftxui/dom/linear_gradient.cppftxui / screen / box.hpp
dom / src/ftxui/dom/linear_gradient.cppftxui / screen / color.hpp
dom / src/ftxui/dom/linear_gradient.cppftxui / dom / elements.hpp
dom / src/ftxui/dom/linear_gradient.cppftxui / dom / linear_gradient.hpp
dom / src/ftxui/dom/linear_gradient.cppftxui / screen / screen.hpp
dom / src/ftxui/dom/paragraph.cppftxui / dom / elements.hpp
dom / src/ftxui/dom/paragraph.cppftxui / dom / flexbox_config.hpp
dom / src/ftxui/dom/selection.cppftxui / dom / selection.hpp
dom / src/ftxui/dom/separator.cppftxui / screen / box.hpp
dom / src/ftxui/dom/separator.cppftxui / screen / color.hpp
dom / src/ftxui/dom/separator.cppftxui / dom / elements.hpp
dom / src/ftxui/dom/separator.cppftxui / dom / node.hpp
dom / src/ftxui/dom/separator.cppftxui / screen / pixel.hpp
dom / src/ftxui/dom/separator.cppftxui / dom / requirement.hpp
dom / src/ftxui/dom/separator.cppftxui / screen / screen.hpp
dom / src/ftxui/dom/size.cppftxui / screen / box.hpp
dom / src/ftxui/dom/size.cppftxui / dom / elements.hpp
dom / src/ftxui/dom/size.cppftxui / dom / node.hpp
dom / src/ftxui/dom/size.cppftxui / dom / requirement.hpp
dom / src/ftxui/dom/spinner.cppftxui / dom / elements.hpp
dom / src/ftxui/dom/table.cppftxui / dom / elements.hpp
dom / src/ftxui/dom/table.cppftxui / dom / table.hpp
dom / strikethrough.cppftxui / screen / box.hpp
dom / strikethrough.cppftxui / dom / elements.hpp
dom / strikethrough.cppftxui / dom / node.hpp
dom / strikethrough.cppftxui / screen / screen.hpp
dom / table.cppmftxui / dom / table.hpp
component / task.cppmftxui / component / task.hpp
component / terminal_input_parser.cppftxui / component / event.hpp
component / terminal_input_parser.cppftxui / component / mouse.hpp
component / terminal_input_parser.cppftxui / component / task.hpp
component / terminal_input_parser.hppftxui / component / mouse.hpp
component / terminal_input_parser_test_fuzzer.cppftxui / component / event.hpp
dom / text.cppftxui / screen / box.hpp
dom / text.cppftxui / dom / dom/deprecated.hpp
dom / text.cppftxui / dom / elements.hpp
dom / text.cppftxui / dom / node.hpp
dom / text.cppftxui / dom / requirement.hpp
dom / text.cppftxui / screen / screen.hpp
dom / text.cppftxui / dom / selection.hpp
dom / text.cppftxui / screen / string.hpp
dom / underlined.cppftxui / screen / box.hpp
dom / underlined.cppftxui / dom / elements.hpp
dom / underlined.cppftxui / dom / node.hpp
dom / underlined.cppftxui / screen / screen.hpp
dom / underlined_double.cppftxui / screen / box.hpp
dom / underlined_double.cppftxui / dom / elements.hpp
dom / underlined_double.cppftxui / dom / node.hpp
dom / underlined_double.cppftxui / screen / screen.hpp
dom / vbox.cppftxui / screen / box.hpp
dom / vbox.cppftxui / dom / elements.hpp
dom / vbox.cppftxui / dom / node.hpp
dom / vbox.cppftxui / dom / requirement.hpp
dom / vbox.cppftxui / dom / selection.hpp
screen / box.cppftxui / screen / box.hpp
screen / box.cppmftxui / screen / box.hpp
screen / screen/color.cppftxui / screen / color.hpp
screen / screen/color.cppftxui / screen / color_info.hpp
screen / screen/color.cppftxui / screen / terminal.hpp
screen / color.cppmftxui / screen / color.hpp
screen / color_info.cppftxui / screen / color_info.hpp
screen / color_info.cppftxui / screen / color.hpp
screen / color_info.cppmftxui / screen / color_info.hpp
screen / screen/deprecated.cppmftxui / screen / screen/deprecated.hpp
screen / image.cppftxui / screen / image.hpp
screen / image.cppftxui / screen / pixel.hpp
screen / image.cppmftxui / screen / image.hpp
screen / pixel.cppmftxui / screen / pixel.hpp
screen / screen.cppftxui / screen / image.hpp
screen / screen.cppftxui / screen / pixel.hpp
screen / screen.cppftxui / screen / screen.hpp
screen / screen.cppftxui / screen / string.hpp
screen / screen.cppftxui / screen / terminal.hpp
screen / screen/screen.cppmftxui / screen / screen.hpp
screen / string.cppftxui / screen / string.hpp
screen / string.cppftxui / screen / screen/deprecated.hpp
screen / string.cppmftxui / screen / string.hpp
screen / terminal.cppftxui / screen / terminal.hpp
screen / terminal.cppmftxui / screen / terminal.hpp
util / autoreset.cppmftxui / util / autoreset.hpp
util / ref.cppmftxui / util / ref.hpp
+
+ + + + + diff --git a/dir_000010_000013.html b/dir_000010_000013.html new file mode 100644 index 000000000..e127ecb2c --- /dev/null +++ b/dir_000010_000013.html @@ -0,0 +1,206 @@ + + + + + + + + +FTXUI: ftxui -> screen Relation + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + + diff --git a/dir_000010_000016.html b/dir_000010_000016.html new file mode 100644 index 000000000..c7dcc9fbc --- /dev/null +++ b/dir_000010_000016.html @@ -0,0 +1,206 @@ + + + + + + + + +FTXUI: ftxui -> util Relation + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+

ftxui → util Relation

File in src/ftxuiIncludes file in src/ftxui/util
util.cppmautoreset.cppm
util.cppmref.cppm
+
+ + + + + diff --git a/dir_000013_000011.html b/dir_000013_000011.html new file mode 100644 index 000000000..3b3b059a0 --- /dev/null +++ b/dir_000013_000011.html @@ -0,0 +1,206 @@ + + + + + + + + +FTXUI: screen -> include Relation + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ + +
+ + + + + diff --git a/dir_000015_000012.html b/dir_000015_000012.html new file mode 100644 index 000000000..a8a6c77ab --- /dev/null +++ b/dir_000015_000012.html @@ -0,0 +1,206 @@ + + + + + + + + +FTXUI: util -> screen Relation + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+

util → screen Relation

File in include/ftxui/utilIncludes file in include/ftxui/screen
ref.hppstring.hpp
+
+ + + + + diff --git a/dir_000016_000011.html b/dir_000016_000011.html new file mode 100644 index 000000000..0183f4d6d --- /dev/null +++ b/dir_000016_000011.html @@ -0,0 +1,206 @@ + + + + + + + + +FTXUI: util -> include Relation + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+

util → include Relation

File in src/ftxui/utilIncludes file in include
autoreset.cppmftxui / util / autoreset.hpp
ref.cppmftxui / util / ref.hpp
+
+ + + + + diff --git a/dir_1668679807285893c235fcc812b1f73d.html b/dir_1668679807285893c235fcc812b1f73d.html new file mode 100644 index 000000000..ef6da8dcf --- /dev/null +++ b/dir_1668679807285893c235fcc812b1f73d.html @@ -0,0 +1,233 @@ + + + + + + + + +FTXUI: util Directory Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
util Directory Reference
+
+
+
+ + Directory dependency graph for util:
+
+
+ + + + + + + + + +

+Files

 autoreset.hpp
 
 ref.hpp
 
 warn_windows_macro.hpp
 
+
+
+ + + + + diff --git a/dir_1668679807285893c235fcc812b1f73d.js b/dir_1668679807285893c235fcc812b1f73d.js new file mode 100644 index 000000000..9aea69ef4 --- /dev/null +++ b/dir_1668679807285893c235fcc812b1f73d.js @@ -0,0 +1,6 @@ +var dir_1668679807285893c235fcc812b1f73d = +[ + [ "autoreset.hpp", "autoreset_8hpp.html", "autoreset_8hpp" ], + [ "ref.hpp", "ref_8hpp.html", "ref_8hpp" ], + [ "warn_windows_macro.hpp", "warn__windows__macro_8hpp.html", null ] +]; \ No newline at end of file diff --git a/dir_1668679807285893c235fcc812b1f73d_dep.map b/dir_1668679807285893c235fcc812b1f73d_dep.map new file mode 100644 index 000000000..de3b225b5 --- /dev/null +++ b/dir_1668679807285893c235fcc812b1f73d_dep.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/dir_1668679807285893c235fcc812b1f73d_dep.md5 b/dir_1668679807285893c235fcc812b1f73d_dep.md5 new file mode 100644 index 000000000..ca1c95c71 --- /dev/null +++ b/dir_1668679807285893c235fcc812b1f73d_dep.md5 @@ -0,0 +1 @@ +8b70903d5986e641832e4a9c1d059e52 \ No newline at end of file diff --git a/dir_1668679807285893c235fcc812b1f73d_dep.png b/dir_1668679807285893c235fcc812b1f73d_dep.png new file mode 100644 index 000000000..b03323758 Binary files /dev/null and b/dir_1668679807285893c235fcc812b1f73d_dep.png differ diff --git a/dir_34153e0f69aea4f55932893abc931484.html b/dir_34153e0f69aea4f55932893abc931484.html new file mode 100644 index 000000000..dc31a7eaf --- /dev/null +++ b/dir_34153e0f69aea4f55932893abc931484.html @@ -0,0 +1,330 @@ + + + + + + + + +FTXUI: component Directory Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
component Directory Reference
+
+ +
+ + + + + diff --git a/dir_34153e0f69aea4f55932893abc931484.js b/dir_34153e0f69aea4f55932893abc931484.js new file mode 100644 index 000000000..f127cc8ef --- /dev/null +++ b/dir_34153e0f69aea4f55932893abc931484.js @@ -0,0 +1,53 @@ +var dir_34153e0f69aea4f55932893abc931484 = +[ + [ "button.cpp", "examples_2component_2button_8cpp.html", "examples_2component_2button_8cpp" ], + [ "button_animated.cpp", "button__animated_8cpp.html", "button__animated_8cpp" ], + [ "button_in_frame.cpp", "button__in__frame_8cpp.html", "button__in__frame_8cpp" ], + [ "button_style.cpp", "button__style_8cpp.html", "button__style_8cpp" ], + [ "canvas_animated.cpp", "canvas__animated_8cpp.html", "canvas__animated_8cpp" ], + [ "checkbox.cpp", "examples_2component_2checkbox_8cpp.html", "examples_2component_2checkbox_8cpp" ], + [ "checkbox_in_frame.cpp", "checkbox__in__frame_8cpp.html", "checkbox__in__frame_8cpp" ], + [ "collapsible.cpp", "examples_2component_2collapsible_8cpp.html", "examples_2component_2collapsible_8cpp" ], + [ "composition.cpp", "composition_8cpp.html", "composition_8cpp" ], + [ "custom_loop.cpp", "custom__loop_8cpp.html", "custom__loop_8cpp" ], + [ "dropdown.cpp", "examples_2component_2dropdown_8cpp.html", "examples_2component_2dropdown_8cpp" ], + [ "dropdown_custom.cpp", "dropdown__custom_8cpp.html", "dropdown__custom_8cpp" ], + [ "flexbox_gallery.cpp", "flexbox__gallery_8cpp.html", "flexbox__gallery_8cpp" ], + [ "focus.cpp", "examples_2component_2focus_8cpp.html", "examples_2component_2focus_8cpp" ], + [ "focus_cursor.cpp", "focus__cursor_8cpp.html", "focus__cursor_8cpp" ], + [ "gallery.cpp", "gallery_8cpp.html", "gallery_8cpp" ], + [ "homescreen.cpp", "homescreen_8cpp.html", "homescreen_8cpp" ], + [ "input.cpp", "examples_2component_2input_8cpp.html", "examples_2component_2input_8cpp" ], + [ "input_in_frame.cpp", "input__in__frame_8cpp.html", "input__in__frame_8cpp" ], + [ "input_style.cpp", "input__style_8cpp.html", "input__style_8cpp" ], + [ "linear_gradient_gallery.cpp", "linear__gradient__gallery_8cpp.html", "linear__gradient__gallery_8cpp" ], + [ "maybe.cpp", "examples_2component_2maybe_8cpp.html", "examples_2component_2maybe_8cpp" ], + [ "menu.cpp", "examples_2component_2menu_8cpp.html", "examples_2component_2menu_8cpp" ], + [ "menu2.cpp", "menu2_8cpp.html", "menu2_8cpp" ], + [ "menu_entries.cpp", "menu__entries_8cpp.html", "menu__entries_8cpp" ], + [ "menu_entries_animated.cpp", "menu__entries__animated_8cpp.html", "menu__entries__animated_8cpp" ], + [ "menu_in_frame.cpp", "menu__in__frame_8cpp.html", "menu__in__frame_8cpp" ], + [ "menu_in_frame_horizontal.cpp", "menu__in__frame__horizontal_8cpp.html", "menu__in__frame__horizontal_8cpp" ], + [ "menu_multiple.cpp", "menu__multiple_8cpp.html", "menu__multiple_8cpp" ], + [ "menu_style.cpp", "menu__style_8cpp.html", "menu__style_8cpp" ], + [ "menu_underline_animated_gallery.cpp", "menu__underline__animated__gallery_8cpp.html", "menu__underline__animated__gallery_8cpp" ], + [ "modal_dialog.cpp", "modal__dialog_8cpp.html", "modal__dialog_8cpp" ], + [ "modal_dialog_custom.cpp", "modal__dialog__custom_8cpp.html", "modal__dialog__custom_8cpp" ], + [ "nested_screen.cpp", "nested__screen_8cpp.html", "nested__screen_8cpp" ], + [ "print_key_press.cpp", "print__key__press_8cpp.html", "print__key__press_8cpp" ], + [ "radiobox.cpp", "examples_2component_2radiobox_8cpp.html", "examples_2component_2radiobox_8cpp" ], + [ "radiobox_in_frame.cpp", "radiobox__in__frame_8cpp.html", "radiobox__in__frame_8cpp" ], + [ "renderer.cpp", "examples_2component_2renderer_8cpp.html", "examples_2component_2renderer_8cpp" ], + [ "resizable_split.cpp", "examples_2component_2resizable__split_8cpp.html", "examples_2component_2resizable__split_8cpp" ], + [ "scrollbar.cpp", "scrollbar_8cpp.html", "scrollbar_8cpp" ], + [ "selection.cpp", "examples_2component_2selection_8cpp.html", "examples_2component_2selection_8cpp" ], + [ "slider.cpp", "examples_2component_2slider_8cpp.html", "examples_2component_2slider_8cpp" ], + [ "slider_direction.cpp", "slider__direction_8cpp.html", "slider__direction_8cpp" ], + [ "slider_rgb.cpp", "slider__rgb_8cpp.html", "slider__rgb_8cpp" ], + [ "tab_horizontal.cpp", "tab__horizontal_8cpp.html", "tab__horizontal_8cpp" ], + [ "tab_vertical.cpp", "tab__vertical_8cpp.html", "tab__vertical_8cpp" ], + [ "textarea.cpp", "textarea_8cpp.html", "textarea_8cpp" ], + [ "toggle.cpp", "toggle_8cpp.html", "toggle_8cpp" ], + [ "window.cpp", "examples_2component_2window_8cpp.html", "examples_2component_2window_8cpp" ], + [ "with_restored_io.cpp", "with__restored__io_8cpp.html", "with__restored__io_8cpp" ] +]; \ No newline at end of file diff --git a/dir_34153e0f69aea4f55932893abc931484_dep.map b/dir_34153e0f69aea4f55932893abc931484_dep.map new file mode 100644 index 000000000..0773e192b --- /dev/null +++ b/dir_34153e0f69aea4f55932893abc931484_dep.map @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/dir_34153e0f69aea4f55932893abc931484_dep.md5 b/dir_34153e0f69aea4f55932893abc931484_dep.md5 new file mode 100644 index 000000000..d69e7d213 --- /dev/null +++ b/dir_34153e0f69aea4f55932893abc931484_dep.md5 @@ -0,0 +1 @@ +ba18667c7722f3e7e7d0e07f0753ffda \ No newline at end of file diff --git a/dir_34153e0f69aea4f55932893abc931484_dep.png b/dir_34153e0f69aea4f55932893abc931484_dep.png new file mode 100644 index 000000000..b14724d72 Binary files /dev/null and b/dir_34153e0f69aea4f55932893abc931484_dep.png differ diff --git a/dir_3f4db74392b369be141833a3ebdcb6a2.html b/dir_3f4db74392b369be141833a3ebdcb6a2.html new file mode 100644 index 000000000..0e4f673c1 --- /dev/null +++ b/dir_3f4db74392b369be141833a3ebdcb6a2.html @@ -0,0 +1,263 @@ + + + + + + + + +FTXUI: screen Directory Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
screen Directory Reference
+
+
+
+ + Directory dependency graph for screen:
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Files

 box.cpp
 
 box.cppm
 
 color.cpp
 
 color.cppm
 
 color_info.cpp
 
 color_info.cppm
 
 deprecated.cppm
 
 image.cpp
 
 image.cppm
 
 pixel.cppm
 
 screen.cpp
 
 screen.cppm
 
 string.cpp
 
 string.cppm
 
 string_internal.hpp
 
 terminal.cpp
 
 terminal.cppm
 
 util.hpp
 
+
+
+ + + + + diff --git a/dir_3f4db74392b369be141833a3ebdcb6a2.js b/dir_3f4db74392b369be141833a3ebdcb6a2.js new file mode 100644 index 000000000..c6ee3549e --- /dev/null +++ b/dir_3f4db74392b369be141833a3ebdcb6a2.js @@ -0,0 +1,21 @@ +var dir_3f4db74392b369be141833a3ebdcb6a2 = +[ + [ "box.cpp", "box_8cpp.html", null ], + [ "box.cppm", "box_8cppm.html", null ], + [ "color.cpp", "screen_2color_8cpp.html", "screen_2color_8cpp" ], + [ "color.cppm", "color_8cppm.html", null ], + [ "color_info.cpp", "color__info_8cpp.html", "color__info_8cpp" ], + [ "color_info.cppm", "color__info_8cppm.html", null ], + [ "deprecated.cppm", "screen_2deprecated_8cppm.html", null ], + [ "image.cpp", "image_8cpp.html", null ], + [ "image.cppm", "image_8cppm.html", null ], + [ "pixel.cppm", "pixel_8cppm.html", null ], + [ "screen.cpp", "screen_8cpp.html", "screen_8cpp" ], + [ "screen.cppm", "screen_2screen_8cppm.html", null ], + [ "string.cpp", "string_8cpp.html", "string_8cpp" ], + [ "string.cppm", "string_8cppm.html", null ], + [ "string_internal.hpp", "string__internal_8hpp.html", "string__internal_8hpp" ], + [ "terminal.cpp", "terminal_8cpp.html", "terminal_8cpp" ], + [ "terminal.cppm", "terminal_8cppm.html", null ], + [ "util.hpp", "util_8hpp.html", "util_8hpp" ] +]; \ No newline at end of file diff --git a/dir_3f4db74392b369be141833a3ebdcb6a2_dep.map b/dir_3f4db74392b369be141833a3ebdcb6a2_dep.map new file mode 100644 index 000000000..49554f211 --- /dev/null +++ b/dir_3f4db74392b369be141833a3ebdcb6a2_dep.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/dir_3f4db74392b369be141833a3ebdcb6a2_dep.md5 b/dir_3f4db74392b369be141833a3ebdcb6a2_dep.md5 new file mode 100644 index 000000000..6f6c79a9e --- /dev/null +++ b/dir_3f4db74392b369be141833a3ebdcb6a2_dep.md5 @@ -0,0 +1 @@ +60132acab31fba947469c2d94e809df3 \ No newline at end of file diff --git a/dir_3f4db74392b369be141833a3ebdcb6a2_dep.png b/dir_3f4db74392b369be141833a3ebdcb6a2_dep.png new file mode 100644 index 000000000..9596a6201 Binary files /dev/null and b/dir_3f4db74392b369be141833a3ebdcb6a2_dep.png differ diff --git a/dir_4cbb3a1c219643e03aadd7cd3693e7bd.html b/dir_4cbb3a1c219643e03aadd7cd3693e7bd.html new file mode 100644 index 000000000..9c0ce1105 --- /dev/null +++ b/dir_4cbb3a1c219643e03aadd7cd3693e7bd.html @@ -0,0 +1,250 @@ + + + + + + + + +FTXUI: dom Directory Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
dom Directory Reference
+
+
+
+ + Directory dependency graph for dom:
+
+
+ + + + + + + + + + + + + + + + + + + + + + + +

+Files

 canvas.hpp
 
 deprecated.hpp
 
 direction.hpp
 
 elements.hpp
 
 flexbox_config.hpp
 
 linear_gradient.hpp
 
 node.hpp
 
 requirement.hpp
 
 selection.hpp
 
 table.hpp
 
+
+
+ + + + + diff --git a/dir_4cbb3a1c219643e03aadd7cd3693e7bd.js b/dir_4cbb3a1c219643e03aadd7cd3693e7bd.js new file mode 100644 index 000000000..afd56cba3 --- /dev/null +++ b/dir_4cbb3a1c219643e03aadd7cd3693e7bd.js @@ -0,0 +1,13 @@ +var dir_4cbb3a1c219643e03aadd7cd3693e7bd = +[ + [ "canvas.hpp", "canvas_8hpp.html", null ], + [ "deprecated.hpp", "dom_2deprecated_8hpp.html", "dom_2deprecated_8hpp" ], + [ "direction.hpp", "direction_8hpp.html", "direction_8hpp" ], + [ "elements.hpp", "elements_8hpp.html", "elements_8hpp" ], + [ "flexbox_config.hpp", "flexbox__config_8hpp.html", null ], + [ "linear_gradient.hpp", "linear__gradient_8hpp.html", "linear__gradient_8hpp" ], + [ "node.hpp", "node_8hpp.html", "node_8hpp" ], + [ "requirement.hpp", "requirement_8hpp.html", "requirement_8hpp" ], + [ "selection.hpp", "selection_8hpp.html", null ], + [ "table.hpp", "table_8hpp.html", "table_8hpp" ] +]; \ No newline at end of file diff --git a/dir_4cbb3a1c219643e03aadd7cd3693e7bd_dep.map b/dir_4cbb3a1c219643e03aadd7cd3693e7bd_dep.map new file mode 100644 index 000000000..e3419b031 --- /dev/null +++ b/dir_4cbb3a1c219643e03aadd7cd3693e7bd_dep.map @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/dir_4cbb3a1c219643e03aadd7cd3693e7bd_dep.md5 b/dir_4cbb3a1c219643e03aadd7cd3693e7bd_dep.md5 new file mode 100644 index 000000000..c068d66dd --- /dev/null +++ b/dir_4cbb3a1c219643e03aadd7cd3693e7bd_dep.md5 @@ -0,0 +1 @@ +0ca4efdd8324fd732ab2839a2795d29d \ No newline at end of file diff --git a/dir_4cbb3a1c219643e03aadd7cd3693e7bd_dep.png b/dir_4cbb3a1c219643e03aadd7cd3693e7bd_dep.png new file mode 100644 index 000000000..a04ac5c24 Binary files /dev/null and b/dir_4cbb3a1c219643e03aadd7cd3693e7bd_dep.png differ diff --git a/dir_53f6d8d3eb5689656c3f196f1d99fcb2.html b/dir_53f6d8d3eb5689656c3f196f1d99fcb2.html new file mode 100644 index 000000000..ccbc16e0f --- /dev/null +++ b/dir_53f6d8d3eb5689656c3f196f1d99fcb2.html @@ -0,0 +1,242 @@ + + + + + + + + +FTXUI: screen Directory Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
screen Directory Reference
+
+
+
+ + Directory dependency graph for screen:
+
+
+ + + + + + + + + + + + + + + + + + + + + +

+Files

 box.hpp
 
 color.hpp
 
 color_info.hpp
 
 deprecated.hpp
 
 image.hpp
 
 pixel.hpp
 
 screen.hpp
 
 string.hpp
 
 terminal.hpp
 
+
+
+ + + + + diff --git a/dir_53f6d8d3eb5689656c3f196f1d99fcb2.js b/dir_53f6d8d3eb5689656c3f196f1d99fcb2.js new file mode 100644 index 000000000..80c3906f1 --- /dev/null +++ b/dir_53f6d8d3eb5689656c3f196f1d99fcb2.js @@ -0,0 +1,12 @@ +var dir_53f6d8d3eb5689656c3f196f1d99fcb2 = +[ + [ "box.hpp", "box_8hpp.html", null ], + [ "color.hpp", "color_8hpp.html", "color_8hpp" ], + [ "color_info.hpp", "color__info_8hpp.html", "color__info_8hpp" ], + [ "deprecated.hpp", "screen_2deprecated_8hpp.html", "screen_2deprecated_8hpp" ], + [ "image.hpp", "image_8hpp.html", null ], + [ "pixel.hpp", "pixel_8hpp.html", null ], + [ "screen.hpp", "screen_8hpp.html", "screen_8hpp" ], + [ "string.hpp", "string_8hpp.html", "string_8hpp" ], + [ "terminal.hpp", "terminal_8hpp.html", "terminal_8hpp" ] +]; \ No newline at end of file diff --git a/dir_53f6d8d3eb5689656c3f196f1d99fcb2_dep.map b/dir_53f6d8d3eb5689656c3f196f1d99fcb2_dep.map new file mode 100644 index 000000000..d5750f312 --- /dev/null +++ b/dir_53f6d8d3eb5689656c3f196f1d99fcb2_dep.map @@ -0,0 +1,4 @@ + + + + diff --git a/dir_53f6d8d3eb5689656c3f196f1d99fcb2_dep.md5 b/dir_53f6d8d3eb5689656c3f196f1d99fcb2_dep.md5 new file mode 100644 index 000000000..ca566389c --- /dev/null +++ b/dir_53f6d8d3eb5689656c3f196f1d99fcb2_dep.md5 @@ -0,0 +1 @@ +f892d1a318e0075ef547f88938a2593e \ No newline at end of file diff --git a/dir_53f6d8d3eb5689656c3f196f1d99fcb2_dep.png b/dir_53f6d8d3eb5689656c3f196f1d99fcb2_dep.png new file mode 100644 index 000000000..535127d0c Binary files /dev/null and b/dir_53f6d8d3eb5689656c3f196f1d99fcb2_dep.png differ diff --git a/dir_591e152ed8a369b957ed274cdb7355d5.html b/dir_591e152ed8a369b957ed274cdb7355d5.html new file mode 100644 index 000000000..61549bd18 --- /dev/null +++ b/dir_591e152ed8a369b957ed274cdb7355d5.html @@ -0,0 +1,321 @@ + + + + + + + + +FTXUI: component Directory Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
component Directory Reference
+
+
+
+ + Directory dependency graph for component:
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Files

 animation.cpp
 
 animation.cppm
 
 button.cpp
 
 captured_mouse.cppm
 
 catch_event.cpp
 
 checkbox.cpp
 
 collapsible.cpp
 
 component.cpp
 
 component.cppm
 
 component_base.cppm
 
 component_fuzzer.cpp
 
 component_options.cpp
 
 component_options.cppm
 
 container.cpp
 
 dropdown.cpp
 
 event.cpp
 
 event.cppm
 
 hoverable.cpp
 
 input.cpp
 
 loop.cpp
 
 loop.cppm
 
 maybe.cpp
 
 menu.cpp
 
 modal.cpp
 
 mouse.cppm
 
 radiobox.cpp
 
 receiver.cppm
 
 renderer.cpp
 
 resizable_split.cpp
 
 screen_interactive.cpp
 
 screen_interactive.cppm
 
 slider.cpp
 
 task.cpp
 
 task.cppm
 
 task_internal.hpp
 
 task_queue.cpp
 
 task_queue.hpp
 
 task_runner.cpp
 
 task_runner.hpp
 
 terminal_input_parser.cpp
 
 terminal_input_parser.hpp
 
 terminal_input_parser_test_fuzzer.cpp
 
 util.cpp
 
 window.cpp
 
+
+
+ + + + + diff --git a/dir_591e152ed8a369b957ed274cdb7355d5.js b/dir_591e152ed8a369b957ed274cdb7355d5.js new file mode 100644 index 000000000..fce653828 --- /dev/null +++ b/dir_591e152ed8a369b957ed274cdb7355d5.js @@ -0,0 +1,47 @@ +var dir_591e152ed8a369b957ed274cdb7355d5 = +[ + [ "animation.cpp", "animation_8cpp.html", "animation_8cpp" ], + [ "animation.cppm", "animation_8cppm.html", null ], + [ "button.cpp", "src_2ftxui_2component_2button_8cpp.html", "src_2ftxui_2component_2button_8cpp" ], + [ "captured_mouse.cppm", "captured__mouse_8cppm.html", null ], + [ "catch_event.cpp", "catch__event_8cpp.html", "catch__event_8cpp" ], + [ "checkbox.cpp", "src_2ftxui_2component_2checkbox_8cpp.html", "src_2ftxui_2component_2checkbox_8cpp" ], + [ "collapsible.cpp", "src_2ftxui_2component_2collapsible_8cpp.html", "src_2ftxui_2component_2collapsible_8cpp" ], + [ "component.cpp", "component_8cpp.html", null ], + [ "component.cppm", "component_2component_8cppm.html", null ], + [ "component_base.cppm", "component__base_8cppm.html", null ], + [ "component_fuzzer.cpp", "component__fuzzer_8cpp.html", "component__fuzzer_8cpp" ], + [ "component_options.cpp", "component__options_8cpp.html", null ], + [ "component_options.cppm", "component__options_8cppm.html", null ], + [ "container.cpp", "container_8cpp.html", "container_8cpp" ], + [ "dropdown.cpp", "src_2ftxui_2component_2dropdown_8cpp.html", "src_2ftxui_2component_2dropdown_8cpp" ], + [ "event.cpp", "event_8cpp.html", null ], + [ "event.cppm", "event_8cppm.html", null ], + [ "hoverable.cpp", "hoverable_8cpp.html", "hoverable_8cpp" ], + [ "input.cpp", "src_2ftxui_2component_2input_8cpp.html", "src_2ftxui_2component_2input_8cpp" ], + [ "loop.cpp", "loop_8cpp.html", null ], + [ "loop.cppm", "loop_8cppm.html", null ], + [ "maybe.cpp", "src_2ftxui_2component_2maybe_8cpp.html", "src_2ftxui_2component_2maybe_8cpp" ], + [ "menu.cpp", "src_2ftxui_2component_2menu_8cpp.html", "src_2ftxui_2component_2menu_8cpp" ], + [ "modal.cpp", "modal_8cpp.html", "modal_8cpp" ], + [ "mouse.cppm", "mouse_8cppm.html", null ], + [ "radiobox.cpp", "src_2ftxui_2component_2radiobox_8cpp.html", "src_2ftxui_2component_2radiobox_8cpp" ], + [ "receiver.cppm", "receiver_8cppm.html", null ], + [ "renderer.cpp", "src_2ftxui_2component_2renderer_8cpp.html", "src_2ftxui_2component_2renderer_8cpp" ], + [ "resizable_split.cpp", "src_2ftxui_2component_2resizable__split_8cpp.html", "src_2ftxui_2component_2resizable__split_8cpp" ], + [ "screen_interactive.cpp", "screen__interactive_8cpp.html", "screen__interactive_8cpp" ], + [ "screen_interactive.cppm", "screen__interactive_8cppm.html", null ], + [ "slider.cpp", "src_2ftxui_2component_2slider_8cpp.html", "src_2ftxui_2component_2slider_8cpp" ], + [ "task.cpp", "task_8cpp.html", null ], + [ "task.cppm", "task_8cppm.html", null ], + [ "task_internal.hpp", "task__internal_8hpp.html", "task__internal_8hpp" ], + [ "task_queue.cpp", "task__queue_8cpp.html", null ], + [ "task_queue.hpp", "task__queue_8hpp.html", "task__queue_8hpp" ], + [ "task_runner.cpp", "task__runner_8cpp.html", null ], + [ "task_runner.hpp", "task__runner_8hpp.html", "task__runner_8hpp" ], + [ "terminal_input_parser.cpp", "terminal__input__parser_8cpp.html", "terminal__input__parser_8cpp" ], + [ "terminal_input_parser.hpp", "terminal__input__parser_8hpp.html", "terminal__input__parser_8hpp" ], + [ "terminal_input_parser_test_fuzzer.cpp", "terminal__input__parser__test__fuzzer_8cpp.html", "terminal__input__parser__test__fuzzer_8cpp" ], + [ "util.cpp", "component_2util_8cpp.html", "component_2util_8cpp" ], + [ "window.cpp", "src_2ftxui_2component_2window_8cpp.html", "src_2ftxui_2component_2window_8cpp" ] +]; \ No newline at end of file diff --git a/dir_591e152ed8a369b957ed274cdb7355d5_dep.map b/dir_591e152ed8a369b957ed274cdb7355d5_dep.map new file mode 100644 index 000000000..265ce68f7 --- /dev/null +++ b/dir_591e152ed8a369b957ed274cdb7355d5_dep.map @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/dir_591e152ed8a369b957ed274cdb7355d5_dep.md5 b/dir_591e152ed8a369b957ed274cdb7355d5_dep.md5 new file mode 100644 index 000000000..e4796af9c --- /dev/null +++ b/dir_591e152ed8a369b957ed274cdb7355d5_dep.md5 @@ -0,0 +1 @@ +746456e14187a8b6f2db7da9f05a0d8f \ No newline at end of file diff --git a/dir_591e152ed8a369b957ed274cdb7355d5_dep.png b/dir_591e152ed8a369b957ed274cdb7355d5_dep.png new file mode 100644 index 000000000..3ce320d63 Binary files /dev/null and b/dir_591e152ed8a369b957ed274cdb7355d5_dep.png differ diff --git a/dir_68267d1309a1af8e8297ef4c3efbcdba.html b/dir_68267d1309a1af8e8297ef4c3efbcdba.html new file mode 100644 index 000000000..9beb1b643 --- /dev/null +++ b/dir_68267d1309a1af8e8297ef4c3efbcdba.html @@ -0,0 +1,229 @@ + + + + + + + + +FTXUI: src Directory Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
src Directory Reference
+
+
+
+ + Directory dependency graph for src:
+
+
+ + + + + +

+Directories

 ftxui
 
+
+
+ + + + + diff --git a/dir_68267d1309a1af8e8297ef4c3efbcdba.js b/dir_68267d1309a1af8e8297ef4c3efbcdba.js new file mode 100644 index 000000000..493d88c82 --- /dev/null +++ b/dir_68267d1309a1af8e8297ef4c3efbcdba.js @@ -0,0 +1,4 @@ +var dir_68267d1309a1af8e8297ef4c3efbcdba = +[ + [ "ftxui", "dir_aca3139ef08e710186b498ba0b7d3b1a.html", "dir_aca3139ef08e710186b498ba0b7d3b1a" ] +]; \ No newline at end of file diff --git a/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.map b/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.map new file mode 100644 index 000000000..10e535871 --- /dev/null +++ b/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.md5 b/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.md5 new file mode 100644 index 000000000..82f8de391 --- /dev/null +++ b/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.md5 @@ -0,0 +1 @@ +572d7aca101ab47e858561a23b864b85 \ No newline at end of file diff --git a/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.png b/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.png new file mode 100644 index 000000000..7fc36de56 Binary files /dev/null and b/dir_68267d1309a1af8e8297ef4c3efbcdba_dep.png differ diff --git a/dir_6c89d1ed406002b4e6ebce07fb51a507.html b/dir_6c89d1ed406002b4e6ebce07fb51a507.html new file mode 100644 index 000000000..d22e6c08b --- /dev/null +++ b/dir_6c89d1ed406002b4e6ebce07fb51a507.html @@ -0,0 +1,209 @@ + + + + + + + + +FTXUI: doc Directory Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
doc Directory Reference
+
+
+
+
+ + + + + diff --git a/dir_7f0d124f4cd00c9c7b5b93f60cb4ae34.html b/dir_7f0d124f4cd00c9c7b5b93f60cb4ae34.html new file mode 100644 index 000000000..a805fb9d7 --- /dev/null +++ b/dir_7f0d124f4cd00c9c7b5b93f60cb4ae34.html @@ -0,0 +1,248 @@ + + + + + + + + +FTXUI: ftxui Directory Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
ftxui Directory Reference
+
+
+
+ + Directory dependency graph for ftxui:
+
+
+ + + + + + + + + + + +

+Directories

 component
 
 dom
 
 screen
 
 util
 
+
+
+ + + + + diff --git a/dir_7f0d124f4cd00c9c7b5b93f60cb4ae34.js b/dir_7f0d124f4cd00c9c7b5b93f60cb4ae34.js new file mode 100644 index 000000000..74d28278d --- /dev/null +++ b/dir_7f0d124f4cd00c9c7b5b93f60cb4ae34.js @@ -0,0 +1,7 @@ +var dir_7f0d124f4cd00c9c7b5b93f60cb4ae34 = +[ + [ "component", "dir_b7c1fcae8d0ae1df453f463e8938778b.html", "dir_b7c1fcae8d0ae1df453f463e8938778b" ], + [ "dom", "dir_4cbb3a1c219643e03aadd7cd3693e7bd.html", "dir_4cbb3a1c219643e03aadd7cd3693e7bd" ], + [ "screen", "dir_53f6d8d3eb5689656c3f196f1d99fcb2.html", "dir_53f6d8d3eb5689656c3f196f1d99fcb2" ], + [ "util", "dir_1668679807285893c235fcc812b1f73d.html", "dir_1668679807285893c235fcc812b1f73d" ] +]; \ No newline at end of file diff --git a/dir_7f0d124f4cd00c9c7b5b93f60cb4ae34_dep.map b/dir_7f0d124f4cd00c9c7b5b93f60cb4ae34_dep.map new file mode 100644 index 000000000..2aa7a1510 --- /dev/null +++ b/dir_7f0d124f4cd00c9c7b5b93f60cb4ae34_dep.map @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/dir_7f0d124f4cd00c9c7b5b93f60cb4ae34_dep.md5 b/dir_7f0d124f4cd00c9c7b5b93f60cb4ae34_dep.md5 new file mode 100644 index 000000000..8593da13b --- /dev/null +++ b/dir_7f0d124f4cd00c9c7b5b93f60cb4ae34_dep.md5 @@ -0,0 +1 @@ +71d06994bbbad9cabbbc282f505f5c97 \ No newline at end of file diff --git a/dir_7f0d124f4cd00c9c7b5b93f60cb4ae34_dep.png b/dir_7f0d124f4cd00c9c7b5b93f60cb4ae34_dep.png new file mode 100644 index 000000000..7e2de6aa7 Binary files /dev/null and b/dir_7f0d124f4cd00c9c7b5b93f60cb4ae34_dep.png differ diff --git a/dir_8b052a5e35b6e4510790af7766fda6cf.html b/dir_8b052a5e35b6e4510790af7766fda6cf.html new file mode 100644 index 000000000..14d4f342b --- /dev/null +++ b/dir_8b052a5e35b6e4510790af7766fda6cf.html @@ -0,0 +1,337 @@ + + + + + + + + +FTXUI: dom Directory Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
dom Directory Reference
+
+
+
+ + Directory dependency graph for dom:
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Files

 automerge.cpp
 
 blink.cpp
 
 bold.cpp
 
 border.cpp
 
 box_helper.cpp
 
 box_helper.hpp
 
 canvas.cpp
 
 canvas.cppm
 
 clear_under.cpp
 
 color.cpp
 
 composite_decorator.cpp
 
 dbox.cpp
 
 deprecated.cppm
 
 dim.cpp
 
 direction.cppm
 
 elements.cppm
 
 flex.cpp
 
 flexbox.cpp
 
 flexbox_config.cpp
 
 flexbox_config.cppm
 
 flexbox_helper.cpp
 
 flexbox_helper.hpp
 
 focus.cpp
 
 frame.cpp
 
 gauge.cpp
 
 graph.cpp
 
 gridbox.cpp
 
 hbox.cpp
 
 hyperlink.cpp
 
 inverted.cpp
 
 italic.cpp
 
 linear_gradient.cpp
 
 linear_gradient.cppm
 
 node.cpp
 
 node.cppm
 
 node_decorator.cpp
 
 node_decorator.hpp
 
 paragraph.cpp
 
 reflect.cpp
 
 requirement.cppm
 
 scroll_indicator.cpp
 
 selection.cpp
 
 selection.cppm
 
 selection_style.cpp
 
 separator.cpp
 
 size.cpp
 
 spinner.cpp
 
 strikethrough.cpp
 
 table.cpp
 
 table.cppm
 
 text.cpp
 
 underlined.cpp
 
 underlined_double.cpp
 
 util.cpp
 
 vbox.cpp
 
+
+
+ + + + + diff --git a/dir_8b052a5e35b6e4510790af7766fda6cf.js b/dir_8b052a5e35b6e4510790af7766fda6cf.js new file mode 100644 index 000000000..ae188673f --- /dev/null +++ b/dir_8b052a5e35b6e4510790af7766fda6cf.js @@ -0,0 +1,58 @@ +var dir_8b052a5e35b6e4510790af7766fda6cf = +[ + [ "automerge.cpp", "automerge_8cpp.html", "automerge_8cpp" ], + [ "blink.cpp", "blink_8cpp.html", "blink_8cpp" ], + [ "bold.cpp", "bold_8cpp.html", "bold_8cpp" ], + [ "border.cpp", "src_2ftxui_2dom_2border_8cpp.html", "src_2ftxui_2dom_2border_8cpp" ], + [ "box_helper.cpp", "box__helper_8cpp.html", "box__helper_8cpp" ], + [ "box_helper.hpp", "box__helper_8hpp.html", "box__helper_8hpp" ], + [ "canvas.cpp", "src_2ftxui_2dom_2canvas_8cpp.html", "src_2ftxui_2dom_2canvas_8cpp" ], + [ "canvas.cppm", "canvas_8cppm.html", null ], + [ "clear_under.cpp", "clear__under_8cpp.html", "clear__under_8cpp" ], + [ "color.cpp", "dom_2color_8cpp.html", "dom_2color_8cpp" ], + [ "composite_decorator.cpp", "composite__decorator_8cpp.html", "composite__decorator_8cpp" ], + [ "dbox.cpp", "src_2ftxui_2dom_2dbox_8cpp.html", "src_2ftxui_2dom_2dbox_8cpp" ], + [ "deprecated.cppm", "dom_2deprecated_8cppm.html", null ], + [ "dim.cpp", "dim_8cpp.html", "dim_8cpp" ], + [ "direction.cppm", "direction_8cppm.html", null ], + [ "elements.cppm", "elements_8cppm.html", null ], + [ "flex.cpp", "flex_8cpp.html", "flex_8cpp" ], + [ "flexbox.cpp", "flexbox_8cpp.html", "flexbox_8cpp" ], + [ "flexbox_config.cpp", "flexbox__config_8cpp.html", null ], + [ "flexbox_config.cppm", "flexbox__config_8cppm.html", null ], + [ "flexbox_helper.cpp", "flexbox__helper_8cpp.html", "flexbox__helper_8cpp" ], + [ "flexbox_helper.hpp", "flexbox__helper_8hpp.html", "flexbox__helper_8hpp" ], + [ "focus.cpp", "src_2ftxui_2dom_2focus_8cpp.html", "src_2ftxui_2dom_2focus_8cpp" ], + [ "frame.cpp", "frame_8cpp.html", "frame_8cpp" ], + [ "gauge.cpp", "src_2ftxui_2dom_2gauge_8cpp.html", "src_2ftxui_2dom_2gauge_8cpp" ], + [ "graph.cpp", "src_2ftxui_2dom_2graph_8cpp.html", "src_2ftxui_2dom_2graph_8cpp" ], + [ "gridbox.cpp", "src_2ftxui_2dom_2gridbox_8cpp.html", "src_2ftxui_2dom_2gridbox_8cpp" ], + [ "hbox.cpp", "hbox_8cpp.html", "hbox_8cpp" ], + [ "hyperlink.cpp", "hyperlink_8cpp.html", "hyperlink_8cpp" ], + [ "inverted.cpp", "inverted_8cpp.html", "inverted_8cpp" ], + [ "italic.cpp", "italic_8cpp.html", "italic_8cpp" ], + [ "linear_gradient.cpp", "src_2ftxui_2dom_2linear__gradient_8cpp.html", "src_2ftxui_2dom_2linear__gradient_8cpp" ], + [ "linear_gradient.cppm", "linear__gradient_8cppm.html", null ], + [ "node.cpp", "node_8cpp.html", "node_8cpp" ], + [ "node.cppm", "node_8cppm.html", null ], + [ "node_decorator.cpp", "node__decorator_8cpp.html", null ], + [ "node_decorator.hpp", "node__decorator_8hpp.html", "node__decorator_8hpp" ], + [ "paragraph.cpp", "src_2ftxui_2dom_2paragraph_8cpp.html", "src_2ftxui_2dom_2paragraph_8cpp" ], + [ "reflect.cpp", "reflect_8cpp.html", "reflect_8cpp" ], + [ "requirement.cppm", "requirement_8cppm.html", null ], + [ "scroll_indicator.cpp", "scroll__indicator_8cpp.html", "scroll__indicator_8cpp" ], + [ "selection.cpp", "src_2ftxui_2dom_2selection_8cpp.html", null ], + [ "selection.cppm", "selection_8cppm.html", null ], + [ "selection_style.cpp", "selection__style_8cpp.html", "selection__style_8cpp" ], + [ "separator.cpp", "src_2ftxui_2dom_2separator_8cpp.html", "src_2ftxui_2dom_2separator_8cpp" ], + [ "size.cpp", "src_2ftxui_2dom_2size_8cpp.html", "src_2ftxui_2dom_2size_8cpp" ], + [ "spinner.cpp", "src_2ftxui_2dom_2spinner_8cpp.html", "src_2ftxui_2dom_2spinner_8cpp" ], + [ "strikethrough.cpp", "strikethrough_8cpp.html", "strikethrough_8cpp" ], + [ "table.cpp", "src_2ftxui_2dom_2table_8cpp.html", null ], + [ "table.cppm", "table_8cppm.html", null ], + [ "text.cpp", "text_8cpp.html", "text_8cpp" ], + [ "underlined.cpp", "underlined_8cpp.html", "underlined_8cpp" ], + [ "underlined_double.cpp", "underlined__double_8cpp.html", "underlined__double_8cpp" ], + [ "util.cpp", "dom_2util_8cpp.html", "dom_2util_8cpp" ], + [ "vbox.cpp", "vbox_8cpp.html", "vbox_8cpp" ] +]; \ No newline at end of file diff --git a/dir_8b052a5e35b6e4510790af7766fda6cf_dep.map b/dir_8b052a5e35b6e4510790af7766fda6cf_dep.map new file mode 100644 index 000000000..e2aab786c --- /dev/null +++ b/dir_8b052a5e35b6e4510790af7766fda6cf_dep.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/dir_8b052a5e35b6e4510790af7766fda6cf_dep.md5 b/dir_8b052a5e35b6e4510790af7766fda6cf_dep.md5 new file mode 100644 index 000000000..781cd0543 --- /dev/null +++ b/dir_8b052a5e35b6e4510790af7766fda6cf_dep.md5 @@ -0,0 +1 @@ +97ccfc5d2e71276aa5f45adba775a249 \ No newline at end of file diff --git a/dir_8b052a5e35b6e4510790af7766fda6cf_dep.png b/dir_8b052a5e35b6e4510790af7766fda6cf_dep.png new file mode 100644 index 000000000..493183906 Binary files /dev/null and b/dir_8b052a5e35b6e4510790af7766fda6cf_dep.png differ diff --git a/dir_9acac4494befa3e78fe4cf0f88d4c1ad.html b/dir_9acac4494befa3e78fe4cf0f88d4c1ad.html new file mode 100644 index 000000000..2b8e5e92a --- /dev/null +++ b/dir_9acac4494befa3e78fe4cf0f88d4c1ad.html @@ -0,0 +1,231 @@ + + + + + + + + +FTXUI: util Directory Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
util Directory Reference
+
+
+
+ + Directory dependency graph for util:
+
+
+ + + + + + + +

+Files

 autoreset.cppm
 
 ref.cppm
 
+
+
+ + + + + diff --git a/dir_9acac4494befa3e78fe4cf0f88d4c1ad.js b/dir_9acac4494befa3e78fe4cf0f88d4c1ad.js new file mode 100644 index 000000000..109df45e5 --- /dev/null +++ b/dir_9acac4494befa3e78fe4cf0f88d4c1ad.js @@ -0,0 +1,5 @@ +var dir_9acac4494befa3e78fe4cf0f88d4c1ad = +[ + [ "autoreset.cppm", "autoreset_8cppm.html", null ], + [ "ref.cppm", "ref_8cppm.html", null ] +]; \ No newline at end of file diff --git a/dir_9acac4494befa3e78fe4cf0f88d4c1ad_dep.map b/dir_9acac4494befa3e78fe4cf0f88d4c1ad_dep.map new file mode 100644 index 000000000..8bc8aa9b0 --- /dev/null +++ b/dir_9acac4494befa3e78fe4cf0f88d4c1ad_dep.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/dir_9acac4494befa3e78fe4cf0f88d4c1ad_dep.md5 b/dir_9acac4494befa3e78fe4cf0f88d4c1ad_dep.md5 new file mode 100644 index 000000000..693c236a8 --- /dev/null +++ b/dir_9acac4494befa3e78fe4cf0f88d4c1ad_dep.md5 @@ -0,0 +1 @@ +bb83e8a6ee9745f556a407918e5893c5 \ No newline at end of file diff --git a/dir_9acac4494befa3e78fe4cf0f88d4c1ad_dep.png b/dir_9acac4494befa3e78fe4cf0f88d4c1ad_dep.png new file mode 100644 index 000000000..b65403e1b Binary files /dev/null and b/dir_9acac4494befa3e78fe4cf0f88d4c1ad_dep.png differ diff --git a/dir_aca3139ef08e710186b498ba0b7d3b1a.html b/dir_aca3139ef08e710186b498ba0b7d3b1a.html new file mode 100644 index 000000000..25a96e304 --- /dev/null +++ b/dir_aca3139ef08e710186b498ba0b7d3b1a.html @@ -0,0 +1,270 @@ + + + + + + + + +FTXUI: ftxui Directory Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
ftxui Directory Reference
+
+
+
+ + Directory dependency graph for ftxui:
+
+
+ + + + + + + + + + + +

+Directories

 component
 
 dom
 
 screen
 
 util
 
+ + + + + + + + + + + +

+Files

 component.cppm
 
 dom.cppm
 
 ftxui.cppm
 
 screen.cppm
 
 util.cppm
 
+
+
+ + + + + diff --git a/dir_aca3139ef08e710186b498ba0b7d3b1a.js b/dir_aca3139ef08e710186b498ba0b7d3b1a.js new file mode 100644 index 000000000..ddd03afad --- /dev/null +++ b/dir_aca3139ef08e710186b498ba0b7d3b1a.js @@ -0,0 +1,12 @@ +var dir_aca3139ef08e710186b498ba0b7d3b1a = +[ + [ "component", "dir_591e152ed8a369b957ed274cdb7355d5.html", "dir_591e152ed8a369b957ed274cdb7355d5" ], + [ "dom", "dir_8b052a5e35b6e4510790af7766fda6cf.html", "dir_8b052a5e35b6e4510790af7766fda6cf" ], + [ "screen", "dir_3f4db74392b369be141833a3ebdcb6a2.html", "dir_3f4db74392b369be141833a3ebdcb6a2" ], + [ "util", "dir_9acac4494befa3e78fe4cf0f88d4c1ad.html", "dir_9acac4494befa3e78fe4cf0f88d4c1ad" ], + [ "component.cppm", "component_8cppm.html", null ], + [ "dom.cppm", "dom_8cppm.html", null ], + [ "ftxui.cppm", "ftxui_8cppm.html", null ], + [ "screen.cppm", "screen_8cppm.html", null ], + [ "util.cppm", "util_8cppm.html", null ] +]; \ No newline at end of file diff --git a/dir_aca3139ef08e710186b498ba0b7d3b1a_dep.map b/dir_aca3139ef08e710186b498ba0b7d3b1a_dep.map new file mode 100644 index 000000000..20c55acc6 --- /dev/null +++ b/dir_aca3139ef08e710186b498ba0b7d3b1a_dep.map @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dir_aca3139ef08e710186b498ba0b7d3b1a_dep.md5 b/dir_aca3139ef08e710186b498ba0b7d3b1a_dep.md5 new file mode 100644 index 000000000..15ab0360e --- /dev/null +++ b/dir_aca3139ef08e710186b498ba0b7d3b1a_dep.md5 @@ -0,0 +1 @@ +3f1d2cddb917f8003eb79f62d527d1c7 \ No newline at end of file diff --git a/dir_aca3139ef08e710186b498ba0b7d3b1a_dep.png b/dir_aca3139ef08e710186b498ba0b7d3b1a_dep.png new file mode 100644 index 000000000..6ecd940df Binary files /dev/null and b/dir_aca3139ef08e710186b498ba0b7d3b1a_dep.png differ diff --git a/dir_b7c1fcae8d0ae1df453f463e8938778b.html b/dir_b7c1fcae8d0ae1df453f463e8938778b.html new file mode 100644 index 000000000..ba8646a19 --- /dev/null +++ b/dir_b7c1fcae8d0ae1df453f463e8938778b.html @@ -0,0 +1,255 @@ + + + + + + + + +FTXUI: component Directory Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
component Directory Reference
+
+
+
+ + Directory dependency graph for component:
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +

+Files

 animation.hpp
 
 captured_mouse.hpp
 
 component.hpp
 
 component_base.hpp
 
 component_options.hpp
 
 event.hpp
 
 loop.hpp
 
 mouse.hpp
 
 receiver.hpp
 
 screen_interactive.hpp
 
 task.hpp
 
+
+
+ + + + + diff --git a/dir_b7c1fcae8d0ae1df453f463e8938778b.js b/dir_b7c1fcae8d0ae1df453f463e8938778b.js new file mode 100644 index 000000000..2e51e07d2 --- /dev/null +++ b/dir_b7c1fcae8d0ae1df453f463e8938778b.js @@ -0,0 +1,14 @@ +var dir_b7c1fcae8d0ae1df453f463e8938778b = +[ + [ "animation.hpp", "animation_8hpp.html", "animation_8hpp" ], + [ "captured_mouse.hpp", "captured__mouse_8hpp.html", "captured__mouse_8hpp" ], + [ "component.hpp", "component_8hpp.html", "component_8hpp" ], + [ "component_base.hpp", "component__base_8hpp.html", "component__base_8hpp" ], + [ "component_options.hpp", "component__options_8hpp.html", "component__options_8hpp" ], + [ "event.hpp", "event_8hpp.html", null ], + [ "loop.hpp", "loop_8hpp.html", null ], + [ "mouse.hpp", "mouse_8hpp.html", null ], + [ "receiver.hpp", "receiver_8hpp.html", "receiver_8hpp" ], + [ "screen_interactive.hpp", "screen__interactive_8hpp.html", "screen__interactive_8hpp" ], + [ "task.hpp", "task_8hpp.html", "task_8hpp" ] +]; \ No newline at end of file diff --git a/dir_b7c1fcae8d0ae1df453f463e8938778b_dep.map b/dir_b7c1fcae8d0ae1df453f463e8938778b_dep.map new file mode 100644 index 000000000..3e070a8fa --- /dev/null +++ b/dir_b7c1fcae8d0ae1df453f463e8938778b_dep.map @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/dir_b7c1fcae8d0ae1df453f463e8938778b_dep.md5 b/dir_b7c1fcae8d0ae1df453f463e8938778b_dep.md5 new file mode 100644 index 000000000..983c00bea --- /dev/null +++ b/dir_b7c1fcae8d0ae1df453f463e8938778b_dep.md5 @@ -0,0 +1 @@ +fd3fbf5d5d926054fc401fd4ea3d1785 \ No newline at end of file diff --git a/dir_b7c1fcae8d0ae1df453f463e8938778b_dep.png b/dir_b7c1fcae8d0ae1df453f463e8938778b_dep.png new file mode 100644 index 000000000..63a74bf76 Binary files /dev/null and b/dir_b7c1fcae8d0ae1df453f463e8938778b_dep.png differ diff --git a/dir_c6e2a03fcd381aa57f98a8fd0760f80b.html b/dir_c6e2a03fcd381aa57f98a8fd0760f80b.html new file mode 100644 index 000000000..9e5779ac7 --- /dev/null +++ b/dir_c6e2a03fcd381aa57f98a8fd0760f80b.html @@ -0,0 +1,301 @@ + + + + + + + + +FTXUI: dom Directory Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
dom Directory Reference
+
+ +
+ + + + + diff --git a/dir_c6e2a03fcd381aa57f98a8fd0760f80b.js b/dir_c6e2a03fcd381aa57f98a8fd0760f80b.js new file mode 100644 index 000000000..dba8e503a --- /dev/null +++ b/dir_c6e2a03fcd381aa57f98a8fd0760f80b.js @@ -0,0 +1,40 @@ +var dir_c6e2a03fcd381aa57f98a8fd0760f80b = +[ + [ "border.cpp", "examples_2dom_2border_8cpp.html", "examples_2dom_2border_8cpp" ], + [ "border_colored.cpp", "border__colored_8cpp.html", "border__colored_8cpp" ], + [ "border_style.cpp", "border__style_8cpp.html", "border__style_8cpp" ], + [ "canvas.cpp", "examples_2dom_2canvas_8cpp.html", "examples_2dom_2canvas_8cpp" ], + [ "color_gallery.cpp", "color__gallery_8cpp.html", "color__gallery_8cpp" ], + [ "color_info_palette256.cpp", "color__info__palette256_8cpp.html", "color__info__palette256_8cpp" ], + [ "color_info_sorted_2d.ipp", "color__info__sorted__2d_8ipp.html", "color__info__sorted__2d_8ipp" ], + [ "color_truecolor_HSV.cpp", "color__truecolor__HSV_8cpp.html", "color__truecolor__HSV_8cpp" ], + [ "color_truecolor_RGB.cpp", "color__truecolor__RGB_8cpp.html", "color__truecolor__RGB_8cpp" ], + [ "dbox.cpp", "examples_2dom_2dbox_8cpp.html", "examples_2dom_2dbox_8cpp" ], + [ "gauge.cpp", "examples_2dom_2gauge_8cpp.html", "examples_2dom_2gauge_8cpp" ], + [ "gauge_direction.cpp", "gauge__direction_8cpp.html", "gauge__direction_8cpp" ], + [ "graph.cpp", "examples_2dom_2graph_8cpp.html", "examples_2dom_2graph_8cpp" ], + [ "gridbox.cpp", "examples_2dom_2gridbox_8cpp.html", "examples_2dom_2gridbox_8cpp" ], + [ "hflow.cpp", "hflow_8cpp.html", "hflow_8cpp" ], + [ "html_like.cpp", "html__like_8cpp.html", "html__like_8cpp" ], + [ "linear_gradient.cpp", "examples_2dom_2linear__gradient_8cpp.html", "examples_2dom_2linear__gradient_8cpp" ], + [ "package_manager.cpp", "package__manager_8cpp.html", "package__manager_8cpp" ], + [ "paragraph.cpp", "examples_2dom_2paragraph_8cpp.html", "examples_2dom_2paragraph_8cpp" ], + [ "separator.cpp", "examples_2dom_2separator_8cpp.html", "examples_2dom_2separator_8cpp" ], + [ "separator_style.cpp", "separator__style_8cpp.html", "separator__style_8cpp" ], + [ "size.cpp", "examples_2dom_2size_8cpp.html", "examples_2dom_2size_8cpp" ], + [ "spinner.cpp", "examples_2dom_2spinner_8cpp.html", "examples_2dom_2spinner_8cpp" ], + [ "style_blink.cpp", "style__blink_8cpp.html", "style__blink_8cpp" ], + [ "style_bold.cpp", "style__bold_8cpp.html", "style__bold_8cpp" ], + [ "style_color.cpp", "style__color_8cpp.html", "style__color_8cpp" ], + [ "style_dim.cpp", "style__dim_8cpp.html", "style__dim_8cpp" ], + [ "style_gallery.cpp", "style__gallery_8cpp.html", "style__gallery_8cpp" ], + [ "style_hyperlink.cpp", "style__hyperlink_8cpp.html", "style__hyperlink_8cpp" ], + [ "style_inverted.cpp", "style__inverted_8cpp.html", "style__inverted_8cpp" ], + [ "style_italic.cpp", "style__italic_8cpp.html", "style__italic_8cpp" ], + [ "style_strikethrough.cpp", "style__strikethrough_8cpp.html", "style__strikethrough_8cpp" ], + [ "style_underlined.cpp", "style__underlined_8cpp.html", "style__underlined_8cpp" ], + [ "style_underlined_double.cpp", "style__underlined__double_8cpp.html", "style__underlined__double_8cpp" ], + [ "table.cpp", "examples_2dom_2table_8cpp.html", "examples_2dom_2table_8cpp" ], + [ "vbox_hbox.cpp", "vbox__hbox_8cpp.html", "vbox__hbox_8cpp" ], + [ "vflow.cpp", "vflow_8cpp.html", "vflow_8cpp" ] +]; \ No newline at end of file diff --git a/dir_c6e2a03fcd381aa57f98a8fd0760f80b_dep.map b/dir_c6e2a03fcd381aa57f98a8fd0760f80b_dep.map new file mode 100644 index 000000000..9b863156c --- /dev/null +++ b/dir_c6e2a03fcd381aa57f98a8fd0760f80b_dep.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/dir_c6e2a03fcd381aa57f98a8fd0760f80b_dep.md5 b/dir_c6e2a03fcd381aa57f98a8fd0760f80b_dep.md5 new file mode 100644 index 000000000..117315893 --- /dev/null +++ b/dir_c6e2a03fcd381aa57f98a8fd0760f80b_dep.md5 @@ -0,0 +1 @@ +c7394c0361bae4523027de7ea34f765f \ No newline at end of file diff --git a/dir_c6e2a03fcd381aa57f98a8fd0760f80b_dep.png b/dir_c6e2a03fcd381aa57f98a8fd0760f80b_dep.png new file mode 100644 index 000000000..23b1bafd7 Binary files /dev/null and b/dir_c6e2a03fcd381aa57f98a8fd0760f80b_dep.png differ diff --git a/dir_d28a4824dc47e487b107a5db32ef43c4.html b/dir_d28a4824dc47e487b107a5db32ef43c4.html new file mode 100644 index 000000000..1894390d5 --- /dev/null +++ b/dir_d28a4824dc47e487b107a5db32ef43c4.html @@ -0,0 +1,236 @@ + + + + + + + + +FTXUI: examples Directory Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples Directory Reference
+
+
+
+ + Directory dependency graph for examples:
+
+
+ + + + + + + +

+Directories

 component
 
 dom
 
+
+
+ + + + + diff --git a/dir_d28a4824dc47e487b107a5db32ef43c4.js b/dir_d28a4824dc47e487b107a5db32ef43c4.js new file mode 100644 index 000000000..971a71ddd --- /dev/null +++ b/dir_d28a4824dc47e487b107a5db32ef43c4.js @@ -0,0 +1,5 @@ +var dir_d28a4824dc47e487b107a5db32ef43c4 = +[ + [ "component", "dir_34153e0f69aea4f55932893abc931484.html", "dir_34153e0f69aea4f55932893abc931484" ], + [ "dom", "dir_c6e2a03fcd381aa57f98a8fd0760f80b.html", "dir_c6e2a03fcd381aa57f98a8fd0760f80b" ] +]; \ No newline at end of file diff --git a/dir_d28a4824dc47e487b107a5db32ef43c4_dep.map b/dir_d28a4824dc47e487b107a5db32ef43c4_dep.map new file mode 100644 index 000000000..9bec4bd6a --- /dev/null +++ b/dir_d28a4824dc47e487b107a5db32ef43c4_dep.map @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/dir_d28a4824dc47e487b107a5db32ef43c4_dep.md5 b/dir_d28a4824dc47e487b107a5db32ef43c4_dep.md5 new file mode 100644 index 000000000..3fe352930 --- /dev/null +++ b/dir_d28a4824dc47e487b107a5db32ef43c4_dep.md5 @@ -0,0 +1 @@ +399c93eca683f0d7a4a18c1bcd4693a8 \ No newline at end of file diff --git a/dir_d28a4824dc47e487b107a5db32ef43c4_dep.png b/dir_d28a4824dc47e487b107a5db32ef43c4_dep.png new file mode 100644 index 000000000..6fed7c109 Binary files /dev/null and b/dir_d28a4824dc47e487b107a5db32ef43c4_dep.png differ diff --git a/dir_d44c64559bbebec7f509842c48db8b23.html b/dir_d44c64559bbebec7f509842c48db8b23.html new file mode 100644 index 000000000..5698cc120 --- /dev/null +++ b/dir_d44c64559bbebec7f509842c48db8b23.html @@ -0,0 +1,226 @@ + + + + + + + + +FTXUI: include Directory Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
include Directory Reference
+
+
+
+ + Directory dependency graph for include:
+
+
+ + + + + +

+Directories

 ftxui
 
+
+
+ + + + + diff --git a/dir_d44c64559bbebec7f509842c48db8b23.js b/dir_d44c64559bbebec7f509842c48db8b23.js new file mode 100644 index 000000000..65e71f0f8 --- /dev/null +++ b/dir_d44c64559bbebec7f509842c48db8b23.js @@ -0,0 +1,4 @@ +var dir_d44c64559bbebec7f509842c48db8b23 = +[ + [ "ftxui", "dir_7f0d124f4cd00c9c7b5b93f60cb4ae34.html", "dir_7f0d124f4cd00c9c7b5b93f60cb4ae34" ] +]; \ No newline at end of file diff --git a/dir_d44c64559bbebec7f509842c48db8b23_dep.map b/dir_d44c64559bbebec7f509842c48db8b23_dep.map new file mode 100644 index 000000000..281e7a5b0 --- /dev/null +++ b/dir_d44c64559bbebec7f509842c48db8b23_dep.map @@ -0,0 +1,4 @@ + + + + diff --git a/dir_d44c64559bbebec7f509842c48db8b23_dep.md5 b/dir_d44c64559bbebec7f509842c48db8b23_dep.md5 new file mode 100644 index 000000000..fa0285072 --- /dev/null +++ b/dir_d44c64559bbebec7f509842c48db8b23_dep.md5 @@ -0,0 +1 @@ +47c05b247d2bc649adeb68ac7a81a518 \ No newline at end of file diff --git a/dir_d44c64559bbebec7f509842c48db8b23_dep.png b/dir_d44c64559bbebec7f509842c48db8b23_dep.png new file mode 100644 index 000000000..a53a09447 Binary files /dev/null and b/dir_d44c64559bbebec7f509842c48db8b23_dep.png differ diff --git a/dir_e68e8157741866f444e17edd764ebbae.html b/dir_e68e8157741866f444e17edd764ebbae.html new file mode 100644 index 000000000..371607a14 --- /dev/null +++ b/dir_e68e8157741866f444e17edd764ebbae.html @@ -0,0 +1,209 @@ + + + + + + + + +FTXUI: doc Directory Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
doc Directory Reference
+
+
+
+
+ + + + + diff --git a/direction_8cppm.html b/direction_8cppm.html new file mode 100644 index 000000000..8d58cb383 --- /dev/null +++ b/direction_8cppm.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: direction.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
direction.cppm File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+
+
+ + + + + diff --git a/direction_8cppm_source.html b/direction_8cppm_source.html new file mode 100644 index 000000000..7aac85eca --- /dev/null +++ b/direction_8cppm_source.html @@ -0,0 +1,229 @@ + + + + + + + + +FTXUI: direction.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
direction.cppm
+
+
+Go to the documentation of this file.
1/// @module ftxui.dom.direction
+
2/// @brief Module file for the Direction enum of the Dom module
+
3
+
4module;
+
5
+ +
7
+
8export module ftxui.dom.direction;
+
9
+
10/**
+
11 * @namespace ftxui
+
12 * @brief The FTXUI ftxui:: namespace
+
13 */
+
14export namespace ftxui {
+
15 using ftxui::Direction;
+
16}
+ +
Direction
Direction is an enumeration that represents the four cardinal directions.
Definition direction.hpp:13
+
Module file for the Direction enum of the Dom module.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
+
+ + + + + diff --git a/direction_8hpp.html b/direction_8hpp.html new file mode 100644 index 000000000..1be640a56 --- /dev/null +++ b/direction_8hpp.html @@ -0,0 +1,236 @@ + + + + + + + + +FTXUI: direction.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
direction.hpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+ + + + +

+Enumerations

enum class  Direction {
+  Up = 0 +,
+  Down = 1 +,
+  Left = 2 +,
+  Right = 3 +
+ }
 Direction is an enumeration that represents the four cardinal directions. More...
 
+
+
+ + + + + diff --git a/direction_8hpp.js b/direction_8hpp.js new file mode 100644 index 000000000..f7ba8713f --- /dev/null +++ b/direction_8hpp.js @@ -0,0 +1,9 @@ +var direction_8hpp = +[ + [ "Direction", "direction_8hpp.html#ga224b9163917ac32fc95a60d8c1eec3aa", [ + [ "Up", "direction_8hpp.html#gga224b9163917ac32fc95a60d8c1eec3aaa258f49887ef8d14ac268c92b02503aaa", null ], + [ "Down", "direction_8hpp.html#gga224b9163917ac32fc95a60d8c1eec3aaa08a38277b0309070706f6652eeae9a53", null ], + [ "Left", "direction_8hpp.html#gga224b9163917ac32fc95a60d8c1eec3aaa945d5e233cf7d6240f6b783b36a374ff", null ], + [ "Right", "direction_8hpp.html#gga224b9163917ac32fc95a60d8c1eec3aaa92b09c7c48c520c3c55e497875da437c", null ] + ] ] +]; \ No newline at end of file diff --git a/direction_8hpp_source.html b/direction_8hpp_source.html new file mode 100644 index 000000000..c669369ca --- /dev/null +++ b/direction_8hpp_source.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: direction.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
direction.hpp
+
+
+Go to the documentation of this file.
1// Copyright 2023 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#ifndef FTXUI_DOM_DIRECTION_HPP
+
5#define FTXUI_DOM_DIRECTION_HPP
+
6
+
7namespace ftxui {
+
8
+
9/// @brief Direction is an enumeration that represents the four cardinal
+
10/// directions.
+
11///
+
12/// @ingroup dom
+
+
13enum class Direction {
+
14 Up = 0,
+
15 Down = 1,
+
16 Left = 2,
+
17 Right = 3,
+
18};
+
+
19
+
20} // namespace ftxui
+
21
+
22#endif /* end of include guard: FTXUI_DOM_DIRECTION_HPP */
+
Direction
Direction is an enumeration that represents the four cardinal directions.
Definition direction.hpp:13
+ + + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
+
+ + + + + diff --git a/doc.svg b/doc.svg new file mode 100644 index 000000000..387945444 --- /dev/null +++ b/doc.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/docd.svg b/docd.svg new file mode 100644 index 000000000..c20ddf1e0 --- /dev/null +++ b/docd.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/dom_2color_8cpp.html b/dom_2color_8cpp.html new file mode 100644 index 000000000..4e6af80ec --- /dev/null +++ b/dom_2color_8cpp.html @@ -0,0 +1,253 @@ + + + + + + + + +FTXUI: color.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
color.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+ + + + + + + + + + + + + +

+Functions

Element color (Color color, Element child)
 Set the foreground color of an element.
 
Element bgcolor (Color color, Element child)
 Set the background color of an element.
 
Decorator color (Color c)
 Decorate using a foreground color.
 
Decorator bgcolor (Color color)
 Decorate using a background color.
 
+

Variable Documentation

+ +

◆ color_

+ +
+
+ + + + +
Color color_
+
+ +

Definition at line 39 of file dom/color.cpp.

+ +
+
+
+
+ + + + + diff --git a/dom_2color_8cpp.js b/dom_2color_8cpp.js new file mode 100644 index 000000000..125e352b3 --- /dev/null +++ b/dom_2color_8cpp.js @@ -0,0 +1,8 @@ +var dom_2color_8cpp = +[ + [ "color", "dom_2color_8cpp.html#gadef6e6e66199153de6d3b21b14dcf868", null ], + [ "bgcolor", "dom_2color_8cpp.html#gaae86eacae0a0626b41e9964ac7f4f532", null ], + [ "color", "dom_2color_8cpp.html#gaf61b489da39ca5e24b68e6e1a2b09c0d", null ], + [ "bgcolor", "dom_2color_8cpp.html#ga01d4c5aaf0447e862246849111782245", null ], + [ "color_", "dom_2color_8cpp.html#af75802a6553b2b23639f23d3c4b94217", null ] +]; \ No newline at end of file diff --git a/dom_2color_8cpp_source.html b/dom_2color_8cpp_source.html new file mode 100644 index 000000000..7dcd258b4 --- /dev/null +++ b/dom_2color_8cpp_source.html @@ -0,0 +1,361 @@ + + + + + + + + +FTXUI: color.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
dom/color.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <memory> // for make_shared
+
5#include <utility> // for move
+
6
+
7#include "ftxui/dom/elements.hpp" // for Element, Decorator, bgcolor, color
+
8#include "ftxui/dom/node_decorator.hpp" // for NodeDecorator
+
9#include "ftxui/screen/box.hpp" // for Box
+
10#include "ftxui/screen/color.hpp" // for Color
+
11#include "ftxui/screen/screen.hpp" // for Pixel, Screen
+
12
+
13namespace ftxui {
+
14
+
15namespace {
+
16class BgColor : public NodeDecorator {
+
17 public:
+
18 BgColor(Element child, Color color)
+
19 : NodeDecorator(std::move(child)), color_(color) {}
+
20
+
21 void Render(Screen& screen) override {
+
22 if (color_.IsOpaque()) {
+
23 for (int y = box_.y_min; y <= box_.y_max; ++y) {
+
24 for (int x = box_.x_min; x <= box_.x_max; ++x) {
+
25 screen.PixelAt(x, y).background_color = color_;
+
26 }
+
27 }
+
28 } else {
+
29 for (int y = box_.y_min; y <= box_.y_max; ++y) {
+
30 for (int x = box_.x_min; x <= box_.x_max; ++x) {
+
31 Color& color = screen.PixelAt(x, y).background_color;
+
32 color = Color::Blend(color, color_);
+
33 }
+
34 }
+
35 }
+ +
37 }
+
38
+
39 Color color_;
+
40};
+
41
+
42class FgColor : public NodeDecorator {
+
43 public:
+
44 FgColor(Element child, Color color)
+
45 : NodeDecorator(std::move(child)), color_(color) {}
+
46
+
47 void Render(Screen& screen) override {
+
48 if (color_.IsOpaque()) {
+
49 for (int y = box_.y_min; y <= box_.y_max; ++y) {
+
50 for (int x = box_.x_min; x <= box_.x_max; ++x) {
+
51 screen.PixelAt(x, y).foreground_color = color_;
+
52 }
+
53 }
+
54 } else {
+
55 for (int y = box_.y_min; y <= box_.y_max; ++y) {
+
56 for (int x = box_.x_min; x <= box_.x_max; ++x) {
+
57 Color& color = screen.PixelAt(x, y).foreground_color;
+
58 color = Color::Blend(color, color_);
+
59 }
+
60 }
+
61 }
+ +
63 }
+
64
+ +
66};
+
67
+
68} // namespace
+
69
+
70/// @brief Set the foreground color of an element.
+
71/// @param color The color of the output element.
+
72/// @param child The input element.
+
73/// @return The output element colored.
+
74/// @ingroup dom
+
75///
+
76/// ### Example
+
77///
+
78/// ```cpp
+
79/// Element document = color(Color::Green, text("Success")),
+
80/// ```
+
+
81Element color(Color color, Element child) {
+
82 return std::make_shared<FgColor>(std::move(child), color);
+
83}
+
+
84
+
85/// @brief Set the background color of an element.
+
86/// @param color The color of the output element.
+
87/// @param child The input element.
+
88/// @return The output element colored.
+
89/// @ingroup dom
+
90///
+
91/// ### Example
+
92///
+
93/// ```cpp
+
94/// Element document = bgcolor(Color::Green, text("Success")),
+
95/// ```
+
+ +
97 return std::make_shared<BgColor>(std::move(child), color);
+
98}
+
+
99
+
100/// @brief Decorate using a foreground color.
+
101/// @param c The foreground color to be applied.
+
102/// @return The Decorator applying the color.
+
103/// @ingroup dom
+
104///
+
105/// ### Example
+
106///
+
107/// ```cpp
+
108/// Element document = text("red") | color(Color::Red);
+
109/// ```
+
+ +
111 return [c](Element child) { return color(c, std::move(child)); };
+
112}
+
+
113
+
114/// @brief Decorate using a background color.
+
115/// @param color The background color to be applied.
+
116/// @return The Decorator applying the color.
+
117/// @ingroup dom
+
118///
+
119/// ### Example
+
120///
+
121/// ```cpp
+
122/// Element document = text("red") | bgcolor(Color::Red);
+
123/// ```
+
+ +
125 return [color](Element child) { return bgcolor(color, std::move(child)); };
+
126}
+
+
127
+
128} // namespace ftxui
+ + + +
friend void Render(Screen &screen, Node *node, Selection &selection)
Definition node.cpp:96
+
Decorator bgcolor(Color)
Decorate using a background color.
+
void Render(Screen &screen, const Element &element)
Display an element on a ftxui::Screen.
Definition node.cpp:84
+
Decorator color(Color)
Decorate using a foreground color.
+
static Color Blend(const Color &lhs, const Color &rhs)
Blend two colors together using the alpha channel.
+
Color is a class that represents a color in the terminal user interface.
Definition color.hpp:22
+
Color
Color is an enumeration that represents the color support of the terminal.
Definition terminal.hpp:23
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::function< Element(Element)> Decorator
Definition elements.hpp:24
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+ + + +
+
+ + + + + diff --git a/dom_2deprecated_8cppm.html b/dom_2deprecated_8cppm.html new file mode 100644 index 000000000..cdda64003 --- /dev/null +++ b/dom_2deprecated_8cppm.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: deprecated.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
deprecated.cppm File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+
+
+ + + + + diff --git a/dom_2deprecated_8cppm_source.html b/dom_2deprecated_8cppm_source.html new file mode 100644 index 000000000..7ab5501af --- /dev/null +++ b/dom_2deprecated_8cppm_source.html @@ -0,0 +1,230 @@ + + + + + + + + +FTXUI: deprecated.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
dom/deprecated.cppm
+
+
+Go to the documentation of this file.
1/// @module ftxui.dom.deprecated
+
2/// @brief Module file for deprecated parts of the Dom module
+
3
+
4module;
+
5
+ +
7
+
8export module ftxui.dom.deprecated;
+
9
+
10/**
+
11 * @namespace ftxui
+
12 * @brief The FTXUI ftxui:: namespace
+
13 */
+
14export namespace ftxui {
+
15 using ftxui::text;
+
16 using ftxui::vtext;
+
17 using ftxui::paragraph;
+
18}
+ +
Module file for deprecated parts of the Dom module.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
+
+ + + + + diff --git a/dom_2deprecated_8hpp.html b/dom_2deprecated_8hpp.html new file mode 100644 index 000000000..42786fe09 --- /dev/null +++ b/dom_2deprecated_8hpp.html @@ -0,0 +1,232 @@ + + + + + + + + +FTXUI: deprecated.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
deprecated.hpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+ + + + + + + + + +

+Functions

Element text (std::wstring text)
 Display a piece of unicode text.
 
Element vtext (std::wstring text)
 Display a piece unicode text vertically.
 
Elements paragraph (std::wstring text)
 
+
+
+ + + + + diff --git a/dom_2deprecated_8hpp.js b/dom_2deprecated_8hpp.js new file mode 100644 index 000000000..e74ebc223 --- /dev/null +++ b/dom_2deprecated_8hpp.js @@ -0,0 +1,6 @@ +var dom_2deprecated_8hpp = +[ + [ "text", "dom_2deprecated_8hpp.html#ga75baaa2734ed76a9f478beaafa87ae57", null ], + [ "vtext", "dom_2deprecated_8hpp.html#ga9f9f7485a45aa9d432726ca9845d1eac", null ], + [ "paragraph", "dom_2deprecated_8hpp.html#ac54cdd05db30871ce082a8fa650545da", null ] +]; \ No newline at end of file diff --git a/dom_2deprecated_8hpp_source.html b/dom_2deprecated_8hpp_source.html new file mode 100644 index 000000000..7bfb14c0f --- /dev/null +++ b/dom_2deprecated_8hpp_source.html @@ -0,0 +1,232 @@ + + + + + + + + +FTXUI: deprecated.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
dom/deprecated.hpp
+
+
+Go to the documentation of this file.
1// Copyright 2021 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#ifndef FTXUI_DOM_DEPRECATED_HPP
+
5#define FTXUI_DOM_DEPRECATED_HPP
+
6
+
7#include <ftxui/dom/node.hpp>
+
8#include <string>
+
9
+
10namespace ftxui {
+
11Element text(std::wstring text);
+
12Element vtext(std::wstring text);
+
13Elements paragraph(std::wstring text);
+
14} // namespace ftxui
+
15
+
16#endif // FTXUI_DOM_DEPRECATED_HPP
+
Element text(std::wstring text)
Display a piece of unicode text.
Definition text.cpp:160
+
Element vtext(std::wstring text)
Display a piece unicode text vertically.
Definition text.cpp:220
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+
std::vector< Element > Elements
Definition elements.hpp:23
+
Elements paragraph(std::wstring text)
+ +
+
+ + + + + diff --git a/dom_2util_8cpp.html b/dom_2util_8cpp.html new file mode 100644 index 000000000..11f563ef2 --- /dev/null +++ b/dom_2util_8cpp.html @@ -0,0 +1,241 @@ + + + + + + + + +FTXUI: util.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
util.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+ + + + + + + + + + + + + + + + + + +

+Functions

Element nothing (Element element)
 A decoration doing absolutely nothing.
 
Decorator operator| (Decorator a, Decorator b)
 Compose two decorator into one.
 
Elements operator| (Elements elements, Decorator decorator)
 From a set of element, apply a decorator to every elements.
 
Element operator| (Element element, Decorator decorator)
 From an element, apply a decorator.
 
Elementoperator|= (Element &e, Decorator d)
 Apply a decorator to an element.
 
Element emptyElement ()
 
+
+
+ + + + + diff --git a/dom_2util_8cpp.js b/dom_2util_8cpp.js new file mode 100644 index 000000000..251ca0246 --- /dev/null +++ b/dom_2util_8cpp.js @@ -0,0 +1,9 @@ +var dom_2util_8cpp = +[ + [ "nothing", "dom_2util_8cpp.html#ga1bfd3885ac8b40dc82a1103725003c07", null ], + [ "operator|", "dom_2util_8cpp.html#ga027fbc9cf6fef9e86ae6a2a79e8bf23a", null ], + [ "operator|", "dom_2util_8cpp.html#ga6cbc84eb24a655ae084b3c7d26f9abfc", null ], + [ "operator|", "dom_2util_8cpp.html#ga7e9a69f0592b4013bd725d662f4a76e7", null ], + [ "operator|=", "dom_2util_8cpp.html#ga0be26ac5dcbe6c707857c791d8eec720", null ], + [ "emptyElement", "dom_2util_8cpp.html#ga40451515a5b3049e7a1276cad8b9356c", null ] +]; \ No newline at end of file diff --git a/dom_2util_8cpp_source.html b/dom_2util_8cpp_source.html new file mode 100644 index 000000000..4986ee775 --- /dev/null +++ b/dom_2util_8cpp_source.html @@ -0,0 +1,388 @@ + + + + + + + + +FTXUI: util.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
dom/util.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <algorithm> // for min
+
5#include <functional> // for function
+
6#include <memory> // for __shared_ptr_access, make_unique
+
7#include <utility> // for move
+
8
+
9#include "ftxui/dom/elements.hpp" // for Element, Decorator, Elements, operator|, Fit, emptyElement, nothing, operator|=
+
10#include "ftxui/dom/node.hpp" // for Node, Node::Status
+
11#include "ftxui/dom/requirement.hpp" // for Requirement
+
12#include "ftxui/screen/box.hpp" // for Box
+
13#include "ftxui/screen/screen.hpp" // for Full
+
14#include "ftxui/screen/terminal.hpp" // for Dimensions
+
15
+
16namespace ftxui {
+
17
+
18namespace {
+
19Decorator compose(Decorator a, Decorator b) {
+
20 return [a = std::move(a), b = std::move(b)](Element element) {
+
21 return b(a(std::move(element)));
+
22 };
+
23}
+
24} // namespace
+
25
+
26/// @brief A decoration doing absolutely nothing.
+
27/// @ingroup dom
+
+ +
29 return element;
+
30}
+
+
31
+
32/// @brief Compose two decorator into one.
+
33/// @ingroup dom
+
34///
+
35/// ### Example
+
36///
+
37/// ```cpp
+
38/// auto decorator = bold | blink;
+
39/// ```
+
+ +
41 return compose(std::move(a), //
+
42 std::move(b));
+
43}
+
+
44
+
45/// @brief From a set of element, apply a decorator to every elements.
+
46/// @return the set of decorated element.
+
47/// @ingroup dom
+
+
48Elements operator|(Elements elements, Decorator decorator) { // NOLINT
+
49 Elements output;
+
50 output.reserve(elements.size());
+
51 for (auto& it : elements) {
+
52 output.push_back(std::move(it) | decorator);
+
53 }
+
54 return output;
+
55}
+
+
56
+
57/// @brief From an element, apply a decorator.
+
58/// @return the decorated element.
+
59/// @ingroup dom
+
60///
+
61/// ### Example
+
62///
+
63/// Both of these are equivalent:
+
64/// ```cpp
+
65/// bold(text("Hello"));
+
66/// ```
+
67/// ```cpp
+
68/// text("Hello") | bold;
+
69/// ```
+
+
70Element operator|(Element element, Decorator decorator) { // NOLINT
+
71 return decorator(std::move(element));
+
72}
+
+
73
+
74/// @brief Apply a decorator to an element.
+
75/// @return the decorated element.
+
76/// @ingroup dom
+
77///
+
78/// ### Example
+
79///
+
80/// Both of these are equivalent:
+
81/// ```cpp
+
82/// auto element = text("Hello");
+
83/// element |= bold;
+
84/// ```
+
+ +
86 e = e | std::move(d);
+
87 return e;
+
88}
+
+
89
+
90/// The minimal dimension that will fit the given element.
+
91/// @see Fixed
+
92/// @see Full
+
93Dimensions Dimension::Fit(Element& e, bool extend_beyond_screen) {
+
94 const Dimensions fullsize = Dimension::Full();
+
95 Box box;
+
96 box.x_min = 0;
+
97 box.y_min = 0;
+
98 box.x_max = fullsize.dimx;
+
99 box.y_max = fullsize.dimy;
+
100
+
101 Node::Status status;
+
102 e->Check(&status);
+
103 const int max_iteration = 20;
+
104 while (status.need_iteration && status.iteration < max_iteration) {
+
105 e->ComputeRequirement();
+
106
+
107 // Don't give the element more space than it needs:
+
108 box.x_max = std::min(box.x_max, e->requirement().min_x);
+
109 box.y_max = e->requirement().min_y;
+
110 if (!extend_beyond_screen) {
+
111 box.y_max = std::min(box.y_max, fullsize.dimy);
+
112 }
+
113
+
114 e->SetBox(box);
+
115 status.need_iteration = false;
+
116 status.iteration++;
+
117 e->Check(&status);
+
118
+
119 if (!status.need_iteration) {
+
120 break;
+
121 }
+
122 // Increase the size of the box until it fits...
+
123 box.x_max = std::min(e->requirement().min_x, fullsize.dimx);
+
124 box.y_max = e->requirement().min_y;
+
125
+
126 // ... but don't go beyond the screen size:
+
127 if (!extend_beyond_screen) {
+
128 box.y_max = std::min(box.y_max, fullsize.dimy);
+
129 }
+
130 }
+
131
+
132 return {
+
133 box.x_max,
+
134 box.y_max,
+
135 };
+
136}
+
137
+
138/// An element of size 0x0 drawing nothing.
+
139/// @ingroup dom
+
+ +
141 class Impl : public Node {
+
142 void ComputeRequirement() override {
+
143 requirement_.min_x = 0;
+
144 requirement_.min_y = 0;
+
145 }
+
146 };
+
147 return std::make_unique<Impl>();
+
148}
+
+
149
+
150} // namespace ftxui
+ + +
Node is the base class for all elements in the DOM tree.
Definition node.hpp:37
+
Element nothing(Element element)
A decoration doing absolutely nothing.
Definition dom/util.cpp:28
+
Element emptyElement()
Definition dom/util.cpp:140
+
Dimensions Fit(Element &, bool extend_beyond_screen=false)
+
Dimensions Full()
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::function< Element(Element)> Decorator
Definition elements.hpp:24
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+
std::vector< Element > Elements
Definition elements.hpp:23
+
Component operator|(Component component, ComponentDecorator decorator)
+
Component & operator|=(Component &component, ComponentDecorator decorator)
+ + + + +
+
+ + + + + diff --git a/dom_8cppm.html b/dom_8cppm.html new file mode 100644 index 000000000..c0c9dc53f --- /dev/null +++ b/dom_8cppm.html @@ -0,0 +1,211 @@ + + + + + + + + +FTXUI: dom.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
dom.cppm File Reference
module ftxui.dom
+
+ +
+ + + + + diff --git a/dom_8cppm_source.html b/dom_8cppm_source.html new file mode 100644 index 000000000..d544cdfac --- /dev/null +++ b/dom_8cppm_source.html @@ -0,0 +1,235 @@ + + + + + + + + +FTXUI: dom.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
dom.cppm
+
+
+Go to the documentation of this file.
1/// @module ftxui.dom
+
2/// @brief Module file for FTXUI main operations.
+
3
+
4export module ftxui.dom;
+
5
+
6export import ftxui.dom.canvas;
+
7export import ftxui.dom.deprecated;
+
8export import ftxui.dom.direction;
+
9export import ftxui.dom.elements;
+
10export import ftxui.dom.flexbox_config;
+
11export import ftxui.dom.linear_gradient;
+
12export import ftxui.dom.node;
+
13export import ftxui.dom.requirement;
+
14export import ftxui.dom.selection;
+
15export import ftxui.dom.table;
+
Module file for the Canvas struct of the Dom module.
+
Module file for deprecated parts of the Dom module.
+
Module file for the Direction enum of the Dom module.
+
Module file for the Element classes and functions of the Dom module.
+
Module file for the FlexboxConfig struct of the Dom module.
+
Module file for the LinearGradient struct of the Dom module.
+
Module file for the Node class of the Dom module.
+
Module file for the Requirement struct of the Dom module.
+
Module file for the Selection class of the Dom module.
+
Module file for the Table class of the Dom module.
+
Module file for FTXUI main operations.
+
+
+ + + + + diff --git a/dom__examples_8md.html b/dom__examples_8md.html new file mode 100644 index 000000000..af1caf381 --- /dev/null +++ b/dom__examples_8md.html @@ -0,0 +1,209 @@ + + + + + + + + +FTXUI: dom_examples.md File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
dom_examples.md File Reference
+
+
+
+
+ + + + + diff --git a/doxygen-awesome-fragment-copy-button.js b/doxygen-awesome-fragment-copy-button.js new file mode 100644 index 000000000..86c16fd93 --- /dev/null +++ b/doxygen-awesome-fragment-copy-button.js @@ -0,0 +1,85 @@ +/** + +Doxygen Awesome +https://github.com/jothepro/doxygen-awesome-css + +MIT License + +Copyright (c) 2022 - 2023 jothepro + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +*/ + +class DoxygenAwesomeFragmentCopyButton extends HTMLElement { + constructor() { + super(); + this.onclick=this.copyContent + } + static title = "Copy to clipboard" + static copyIcon = `` + static successIcon = `` + static successDuration = 980 + static init() { + $(function() { + $(document).ready(function() { + if(navigator.clipboard) { + const fragments = document.getElementsByClassName("fragment") + for(const fragment of fragments) { + const fragmentWrapper = document.createElement("div") + fragmentWrapper.className = "doxygen-awesome-fragment-wrapper" + const fragmentCopyButton = document.createElement("doxygen-awesome-fragment-copy-button") + fragmentCopyButton.innerHTML = DoxygenAwesomeFragmentCopyButton.copyIcon + fragmentCopyButton.title = DoxygenAwesomeFragmentCopyButton.title + + fragment.parentNode.replaceChild(fragmentWrapper, fragment) + fragmentWrapper.appendChild(fragment) + fragmentWrapper.appendChild(fragmentCopyButton) + + } + } + }) + }) + } + + + copyContent() { + const content = this.previousSibling.cloneNode(true) + // filter out line number from file listings + content.querySelectorAll(".lineno, .ttc").forEach((node) => { + node.remove() + }) + let textContent = content.textContent + // remove trailing newlines that appear in file listings + let numberOfTrailingNewlines = 0 + while(textContent.charAt(textContent.length - (numberOfTrailingNewlines + 1)) == '\n') { + numberOfTrailingNewlines++; + } + textContent = textContent.substring(0, textContent.length - numberOfTrailingNewlines) + navigator.clipboard.writeText(textContent); + this.classList.add("success") + this.innerHTML = DoxygenAwesomeFragmentCopyButton.successIcon + window.setTimeout(() => { + this.classList.remove("success") + this.innerHTML = DoxygenAwesomeFragmentCopyButton.copyIcon + }, DoxygenAwesomeFragmentCopyButton.successDuration); + } +} + +customElements.define("doxygen-awesome-fragment-copy-button", DoxygenAwesomeFragmentCopyButton) diff --git a/doxygen-awesome-interactive-toc.js b/doxygen-awesome-interactive-toc.js new file mode 100644 index 000000000..f3c3e7706 --- /dev/null +++ b/doxygen-awesome-interactive-toc.js @@ -0,0 +1,91 @@ +/** + +Doxygen Awesome +https://github.com/jothepro/doxygen-awesome-css + +MIT License + +Copyright (c) 2022 - 2023 jothepro + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +*/ + +class DoxygenAwesomeInteractiveToc { + static topOffset = 38 + static hideMobileMenu = true + static headers = [] + + static init() { + window.addEventListener("load", () => { + let toc = document.querySelector(".contents > .toc") + if(toc) { + toc.classList.add("interactive") + if(!DoxygenAwesomeInteractiveToc.hideMobileMenu) { + toc.classList.add("open") + } + document.querySelector(".contents > .toc > h3")?.addEventListener("click", () => { + if(toc.classList.contains("open")) { + toc.classList.remove("open") + } else { + toc.classList.add("open") + } + }) + + document.querySelectorAll(".contents > .toc > ul a").forEach((node) => { + let id = node.getAttribute("href").substring(1) + DoxygenAwesomeInteractiveToc.headers.push({ + node: node, + headerNode: document.getElementById(id) + }) + + document.getElementById("doc-content")?.addEventListener("scroll",this.throttle(DoxygenAwesomeInteractiveToc.update, 100)) + }) + DoxygenAwesomeInteractiveToc.update() + } + }) + } + + static update() { + let active = DoxygenAwesomeInteractiveToc.headers[0]?.node + DoxygenAwesomeInteractiveToc.headers.forEach((header) => { + let position = header.headerNode.getBoundingClientRect().top + header.node.classList.remove("active") + header.node.classList.remove("aboveActive") + if(position < DoxygenAwesomeInteractiveToc.topOffset) { + active = header.node + active?.classList.add("aboveActive") + } + }) + active?.classList.add("active") + active?.classList.remove("aboveActive") + } + + static throttle(func, delay) { + let lastCall = 0; + return function (...args) { + const now = new Date().getTime(); + if (now - lastCall < delay) { + return; + } + lastCall = now; + return setTimeout(() => {func(...args)}, delay); + }; + } +} diff --git a/doxygen-awesome-paragraph-link.js b/doxygen-awesome-paragraph-link.js new file mode 100644 index 000000000..e53d132ce --- /dev/null +++ b/doxygen-awesome-paragraph-link.js @@ -0,0 +1,51 @@ +/** + +Doxygen Awesome +https://github.com/jothepro/doxygen-awesome-css + +MIT License + +Copyright (c) 2022 - 2023 jothepro + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +*/ + +class DoxygenAwesomeParagraphLink { + // Icon from https://fonts.google.com/icons + // Licensed under the Apache 2.0 license: + // https://www.apache.org/licenses/LICENSE-2.0.html + static icon = `` + static title = "Permanent Link" + static init() { + $(function() { + $(document).ready(function() { + document.querySelectorAll(".contents a.anchor[id], .contents .groupheader > a[id]").forEach((node) => { + let anchorlink = document.createElement("a") + anchorlink.setAttribute("href", `#${node.getAttribute("id")}`) + anchorlink.setAttribute("title", DoxygenAwesomeParagraphLink.title) + anchorlink.classList.add("anchorlink") + node.classList.add("anchor") + anchorlink.innerHTML = DoxygenAwesomeParagraphLink.icon + node.parentElement.appendChild(anchorlink) + }) + }) + }) + } +} diff --git a/doxygen-awesome-tabs.js b/doxygen-awesome-tabs.js new file mode 100644 index 000000000..06dfd3d66 --- /dev/null +++ b/doxygen-awesome-tabs.js @@ -0,0 +1,90 @@ +/** + +Doxygen Awesome +https://github.com/jothepro/doxygen-awesome-css + +MIT License + +Copyright (c) 2023 jothepro + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +*/ + +class DoxygenAwesomeTabs { + + static init() { + window.addEventListener("load", () => { + document.querySelectorAll(".tabbed:not(:empty)").forEach((tabbed, tabbedIndex) => { + let tabLinkList = [] + tabbed.querySelectorAll(":scope > ul > li").forEach((tab, tabIndex) => { + tab.id = "tab_" + tabbedIndex + "_" + tabIndex + let header = tab.querySelector(".tab-title") + let tabLink = document.createElement("button") + tabLink.classList.add("tab-button") + tabLink.appendChild(header) + header.title = header.textContent + tabLink.addEventListener("click", () => { + tabbed.querySelectorAll(":scope > ul > li").forEach((tab) => { + tab.classList.remove("selected") + }) + tabLinkList.forEach((tabLink) => { + tabLink.classList.remove("active") + }) + tab.classList.add("selected") + tabLink.classList.add("active") + }) + tabLinkList.push(tabLink) + if(tabIndex == 0) { + tab.classList.add("selected") + tabLink.classList.add("active") + } + }) + let tabsOverview = document.createElement("div") + tabsOverview.classList.add("tabs-overview") + let tabsOverviewContainer = document.createElement("div") + tabsOverviewContainer.classList.add("tabs-overview-container") + tabLinkList.forEach((tabLink) => { + tabsOverview.appendChild(tabLink) + }) + tabsOverviewContainer.appendChild(tabsOverview) + tabbed.before(tabsOverviewContainer) + + function resize() { + let maxTabHeight = 0 + tabbed.querySelectorAll(":scope > ul > li").forEach((tab, tabIndex) => { + let visibility = tab.style.display + tab.style.display = "block" + maxTabHeight = Math.max(tab.offsetHeight, maxTabHeight) + tab.style.display = visibility + }) + tabbed.style.height = `${maxTabHeight + 10}px` + } + + resize() + new ResizeObserver(resize).observe(tabbed) + }) + }) + + } + + static resize(tabbed) { + + } +} \ No newline at end of file diff --git a/doxygen-awesome.css b/doxygen-awesome.css new file mode 100644 index 000000000..c2f41142f --- /dev/null +++ b/doxygen-awesome.css @@ -0,0 +1,2681 @@ +/** + +Doxygen Awesome +https://github.com/jothepro/doxygen-awesome-css + +MIT License + +Copyright (c) 2021 - 2023 jothepro + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +*/ + +html { + /* primary theme color. This will affect the entire websites color scheme: links, arrows, labels, ... */ + --primary-color: #1779c4; + --primary-dark-color: #335c80; + --primary-light-color: #70b1e9; + + /* page base colors */ + --page-background-color: #ffffff; + --page-foreground-color: #2f4153; + --page-secondary-foreground-color: #6f7e8e; + + /* color for all separators on the website: hr, borders, ... */ + --separator-color: #dedede; + + /* border radius for all rounded components. Will affect many components, like dropdowns, memitems, codeblocks, ... */ + --border-radius-large: 8px; + --border-radius-small: 4px; + --border-radius-medium: 6px; + + /* default spacings. Most components reference these values for spacing, to provide uniform spacing on the page. */ + --spacing-small: 5px; + --spacing-medium: 10px; + --spacing-large: 16px; + + /* default box shadow used for raising an element above the normal content. Used in dropdowns, search result, ... */ + --box-shadow: 0 2px 8px 0 rgba(0,0,0,.075); + + --odd-color: rgba(0,0,0,.028); + + /* font-families. will affect all text on the website + * font-family: the normal font for text, headlines, menus + * font-family-monospace: used for preformatted text in memtitle, code, fragments + */ + --font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif; + --font-family-monospace: ui-monospace,SFMono-Regular,SF Mono,Menlo,Consolas,Liberation Mono,monospace; + + /* font sizes */ + --page-font-size: 15.6px; + --navigation-font-size: 14.4px; + --toc-font-size: 13.4px; + --code-font-size: 14px; /* affects code, fragment */ + --title-font-size: 22px; + + /* content text properties. These only affect the page content, not the navigation or any other ui elements */ + --content-line-height: 27px; + /* The content is centered and constraint in it's width. To make the content fill the whole page, set the variable to auto.*/ + --content-maxwidth: 1050px; + --table-line-height: 24px; + --toc-sticky-top: var(--spacing-medium); + --toc-width: 200px; + --toc-max-height: calc(100vh - 2 * var(--spacing-medium) - 85px); + + /* colors for various content boxes: @warning, @note, @deprecated @bug */ + --warning-color: #faf3d8; + --warning-color-dark: #f3a600; + --warning-color-darker: #5f4204; + --note-color: #e4f3ff; + --note-color-dark: #1879C4; + --note-color-darker: #274a5c; + --todo-color: #e4dafd; + --todo-color-dark: #5b2bdd; + --todo-color-darker: #2a0d72; + --deprecated-color: #ecf0f3; + --deprecated-color-dark: #5b6269; + --deprecated-color-darker: #43454a; + --bug-color: #f8d1cc; + --bug-color-dark: #b61825; + --bug-color-darker: #75070f; + --invariant-color: #d8f1e3; + --invariant-color-dark: #44b86f; + --invariant-color-darker: #265532; + + /* blockquote colors */ + --blockquote-background: #f8f9fa; + --blockquote-foreground: #636568; + + /* table colors */ + --tablehead-background: #f1f1f1; + --tablehead-foreground: var(--page-foreground-color); + + /* menu-display: block | none + * Visibility of the top navigation on screens >= 768px. On smaller screen the menu is always visible. + * `GENERATE_TREEVIEW` MUST be enabled! + */ + --menu-display: block; + + --menu-focus-foreground: var(--page-background-color); + --menu-focus-background: var(--primary-color); + --menu-selected-background: rgba(0,0,0,.05); + + + --header-background: var(--page-background-color); + --header-foreground: var(--page-foreground-color); + + /* searchbar colors */ + --searchbar-background: var(--side-nav-background); + --searchbar-foreground: var(--page-foreground-color); + + /* searchbar size + * (`searchbar-width` is only applied on screens >= 768px. + * on smaller screens the searchbar will always fill the entire screen width) */ + --searchbar-height: 33px; + --searchbar-width: 210px; + --searchbar-border-radius: var(--searchbar-height); + + /* code block colors */ + --code-background: #f5f5f5; + --code-foreground: var(--page-foreground-color); + + /* fragment colors */ + --fragment-background: #F8F9FA; + --fragment-foreground: #37474F; + --fragment-keyword: #bb6bb2; + --fragment-keywordtype: #8258b3; + --fragment-keywordflow: #d67c3b; + --fragment-token: #438a59; + --fragment-comment: #969696; + --fragment-link: #5383d6; + --fragment-preprocessor: #46aaa5; + --fragment-linenumber-color: #797979; + --fragment-linenumber-background: #f4f4f5; + --fragment-linenumber-border: #e3e5e7; + --fragment-lineheight: 20px; + + /* sidebar navigation (treeview) colors */ + --side-nav-background: #fbfbfb; + --side-nav-foreground: var(--page-foreground-color); + --side-nav-arrow-opacity: 0; + --side-nav-arrow-hover-opacity: 0.9; + + --toc-background: var(--side-nav-background); + --toc-foreground: var(--side-nav-foreground); + + /* height of an item in any tree / collapsible table */ + --tree-item-height: 30px; + + --memname-font-size: var(--code-font-size); + --memtitle-font-size: 18px; + + --webkit-scrollbar-size: 7px; + --webkit-scrollbar-padding: 4px; + --webkit-scrollbar-color: var(--separator-color); + + --animation-duration: .12s +} + +@media screen and (max-width: 767px) { + html { + --page-font-size: 16px; + --navigation-font-size: 16px; + --toc-font-size: 15px; + --code-font-size: 15px; /* affects code, fragment */ + --title-font-size: 22px; + } +} + +@media (prefers-color-scheme: dark) { + html:not(.light-mode) { + color-scheme: dark; + + --primary-color: #1982d2; + --primary-dark-color: #86a9c4; + --primary-light-color: #4779ac; + + --box-shadow: 0 2px 8px 0 rgba(0,0,0,.35); + + --odd-color: rgba(100,100,100,.06); + + --menu-selected-background: rgba(0,0,0,.4); + + --page-background-color: #1C1D1F; + --page-foreground-color: #d2dbde; + --page-secondary-foreground-color: #859399; + --separator-color: #38393b; + --side-nav-background: #252628; + + --code-background: #2a2c2f; + + --tablehead-background: #2a2c2f; + + --blockquote-background: #222325; + --blockquote-foreground: #7e8c92; + + --warning-color: #3b2e04; + --warning-color-dark: #f1b602; + --warning-color-darker: #ceb670; + --note-color: #163750; + --note-color-dark: #1982D2; + --note-color-darker: #dcf0fa; + --todo-color: #2a2536; + --todo-color-dark: #7661b3; + --todo-color-darker: #ae9ed6; + --deprecated-color: #2e323b; + --deprecated-color-dark: #738396; + --deprecated-color-darker: #abb0bd; + --bug-color: #2e1917; + --bug-color-dark: #ad2617; + --bug-color-darker: #f5b1aa; + --invariant-color: #303a35; + --invariant-color-dark: #76ce96; + --invariant-color-darker: #cceed5; + + --fragment-background: #282c34; + --fragment-foreground: #dbe4eb; + --fragment-keyword: #cc99cd; + --fragment-keywordtype: #ab99cd; + --fragment-keywordflow: #e08000; + --fragment-token: #7ec699; + --fragment-comment: #999999; + --fragment-link: #98c0e3; + --fragment-preprocessor: #65cabe; + --fragment-linenumber-color: #cccccc; + --fragment-linenumber-background: #35393c; + --fragment-linenumber-border: #1f1f1f; + } +} + +/* dark mode variables are defined twice, to support both the dark-mode without and with doxygen-awesome-darkmode-toggle.js */ +html.dark-mode { + color-scheme: dark; + + --primary-color: #1982d2; + --primary-dark-color: #86a9c4; + --primary-light-color: #4779ac; + + --box-shadow: 0 2px 8px 0 rgba(0,0,0,.30); + + --odd-color: rgba(100,100,100,.06); + + --menu-selected-background: rgba(0,0,0,.4); + + --page-background-color: #1C1D1F; + --page-foreground-color: #d2dbde; + --page-secondary-foreground-color: #859399; + --separator-color: #38393b; + --side-nav-background: #252628; + + --code-background: #2a2c2f; + + --tablehead-background: #2a2c2f; + + --blockquote-background: #222325; + --blockquote-foreground: #7e8c92; + + --warning-color: #3b2e04; + --warning-color-dark: #f1b602; + --warning-color-darker: #ceb670; + --note-color: #163750; + --note-color-dark: #1982D2; + --note-color-darker: #dcf0fa; + --todo-color: #2a2536; + --todo-color-dark: #7661b3; + --todo-color-darker: #ae9ed6; + --deprecated-color: #2e323b; + --deprecated-color-dark: #738396; + --deprecated-color-darker: #abb0bd; + --bug-color: #2e1917; + --bug-color-dark: #ad2617; + --bug-color-darker: #f5b1aa; + --invariant-color: #303a35; + --invariant-color-dark: #76ce96; + --invariant-color-darker: #cceed5; + + --fragment-background: #282c34; + --fragment-foreground: #dbe4eb; + --fragment-keyword: #cc99cd; + --fragment-keywordtype: #ab99cd; + --fragment-keywordflow: #e08000; + --fragment-token: #7ec699; + --fragment-comment: #999999; + --fragment-link: #98c0e3; + --fragment-preprocessor: #65cabe; + --fragment-linenumber-color: #cccccc; + --fragment-linenumber-background: #35393c; + --fragment-linenumber-border: #1f1f1f; +} + +body { + color: var(--page-foreground-color); + background-color: var(--page-background-color); + font-size: var(--page-font-size); +} + +body, table, div, p, dl, #nav-tree .label, .title, +.sm-dox a, .sm-dox a:hover, .sm-dox a:focus, #projectname, +.SelectItem, #MSearchField, .navpath li.navelem a, +.navpath li.navelem a:hover, p.reference, p.definition, div.toc li, div.toc h3 { + font-family: var(--font-family); +} + +h1, h2, h3, h4, h5 { + margin-top: 1em; + font-weight: 600; + line-height: initial; +} + +p, div, table, dl, p.reference, p.definition { + font-size: var(--page-font-size); +} + +p.reference, p.definition { + color: var(--page-secondary-foreground-color); +} + +a:link, a:visited, a:hover, a:focus, a:active { + color: var(--primary-color) !important; + font-weight: 500; + background: none; +} + +a.anchor { + scroll-margin-top: var(--spacing-large); + display: block; +} + +/* + Title and top navigation + */ + +#top { + background: var(--header-background); + border-bottom: 1px solid var(--separator-color); +} + +@media screen and (min-width: 768px) { + #top { + display: flex; + flex-wrap: wrap; + justify-content: space-between; + align-items: center; + } +} + +#main-nav { + flex-grow: 5; + padding: var(--spacing-small) var(--spacing-medium); +} + +#titlearea { + width: auto; + padding: var(--spacing-medium) var(--spacing-large); + background: none; + color: var(--header-foreground); + border-bottom: none; +} + +@media screen and (max-width: 767px) { + #titlearea { + padding-bottom: var(--spacing-small); + } +} + +#titlearea table tbody tr { + height: auto !important; +} + +#projectname { + font-size: var(--title-font-size); + font-weight: 600; +} + +#projectnumber { + font-family: inherit; + font-size: 60%; +} + +#projectbrief { + font-family: inherit; + font-size: 80%; +} + +#projectlogo { + vertical-align: middle; +} + +#projectlogo img { + max-height: calc(var(--title-font-size) * 2); + margin-right: var(--spacing-small); +} + +.sm-dox, .tabs, .tabs2, .tabs3 { + background: none; + padding: 0; +} + +.tabs, .tabs2, .tabs3 { + border-bottom: 1px solid var(--separator-color); + margin-bottom: -1px; +} + +.main-menu-btn-icon, .main-menu-btn-icon:before, .main-menu-btn-icon:after { + background: var(--page-secondary-foreground-color); +} + +@media screen and (max-width: 767px) { + .sm-dox a span.sub-arrow { + background: var(--code-background); + } + + #main-menu a.has-submenu span.sub-arrow { + color: var(--page-secondary-foreground-color); + border-radius: var(--border-radius-medium); + } + + #main-menu a.has-submenu:hover span.sub-arrow { + color: var(--page-foreground-color); + } +} + +@media screen and (min-width: 768px) { + .sm-dox li, .tablist li { + display: var(--menu-display); + } + + .sm-dox a span.sub-arrow { + border-color: var(--header-foreground) transparent transparent transparent; + } + + .sm-dox a:hover span.sub-arrow { + border-color: var(--menu-focus-foreground) transparent transparent transparent; + } + + .sm-dox ul a span.sub-arrow { + border-color: transparent transparent transparent var(--page-foreground-color); + } + + .sm-dox ul a:hover span.sub-arrow { + border-color: transparent transparent transparent var(--menu-focus-foreground); + } +} + +.sm-dox ul { + background: var(--page-background-color); + box-shadow: var(--box-shadow); + border: 1px solid var(--separator-color); + border-radius: var(--border-radius-medium) !important; + padding: var(--spacing-small); + animation: ease-out 150ms slideInMenu; +} + +@keyframes slideInMenu { + from { + opacity: 0; + transform: translate(0px, -2px); + } + + to { + opacity: 1; + transform: translate(0px, 0px); + } +} + +.sm-dox ul a { + color: var(--page-foreground-color) !important; + background: var(--page-background-color); + font-size: var(--navigation-font-size); +} + +.sm-dox>li>ul:after { + border-bottom-color: var(--page-background-color) !important; +} + +.sm-dox>li>ul:before { + border-bottom-color: var(--separator-color) !important; +} + +.sm-dox ul a:hover, .sm-dox ul a:active, .sm-dox ul a:focus { + font-size: var(--navigation-font-size) !important; + color: var(--menu-focus-foreground) !important; + text-shadow: none; + background-color: var(--menu-focus-background); + border-radius: var(--border-radius-small) !important; +} + +.sm-dox a, .sm-dox a:focus, .tablist li, .tablist li a, .tablist li.current a { + text-shadow: none; + background: transparent; + background-image: none !important; + color: var(--header-foreground) !important; + font-weight: normal; + font-size: var(--navigation-font-size); + border-radius: var(--border-radius-small) !important; +} + +.sm-dox a:focus { + outline: auto; +} + +.sm-dox a:hover, .sm-dox a:active, .tablist li a:hover { + text-shadow: none; + font-weight: normal; + background: var(--menu-focus-background); + color: var(--menu-focus-foreground) !important; + border-radius: var(--border-radius-small) !important; + font-size: var(--navigation-font-size); +} + +.tablist li.current { + border-radius: var(--border-radius-small); + background: var(--menu-selected-background); +} + +.tablist li { + margin: var(--spacing-small) 0 var(--spacing-small) var(--spacing-small); +} + +.tablist a { + padding: 0 var(--spacing-large); +} + + +/* + Search box + */ + +#MSearchBox { + height: var(--searchbar-height); + background: var(--searchbar-background); + border-radius: var(--searchbar-border-radius); + border: 1px solid var(--separator-color); + overflow: hidden; + width: var(--searchbar-width); + position: relative; + box-shadow: none; + display: block; + margin-top: 0; +} + +/* until Doxygen 1.9.4 */ +.left img#MSearchSelect { + left: 0; + user-select: none; + padding-left: 8px; +} + +/* Doxygen 1.9.5 */ +.left span#MSearchSelect { + left: 0; + user-select: none; + margin-left: 8px; + padding: 0; +} + +.left #MSearchSelect[src$=".png"] { + padding-left: 0 +} + +.SelectionMark { + user-select: none; +} + +.tabs .left #MSearchSelect { + padding-left: 0; +} + +.tabs #MSearchBox { + position: absolute; + right: var(--spacing-medium); +} + +@media screen and (max-width: 767px) { + .tabs #MSearchBox { + position: relative; + right: 0; + margin-left: var(--spacing-medium); + margin-top: 0; + } +} + +#MSearchSelectWindow, #MSearchResultsWindow { + z-index: 9999; +} + +#MSearchBox.MSearchBoxActive { + border-color: var(--primary-color); + box-shadow: inset 0 0 0 1px var(--primary-color); +} + +#main-menu > li:last-child { + margin-right: 0; +} + +@media screen and (max-width: 767px) { + #main-menu > li:last-child { + height: 50px; + } +} + +#MSearchField { + font-size: var(--navigation-font-size); + height: calc(var(--searchbar-height) - 2px); + background: transparent; + width: calc(var(--searchbar-width) - 64px); +} + +.MSearchBoxActive #MSearchField { + color: var(--searchbar-foreground); +} + +#MSearchSelect { + top: calc(calc(var(--searchbar-height) / 2) - 11px); +} + +#MSearchBox span.left, #MSearchBox span.right { + background: none; + background-image: none; +} + +#MSearchBox span.right { + padding-top: calc(calc(var(--searchbar-height) / 2) - 12px); + position: absolute; + right: var(--spacing-small); +} + +.tabs #MSearchBox span.right { + top: calc(calc(var(--searchbar-height) / 2) - 12px); +} + +@keyframes slideInSearchResults { + from { + opacity: 0; + transform: translate(0, 15px); + } + + to { + opacity: 1; + transform: translate(0, 20px); + } +} + +#MSearchResultsWindow { + left: auto !important; + right: var(--spacing-medium); + border-radius: var(--border-radius-large); + border: 1px solid var(--separator-color); + transform: translate(0, 20px); + box-shadow: var(--box-shadow); + animation: ease-out 280ms slideInSearchResults; + background: var(--page-background-color); +} + +iframe#MSearchResults { + margin: 4px; +} + +iframe { + color-scheme: normal; +} + +@media (prefers-color-scheme: dark) { + html:not(.light-mode) iframe#MSearchResults { + filter: invert() hue-rotate(180deg); + } +} + +html.dark-mode iframe#MSearchResults { + filter: invert() hue-rotate(180deg); +} + +#MSearchResults .SRPage { + background-color: transparent; +} + +#MSearchResults .SRPage .SREntry { + font-size: 10pt; + padding: var(--spacing-small) var(--spacing-medium); +} + +#MSearchSelectWindow { + border: 1px solid var(--separator-color); + border-radius: var(--border-radius-medium); + box-shadow: var(--box-shadow); + background: var(--page-background-color); + padding-top: var(--spacing-small); + padding-bottom: var(--spacing-small); +} + +#MSearchSelectWindow a.SelectItem { + font-size: var(--navigation-font-size); + line-height: var(--content-line-height); + margin: 0 var(--spacing-small); + border-radius: var(--border-radius-small); + color: var(--page-foreground-color) !important; + font-weight: normal; +} + +#MSearchSelectWindow a.SelectItem:hover { + background: var(--menu-focus-background); + color: var(--menu-focus-foreground) !important; +} + +@media screen and (max-width: 767px) { + #MSearchBox { + margin-top: var(--spacing-medium); + margin-bottom: var(--spacing-medium); + width: calc(100vw - 30px); + } + + #main-menu > li:last-child { + float: none !important; + } + + #MSearchField { + width: calc(100vw - 110px); + } + + @keyframes slideInSearchResultsMobile { + from { + opacity: 0; + transform: translate(0, 15px); + } + + to { + opacity: 1; + transform: translate(0, 20px); + } + } + + #MSearchResultsWindow { + left: var(--spacing-medium) !important; + right: var(--spacing-medium); + overflow: auto; + transform: translate(0, 20px); + animation: ease-out 280ms slideInSearchResultsMobile; + width: auto !important; + } + + /* + * Overwrites for fixing the searchbox on mobile in doxygen 1.9.2 + */ + label.main-menu-btn ~ #searchBoxPos1 { + top: 3px !important; + right: 6px !important; + left: 45px; + display: flex; + } + + label.main-menu-btn ~ #searchBoxPos1 > #MSearchBox { + margin-top: 0; + margin-bottom: 0; + flex-grow: 2; + float: left; + } +} + +/* + Tree view + */ + +#side-nav { + padding: 0 !important; + background: var(--side-nav-background); + min-width: 8px; + max-width: 50vw; +} + +@media screen and (max-width: 767px) { + #side-nav { + display: none; + } + + #doc-content { + margin-left: 0 !important; + } +} + +#nav-tree { + background: transparent; + margin-right: 1px; +} + +#nav-tree .label { + font-size: var(--navigation-font-size); +} + +#nav-tree .item { + height: var(--tree-item-height); + line-height: var(--tree-item-height); + overflow: hidden; + text-overflow: ellipsis; +} + +#nav-tree .item > a:focus { + outline: none; +} + +#nav-sync { + bottom: 12px; + right: 12px; + top: auto !important; + user-select: none; +} + +#nav-tree .selected { + text-shadow: none; + background-image: none; + background-color: transparent; + position: relative; + color: var(--primary-color) !important; + font-weight: 500; +} + +#nav-tree .selected::after { + content: ""; + position: absolute; + top: 1px; + bottom: 1px; + left: 0; + width: 4px; + border-radius: 0 var(--border-radius-small) var(--border-radius-small) 0; + background: var(--primary-color); +} + + +#nav-tree a { + color: var(--side-nav-foreground) !important; + font-weight: normal; +} + +#nav-tree a:focus { + outline-style: auto; +} + +#nav-tree .arrow { + opacity: var(--side-nav-arrow-opacity); + background: none; +} + +.arrow { + color: inherit; + cursor: pointer; + font-size: 45%; + vertical-align: middle; + margin-right: 2px; + font-family: serif; + height: auto; + text-align: right; +} + +#nav-tree div.item:hover .arrow, #nav-tree a:focus .arrow { + opacity: var(--side-nav-arrow-hover-opacity); +} + +#nav-tree .selected a { + color: var(--primary-color) !important; + font-weight: bolder; + font-weight: 600; +} + +.ui-resizable-e { + width: 4px; + background: transparent; + box-shadow: inset -1px 0 0 0 var(--separator-color); +} + +/* + Contents + */ + +div.header { + border-bottom: 1px solid var(--separator-color); + background-color: var(--page-background-color); + background-image: none; +} + +@media screen and (min-width: 1000px) { + #doc-content > div > div.contents, + .PageDoc > div.contents { + display: flex; + flex-direction: row-reverse; + flex-wrap: nowrap; + align-items: flex-start; + } + + div.contents .textblock { + min-width: 200px; + flex-grow: 1; + } +} + +div.contents, div.header .title, div.header .summary { + max-width: var(--content-maxwidth); +} + +div.contents, div.header .title { + line-height: initial; + margin: calc(var(--spacing-medium) + .2em) auto var(--spacing-medium) auto; +} + +div.header .summary { + margin: var(--spacing-medium) auto 0 auto; +} + +div.headertitle { + padding: 0; +} + +div.header .title { + font-weight: 600; + font-size: 225%; + padding: var(--spacing-medium) var(--spacing-large); + word-break: break-word; +} + +div.header .summary { + width: auto; + display: block; + float: none; + padding: 0 var(--spacing-large); +} + +td.memSeparator { + border-color: var(--separator-color); +} + +span.mlabel { + background: var(--primary-color); + border: none; + padding: 4px 9px; + border-radius: 12px; + margin-right: var(--spacing-medium); +} + +span.mlabel:last-of-type { + margin-right: 2px; +} + +div.contents { + padding: 0 var(--spacing-large); +} + +div.contents p, div.contents li { + line-height: var(--content-line-height); +} + +div.contents div.dyncontent { + margin: var(--spacing-medium) 0; +} + +@media (prefers-color-scheme: dark) { + html:not(.light-mode) div.contents div.dyncontent img, + html:not(.light-mode) div.contents center img, + html:not(.light-mode) div.contents > table img, + html:not(.light-mode) div.contents div.dyncontent iframe, + html:not(.light-mode) div.contents center iframe, + html:not(.light-mode) div.contents table iframe, + html:not(.light-mode) div.contents .dotgraph iframe { + filter: brightness(89%) hue-rotate(180deg) invert(); + } +} + +html.dark-mode div.contents div.dyncontent img, +html.dark-mode div.contents center img, +html.dark-mode div.contents > table img, +html.dark-mode div.contents div.dyncontent iframe, +html.dark-mode div.contents center iframe, +html.dark-mode div.contents table iframe, +html.dark-mode div.contents .dotgraph iframe + { + filter: brightness(89%) hue-rotate(180deg) invert(); +} + +h2.groupheader { + border-bottom: 0px; + color: var(--page-foreground-color); + box-shadow: + 100px 0 var(--page-background-color), + -100px 0 var(--page-background-color), + 100px 0.75px var(--separator-color), + -100px 0.75px var(--separator-color), + 500px 0 var(--page-background-color), + -500px 0 var(--page-background-color), + 500px 0.75px var(--separator-color), + -500px 0.75px var(--separator-color), + 900px 0 var(--page-background-color), + -900px 0 var(--page-background-color), + 900px 0.75px var(--separator-color), + -900px 0.75px var(--separator-color), + 1400px 0 var(--page-background-color), + -1400px 0 var(--page-background-color), + 1400px 0.75px var(--separator-color), + -1400px 0.75px var(--separator-color), + 1900px 0 var(--page-background-color), + -1900px 0 var(--page-background-color), + 1900px 0.75px var(--separator-color), + -1900px 0.75px var(--separator-color); +} + +blockquote { + margin: 0 var(--spacing-medium) 0 var(--spacing-medium); + padding: var(--spacing-small) var(--spacing-large); + background: var(--blockquote-background); + color: var(--blockquote-foreground); + border-left: 0; + overflow: visible; + border-radius: var(--border-radius-medium); + overflow: visible; + position: relative; +} + +blockquote::before, blockquote::after { + font-weight: bold; + font-family: serif; + font-size: 360%; + opacity: .15; + position: absolute; +} + +blockquote::before { + content: "“"; + left: -10px; + top: 4px; +} + +blockquote::after { + content: "”"; + right: -8px; + bottom: -25px; +} + +blockquote p { + margin: var(--spacing-small) 0 var(--spacing-medium) 0; +} +.paramname, .paramname em { + font-weight: 600; + color: var(--primary-dark-color); +} + +.paramname > code { + border: 0; +} + +table.params .paramname { + font-weight: 600; + font-family: var(--font-family-monospace); + font-size: var(--code-font-size); + padding-right: var(--spacing-small); + line-height: var(--table-line-height); +} + +h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { + text-shadow: 0 0 15px var(--primary-light-color); +} + +.alphachar a { + color: var(--page-foreground-color); +} + +.dotgraph { + max-width: 100%; + overflow-x: scroll; +} + +.dotgraph .caption { + position: sticky; + left: 0; +} + +/* Wrap Graphviz graphs with the `interactive_dotgraph` class if `INTERACTIVE_SVG = YES` */ +.interactive_dotgraph .dotgraph iframe { + max-width: 100%; +} + +/* + Table of Contents + */ + +div.contents .toc { + max-height: var(--toc-max-height); + min-width: var(--toc-width); + border: 0; + border-left: 1px solid var(--separator-color); + border-radius: 0; + background-color: var(--page-background-color); + box-shadow: none; + position: sticky; + top: var(--toc-sticky-top); + padding: 0 var(--spacing-large); + margin: var(--spacing-small) 0 var(--spacing-large) var(--spacing-large); +} + +div.toc h3 { + color: var(--toc-foreground); + font-size: var(--navigation-font-size); + margin: var(--spacing-large) 0 var(--spacing-medium) 0; +} + +div.toc li { + padding: 0; + background: none; + line-height: var(--toc-font-size); + margin: var(--toc-font-size) 0 0 0; +} + +div.toc li::before { + display: none; +} + +div.toc ul { + margin-top: 0 +} + +div.toc li a { + font-size: var(--toc-font-size); + color: var(--page-foreground-color) !important; + text-decoration: none; +} + +div.toc li a:hover, div.toc li a.active { + color: var(--primary-color) !important; +} + +div.toc li a.aboveActive { + color: var(--page-secondary-foreground-color) !important; +} + + +@media screen and (max-width: 999px) { + div.contents .toc { + max-height: 45vh; + float: none; + width: auto; + margin: 0 0 var(--spacing-medium) 0; + position: relative; + top: 0; + position: relative; + border: 1px solid var(--separator-color); + border-radius: var(--border-radius-medium); + background-color: var(--toc-background); + box-shadow: var(--box-shadow); + } + + div.contents .toc.interactive { + max-height: calc(var(--navigation-font-size) + 2 * var(--spacing-large)); + overflow: hidden; + } + + div.contents .toc > h3 { + -webkit-tap-highlight-color: transparent; + cursor: pointer; + position: sticky; + top: 0; + background-color: var(--toc-background); + margin: 0; + padding: var(--spacing-large) 0; + display: block; + } + + div.contents .toc.interactive > h3::before { + content: ""; + width: 0; + height: 0; + border-left: 4px solid transparent; + border-right: 4px solid transparent; + border-top: 5px solid var(--primary-color); + display: inline-block; + margin-right: var(--spacing-small); + margin-bottom: calc(var(--navigation-font-size) / 4); + transform: rotate(-90deg); + transition: transform var(--animation-duration) ease-out; + } + + div.contents .toc.interactive.open > h3::before { + transform: rotate(0deg); + } + + div.contents .toc.interactive.open { + max-height: 45vh; + overflow: auto; + transition: max-height 0.2s ease-in-out; + } + + div.contents .toc a, div.contents .toc a.active { + color: var(--primary-color) !important; + } + + div.contents .toc a:hover { + text-decoration: underline; + } +} + +/* + Code & Fragments + */ + +code, div.fragment, pre.fragment { + border-radius: var(--border-radius-small); + border: 1px solid var(--separator-color); + overflow: hidden; +} + +code { + display: inline; + background: var(--code-background); + color: var(--code-foreground); + padding: 2px 6px; +} + +div.fragment, pre.fragment { + margin: var(--spacing-medium) 0; + padding: calc(var(--spacing-large) - (var(--spacing-large) / 6)) var(--spacing-large); + background: var(--fragment-background); + color: var(--fragment-foreground); + overflow-x: auto; +} + +@media screen and (max-width: 767px) { + div.fragment, pre.fragment { + border-top-right-radius: 0; + border-bottom-right-radius: 0; + border-right: 0; + } + + .contents > div.fragment, + .textblock > div.fragment, + .textblock > pre.fragment, + .textblock > .tabbed > ul > li > div.fragment, + .textblock > .tabbed > ul > li > pre.fragment, + .contents > .doxygen-awesome-fragment-wrapper > div.fragment, + .textblock > .doxygen-awesome-fragment-wrapper > div.fragment, + .textblock > .doxygen-awesome-fragment-wrapper > pre.fragment, + .textblock > .tabbed > ul > li > .doxygen-awesome-fragment-wrapper > div.fragment, + .textblock > .tabbed > ul > li > .doxygen-awesome-fragment-wrapper > pre.fragment { + margin: var(--spacing-medium) calc(0px - var(--spacing-large)); + border-radius: 0; + border-left: 0; + } + + .textblock li > .fragment, + .textblock li > .doxygen-awesome-fragment-wrapper > .fragment { + margin: var(--spacing-medium) calc(0px - var(--spacing-large)); + } + + .memdoc li > .fragment, + .memdoc li > .doxygen-awesome-fragment-wrapper > .fragment { + margin: var(--spacing-medium) calc(0px - var(--spacing-medium)); + } + + .textblock ul, .memdoc ul { + overflow: initial; + } + + .memdoc > div.fragment, + .memdoc > pre.fragment, + dl dd > div.fragment, + dl dd pre.fragment, + .memdoc > .doxygen-awesome-fragment-wrapper > div.fragment, + .memdoc > .doxygen-awesome-fragment-wrapper > pre.fragment, + dl dd > .doxygen-awesome-fragment-wrapper > div.fragment, + dl dd .doxygen-awesome-fragment-wrapper > pre.fragment { + margin: var(--spacing-medium) calc(0px - var(--spacing-medium)); + border-radius: 0; + border-left: 0; + } +} + +code, code a, pre.fragment, div.fragment, div.fragment .line, div.fragment span, div.fragment .line a, div.fragment .line span { + font-family: var(--font-family-monospace); + font-size: var(--code-font-size) !important; +} + +div.line:after { + margin-right: var(--spacing-medium); +} + +div.fragment .line, pre.fragment { + white-space: pre; + word-wrap: initial; + line-height: var(--fragment-lineheight); +} + +div.fragment span.keyword { + color: var(--fragment-keyword); +} + +div.fragment span.keywordtype { + color: var(--fragment-keywordtype); +} + +div.fragment span.keywordflow { + color: var(--fragment-keywordflow); +} + +div.fragment span.stringliteral { + color: var(--fragment-token) +} + +div.fragment span.comment { + color: var(--fragment-comment); +} + +div.fragment a.code { + color: var(--fragment-link) !important; +} + +div.fragment span.preprocessor { + color: var(--fragment-preprocessor); +} + +div.fragment span.lineno { + display: inline-block; + width: 27px; + border-right: none; + background: var(--fragment-linenumber-background); + color: var(--fragment-linenumber-color); +} + +div.fragment span.lineno a { + background: none; + color: var(--fragment-link) !important; +} + +div.fragment > .line:first-child .lineno { + box-shadow: -999999px 0px 0 999999px var(--fragment-linenumber-background), -999998px 0px 0 999999px var(--fragment-linenumber-border); + background-color: var(--fragment-linenumber-background) !important; +} + +div.line { + border-radius: var(--border-radius-small); +} + +div.line.glow { + background-color: var(--primary-light-color); + box-shadow: none; +} + +/* + dl warning, attention, note, deprecated, bug, ... + */ + +dl.bug dt a, dl.deprecated dt a, dl.todo dt a { + font-weight: bold !important; +} + +dl.warning, dl.attention, dl.note, dl.deprecated, dl.bug, dl.invariant, dl.pre, dl.post, dl.todo, dl.remark { + padding: var(--spacing-medium); + margin: var(--spacing-medium) 0; + color: var(--page-background-color); + overflow: hidden; + margin-left: 0; + border-radius: var(--border-radius-small); +} + +dl.section dd { + margin-bottom: 2px; +} + +dl.warning, dl.attention { + background: var(--warning-color); + border-left: 8px solid var(--warning-color-dark); + color: var(--warning-color-darker); +} + +dl.warning dt, dl.attention dt { + color: var(--warning-color-dark); +} + +dl.note, dl.remark { + background: var(--note-color); + border-left: 8px solid var(--note-color-dark); + color: var(--note-color-darker); +} + +dl.note dt, dl.remark dt { + color: var(--note-color-dark); +} + +dl.todo { + background: var(--todo-color); + border-left: 8px solid var(--todo-color-dark); + color: var(--todo-color-darker); +} + +dl.todo dt a { + color: var(--todo-color-dark) !important; +} + +dl.bug dt a { + color: var(--todo-color-dark) !important; +} + +dl.bug { + background: var(--bug-color); + border-left: 8px solid var(--bug-color-dark); + color: var(--bug-color-darker); +} + +dl.bug dt a { + color: var(--bug-color-dark) !important; +} + +dl.deprecated { + background: var(--deprecated-color); + border-left: 8px solid var(--deprecated-color-dark); + color: var(--deprecated-color-darker); +} + +dl.deprecated dt a { + color: var(--deprecated-color-dark) !important; +} + +dl.section dd, dl.bug dd, dl.deprecated dd, dl.todo dd { + margin-inline-start: 0px; +} + +dl.invariant, dl.pre, dl.post { + background: var(--invariant-color); + border-left: 8px solid var(--invariant-color-dark); + color: var(--invariant-color-darker); +} + +dl.invariant dt, dl.pre dt, dl.post dt { + color: var(--invariant-color-dark); +} + +/* + memitem + */ + +div.memdoc, div.memproto, h2.memtitle { + box-shadow: none; + background-image: none; + border: none; +} + +div.memdoc { + padding: 0 var(--spacing-medium); + background: var(--page-background-color); +} + +h2.memtitle, div.memitem { + border: 1px solid var(--separator-color); + box-shadow: var(--box-shadow); +} + +h2.memtitle { + box-shadow: 0px var(--spacing-medium) 0 -1px var(--fragment-background), var(--box-shadow); +} + +div.memitem { + transition: none; +} + +div.memproto, h2.memtitle { + background: var(--fragment-background); +} + +h2.memtitle { + font-weight: 500; + font-size: var(--memtitle-font-size); + font-family: var(--font-family-monospace); + border-bottom: none; + border-top-left-radius: var(--border-radius-medium); + border-top-right-radius: var(--border-radius-medium); + word-break: break-all; + position: relative; +} + +h2.memtitle:after { + content: ""; + display: block; + background: var(--fragment-background); + height: var(--spacing-medium); + bottom: calc(0px - var(--spacing-medium)); + left: 0; + right: -14px; + position: absolute; + border-top-right-radius: var(--border-radius-medium); +} + +h2.memtitle > span.permalink { + font-size: inherit; +} + +h2.memtitle > span.permalink > a { + text-decoration: none; + padding-left: 3px; + margin-right: -4px; + user-select: none; + display: inline-block; + margin-top: -6px; +} + +h2.memtitle > span.permalink > a:hover { + color: var(--primary-dark-color) !important; +} + +a:target + h2.memtitle, a:target + h2.memtitle + div.memitem { + border-color: var(--primary-light-color); +} + +div.memitem { + border-top-right-radius: var(--border-radius-medium); + border-bottom-right-radius: var(--border-radius-medium); + border-bottom-left-radius: var(--border-radius-medium); + overflow: hidden; + display: block !important; +} + +div.memdoc { + border-radius: 0; +} + +div.memproto { + border-radius: 0 var(--border-radius-small) 0 0; + overflow: auto; + border-bottom: 1px solid var(--separator-color); + padding: var(--spacing-medium); + margin-bottom: -1px; +} + +div.memtitle { + border-top-right-radius: var(--border-radius-medium); + border-top-left-radius: var(--border-radius-medium); +} + +div.memproto table.memname { + font-family: var(--font-family-monospace); + color: var(--page-foreground-color); + font-size: var(--memname-font-size); + text-shadow: none; +} + +div.memproto div.memtemplate { + font-family: var(--font-family-monospace); + color: var(--primary-dark-color); + font-size: var(--memname-font-size); + margin-left: 2px; + text-shadow: none; +} + +table.mlabels, table.mlabels > tbody { + display: block; +} + +td.mlabels-left { + width: auto; +} + +td.mlabels-right { + margin-top: 3px; + position: sticky; + left: 0; +} + +table.mlabels > tbody > tr:first-child { + display: flex; + justify-content: space-between; + flex-wrap: wrap; +} + +.memname, .memitem span.mlabels { + margin: 0 +} + +/* + reflist + */ + +dl.reflist { + box-shadow: var(--box-shadow); + border-radius: var(--border-radius-medium); + border: 1px solid var(--separator-color); + overflow: hidden; + padding: 0; +} + + +dl.reflist dt, dl.reflist dd { + box-shadow: none; + text-shadow: none; + background-image: none; + border: none; + padding: 12px; +} + + +dl.reflist dt { + font-weight: 500; + border-radius: 0; + background: var(--code-background); + border-bottom: 1px solid var(--separator-color); + color: var(--page-foreground-color) +} + + +dl.reflist dd { + background: none; +} + +/* + Table + */ + +.contents table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname), +.contents table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) tbody { + display: inline-block; + max-width: 100%; +} + +.contents > table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname):not(.classindex) { + margin-left: calc(0px - var(--spacing-large)); + margin-right: calc(0px - var(--spacing-large)); + max-width: calc(100% + 2 * var(--spacing-large)); +} + +table.fieldtable, +table.markdownTable tbody, +table.doxtable tbody { + border: none; + margin: var(--spacing-medium) 0; + box-shadow: 0 0 0 1px var(--separator-color); + border-radius: var(--border-radius-small); +} + +table.markdownTable, table.doxtable, table.fieldtable { + padding: 1px; +} + +table.doxtable caption { + display: block; +} + +table.fieldtable { + border-collapse: collapse; + width: 100%; +} + +th.markdownTableHeadLeft, +th.markdownTableHeadRight, +th.markdownTableHeadCenter, +th.markdownTableHeadNone, +table.doxtable th { + background: var(--tablehead-background); + color: var(--tablehead-foreground); + font-weight: 600; + font-size: var(--page-font-size); +} + +th.markdownTableHeadLeft:first-child, +th.markdownTableHeadRight:first-child, +th.markdownTableHeadCenter:first-child, +th.markdownTableHeadNone:first-child, +table.doxtable tr th:first-child { + border-top-left-radius: var(--border-radius-small); +} + +th.markdownTableHeadLeft:last-child, +th.markdownTableHeadRight:last-child, +th.markdownTableHeadCenter:last-child, +th.markdownTableHeadNone:last-child, +table.doxtable tr th:last-child { + border-top-right-radius: var(--border-radius-small); +} + +table.markdownTable td, +table.markdownTable th, +table.fieldtable td, +table.fieldtable th, +table.doxtable td, +table.doxtable th { + border: 1px solid var(--separator-color); + padding: var(--spacing-small) var(--spacing-medium); +} + +table.markdownTable td:last-child, +table.markdownTable th:last-child, +table.fieldtable td:last-child, +table.fieldtable th:last-child, +table.doxtable td:last-child, +table.doxtable th:last-child { + border-right: none; +} + +table.markdownTable td:first-child, +table.markdownTable th:first-child, +table.fieldtable td:first-child, +table.fieldtable th:first-child, +table.doxtable td:first-child, +table.doxtable th:first-child { + border-left: none; +} + +table.markdownTable tr:first-child td, +table.markdownTable tr:first-child th, +table.fieldtable tr:first-child td, +table.fieldtable tr:first-child th, +table.doxtable tr:first-child td, +table.doxtable tr:first-child th { + border-top: none; +} + +table.markdownTable tr:last-child td, +table.markdownTable tr:last-child th, +table.fieldtable tr:last-child td, +table.fieldtable tr:last-child th, +table.doxtable tr:last-child td, +table.doxtable tr:last-child th { + border-bottom: none; +} + +table.markdownTable tr, table.doxtable tr { + border-bottom: 1px solid var(--separator-color); +} + +table.markdownTable tr:last-child, table.doxtable tr:last-child { + border-bottom: none; +} + +.full_width_table table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) { + display: block; +} + +.full_width_table table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) tbody { + display: table; + width: 100%; +} + +table.fieldtable th { + font-size: var(--page-font-size); + font-weight: 600; + background-image: none; + background-color: var(--tablehead-background); + color: var(--tablehead-foreground); +} + +table.fieldtable td.fieldtype, .fieldtable td.fieldname, .fieldtable td.fieldinit, .fieldtable td.fielddoc, .fieldtable th { + border-bottom: 1px solid var(--separator-color); + border-right: 1px solid var(--separator-color); +} + +table.fieldtable tr:last-child td:first-child { + border-bottom-left-radius: var(--border-radius-small); +} + +table.fieldtable tr:last-child td:last-child { + border-bottom-right-radius: var(--border-radius-small); +} + +.memberdecls td.glow, .fieldtable tr.glow { + background-color: var(--primary-light-color); + box-shadow: none; +} + +table.memberdecls { + display: block; + -webkit-tap-highlight-color: transparent; +} + +table.memberdecls tr[class^='memitem'] { + font-family: var(--font-family-monospace); + font-size: var(--code-font-size); +} + +table.memberdecls tr[class^='memitem'] .memTemplParams { + font-family: var(--font-family-monospace); + font-size: var(--code-font-size); + color: var(--primary-dark-color); + white-space: normal; +} + +table.memberdecls .memItemLeft, +table.memberdecls .memItemRight, +table.memberdecls .memTemplItemLeft, +table.memberdecls .memTemplItemRight, +table.memberdecls .memTemplParams { + transition: none; + padding-top: var(--spacing-small); + padding-bottom: var(--spacing-small); + border-top: 1px solid var(--separator-color); + border-bottom: 1px solid var(--separator-color); + background-color: var(--fragment-background); +} + +table.memberdecls .memTemplItemLeft, +table.memberdecls .memTemplItemRight { + padding-top: 2px; +} + +table.memberdecls .memTemplParams { + border-bottom: 0; + border-left: 1px solid var(--separator-color); + border-right: 1px solid var(--separator-color); + border-radius: var(--border-radius-small) var(--border-radius-small) 0 0; + padding-bottom: var(--spacing-small); +} + +table.memberdecls .memTemplItemLeft { + border-radius: 0 0 0 var(--border-radius-small); + border-left: 1px solid var(--separator-color); + border-top: 0; +} + +table.memberdecls .memTemplItemRight { + border-radius: 0 0 var(--border-radius-small) 0; + border-right: 1px solid var(--separator-color); + padding-left: 0; + border-top: 0; +} + +table.memberdecls .memItemLeft { + border-radius: var(--border-radius-small) 0 0 var(--border-radius-small); + border-left: 1px solid var(--separator-color); + padding-left: var(--spacing-medium); + padding-right: 0; +} + +table.memberdecls .memItemRight { + border-radius: 0 var(--border-radius-small) var(--border-radius-small) 0; + border-right: 1px solid var(--separator-color); + padding-right: var(--spacing-medium); + padding-left: 0; + +} + +table.memberdecls .mdescLeft, table.memberdecls .mdescRight { + background: none; + color: var(--page-foreground-color); + padding: var(--spacing-small) 0; +} + +table.memberdecls .memItemLeft, +table.memberdecls .memTemplItemLeft { + padding-right: var(--spacing-medium); +} + +table.memberdecls .memSeparator { + background: var(--page-background-color); + height: var(--spacing-large); + border: 0; + transition: none; +} + +table.memberdecls .groupheader { + margin-bottom: var(--spacing-large); +} + +table.memberdecls .inherit_header td { + padding: 0 0 var(--spacing-medium) 0; + text-indent: -12px; + color: var(--page-secondary-foreground-color); +} + +table.memberdecls img[src="closed.png"], +table.memberdecls img[src="open.png"], +div.dynheader img[src="open.png"], +div.dynheader img[src="closed.png"] { + width: 0; + height: 0; + border-left: 4px solid transparent; + border-right: 4px solid transparent; + border-top: 5px solid var(--primary-color); + margin-top: 8px; + display: block; + float: left; + margin-left: -10px; + transition: transform var(--animation-duration) ease-out; +} + +table.memberdecls img { + margin-right: 10px; +} + +table.memberdecls img[src="closed.png"], +div.dynheader img[src="closed.png"] { + transform: rotate(-90deg); + +} + +.compoundTemplParams { + font-family: var(--font-family-monospace); + color: var(--primary-dark-color); + font-size: var(--code-font-size); +} + +@media screen and (max-width: 767px) { + + table.memberdecls .memItemLeft, + table.memberdecls .memItemRight, + table.memberdecls .mdescLeft, + table.memberdecls .mdescRight, + table.memberdecls .memTemplItemLeft, + table.memberdecls .memTemplItemRight, + table.memberdecls .memTemplParams { + display: block; + text-align: left; + padding-left: var(--spacing-large); + margin: 0 calc(0px - var(--spacing-large)) 0 calc(0px - var(--spacing-large)); + border-right: none; + border-left: none; + border-radius: 0; + white-space: normal; + } + + table.memberdecls .memItemLeft, + table.memberdecls .mdescLeft, + table.memberdecls .memTemplItemLeft { + border-bottom: 0; + padding-bottom: 0; + } + + table.memberdecls .memTemplItemLeft { + padding-top: 0; + } + + table.memberdecls .mdescLeft { + margin-bottom: calc(0px - var(--page-font-size)); + } + + table.memberdecls .memItemRight, + table.memberdecls .mdescRight, + table.memberdecls .memTemplItemRight { + border-top: 0; + padding-top: 0; + padding-right: var(--spacing-large); + overflow-x: auto; + } + + table.memberdecls tr[class^='memitem']:not(.inherit) { + display: block; + width: calc(100vw - 2 * var(--spacing-large)); + } + + table.memberdecls .mdescRight { + color: var(--page-foreground-color); + } + + table.memberdecls tr.inherit { + visibility: hidden; + } + + table.memberdecls tr[style="display: table-row;"] { + display: block !important; + visibility: visible; + width: calc(100vw - 2 * var(--spacing-large)); + animation: fade .5s; + } + + @keyframes fade { + 0% { + opacity: 0; + max-height: 0; + } + + 100% { + opacity: 1; + max-height: 200px; + } + } +} + + +/* + Horizontal Rule + */ + +hr { + margin-top: var(--spacing-large); + margin-bottom: var(--spacing-large); + height: 1px; + background-color: var(--separator-color); + border: 0; +} + +.contents hr { + box-shadow: 100px 0 var(--separator-color), + -100px 0 var(--separator-color), + 500px 0 var(--separator-color), + -500px 0 var(--separator-color), + 900px 0 var(--separator-color), + -900px 0 var(--separator-color), + 1400px 0 var(--separator-color), + -1400px 0 var(--separator-color), + 1900px 0 var(--separator-color), + -1900px 0 var(--separator-color); +} + +.contents img, .contents .center, .contents center, .contents div.image object { + max-width: 100%; + overflow: auto; +} + +@media screen and (max-width: 767px) { + .contents .dyncontent > .center, .contents > center { + margin-left: calc(0px - var(--spacing-large)); + margin-right: calc(0px - var(--spacing-large)); + max-width: calc(100% + 2 * var(--spacing-large)); + } +} + +/* + Directories + */ +div.directory { + border-top: 1px solid var(--separator-color); + border-bottom: 1px solid var(--separator-color); + width: auto; +} + +table.directory { + font-family: var(--font-family); + font-size: var(--page-font-size); + font-weight: normal; + width: 100%; +} + +table.directory td.entry, table.directory td.desc { + padding: calc(var(--spacing-small) / 2) var(--spacing-small); + line-height: var(--table-line-height); +} + +table.directory tr.even td:last-child { + border-radius: 0 var(--border-radius-small) var(--border-radius-small) 0; +} + +table.directory tr.even td:first-child { + border-radius: var(--border-radius-small) 0 0 var(--border-radius-small); +} + +table.directory tr.even:last-child td:last-child { + border-radius: 0 var(--border-radius-small) 0 0; +} + +table.directory tr.even:last-child td:first-child { + border-radius: var(--border-radius-small) 0 0 0; +} + +table.directory td.desc { + min-width: 250px; +} + +table.directory tr.even { + background-color: var(--odd-color); +} + +table.directory tr.odd { + background-color: transparent; +} + +.icona { + width: auto; + height: auto; + margin: 0 var(--spacing-small); +} + +.icon { + background: var(--primary-color); + border-radius: var(--border-radius-small); + font-size: var(--page-font-size); + padding: calc(var(--page-font-size) / 5); + line-height: var(--page-font-size); + transform: scale(0.8); + height: auto; + width: var(--page-font-size); + user-select: none; +} + +.iconfopen, .icondoc, .iconfclosed { + background-position: center; + margin-bottom: 0; + height: var(--table-line-height); +} + +.icondoc { + filter: saturate(0.2); +} + +@media screen and (max-width: 767px) { + div.directory { + margin-left: calc(0px - var(--spacing-large)); + margin-right: calc(0px - var(--spacing-large)); + } +} + +@media (prefers-color-scheme: dark) { + html:not(.light-mode) .iconfopen, html:not(.light-mode) .iconfclosed { + filter: hue-rotate(180deg) invert(); + } +} + +html.dark-mode .iconfopen, html.dark-mode .iconfclosed { + filter: hue-rotate(180deg) invert(); +} + +/* + Class list + */ + +.classindex dl.odd { + background: var(--odd-color); + border-radius: var(--border-radius-small); +} + +.classindex dl.even { + background-color: transparent; +} + +/* + Class Index Doxygen 1.8 +*/ + +table.classindex { + margin-left: 0; + margin-right: 0; + width: 100%; +} + +table.classindex table div.ah { + background-image: none; + background-color: initial; + border-color: var(--separator-color); + color: var(--page-foreground-color); + box-shadow: var(--box-shadow); + border-radius: var(--border-radius-large); + padding: var(--spacing-small); +} + +div.qindex { + background-color: var(--odd-color); + border-radius: var(--border-radius-small); + border: 1px solid var(--separator-color); + padding: var(--spacing-small) 0; +} + +/* + Footer and nav-path + */ + +#nav-path { + width: 100%; +} + +#nav-path ul { + background-image: none; + background: var(--page-background-color); + border: none; + border-top: 1px solid var(--separator-color); + border-bottom: 1px solid var(--separator-color); + border-bottom: 0; + box-shadow: 0 0.75px 0 var(--separator-color); + font-size: var(--navigation-font-size); +} + +img.footer { + width: 60px; +} + +.navpath li.footer { + color: var(--page-secondary-foreground-color); +} + +address.footer { + color: var(--page-secondary-foreground-color); + margin-bottom: var(--spacing-large); +} + +#nav-path li.navelem { + background-image: none; + display: flex; + align-items: center; +} + +.navpath li.navelem a { + text-shadow: none; + display: inline-block; + color: var(--primary-color) !important; +} + +.navpath li.navelem b { + color: var(--primary-dark-color); + font-weight: 500; +} + +li.navelem { + padding: 0; + margin-left: -8px; +} + +li.navelem:first-child { + margin-left: var(--spacing-large); +} + +li.navelem:first-child:before { + display: none; +} + +#nav-path li.navelem:after { + content: ''; + border: 5px solid var(--page-background-color); + border-bottom-color: transparent; + border-right-color: transparent; + border-top-color: transparent; + transform: translateY(-1px) scaleY(4.2); + z-index: 10; + margin-left: 6px; +} + +#nav-path li.navelem:before { + content: ''; + border: 5px solid var(--separator-color); + border-bottom-color: transparent; + border-right-color: transparent; + border-top-color: transparent; + transform: translateY(-1px) scaleY(3.2); + margin-right: var(--spacing-small); +} + +.navpath li.navelem a:hover { + color: var(--primary-color); +} + +/* + Scrollbars for Webkit +*/ + +#nav-tree::-webkit-scrollbar, +div.fragment::-webkit-scrollbar, +pre.fragment::-webkit-scrollbar, +div.memproto::-webkit-scrollbar, +.contents center::-webkit-scrollbar, +.contents .center::-webkit-scrollbar, +.contents table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) tbody::-webkit-scrollbar, +div.contents .toc::-webkit-scrollbar, +.contents .dotgraph::-webkit-scrollbar, +.contents .tabs-overview-container::-webkit-scrollbar { + background: transparent; + width: calc(var(--webkit-scrollbar-size) + var(--webkit-scrollbar-padding) + var(--webkit-scrollbar-padding)); + height: calc(var(--webkit-scrollbar-size) + var(--webkit-scrollbar-padding) + var(--webkit-scrollbar-padding)); +} + +#nav-tree::-webkit-scrollbar-thumb, +div.fragment::-webkit-scrollbar-thumb, +pre.fragment::-webkit-scrollbar-thumb, +div.memproto::-webkit-scrollbar-thumb, +.contents center::-webkit-scrollbar-thumb, +.contents .center::-webkit-scrollbar-thumb, +.contents table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) tbody::-webkit-scrollbar-thumb, +div.contents .toc::-webkit-scrollbar-thumb, +.contents .dotgraph::-webkit-scrollbar-thumb, +.contents .tabs-overview-container::-webkit-scrollbar-thumb { + background-color: transparent; + border: var(--webkit-scrollbar-padding) solid transparent; + border-radius: calc(var(--webkit-scrollbar-padding) + var(--webkit-scrollbar-padding)); + background-clip: padding-box; +} + +#nav-tree:hover::-webkit-scrollbar-thumb, +div.fragment:hover::-webkit-scrollbar-thumb, +pre.fragment:hover::-webkit-scrollbar-thumb, +div.memproto:hover::-webkit-scrollbar-thumb, +.contents center:hover::-webkit-scrollbar-thumb, +.contents .center:hover::-webkit-scrollbar-thumb, +.contents table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) tbody:hover::-webkit-scrollbar-thumb, +div.contents .toc:hover::-webkit-scrollbar-thumb, +.contents .dotgraph:hover::-webkit-scrollbar-thumb, +.contents .tabs-overview-container:hover::-webkit-scrollbar-thumb { + background-color: var(--webkit-scrollbar-color); +} + +#nav-tree::-webkit-scrollbar-track, +div.fragment::-webkit-scrollbar-track, +pre.fragment::-webkit-scrollbar-track, +div.memproto::-webkit-scrollbar-track, +.contents center::-webkit-scrollbar-track, +.contents .center::-webkit-scrollbar-track, +.contents table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) tbody::-webkit-scrollbar-track, +div.contents .toc::-webkit-scrollbar-track, +.contents .dotgraph::-webkit-scrollbar-track, +.contents .tabs-overview-container::-webkit-scrollbar-track { + background: transparent; +} + +#nav-tree::-webkit-scrollbar-corner { + background-color: var(--side-nav-background); +} + +#nav-tree, +div.fragment, +pre.fragment, +div.memproto, +.contents center, +.contents .center, +.contents table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) tbody, +div.contents .toc { + overflow-x: auto; + overflow-x: overlay; +} + +#nav-tree { + overflow-x: auto; + overflow-y: auto; + overflow-y: overlay; +} + +/* + Scrollbars for Firefox +*/ + +#nav-tree, +div.fragment, +pre.fragment, +div.memproto, +.contents center, +.contents .center, +.contents table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) tbody, +div.contents .toc, +.contents .dotgraph, +.contents .tabs-overview-container { + scrollbar-width: thin; +} + +/* + Optional Dark mode toggle button +*/ + +doxygen-awesome-dark-mode-toggle { + display: inline-block; + margin: 0 0 0 var(--spacing-small); + padding: 0; + width: var(--searchbar-height); + height: var(--searchbar-height); + background: none; + border: none; + border-radius: var(--searchbar-height); + vertical-align: middle; + text-align: center; + line-height: var(--searchbar-height); + font-size: 22px; + display: flex; + align-items: center; + justify-content: center; + user-select: none; + cursor: pointer; +} + +doxygen-awesome-dark-mode-toggle > svg { + transition: transform var(--animation-duration) ease-in-out; +} + +doxygen-awesome-dark-mode-toggle:active > svg { + transform: scale(.5); +} + +doxygen-awesome-dark-mode-toggle:hover { + background-color: rgba(0,0,0,.03); +} + +html.dark-mode doxygen-awesome-dark-mode-toggle:hover { + background-color: rgba(0,0,0,.18); +} + +/* + Optional fragment copy button +*/ +.doxygen-awesome-fragment-wrapper { + position: relative; +} + +doxygen-awesome-fragment-copy-button { + opacity: 0; + background: var(--fragment-background); + width: 28px; + height: 28px; + position: absolute; + right: calc(var(--spacing-large) - (var(--spacing-large) / 2.5)); + top: calc(var(--spacing-large) - (var(--spacing-large) / 2.5)); + border: 1px solid var(--fragment-foreground); + cursor: pointer; + border-radius: var(--border-radius-small); + display: flex; + justify-content: center; + align-items: center; +} + +.doxygen-awesome-fragment-wrapper:hover doxygen-awesome-fragment-copy-button, doxygen-awesome-fragment-copy-button.success { + opacity: .28; +} + +doxygen-awesome-fragment-copy-button:hover, doxygen-awesome-fragment-copy-button.success { + opacity: 1 !important; +} + +doxygen-awesome-fragment-copy-button:active:not([class~=success]) svg { + transform: scale(.91); +} + +doxygen-awesome-fragment-copy-button svg { + fill: var(--fragment-foreground); + width: 18px; + height: 18px; +} + +doxygen-awesome-fragment-copy-button.success svg { + fill: rgb(14, 168, 14); +} + +doxygen-awesome-fragment-copy-button.success { + border-color: rgb(14, 168, 14); +} + +@media screen and (max-width: 767px) { + .textblock > .doxygen-awesome-fragment-wrapper > doxygen-awesome-fragment-copy-button, + .textblock li > .doxygen-awesome-fragment-wrapper > doxygen-awesome-fragment-copy-button, + .memdoc li > .doxygen-awesome-fragment-wrapper > doxygen-awesome-fragment-copy-button, + .memdoc > .doxygen-awesome-fragment-wrapper > doxygen-awesome-fragment-copy-button, + dl dd > .doxygen-awesome-fragment-wrapper > doxygen-awesome-fragment-copy-button { + right: 0; + } +} + +/* + Optional paragraph link button +*/ + +a.anchorlink { + font-size: 90%; + margin-left: var(--spacing-small); + color: var(--page-foreground-color) !important; + text-decoration: none; + opacity: .15; + display: none; + transition: opacity var(--animation-duration) ease-in-out, color var(--animation-duration) ease-in-out; +} + +a.anchorlink svg { + fill: var(--page-foreground-color); +} + +h3 a.anchorlink svg, h4 a.anchorlink svg { + margin-bottom: -3px; + margin-top: -4px; +} + +a.anchorlink:hover { + opacity: .45; +} + +h2:hover a.anchorlink, h1:hover a.anchorlink, h3:hover a.anchorlink, h4:hover a.anchorlink { + display: inline-block; +} + +/* + Optional tab feature +*/ + +.tabbed > ul { + padding-inline-start: 0px; + margin: 0; + padding: var(--spacing-small) 0; +} + +.tabbed > ul > li { + display: none; +} + +.tabbed > ul > li.selected { + display: block; +} + +.tabs-overview-container { + overflow-x: auto; + display: block; + overflow-y: visible; +} + +.tabs-overview { + border-bottom: 1px solid var(--separator-color); + display: flex; + flex-direction: row; +} + +@media screen and (max-width: 767px) { + .tabs-overview-container { + margin: 0 calc(0px - var(--spacing-large)); + } + .tabs-overview { + padding: 0 var(--spacing-large) + } +} + +.tabs-overview button.tab-button { + color: var(--page-foreground-color); + margin: 0; + border: none; + background: transparent; + padding: calc(var(--spacing-large) / 2) 0; + display: inline-block; + font-size: var(--page-font-size); + cursor: pointer; + box-shadow: 0 1px 0 0 var(--separator-color); + position: relative; + + -webkit-tap-highlight-color: transparent; +} + +.tabs-overview button.tab-button .tab-title::before { + display: block; + content: attr(title); + font-weight: 600; + height: 0; + overflow: hidden; + visibility: hidden; +} + +.tabs-overview button.tab-button .tab-title { + float: left; + white-space: nowrap; + font-weight: normal; + padding: calc(var(--spacing-large) / 2) var(--spacing-large); + border-radius: var(--border-radius-medium); + transition: background-color var(--animation-duration) ease-in-out, font-weight var(--animation-duration) ease-in-out; +} + +.tabs-overview button.tab-button:not(:last-child) .tab-title { + box-shadow: 8px 0 0 -7px var(--separator-color); +} + +.tabs-overview button.tab-button:hover .tab-title { + background: var(--separator-color); + box-shadow: none; +} + +.tabs-overview button.tab-button.active .tab-title { + font-weight: 600; +} + +.tabs-overview button.tab-button::after { + content: ''; + display: block; + position: absolute; + left: 0; + bottom: 0; + right: 0; + height: 0; + width: 0%; + margin: 0 auto; + border-radius: var(--border-radius-small) var(--border-radius-small) 0 0; + background-color: var(--primary-color); + transition: width var(--animation-duration) ease-in-out, height var(--animation-duration) ease-in-out; +} + +.tabs-overview button.tab-button.active::after { + width: 100%; + box-sizing: border-box; + height: 3px; +} + + +/* + Navigation Buttons +*/ + +.section_buttons:not(:empty) { + margin-top: calc(var(--spacing-large) * 3); +} + +.section_buttons table.markdownTable { + display: block; + width: 100%; +} + +.section_buttons table.markdownTable tbody { + display: table !important; + width: 100%; + box-shadow: none; + border-spacing: 10px; +} + +.section_buttons table.markdownTable td { + padding: 0; +} + +.section_buttons table.markdownTable th { + display: none; +} + +.section_buttons table.markdownTable tr.markdownTableHead { + border: none; +} + +.section_buttons tr th, .section_buttons tr td { + background: none; + border: none; + padding: var(--spacing-large) 0 var(--spacing-small); +} + +.section_buttons a { + display: inline-block; + border: 1px solid var(--separator-color); + border-radius: var(--border-radius-medium); + color: var(--page-secondary-foreground-color) !important; + text-decoration: none; + transition: color var(--animation-duration) ease-in-out, background-color var(--animation-duration) ease-in-out; +} + +.section_buttons a:hover { + color: var(--page-foreground-color) !important; + background-color: var(--odd-color); +} + +.section_buttons tr td.markdownTableBodyLeft a { + padding: var(--spacing-medium) var(--spacing-large) var(--spacing-medium) calc(var(--spacing-large) / 2); +} + +.section_buttons tr td.markdownTableBodyRight a { + padding: var(--spacing-medium) calc(var(--spacing-large) / 2) var(--spacing-medium) var(--spacing-large); +} + +.section_buttons tr td.markdownTableBodyLeft a::before, +.section_buttons tr td.markdownTableBodyRight a::after { + color: var(--page-secondary-foreground-color) !important; + display: inline-block; + transition: color .08s ease-in-out, transform .09s ease-in-out; +} + +.section_buttons tr td.markdownTableBodyLeft a::before { + content: '〈'; + padding-right: var(--spacing-large); +} + + +.section_buttons tr td.markdownTableBodyRight a::after { + content: '〉'; + padding-left: var(--spacing-large); +} + + +.section_buttons tr td.markdownTableBodyLeft a:hover::before { + color: var(--page-foreground-color) !important; + transform: translateX(-3px); +} + +.section_buttons tr td.markdownTableBodyRight a:hover::after { + color: var(--page-foreground-color) !important; + transform: translateX(3px); +} + +@media screen and (max-width: 450px) { + .section_buttons a { + width: 100%; + box-sizing: border-box; + } + + .section_buttons tr td:nth-of-type(1).markdownTableBodyLeft a { + border-radius: var(--border-radius-medium) 0 0 var(--border-radius-medium); + border-right: none; + } + + .section_buttons tr td:nth-of-type(2).markdownTableBodyRight a { + border-radius: 0 var(--border-radius-medium) var(--border-radius-medium) 0; + } +} diff --git a/doxygen.css b/doxygen.css new file mode 100644 index 000000000..52886aa1a --- /dev/null +++ b/doxygen.css @@ -0,0 +1,1841 @@ +/* The standard CSS for doxygen 1.12.0*/ + +body { + background-color: white; + color: black; +} + +body, table, div, p, dl { + font-weight: 400; + font-size: 14px; + font-family: Roboto,sans-serif; + line-height: 22px; +} + +/* @group Heading Levels */ + +.title { + font-family: Roboto,sans-serif; + line-height: 28px; + font-size: 150%; + font-weight: bold; + margin: 10px 2px; +} + +h1.groupheader { + font-size: 150%; +} + +h2.groupheader { + border-bottom: 1px solid #6693EC; + color: #13419E; + font-size: 150%; + font-weight: normal; + margin-top: 1.75em; + padding-top: 8px; + padding-bottom: 4px; + width: 100%; +} + +h3.groupheader { + font-size: 100%; +} + +h1, h2, h3, h4, h5, h6 { + -webkit-transition: text-shadow 0.5s linear; + -moz-transition: text-shadow 0.5s linear; + -ms-transition: text-shadow 0.5s linear; + -o-transition: text-shadow 0.5s linear; + transition: text-shadow 0.5s linear; + margin-right: 15px; +} + +h1.glow, h2.glow, h3.glow, h4.glow, h5.glow, h6.glow { + text-shadow: 0 0 15px cyan; +} + +dt { + font-weight: bold; +} + +p.startli, p.startdd { + margin-top: 2px; +} + +th p.starttd, th p.intertd, th p.endtd { + font-size: 100%; + font-weight: 700; +} + +p.starttd { + margin-top: 0px; +} + +p.endli { + margin-bottom: 0px; +} + +p.enddd { + margin-bottom: 4px; +} + +p.endtd { + margin-bottom: 2px; +} + +p.interli { +} + +p.interdd { +} + +p.intertd { +} + +/* @end */ + +caption { + font-weight: bold; +} + +span.legend { + font-size: 70%; + text-align: center; +} + +h3.version { + font-size: 90%; + text-align: center; +} + +div.navtab { + padding-right: 15px; + text-align: right; + line-height: 110%; +} + +div.navtab table { + border-spacing: 0; +} + +td.navtab { + padding-right: 6px; + padding-left: 6px; +} + +td.navtabHL { + background-image: url('tab_a.png'); + background-repeat:repeat-x; + padding-right: 6px; + padding-left: 6px; +} + +td.navtabHL a, td.navtabHL a:visited { + color: white; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +} + +a.navtab { + font-weight: bold; +} + +div.qindex{ + text-align: center; + width: 100%; + line-height: 140%; + font-size: 130%; + color: #A0A0A0; +} + +#main-menu a:focus { + outline: auto; + z-index: 10; + position: relative; +} + +dt.alphachar{ + font-size: 180%; + font-weight: bold; +} + +.alphachar a{ + color: black; +} + +.alphachar a:hover, .alphachar a:visited{ + text-decoration: none; +} + +.classindex dl { + padding: 25px; + column-count:1 +} + +.classindex dd { + display:inline-block; + margin-left: 50px; + width: 90%; + line-height: 1.15em; +} + +.classindex dl.even { + background-color: white; +} + +.classindex dl.odd { + background-color: #F6F8FD; +} + +@media(min-width: 1120px) { + .classindex dl { + column-count:2 + } +} + +@media(min-width: 1320px) { + .classindex dl { + column-count:3 + } +} + + +/* @group Link Styling */ + +a { + color: #154AB3; + font-weight: normal; + text-decoration: none; +} + +.contents a:visited { + color: #1956D0; +} + +a:hover { + text-decoration: none; + background: linear-gradient(to bottom, transparent 0,transparent calc(100% - 1px), currentColor 100%); +} + +a:hover > span.arrow { + text-decoration: none; + background : #F7F9FE; +} + +a.el { + font-weight: bold; +} + +a.elRef { +} + +a.code, a.code:visited, a.line, a.line:visited { + color: #1956D0; +} + +a.codeRef, a.codeRef:visited, a.lineRef, a.lineRef:visited { + color: #1956D0; +} + +a.code.hl_class { /* style for links to class names in code snippets */ } +a.code.hl_struct { /* style for links to struct names in code snippets */ } +a.code.hl_union { /* style for links to union names in code snippets */ } +a.code.hl_interface { /* style for links to interface names in code snippets */ } +a.code.hl_protocol { /* style for links to protocol names in code snippets */ } +a.code.hl_category { /* style for links to category names in code snippets */ } +a.code.hl_exception { /* style for links to exception names in code snippets */ } +a.code.hl_service { /* style for links to service names in code snippets */ } +a.code.hl_singleton { /* style for links to singleton names in code snippets */ } +a.code.hl_concept { /* style for links to concept names in code snippets */ } +a.code.hl_namespace { /* style for links to namespace names in code snippets */ } +a.code.hl_package { /* style for links to package names in code snippets */ } +a.code.hl_define { /* style for links to macro names in code snippets */ } +a.code.hl_function { /* style for links to function names in code snippets */ } +a.code.hl_variable { /* style for links to variable names in code snippets */ } +a.code.hl_typedef { /* style for links to typedef names in code snippets */ } +a.code.hl_enumvalue { /* style for links to enum value names in code snippets */ } +a.code.hl_enumeration { /* style for links to enumeration names in code snippets */ } +a.code.hl_signal { /* style for links to Qt signal names in code snippets */ } +a.code.hl_slot { /* style for links to Qt slot names in code snippets */ } +a.code.hl_friend { /* style for links to friend names in code snippets */ } +a.code.hl_dcop { /* style for links to KDE3 DCOP names in code snippets */ } +a.code.hl_property { /* style for links to property names in code snippets */ } +a.code.hl_event { /* style for links to event names in code snippets */ } +a.code.hl_sequence { /* style for links to sequence names in code snippets */ } +a.code.hl_dictionary { /* style for links to dictionary names in code snippets */ } + +/* @end */ + +dl.el { + margin-left: -1cm; +} + +ul.check { + list-style:none; + text-indent: -16px; + padding-left: 38px; +} +li.unchecked:before { + content: "\2610\A0"; +} +li.checked:before { + content: "\2611\A0"; +} + +ol { + text-indent: 0px; +} + +ul { + text-indent: 0px; + overflow: visible; +} + +ul.multicol { + -moz-column-gap: 1em; + -webkit-column-gap: 1em; + column-gap: 1em; + -moz-column-count: 3; + -webkit-column-count: 3; + column-count: 3; + list-style-type: none; +} + +#side-nav ul { + overflow: visible; /* reset ul rule for scroll bar in GENERATE_TREEVIEW window */ +} + +#main-nav ul { + overflow: visible; /* reset ul rule for the navigation bar drop down lists */ +} + +.fragment { + text-align: left; + direction: ltr; + overflow-x: auto; + overflow-y: hidden; + position: relative; + min-height: 12px; + margin: 10px 0px; + padding: 10px 10px; + border: 1px solid #B4CAF6; + border-radius: 4px; + background-color: #FAFBFE; + color: black; +} + +pre.fragment { + word-wrap: break-word; + font-size: 10pt; + line-height: 125%; + font-family: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; +} + +.clipboard { + width: 24px; + height: 24px; + right: 5px; + top: 5px; + opacity: 0; + position: absolute; + display: inline; + overflow: auto; + fill: black; + justify-content: center; + align-items: center; + cursor: pointer; +} + +.clipboard.success { + border: 1px solid black; + border-radius: 4px; +} + +.fragment:hover .clipboard, .clipboard.success { + opacity: .28; +} + +.clipboard:hover, .clipboard.success { + opacity: 1 !important; +} + +.clipboard:active:not([class~=success]) svg { + transform: scale(.91); +} + +.clipboard.success svg { + fill: #2EC82E; +} + +.clipboard.success { + border-color: #2EC82E; +} + +div.line { + font-family: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; + font-size: 13px; + min-height: 13px; + line-height: 1.2; + text-wrap: unrestricted; + white-space: -moz-pre-wrap; /* Moz */ + white-space: -pre-wrap; /* Opera 4-6 */ + white-space: -o-pre-wrap; /* Opera 7 */ + white-space: pre-wrap; /* CSS3 */ + word-wrap: break-word; /* IE 5.5+ */ + text-indent: -53px; + padding-left: 53px; + padding-bottom: 0px; + margin: 0px; + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +div.line:after { + content:"\000A"; + white-space: pre; +} + +div.line.glow { + background-color: cyan; + box-shadow: 0 0 10px cyan; +} + +span.fold { + margin-left: 5px; + margin-right: 1px; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; + display: inline-block; + width: 12px; + height: 12px; + background-repeat:no-repeat; + background-position:center; +} + +span.lineno { + padding-right: 4px; + margin-right: 9px; + text-align: right; + border-right: 2px solid #00FF00; + color: black; + background-color: #E8E8E8; + white-space: pre; +} +span.lineno a, span.lineno a:visited { + color: #1956D0; + background-color: #D8D8D8; +} + +span.lineno a:hover { + color: #1956D0; + background-color: #C8C8C8; +} + +.lineno { + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +div.classindex ul { + list-style: none; + padding-left: 0; +} + +div.classindex span.ai { + display: inline-block; +} + +div.groupHeader { + margin-left: 16px; + margin-top: 12px; + font-weight: bold; +} + +div.groupText { + margin-left: 16px; + font-style: italic; +} + +body { + color: black; + margin: 0; +} + +div.contents { + margin-top: 10px; + margin-left: 12px; + margin-right: 8px; +} + +p.formulaDsp { + text-align: center; +} + +img.dark-mode-visible { + display: none; +} +img.light-mode-visible { + display: none; +} + +img.formulaInl, img.inline { + vertical-align: middle; +} + +div.center { + text-align: center; + margin-top: 0px; + margin-bottom: 0px; + padding: 0px; +} + +div.center img { + border: 0px; +} + +address.footer { + text-align: right; + padding-right: 12px; +} + +img.footer { + border: 0px; + vertical-align: middle; + width: 104px; +} + +.compoundTemplParams { + color: #1956D0; + font-size: 80%; + line-height: 120%; +} + +/* @group Code Colorization */ + +span.keyword { + color: #008000; +} + +span.keywordtype { + color: #604020; +} + +span.keywordflow { + color: #E08000; +} + +span.comment { + color: #800000; +} + +span.preprocessor { + color: #806020; +} + +span.stringliteral { + color: #002080; +} + +span.charliteral { + color: #008080; +} + +span.xmlcdata { + color: black; +} + +span.vhdldigit { + color: #FF00FF; +} + +span.vhdlchar { + color: #000000; +} + +span.vhdlkeyword { + color: #700070; +} + +span.vhdllogic { + color: #FF0000; +} + +blockquote { + background-color: #F4F7FD; + border-left: 2px solid #80A5EF; + margin: 0 24px 0 4px; + padding: 0 12px 0 16px; +} + +/* @end */ + +td.tiny { + font-size: 75%; +} + +.dirtab { + padding: 4px; + border-collapse: collapse; + border: 1px solid #103785; +} + +th.dirtab { + background-color: #1343A3; + color: #FFFFFE; + font-weight: bold; +} + +hr { + height: 0px; + border: none; + border-top: 1px solid #1A5ADA; +} + +hr.footer { + height: 1px; +} + +/* @group Member Descriptions */ + +table.memberdecls { + border-spacing: 0px; + padding: 0px; +} + +.memberdecls td, .fieldtable tr { + -webkit-transition-property: background-color, box-shadow; + -webkit-transition-duration: 0.5s; + -moz-transition-property: background-color, box-shadow; + -moz-transition-duration: 0.5s; + -ms-transition-property: background-color, box-shadow; + -ms-transition-duration: 0.5s; + -o-transition-property: background-color, box-shadow; + -o-transition-duration: 0.5s; + transition-property: background-color, box-shadow; + transition-duration: 0.5s; +} + +.memberdecls td.glow, .fieldtable tr.glow { + background-color: cyan; + box-shadow: 0 0 15px cyan; +} + +.mdescLeft, .mdescRight, +.memItemLeft, .memItemRight, +.memTemplItemLeft, .memTemplItemRight, .memTemplParams { + background-color: #F7F9FE; + border: none; + margin: 4px; + padding: 1px 0 0 8px; +} + +.mdescLeft, .mdescRight { + padding: 0px 8px 4px 8px; + color: #555; +} + +.memSeparator { + border-bottom: 1px solid #D5E1F9; + line-height: 1px; + margin: 0px; + padding: 0px; +} + +.memItemLeft, .memTemplItemLeft { + white-space: nowrap; +} + +.memItemRight, .memTemplItemRight { + width: 100%; +} + +.memTemplParams { + color: #1956D0; + white-space: nowrap; + font-size: 80%; +} + +/* @end */ + +/* @group Member Details */ + +/* Styles for detailed member documentation */ + +.memtitle { + padding: 8px; + border-top: 1px solid #90B0F1; + border-left: 1px solid #90B0F1; + border-right: 1px solid #90B0F1; + border-top-right-radius: 4px; + border-top-left-radius: 4px; + margin-bottom: -1px; + background-image: url('nav_f.png'); + background-repeat: repeat-x; + background-color: #DAE5FA; + line-height: 1.25; + font-weight: 300; + float:left; +} + +.permalink +{ + font-size: 65%; + display: inline-block; + vertical-align: middle; +} + +.memtemplate { + font-size: 80%; + color: #1956D0; + font-weight: normal; + margin-left: 9px; +} + +.mempage { + width: 100%; +} + +.memitem { + padding: 0; + margin-bottom: 10px; + margin-right: 5px; + -webkit-transition: box-shadow 0.5s linear; + -moz-transition: box-shadow 0.5s linear; + -ms-transition: box-shadow 0.5s linear; + -o-transition: box-shadow 0.5s linear; + transition: box-shadow 0.5s linear; + display: table !important; + width: 100%; +} + +.memitem.glow { + box-shadow: 0 0 15px cyan; +} + +.memname { + font-weight: 400; + margin-left: 6px; +} + +.memname td { + vertical-align: bottom; +} + +.memproto, dl.reflist dt { + border-top: 1px solid #90B0F1; + border-left: 1px solid #90B0F1; + border-right: 1px solid #90B0F1; + padding: 6px 0px 6px 0px; + color: #0D2D6D; + font-weight: bold; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + background-color: #D6E2FA; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + border-top-right-radius: 4px; +} + +.overload { + font-family: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; + font-size: 65%; +} + +.memdoc, dl.reflist dd { + border-bottom: 1px solid #90B0F1; + border-left: 1px solid #90B0F1; + border-right: 1px solid #90B0F1; + padding: 6px 10px 2px 10px; + border-top-width: 0; + background-image:url('nav_g.png'); + background-repeat:repeat-x; + background-color: white; + /* opera specific markup */ + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); + /* firefox specific markup */ + -moz-border-radius-bottomleft: 4px; + -moz-border-radius-bottomright: 4px; + -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px; + /* webkit specific markup */ + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +dl.reflist dt { + padding: 5px; +} + +dl.reflist dd { + margin: 0px 0px 10px 0px; + padding: 5px; +} + +.paramkey { + text-align: right; +} + +.paramtype { + white-space: nowrap; + padding: 0px; + padding-bottom: 1px; +} + +.paramname { + white-space: nowrap; + padding: 0px; + padding-bottom: 1px; + margin-left: 2px; +} + +.paramname em { + color: #602020; + font-style: normal; + margin-right: 1px; +} + +.paramname .paramdefval { + font-family: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; +} + +.params, .retval, .exception, .tparams { + margin-left: 0px; + padding-left: 0px; +} + +.params .paramname, .retval .paramname, .tparams .paramname, .exception .paramname { + font-weight: bold; + vertical-align: top; +} + +.params .paramtype, .tparams .paramtype { + font-style: italic; + vertical-align: top; +} + +.params .paramdir, .tparams .paramdir { + font-family: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; + vertical-align: top; +} + +table.mlabels { + border-spacing: 0px; +} + +td.mlabels-left { + width: 100%; + padding: 0px; +} + +td.mlabels-right { + vertical-align: bottom; + padding: 0px; + white-space: nowrap; +} + +span.mlabels { + margin-left: 8px; +} + +span.mlabel { + background-color: #4B7FE9; + border-top:1px solid #2363E4; + border-left:1px solid #2363E4; + border-right:1px solid #B4CAF6; + border-bottom:1px solid #B4CAF6; + text-shadow: none; + color: white; + margin-right: 4px; + padding: 2px 3px; + border-radius: 3px; + font-size: 7pt; + white-space: nowrap; + vertical-align: middle; +} + + + +/* @end */ + +/* these are for tree view inside a (index) page */ + +div.directory { + margin: 10px 0px; + border-top: 1px solid #80A5EF; + border-bottom: 1px solid #80A5EF; + width: 100%; +} + +.directory table { + border-collapse:collapse; +} + +.directory td { + margin: 0px; + padding: 0px; + vertical-align: top; +} + +.directory td.entry { + white-space: nowrap; + padding-right: 6px; + padding-top: 3px; +} + +.directory td.entry a { + outline:none; +} + +.directory td.entry a img { + border: none; +} + +.directory td.desc { + width: 100%; + padding-left: 6px; + padding-right: 6px; + padding-top: 3px; + border-left: 1px solid rgba(0,0,0,0.05); +} + +.directory tr.odd { + padding-left: 6px; + background-color: #F6F8FD; +} + +.directory tr.even { + padding-left: 6px; + background-color: white; +} + +.directory img { + vertical-align: -30%; +} + +.directory .levels { + white-space: nowrap; + width: 100%; + text-align: right; + font-size: 9pt; +} + +.directory .levels span { + cursor: pointer; + padding-left: 2px; + padding-right: 2px; + color: #154AB3; +} + +.arrow { + color: #80A5EF; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; + font-size: 80%; + display: inline-block; + width: 16px; + height: 22px; +} + +.icon { + font-family: Arial,Helvetica; + line-height: normal; + font-weight: bold; + font-size: 12px; + height: 14px; + width: 16px; + display: inline-block; + background-color: #4B7FE9; + color: white; + text-align: center; + border-radius: 4px; + margin-left: 2px; + margin-right: 2px; +} + +.icona { + width: 24px; + height: 22px; + display: inline-block; +} + +.iconfopen { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('folderopen.svg'); + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.iconfclosed { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('folderclosed.svg'); + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +.icondoc { + width: 24px; + height: 18px; + margin-bottom: 4px; + background-image:url('doc.svg'); + background-position: 0px -4px; + background-repeat: repeat-y; + vertical-align:top; + display: inline-block; +} + +/* @end */ + +div.dynheader { + margin-top: 8px; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +address { + font-style: normal; + color: #0F337D; +} + +table.doxtable caption { + caption-side: top; +} + +table.doxtable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.doxtable td, table.doxtable th { + border: 1px solid #103785; + padding: 3px 7px 2px; +} + +table.doxtable th { + background-color: #1343A3; + color: #FFFFFE; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +table.fieldtable { + margin-bottom: 10px; + border: 1px solid #90B0F1; + border-spacing: 0px; + border-radius: 4px; + box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.15); +} + +.fieldtable td, .fieldtable th { + padding: 3px 7px 2px; +} + +.fieldtable td.fieldtype, .fieldtable td.fieldname, .fieldtable td.fieldinit { + white-space: nowrap; + border-right: 1px solid #90B0F1; + border-bottom: 1px solid #90B0F1; + vertical-align: top; +} + +.fieldtable td.fieldname { + padding-top: 3px; +} + +.fieldtable td.fieldinit { + padding-top: 3px; + text-align: right; +} + + +.fieldtable td.fielddoc { + border-bottom: 1px solid #90B0F1; +} + +.fieldtable td.fielddoc p:first-child { + margin-top: 0px; +} + +.fieldtable td.fielddoc p:last-child { + margin-bottom: 2px; +} + +.fieldtable tr:last-child td { + border-bottom: none; +} + +.fieldtable th { + background-image: url('nav_f.png'); + background-repeat:repeat-x; + background-color: #DAE5FA; + font-size: 90%; + color: #0D2D6D; + padding-bottom: 4px; + padding-top: 5px; + text-align:left; + font-weight: 400; + border-top-left-radius: 4px; + border-top-right-radius: 4px; + border-bottom: 1px solid #90B0F1; +} + + +.tabsearch { + top: 0px; + left: 10px; + height: 36px; + background-image: url('tab_b.png'); + z-index: 101; + overflow: hidden; + font-size: 13px; +} + +.navpath ul +{ + font-size: 11px; + background-image: url('tab_b.png'); + background-repeat:repeat-x; + background-position: 0 -5px; + height:30px; + line-height:30px; + color:#0E3177; + border:solid 1px #B1C8F5; + overflow:hidden; + margin:0px; + padding:0px; +} + +.navpath li +{ + list-style-type:none; + float:left; + padding-left:10px; + padding-right:15px; + background-image:url('bc_s.png'); + background-repeat:no-repeat; + background-position:right; + color: #13429F; +} + +.navpath li.navelem a +{ + height:32px; + display:block; + outline: none; + color: #0E3177; + font-family: 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; + text-shadow: 0px 1px 1px rgba(255, 255, 255, 0.9); + text-decoration: none; +} + +.navpath li.navelem a:hover +{ + color: white; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +} + +.navpath li.footer +{ + list-style-type:none; + float:right; + padding-left:10px; + padding-right:15px; + background-image:none; + background-repeat:no-repeat; + background-position:right; + color: #0F337D; + font-size: 8pt; +} + + +div.summary +{ + float: right; + font-size: 8pt; + padding-right: 5px; + width: 50%; + text-align: right; +} + +div.summary a +{ + white-space: nowrap; +} + +table.classindex +{ + margin: 10px; + white-space: nowrap; + margin-left: 3%; + margin-right: 3%; + width: 94%; + border: 0; + border-spacing: 0; + padding: 0; +} + +div.ingroups +{ + font-size: 8pt; + width: 50%; + text-align: left; +} + +div.ingroups a +{ + white-space: nowrap; +} + +div.header +{ + background-image: url('nav_h.png'); + background-repeat:repeat-x; + background-color: #F7F9FE; + margin: 0px; + border-bottom: 1px solid #B4CAF6; +} + +div.headertitle +{ + padding: 5px 5px 5px 10px; +} + +.PageDocRTL-title div.headertitle { + text-align: right; + direction: rtl; +} + +dl { + padding: 0 0 0 0; +} + +/* + +dl.section { + margin-left: 0px; + padding-left: 0px; +} + +dl.note { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #D0C000; +} + +dl.warning, dl.attention, dl.important { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #FF0000; +} + +dl.pre, dl.post, dl.invariant { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #00D000; +} + +dl.deprecated { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #505050; +} + +dl.todo { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #00C0E0; +} + +dl.test { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #3030E0; +} + +dl.bug { + margin-left: -7px; + padding-left: 3px; + border-left: 4px solid; + border-color: #C08050; +} + +*/ + +dl.bug dt a, dl.deprecated dt a, dl.todo dt a, dl.test a { + font-weight: bold !important; +} + +dl.warning, dl.attention, dl.important, dl.note, dl.deprecated, dl.bug, +dl.invariant, dl.pre, dl.post, dl.todo, dl.test, dl.remark { + padding: 10px; + margin: 10px 0px; + overflow: hidden; + margin-left: 0; + border-radius: 4px; +} + +dl.section dd { + margin-bottom: 2px; +} + +dl.warning, dl.attention, dl.important { + background: #f8d1cc; + border-left: 8px solid #b61825; + color: #75070f; +} + +dl.warning dt, dl.attention dt, dl.important dt { + color: #b61825; +} + +dl.note, dl.remark { + background: #faf3d8; + border-left: 8px solid #f3a600; + color: #5f4204; +} + +dl.note dt, dl.remark dt { + color: #f3a600; +} + +dl.todo { + background: #e4f3ff; + border-left: 8px solid #1879C4; + color: #274a5c; +} + +dl.todo dt { + color: #1879C4; +} + +dl.test { + background: #e8e8ff; + border-left: 8px solid #3939C4; + color: #1a1a5c; +} + +dl.test dt { + color: #3939C4; +} + +dl.bug dt a { + color: #5b2bdd !important; +} + +dl.bug { + background: #e4dafd; + border-left: 8px solid #5b2bdd; + color: #2a0d72; +} + +dl.bug dt a { + color: #5b2bdd !important; +} + +dl.deprecated { + background: #ecf0f3; + border-left: 8px solid #5b6269; + color: #43454a; +} + +dl.deprecated dt a { + color: #5b6269 !important; +} + +dl.note dd, dl.warning dd, dl.pre dd, dl.post dd, +dl.remark dd, dl.attention dd, dl.important dd, dl.invariant dd, +dl.bug dd, dl.deprecated dd, dl.todo dd, dl.test dd { + margin-inline-start: 0px; +} + +dl.invariant, dl.pre, dl.post { + background: #d8f1e3; + border-left: 8px solid #44b86f; + color: #265532; +} + +dl.invariant dt, dl.pre dt, dl.post dt { + color: #44b86f; +} + + +#projectrow +{ + height: 56px; +} + +#projectlogo +{ + text-align: center; + vertical-align: bottom; + border-collapse: separate; +} + +#projectlogo img +{ + border: 0px none; +} + +#projectalign +{ + vertical-align: middle; + padding-left: 0.5em; +} + +#projectname +{ + font-size: 200%; + font-family: Tahoma,Arial,sans-serif; + margin: 0px; + padding: 2px 0px; +} + +#projectbrief +{ + font-size: 90%; + font-family: Tahoma,Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#projectnumber +{ + font-size: 50%; + font-family: 50% Tahoma,Arial,sans-serif; + margin: 0px; + padding: 0px; +} + +#titlearea +{ + padding: 0px; + margin: 0px; + width: 100%; + border-bottom: 1px solid #2363E4; + background-color: white; +} + +.image +{ + text-align: center; +} + +.dotgraph +{ + text-align: center; +} + +.mscgraph +{ + text-align: center; +} + +.plantumlgraph +{ + text-align: center; +} + +.diagraph +{ + text-align: center; +} + +.caption +{ + font-weight: bold; +} + +dl.citelist { + margin-bottom:50px; +} + +dl.citelist dt { + color:#123E96; + float:left; + font-weight:bold; + margin-right:10px; + padding:5px; + text-align:right; + width:52px; +} + +dl.citelist dd { + margin:2px 0 2px 72px; + padding:5px 0; +} + +div.toc { + padding: 14px 25px; + background-color: #F2F5FD; + border: 1px solid #CDDCF9; + border-radius: 7px 7px 7px 7px; + float: right; + height: auto; + margin: 0 8px 10px 10px; + width: 200px; +} + +div.toc li { + background: url("data:image/svg+xml;utf8,&%238595;") no-repeat scroll 0 5px transparent; + font: 10px/1.2 Verdana,'DejaVu Sans',Geneva,sans-serif; + margin-top: 5px; + padding-left: 10px; + padding-top: 2px; +} + +div.toc h3 { + font: bold 12px/1.2 Verdana,'DejaVu Sans',Geneva,sans-serif; + color: #1956D0; + border-bottom: 0 none; + margin: 0; +} + +div.toc ul { + list-style: none outside none; + border: medium none; + padding: 0px; +} + +div.toc li[class^='level'] { + margin-left: 15px; +} + +div.toc li.level1 { + margin-left: 0px; +} + +div.toc li.empty { + background-image: none; + margin-top: 0px; +} + +span.emoji { + /* font family used at the site: https://unicode.org/emoji/charts/full-emoji-list.html + * font-family: "Noto Color Emoji", "Apple Color Emoji", "Segoe UI Emoji", Times, Symbola, Aegyptus, Code2000, Code2001, Code2002, Musica, serif, LastResort; + */ +} + +span.obfuscator { + display: none; +} + +.inherit_header { + font-weight: bold; + color: gray; + cursor: pointer; + -webkit-touch-callout: none; + -webkit-user-select: none; + -khtml-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; +} + +.inherit_header td { + padding: 6px 0px 2px 5px; +} + +.inherit { + display: none; +} + +tr.heading h2 { + margin-top: 12px; + margin-bottom: 4px; +} + +/* tooltip related style info */ + +.ttc { + position: absolute; + display: none; +} + +#powerTip { + cursor: default; + /*white-space: nowrap;*/ + color: black; + background-color: white; + border: 1px solid gray; + border-radius: 4px 4px 4px 4px; + box-shadow: 1px 1px 7px gray; + display: none; + font-size: smaller; + max-width: 80%; + opacity: 0.9; + padding: 1ex 1em 1em; + position: absolute; + z-index: 2147483647; +} + +#powerTip div.ttdoc { + color: grey; + font-style: italic; +} + +#powerTip div.ttname a { + font-weight: bold; +} + +#powerTip a { + color: #1956D0; +} + +#powerTip div.ttname { + font-weight: bold; +} + +#powerTip div.ttdeci { + color: #006318; +} + +#powerTip div { + margin: 0px; + padding: 0px; + font-size: 12px; + font-family: Roboto,sans-serif; + line-height: 16px; +} + +#powerTip:before, #powerTip:after { + content: ""; + position: absolute; + margin: 0px; +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.s:after, #powerTip.s:before, +#powerTip.w:after, #powerTip.w:before, +#powerTip.e:after, #powerTip.e:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.nw:after, #powerTip.nw:before, +#powerTip.sw:after, #powerTip.sw:before { + border: solid transparent; + content: " "; + height: 0; + width: 0; + position: absolute; +} + +#powerTip.n:after, #powerTip.s:after, +#powerTip.w:after, #powerTip.e:after, +#powerTip.nw:after, #powerTip.ne:after, +#powerTip.sw:after, #powerTip.se:after { + border-color: rgba(255, 255, 255, 0); +} + +#powerTip.n:before, #powerTip.s:before, +#powerTip.w:before, #powerTip.e:before, +#powerTip.nw:before, #powerTip.ne:before, +#powerTip.sw:before, #powerTip.se:before { + border-color: rgba(128, 128, 128, 0); +} + +#powerTip.n:after, #powerTip.n:before, +#powerTip.ne:after, #powerTip.ne:before, +#powerTip.nw:after, #powerTip.nw:before { + top: 100%; +} + +#powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after { + border-top-color: white; + border-width: 10px; + margin: 0px -10px; +} +#powerTip.n:before, #powerTip.ne:before, #powerTip.nw:before { + border-top-color: gray; + border-width: 11px; + margin: 0px -11px; +} +#powerTip.n:after, #powerTip.n:before { + left: 50%; +} + +#powerTip.nw:after, #powerTip.nw:before { + right: 14px; +} + +#powerTip.ne:after, #powerTip.ne:before { + left: 14px; +} + +#powerTip.s:after, #powerTip.s:before, +#powerTip.se:after, #powerTip.se:before, +#powerTip.sw:after, #powerTip.sw:before { + bottom: 100%; +} + +#powerTip.s:after, #powerTip.se:after, #powerTip.sw:after { + border-bottom-color: white; + border-width: 10px; + margin: 0px -10px; +} + +#powerTip.s:before, #powerTip.se:before, #powerTip.sw:before { + border-bottom-color: gray; + border-width: 11px; + margin: 0px -11px; +} + +#powerTip.s:after, #powerTip.s:before { + left: 50%; +} + +#powerTip.sw:after, #powerTip.sw:before { + right: 14px; +} + +#powerTip.se:after, #powerTip.se:before { + left: 14px; +} + +#powerTip.e:after, #powerTip.e:before { + left: 100%; +} +#powerTip.e:after { + border-left-color: gray; + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.e:before { + border-left-color: gray; + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +#powerTip.w:after, #powerTip.w:before { + right: 100%; +} +#powerTip.w:after { + border-right-color: gray; + border-width: 10px; + top: 50%; + margin-top: -10px; +} +#powerTip.w:before { + border-right-color: gray; + border-width: 11px; + top: 50%; + margin-top: -11px; +} + +@media print +{ + #top { display: none; } + #side-nav { display: none; } + #nav-path { display: none; } + body { overflow:visible; } + h1, h2, h3, h4, h5, h6 { page-break-after: avoid; } + .summary { display: none; } + .memitem { page-break-inside: avoid; } + #doc-content + { + margin-left:0 !important; + height:auto !important; + width:auto !important; + overflow:inherit; + display:inline; + } +} + +/* @group Markdown */ + +table.markdownTable { + border-collapse:collapse; + margin-top: 4px; + margin-bottom: 4px; +} + +table.markdownTable td, table.markdownTable th { + border: 1px solid #103785; + padding: 3px 7px 2px; +} + +table.markdownTable tr { +} + +th.markdownTableHeadLeft, th.markdownTableHeadRight, th.markdownTableHeadCenter, th.markdownTableHeadNone { + background-color: #1343A3; + color: #FFFFFE; + font-size: 110%; + padding-bottom: 4px; + padding-top: 5px; +} + +th.markdownTableHeadLeft, td.markdownTableBodyLeft { + text-align: left +} + +th.markdownTableHeadRight, td.markdownTableBodyRight { + text-align: right +} + +th.markdownTableHeadCenter, td.markdownTableBodyCenter { + text-align: center +} + +tt, code, kbd, samp +{ + display: inline-block; +} +/* @end */ + +u { + text-decoration: underline; +} + +details>summary { + list-style-type: none; +} + +details > summary::-webkit-details-marker { + display: none; +} + +details>summary::before { + content: "\25ba"; + padding-right:4px; + font-size: 80%; +} + +details[open]>summary::before { + content: "\25bc"; + padding-right:4px; + font-size: 80%; +} + diff --git a/doxygen.svg b/doxygen.svg new file mode 100644 index 000000000..6f144f30b --- /dev/null +++ b/doxygen.svg @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/doxygen_crawl.html b/doxygen_crawl.html new file mode 100644 index 000000000..abce9ec17 --- /dev/null +++ b/doxygen_crawl.html @@ -0,0 +1,3910 @@ + + + +Validator / crawler helper + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dropdown__custom_8cpp.html b/dropdown__custom_8cpp.html new file mode 100644 index 000000000..5331a83a6 --- /dev/null +++ b/dropdown__custom_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: dropdown_custom.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
dropdown_custom.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 11 of file dropdown_custom.cpp.

+ +
+
+
+
+ + + + + diff --git a/dropdown__custom_8cpp.js b/dropdown__custom_8cpp.js new file mode 100644 index 000000000..508aa3708 --- /dev/null +++ b/dropdown__custom_8cpp.js @@ -0,0 +1,4 @@ +var dropdown__custom_8cpp = +[ + [ "main", "dropdown__custom_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/dropdown__custom_8cpp_source.html b/dropdown__custom_8cpp_source.html new file mode 100644 index 000000000..eb8c44d18 --- /dev/null +++ b/dropdown__custom_8cpp_source.html @@ -0,0 +1,322 @@ + + + + + + + + +FTXUI: dropdown_custom.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
dropdown_custom.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <string> // for basic_string, string, allocator
+
5#include <vector> // for vector
+
6
+
7#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
8#include "ftxui/component/component.hpp" // for Dropdown, Horizontal, Vertical
+
9#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
10
+
+
11int main() {
+
12 using namespace ftxui;
+
13
+
14 std::vector<std::string> entries = {
+
15 "tribute", "clearance", "ally", "bend", "electronics",
+
16 "module", "era", "cultural", "sniff", "nationalism",
+
17 "negotiation", "deliver", "figure", "east", "tribute",
+
18 "clearance", "ally", "bend", "electronics", "module",
+
19 "era", "cultural", "sniff", "nationalism", "negotiation",
+
20 "deliver", "figure", "east", "tribute", "clearance",
+
21 "ally", "bend", "electronics", "module", "era",
+
22 "cultural", "sniff", "nationalism", "negotiation", "deliver",
+
23 "figure", "east",
+
24 };
+
25
+
26 auto dropdown_1 = Dropdown({
+
27 .radiobox = {.entries = &entries},
+
28 .transform =
+
29 [](bool open, Element checkbox, Element radiobox) {
+
30 if (open) {
+
31 return vbox({
+
32 checkbox | inverted,
+
33 radiobox | vscroll_indicator | frame |
+
34 size(HEIGHT, LESS_THAN, 10),
+
35 filler(),
+
36 });
+
37 }
+
38 return vbox({
+
39 checkbox,
+
40 filler(),
+
41 });
+
42 },
+
43 });
+
44
+
45 auto dropdown_2 = Dropdown({
+
46 .radiobox = {.entries = &entries},
+
47 .transform =
+
48 [](bool open, Element checkbox, Element radiobox) {
+
49 if (open) {
+
50 return vbox({
+
51 checkbox | inverted,
+
52 radiobox | vscroll_indicator | frame |
+
53 size(HEIGHT, LESS_THAN, 10) | bgcolor(Color::Blue),
+
54 filler(),
+
55 });
+
56 }
+
57 return vbox({
+
58 checkbox | bgcolor(Color::Blue),
+
59 filler(),
+
60 });
+
61 },
+
62 });
+
63
+
64 auto dropdown_3 = Dropdown({
+
65 .radiobox =
+
66 {
+
67 .entries = &entries,
+
68 .transform =
+
69 [](const EntryState& s) {
+
70 auto t = text(s.label) | borderEmpty;
+
71 if (s.active) {
+
72 t |= bold;
+
73 }
+
74 if (s.focused) {
+
75 t |= inverted;
+
76 }
+
77 return t;
+
78 },
+
79 },
+
80 .transform =
+
81 [](bool open, Element checkbox, Element radiobox) {
+
82 checkbox |= borderEmpty;
+
83 if (open) {
+
84 return vbox({
+
85 checkbox | inverted,
+
86 radiobox | vscroll_indicator | frame |
+
87 size(HEIGHT, LESS_THAN, 20) | bgcolor(Color::Red),
+
88 filler(),
+
89 });
+
90 }
+
91 return vbox({
+
92 checkbox | bgcolor(Color::Red),
+
93 filler(),
+
94 });
+
95 },
+
96 });
+
97
+
98 auto screen = ScreenInteractive::FitComponent();
+
99 screen.Loop(Container::Horizontal({
+
100 dropdown_1,
+
101 dropdown_2,
+
102 dropdown_3,
+
103 }));
+
104}
+
+ + +
int main()
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+ +
arguments for transform from |ButtonOption|, |CheckboxOption|, |RadioboxOption|, |MenuEntryOption|,...
+
+
+ + + + + diff --git a/dynsections.js b/dynsections.js new file mode 100644 index 000000000..0c3560522 --- /dev/null +++ b/dynsections.js @@ -0,0 +1,205 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ + +function toggleVisibility(linkObj) { + return dynsection.toggleVisibility(linkObj); +} + +let dynsection = { + + // helper function + updateStripes : function() { + $('table.directory tr'). + removeClass('even').filter(':visible:even').addClass('even'); + $('table.directory tr'). + removeClass('odd').filter(':visible:odd').addClass('odd'); + }, + + toggleVisibility : function(linkObj) { + const base = $(linkObj).attr('id'); + const summary = $('#'+base+'-summary'); + const content = $('#'+base+'-content'); + const trigger = $('#'+base+'-trigger'); + const src=$(trigger).attr('src'); + if (content.is(':visible')===true) { + content.hide(); + summary.show(); + $(linkObj).addClass('closed').removeClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-8)+'closed.png'); + } else { + content.show(); + summary.hide(); + $(linkObj).removeClass('closed').addClass('opened'); + $(trigger).attr('src',src.substring(0,src.length-10)+'open.png'); + } + return false; + }, + + toggleLevel : function(level) { + $('table.directory tr').each(function() { + const l = this.id.split('_').length-1; + const i = $('#img'+this.id.substring(3)); + const a = $('#arr'+this.id.substring(3)); + if (l'); + // add vertical lines to other rows + $('span[class=lineno]').not(':eq(0)').append(''); + // add toggle controls to lines with fold divs + $('div[class=foldopen]').each(function() { + // extract specific id to use + const id = $(this).attr('id').replace('foldopen',''); + // extract start and end foldable fragment attributes + const start = $(this).attr('data-start'); + const end = $(this).attr('data-end'); + // replace normal fold span with controls for the first line of a foldable fragment + $(this).find('span[class=fold]:first').replaceWith(''); + // append div for folded (closed) representation + $(this).after(''); + // extract the first line from the "open" section to represent closed content + const line = $(this).children().first().clone(); + // remove any glow that might still be active on the original line + $(line).removeClass('glow'); + if (start) { + // if line already ends with a start marker (e.g. trailing {), remove it + $(line).html($(line).html().replace(new RegExp('\\s*'+start+'\\s*$','g'),'')); + } + // replace minus with plus symbol + $(line).find('span[class=fold]').css('background-image',codefold.plusImg[relPath]); + // append ellipsis + $(line).append(' '+start+''+end); + // insert constructed line into closed div + $('#foldclosed'+id).html(line); + }); + }, +}; +/* @license-end */ +$(function() { + $('.code,.codeRef').each(function() { + $(this).data('powertip',$('#a'+$(this).attr('href').replace(/.*\//,'').replace(/[^a-z_A-Z0-9]/g,'_')).html()); + $.fn.powerTip.smartPlacementLists.s = [ 's', 'n', 'ne', 'se' ]; + $(this).powerTip({ placement: 's', smartPlacement: true, mouseOnToPopup: true }); + }); +}); diff --git a/elements_8cppm.html b/elements_8cppm.html new file mode 100644 index 000000000..59073ec60 --- /dev/null +++ b/elements_8cppm.html @@ -0,0 +1,223 @@ + + + + + + + + +FTXUI: elements.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
elements.cppm File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
namespace  ftxui::Dimension
 Define how the Screen's dimensions should look like.
 
+
+
+ + + + + diff --git a/elements_8cppm_source.html b/elements_8cppm_source.html new file mode 100644 index 000000000..99363c0c7 --- /dev/null +++ b/elements_8cppm_source.html @@ -0,0 +1,355 @@ + + + + + + + + +FTXUI: elements.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
elements.cppm
+
+
+Go to the documentation of this file.
1/// @module ftxui.dom.elements
+
2/// @brief Module file for the Element classes and functions of the Dom module
+
3
+
4module;
+
5
+ +
7
+
8export module ftxui.dom.elements;
+
9
+
10/**
+
11 * @namespace ftxui
+
12 * @brief The FTXUI ftxui:: namespace
+
13 */
+
14export namespace ftxui {
+
15 using ftxui::Node;
+
16 using ftxui::Element;
+
17 using ftxui::Elements;
+
18 using ftxui::Decorator;
+ +
20
+ +
22
+
23 using ftxui::operator|;
+
24 using ftxui::operator|=;
+
25
+
26 using ftxui::text;
+
27 using ftxui::vtext;
+
28 using ftxui::separator;
+
29 using ftxui::separatorLight;
+
30 using ftxui::separatorDashed;
+
31 using ftxui::separatorHeavy;
+
32 using ftxui::separatorDouble;
+
33 using ftxui::separatorEmpty;
+
34 using ftxui::separatorStyled;
+
35 using ftxui::separatorCharacter;
+
36 using ftxui::separatorHSelector;
+
37 using ftxui::separatorVSelector;
+
38 using ftxui::gauge;
+
39 using ftxui::gaugeLeft;
+
40 using ftxui::gaugeRight;
+
41 using ftxui::gaugeUp;
+
42 using ftxui::gaugeDown;
+
43 using ftxui::gaugeDirection;
+
44 using ftxui::border;
+
45 using ftxui::borderLight;
+
46 using ftxui::borderDashed;
+
47 using ftxui::borderHeavy;
+
48 using ftxui::borderDouble;
+
49 using ftxui::borderRounded;
+
50 using ftxui::borderEmpty;
+
51 using ftxui::borderStyled;
+
52 using ftxui::borderWith;
+
53 using ftxui::window;
+
54 using ftxui::spinner;
+
55 using ftxui::paragraph;
+
56 using ftxui::paragraphAlignLeft;
+
57 using ftxui::paragraphAlignRight;
+
58 using ftxui::paragraphAlignCenter;
+
59 using ftxui::paragraphAlignJustify;
+
60 using ftxui::graph;
+
61 using ftxui::emptyElement;
+
62 using ftxui::canvas;
+
63
+
64 using ftxui::bold;
+
65 using ftxui::dim;
+
66 using ftxui::italic;
+
67 using ftxui::inverted;
+
68 using ftxui::underlined;
+
69 using ftxui::underlinedDouble;
+
70 using ftxui::blink;
+
71 using ftxui::strikethrough;
+
72 using ftxui::color;
+
73 using ftxui::bgcolor;
+
74 using ftxui::focusPosition;
+
75 using ftxui::focusPositionRelative;
+
76 using ftxui::automerge;
+
77 using ftxui::hyperlink;
+
78 using ftxui::selectionStyleReset;
+
79 using ftxui::selectionColor;
+
80 using ftxui::selectionBackgroundColor;
+
81 using ftxui::selectionForegroundColor;
+
82 using ftxui::selectionStyle;
+
83
+
84 using ftxui::hbox;
+
85 using ftxui::vbox;
+
86 using ftxui::dbox;
+
87 using ftxui::flexbox;
+
88 using ftxui::gridbox;
+
89 using ftxui::hflow;
+
90 using ftxui::vflow;
+
91
+
92 using ftxui::flex;
+
93 using ftxui::flex_grow;
+
94 using ftxui::flex_shrink;
+
95 using ftxui::xflex;
+
96 using ftxui::xflex_grow;
+
97 using ftxui::xflex_shrink;
+
98 using ftxui::yflex;
+
99 using ftxui::yflex_grow;
+
100 using ftxui::yflex_shrink;
+
101 using ftxui::notflex;
+
102 using ftxui::filler;
+
103
+ +
105 using ftxui::Constraint;
+
106 using ftxui::size;
+
107
+
108 using ftxui::frame;
+
109 using ftxui::xframe;
+
110 using ftxui::yframe;
+
111 using ftxui::focus;
+
112 using ftxui::select;
+
113
+
114 using ftxui::focusCursorBlock;
+
115 using ftxui::focusCursorBlockBlinking;
+
116 using ftxui::focusCursorBar;
+
117 using ftxui::focusCursorBarBlinking;
+
118 using ftxui::focusCursorUnderline;
+
119 using ftxui::focusCursorUnderlineBlinking;
+
120
+
121 using ftxui::vscroll_indicator;
+
122 using ftxui::hscroll_indicator;
+
123 using ftxui::reflect;
+
124 using ftxui::clear_under;
+
125
+
126 using ftxui::hcenter;
+
127 using ftxui::vcenter;
+
128 using ftxui::center;
+
129 using ftxui::align_right;
+
130 using ftxui::nothing;
+
131
+
132 namespace Dimension {
+
133 using ftxui::Dimension::Fit;
+
134 }
+
135}
+ +
Node is the base class for all elements in the DOM tree.
Definition node.hpp:37
+
BorderStyle
BorderStyle is an enumeration that represents the different styles of borders that can be applied to ...
Definition elements.hpp:35
+
Module file for the Element classes and functions of the Dom module.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
WidthOrHeight
Definition elements.hpp:161
+
std::function< Element(Element)> Decorator
Definition elements.hpp:24
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+
std::vector< Element > Elements
Definition elements.hpp:23
+
std::function< std::vector< int >(int, int)> GraphFunction
Definition elements.hpp:25
+ +
+
+ + + + + diff --git a/elements_8hpp.html b/elements_8hpp.html new file mode 100644 index 000000000..33f395913 --- /dev/null +++ b/elements_8hpp.html @@ -0,0 +1,608 @@ + + + + + + + + +FTXUI: elements.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
elements.hpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
namespace  ftxui::Dimension
 Define how the Screen's dimensions should look like.
 
+ + + + + + + + + +

+Typedefs

using Element = std::shared_ptr<Node>
 
using Elements = std::vector<Element>
 
using Decorator = std::function<Element(Element)>
 
using GraphFunction = std::function<std::vector<int>(int, int)>
 
+ + + + + + + + +

+Enumerations

enum  BorderStyle {
+  LIGHT +,
+  DASHED +,
+  HEAVY +,
+  DOUBLE +,
+  ROUNDED +,
+  EMPTY +
+ }
 BorderStyle is an enumeration that represents the different styles of borders that can be applied to elements in the terminal UI. More...
 
enum  WidthOrHeight {
+  WIDTH +,
+  HEIGHT +
+ }
 
enum  Constraint {
+  LESS_THAN +,
+  EQUAL +,
+  GREATER_THAN +
+ }
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

Element operator| (Element element, Decorator decorator)
 From an element, apply a decorator.
 
Elementoperator|= (Element &e, Decorator d)
 Apply a decorator to an element.
 
Elements operator| (Elements elements, Decorator decorator)
 From a set of element, apply a decorator to every elements.
 
Decorator operator| (Decorator a, Decorator b)
 Compose two decorator into one.
 
Element text (std::string text)
 Display a piece of UTF8 encoded unicode text.
 
Element vtext (std::string text)
 Display a piece of unicode text vertically.
 
Element separator ()
 Draw a vertical or horizontal separation in between two other elements.
 
Element separatorLight ()
 Draw a vertical or horizontal separation in between two other elements, using the LIGHT style.
 
Element separatorDashed ()
 Draw a vertical or horizontal separation in between two other elements, using the DASHED style.
 
Element separatorHeavy ()
 Draw a vertical or horizontal separation in between two other elements, using the HEAVY style.
 
Element separatorDouble ()
 Draw a vertical or horizontal separation in between two other elements, using the DOUBLE style.
 
Element separatorEmpty ()
 Draw a vertical or horizontal separation in between two other elements, using the EMPTY style.
 
Element separatorStyled (BorderStyle style)
 Draw a vertical or horizontal separation in between two other elements.
 
Element separator (Pixel pixel)
 Draw a separator in between two element filled with a given pixel.
 
Element separatorCharacter (std::string value)
 Draw a vertical or horizontal separation in between two other elements.
 
Element separatorHSelector (float left, float right, Color unselected_color, Color selected_color)
 Draw a horizontal bar, with the area in between left/right colored differently.
 
Element separatorVSelector (float up, float down, Color unselected_color, Color selected_color)
 Draw an vertical bar, with the area in between up/downcolored differently.
 
Element gauge (float progress)
 Draw a high definition progress bar.
 
Element gaugeLeft (float progress)
 Draw a high definition progress bar progressing from right to left.
 
Element gaugeRight (float progress)
 Draw a high definition progress bar progressing from left to right.
 
Element gaugeUp (float progress)
 Draw a high definition progress bar progressing from bottom to top.
 
Element gaugeDown (float progress)
 Draw a high definition progress bar progressing from top to bottom.
 
Element gaugeDirection (float progress, Direction direction)
 Draw a high definition progress bar progressing in specified direction.
 
Element border (Element child)
 Draw a border around the element.
 
Element borderLight (Element child)
 Draw a light border around the element.
 
Element borderDashed (Element child)
 Draw a dashed border around the element.
 
Element borderHeavy (Element child)
 Draw a heavy border around the element.
 
Element borderDouble (Element child)
 Draw a double border around the element.
 
Element borderRounded (Element child)
 Draw a rounded border around the element.
 
Element borderEmpty (Element child)
 Draw an empty border around the element.
 
Decorator borderStyled (BorderStyle style)
 Same as border but with different styles.
 
Decorator borderStyled (BorderStyle style, Color foreground_color)
 Same as border but with a foreground color and a different style.
 
Decorator borderStyled (Color foreground_color)
 Same as border but with a foreground color.
 
Decorator borderWith (const Pixel &pixel)
 Same as border but with a constant Pixel around the element.
 
Element window (Element title, Element content, BorderStyle border)
 Draw window with a title and a border around the element.
 
Element spinner (int charset_index, size_t image_index)
 Useful to represent the effect of time and/or events. This displays an ASCII art "video".
 
Element paragraph (const std::string &the_text)
 Return an element drawing the paragraph on multiple lines.
 
Element paragraphAlignLeft (const std::string &the_text)
 Return an element drawing the paragraph on multiple lines, aligned on the left.
 
Element paragraphAlignRight (const std::string &the_text)
 Return an element drawing the paragraph on multiple lines, aligned on the right.
 
Element paragraphAlignCenter (const std::string &the_text)
 Return an element drawing the paragraph on multiple lines, aligned on the center.
 
Element paragraphAlignJustify (const std::string &the_text)
 Return an element drawing the paragraph on multiple lines, aligned using a justified alignment. the center.
 
Element graph (GraphFunction graph_function)
 Draw a graph using a GraphFunction.
 
Element emptyElement ()
 
Element canvas (ConstRef< Canvas > canvas)
 Produce an element from a Canvas, or a reference to a Canvas.
 
Element canvas (int width, int height, std::function< void(Canvas &)> fn)
 Produce an element drawing a canvas of requested size.
 
Element canvas (std::function< void(Canvas &)> fn)
 Produce an element drawing a canvas.
 
Element bold (Element child)
 Use a bold font, for elements with more emphasis.
 
Element dim (Element child)
 Use a light font, for elements with less emphasis.
 
Element italic (Element child)
 Apply a underlinedDouble to text.
 
Element inverted (Element child)
 Add a filter that will invert the foreground and the background colors.
 
Element underlined (Element child)
 Underline the given element.
 
Element underlinedDouble (Element child)
 Apply a underlinedDouble to text.
 
Element blink (Element child)
 The text drawn alternates in between visible and hidden.
 
Element strikethrough (Element child)
 Apply a strikethrough to text.
 
Decorator color (Color c)
 Decorate using a foreground color.
 
Decorator bgcolor (Color color)
 Decorate using a background color.
 
Decorator color (const LinearGradient &gradient)
 Decorate using a linear-gradient effect on the foreground color.
 
Decorator bgcolor (const LinearGradient &gradient)
 Decorate using a linear-gradient effect on the background color.
 
Element color (Color color, Element child)
 Set the foreground color of an element.
 
Element bgcolor (Color color, Element child)
 Set the background color of an element.
 
Element color (const LinearGradient &gradient, Element child)
 Set the foreground color of an element with linear-gradient effect.
 
Element bgcolor (const LinearGradient &gradient, Element child)
 Set the background color of an element with linear-gradient effect.
 
Decorator focusPosition (int x, int y)
 Used inside a frame, this force the view to be scrolled toward a a given position. The position is expressed in the numbers of cells.
 
Decorator focusPositionRelative (float x, float y)
 Used inside a frame, this force the view to be scrolled toward a a given position. The position is expressed in proportion of the requested size.
 
Element automerge (Element child)
 Enable character to be automatically merged with others nearby.
 
Decorator hyperlink (std::string link)
 Decorate using a hyperlink. The link will be opened when the user clicks on it. This is supported only on a limited set of terminal emulators. List: https://github.com/Alhadis/OSC8-Adoption/.
 
Element hyperlink (std::string link, Element child)
 Make the rendered area clickable using a web browser. The link will be opened when the user clicks on it. This is supported only on a limited set of terminal emulators. List: https://github.com/Alhadis/OSC8-Adoption/.
 
Element selectionStyleReset (Element child)
 Reset the selection style of an element.
 
Decorator selectionColor (Color foreground)
 Set the color of an element when selected.
 
Decorator selectionBackgroundColor (Color foreground)
 Set the background color of an element when selected. Note that the style is applied on top of the existing style.
 
Decorator selectionForegroundColor (Color foreground)
 Set the foreground color of an element when selected. Note that the style is applied on top of the existing style.
 
Decorator selectionStyle (std::function< void(Pixel &)> style)
 Set the style of an element when selected.
 
Element hbox (Elements children)
 A container displaying elements horizontally one by one.
 
Element vbox (Elements children)
 A container displaying elements vertically one by one.
 
Element dbox (Elements children_)
 Stack several element on top of each other.
 
Element flexbox (Elements children, FlexboxConfig config)
 A container displaying elements on row/columns and capable of wrapping on the next column/row when full.
 
Element gridbox (std::vector< Elements > lines)
 A container displaying a grid of elements.
 
Element hflow (Elements children)
 A container displaying elements in rows from left to right. When filled, it starts on a new row below.
 
Element vflow (Elements children)
 A container displaying elements in rows from top to bottom. When filled, it starts on a new columns on the right. filled, it starts on a new row. is full, it starts a new row.
 
Element flex (Element child)
 Make a child element to expand proportionally to the space left in a container.
 
Element flex_grow (Element child)
 Expand if possible.
 
Element flex_shrink (Element child)
 Minimize if needed.
 
Element xflex (Element child)
 Expand/Minimize if possible/needed on the X axis.
 
Element xflex_grow (Element child)
 Expand if possible on the X axis.
 
Element xflex_shrink (Element child)
 Minimize if needed on the X axis.
 
Element yflex (Element child)
 Expand/Minimize if possible/needed on the Y axis.
 
Element yflex_grow (Element child)
 Expand if possible on the Y axis.
 
Element yflex_shrink (Element child)
 Minimize if needed on the Y axis.
 
Element notflex (Element child)
 Make the element not flexible.
 
Element filler ()
 An element that will take expand proportionally to the space left in a container.
 
Decorator size (WidthOrHeight direction, Constraint constraint, int value)
 Apply a constraint on the size of an element.
 
Element frame (Element child)
 Allow an element to be displayed inside a 'virtual' area. It size can be larger than its container. In this case only a smaller portion is displayed. The view is scrollable to make the focused element visible.
 
Element xframe (Element child)
 Same as frame, but only on the x-axis.
 
Element yframe (Element child)
 Same as frame, but only on the y-axis.
 
Element focus (Element child)
 Set the child to be the one focused among its siblings.
 
Element select (Element child)
 Set the child to be the one focused among its siblings.
 
Element focusCursorBlock (Element child)
 Same as focus, but set the cursor shape to be a still block.
 
Element focusCursorBlockBlinking (Element child)
 Same as focus, but set the cursor shape to be a blinking block.
 
Element focusCursorBar (Element child)
 Same as focus, but set the cursor shape to be a still block.
 
Element focusCursorBarBlinking (Element child)
 Same as focus, but set the cursor shape to be a blinking bar.
 
Element focusCursorUnderline (Element child)
 Same as focus, but set the cursor shape to be a still underline.
 
Element focusCursorUnderlineBlinking (Element child)
 Same as focus, but set the cursor shape to be a blinking underline.
 
Element vscroll_indicator (Element child)
 Display a vertical scrollbar on the right. Colors follow the content.
 
Element hscroll_indicator (Element child)
 Display a horizontal scrollbar at the bottom. Colors follow the content.
 
Decorator reflect (Box &box)
 
Element clear_under (Element element)
 Before drawing |child|, clear the pixels below. This is useful in combination with dbox.
 
Element hcenter (Element child)
 Center an element horizontally.
 
Element vcenter (Element child)
 Center an element vertically.
 
Element center (Element child)
 Center an element horizontally and vertically.
 
Element align_right (Element child)
 Align an element on the right side.
 
Element nothing (Element element)
 A decoration doing absolutely nothing.
 
Dimensions Fit (Element &, bool extend_beyond_screen=false)
 
+
+
+ + + + + diff --git a/elements_8hpp.js b/elements_8hpp.js new file mode 100644 index 000000000..ca08aeaa5 --- /dev/null +++ b/elements_8hpp.js @@ -0,0 +1,136 @@ +var elements_8hpp = +[ + [ "Element", "elements_8hpp.html#a2bc31f2d685189e5c61d2293a1f51b4f", null ], + [ "Elements", "elements_8hpp.html#a5d4aa06ca6cc6a72e981bd5386f93f0a", null ], + [ "Decorator", "elements_8hpp.html#a164021903e9ac6f1357e4186582891e3", null ], + [ "GraphFunction", "elements_8hpp.html#ab07cb9a766f38fc867f8fe736ce2e6e3", null ], + [ "BorderStyle", "elements_8hpp.html#gafe3103dd0b8240c5443892484ef5af9c", [ + [ "LIGHT", "elements_8hpp.html#ggafe3103dd0b8240c5443892484ef5af9caf917d6c11c85b4ac32e30d1cc9da25eb", null ], + [ "DASHED", "elements_8hpp.html#ggafe3103dd0b8240c5443892484ef5af9ca830310bdfd296d7cd00c59773579b892", null ], + [ "HEAVY", "elements_8hpp.html#ggafe3103dd0b8240c5443892484ef5af9ca34cd68a92c52759ed9b545969a11c2da", null ], + [ "DOUBLE", "elements_8hpp.html#ggafe3103dd0b8240c5443892484ef5af9ca33465d1d419b1074fb259ef444609e92", null ], + [ "ROUNDED", "elements_8hpp.html#ggafe3103dd0b8240c5443892484ef5af9ca655074b92b285adff7d18a45748bf493", null ], + [ "EMPTY", "elements_8hpp.html#ggafe3103dd0b8240c5443892484ef5af9ca2f0d18fc0d0fa4a6cd92dc328501874d", null ] + ] ], + [ "WidthOrHeight", "elements_8hpp.html#a04711c04f28aabfa0e5928a35baaec53", [ + [ "WIDTH", "elements_8hpp.html#a04711c04f28aabfa0e5928a35baaec53a73c0818986b7c462c2977f57afd00522", null ], + [ "HEIGHT", "elements_8hpp.html#a04711c04f28aabfa0e5928a35baaec53a38b9241136017b93ea2755a49cf0a000", null ] + ] ], + [ "Constraint", "elements_8hpp.html#ae09f44b989d381a387329fd0a0935926", [ + [ "LESS_THAN", "elements_8hpp.html#ae09f44b989d381a387329fd0a0935926a41b05932cd237b2b133fff1ade85bed5", null ], + [ "EQUAL", "elements_8hpp.html#ae09f44b989d381a387329fd0a0935926a59a84258a4cb9025b567ee5139455029", null ], + [ "GREATER_THAN", "elements_8hpp.html#ae09f44b989d381a387329fd0a0935926a5fae95457121bd697edd588d1b64cc7c", null ] + ] ], + [ "operator|", "elements_8hpp.html#ga7e9a69f0592b4013bd725d662f4a76e7", null ], + [ "operator|=", "elements_8hpp.html#ga0be26ac5dcbe6c707857c791d8eec720", null ], + [ "operator|", "elements_8hpp.html#ga6cbc84eb24a655ae084b3c7d26f9abfc", null ], + [ "operator|", "elements_8hpp.html#ga027fbc9cf6fef9e86ae6a2a79e8bf23a", null ], + [ "text", "elements_8hpp.html#ga366051704fd333c23460f7932598a5e3", null ], + [ "vtext", "elements_8hpp.html#ga64172a43b4b526afeb6313e6e1a6d5a1", null ], + [ "separator", "elements_8hpp.html#gac1ef1cf6bf7cd0759ffa195071edb2a0", null ], + [ "separatorLight", "elements_8hpp.html#ga37c2b93daf557f68064bc9fbf93ebde0", null ], + [ "separatorDashed", "elements_8hpp.html#ga81f2d3256c0cfbc70f820129286f08c6", null ], + [ "separatorHeavy", "elements_8hpp.html#gaf0649e89a9960f1c2703e48c1817645b", null ], + [ "separatorDouble", "elements_8hpp.html#gadd376830fdb51b0bf52672ef17515989", null ], + [ "separatorEmpty", "elements_8hpp.html#ga1934703e56ab66f6f259b9f8da331f1b", null ], + [ "separatorStyled", "elements_8hpp.html#ga13cb559cfc7e409b3f211f0bb35ea7fa", null ], + [ "separator", "elements_8hpp.html#ga71d9a6a32f65b6d172f9696b3b9579b4", null ], + [ "separatorCharacter", "elements_8hpp.html#ga97a10482d591aade2958da0f2f19b371", null ], + [ "separatorHSelector", "elements_8hpp.html#a50413065cee4757447b35c3a500667d3", null ], + [ "separatorVSelector", "elements_8hpp.html#a1a0211233bacd4eb4d31a8e3d58b5f48", null ], + [ "gauge", "elements_8hpp.html#gae0b8041a60629fd790716038738c93ce", null ], + [ "gaugeLeft", "elements_8hpp.html#ga97898b9f77b3edd330eaef22fce7cf2b", null ], + [ "gaugeRight", "elements_8hpp.html#ga333d781a44885ed4b5ea8444015b86f7", null ], + [ "gaugeUp", "elements_8hpp.html#ga6e9a97b66c14404a2b3f95f4dae414c2", null ], + [ "gaugeDown", "elements_8hpp.html#gafe537f915cac5613261580bae3a8fe33", null ], + [ "gaugeDirection", "elements_8hpp.html#ga1265cc8a52448e1b98d7abe84a04681e", null ], + [ "border", "elements_8hpp.html#gae8537acd423d47cf07e61bd774fb1098", null ], + [ "borderLight", "elements_8hpp.html#gaa074cdab57eeb47b99f1699bcc8addd8", null ], + [ "borderDashed", "elements_8hpp.html#ga181c80f8ada12d1356f6bfa0ebb7219f", null ], + [ "borderHeavy", "elements_8hpp.html#ga666c31419cc31cdadc9f8178ed63529e", null ], + [ "borderDouble", "elements_8hpp.html#ga052b504344f3bc1ff86b3493cd934215", null ], + [ "borderRounded", "elements_8hpp.html#ga3cf2db223a5efaa370f0ca6bb405b80e", null ], + [ "borderEmpty", "elements_8hpp.html#gaf20f7d6fb275d109f0bdc01a2e4d3f3e", null ], + [ "borderStyled", "elements_8hpp.html#gabc9db79957d4dd36deb8ca79938e4c41", null ], + [ "borderStyled", "elements_8hpp.html#ga5aab98b289d2e7b2ce8ca0eeee51ce78", null ], + [ "borderStyled", "elements_8hpp.html#gad1dbf36194dcb77674085df9e11c1e22", null ], + [ "borderWith", "elements_8hpp.html#gaa97cfcfbe6df92dac085454395ec7b2f", null ], + [ "window", "elements_8hpp.html#ga03049def08fa7a5eaa4d5e897152bc1a", null ], + [ "spinner", "elements_8hpp.html#ga3b08e0030a0831d3ec3e2a505908273b", null ], + [ "paragraph", "elements_8hpp.html#ga3f9093ae1a2790d396fc2cff9990fbbd", null ], + [ "paragraphAlignLeft", "elements_8hpp.html#gaa334a836eccc573e1137a1ba29d07d8a", null ], + [ "paragraphAlignRight", "elements_8hpp.html#ga28a69f06a88c89fe7a507e33ab486411", null ], + [ "paragraphAlignCenter", "elements_8hpp.html#ga6a105f6b0d07d7933379ff1ae9282fb8", null ], + [ "paragraphAlignJustify", "elements_8hpp.html#gae4de548aa67ab77cb345e4ddec6b248b", null ], + [ "graph", "elements_8hpp.html#ae78c2b2b147e65701493465f8e3f4d89", null ], + [ "emptyElement", "elements_8hpp.html#ga40451515a5b3049e7a1276cad8b9356c", null ], + [ "canvas", "elements_8hpp.html#a57d7bdf155e190de514a689abb4e9a35", null ], + [ "canvas", "elements_8hpp.html#ac781c6530fb74b861af7d52c03ffb2b9", null ], + [ "canvas", "elements_8hpp.html#a8bef154e558868d259c52380e1e5ead9", null ], + [ "bold", "elements_8hpp.html#ga353c769068e25303eb41fa2da565c604", null ], + [ "dim", "elements_8hpp.html#gac6a3b77604739516e809369810896646", null ], + [ "italic", "elements_8hpp.html#ga8a8d190765de7bbd9e78f9e639c2a96d", null ], + [ "inverted", "elements_8hpp.html#ga672456b8f2091b615a30ff755418b37b", null ], + [ "underlined", "elements_8hpp.html#ga5ad450c97c4d084b64ffb5b5ca942664", null ], + [ "underlinedDouble", "elements_8hpp.html#ga16d1b74107610750276499ddb3dde8da", null ], + [ "blink", "elements_8hpp.html#gad57613de5895e774218d91dea48d074b", null ], + [ "strikethrough", "elements_8hpp.html#ga8594d70f0491def903370e86132fbf01", null ], + [ "color", "elements_8hpp.html#gaf61b489da39ca5e24b68e6e1a2b09c0d", null ], + [ "bgcolor", "elements_8hpp.html#ga01d4c5aaf0447e862246849111782245", null ], + [ "color", "elements_8hpp.html#ga8af6b5a06b03fd53bf30a6b050b96968", null ], + [ "bgcolor", "elements_8hpp.html#gaee41f3eaff28a123214e81231f8f4593", null ], + [ "color", "elements_8hpp.html#gadef6e6e66199153de6d3b21b14dcf868", null ], + [ "bgcolor", "elements_8hpp.html#gaae86eacae0a0626b41e9964ac7f4f532", null ], + [ "color", "elements_8hpp.html#ga050df9c8ed04eec13309d6c0542c636d", null ], + [ "bgcolor", "elements_8hpp.html#gaaac1622d43662a6a02113d9230a4fdd4", null ], + [ "focusPosition", "elements_8hpp.html#ga78447ba1ccb792963ad6d306f4ed1256", null ], + [ "focusPositionRelative", "elements_8hpp.html#ga13befad33cb4125e2143f2af3eddcc71", null ], + [ "automerge", "elements_8hpp.html#gaca42bd6c44d8d366d5c1014330402086", null ], + [ "hyperlink", "elements_8hpp.html#gad0eac58eac9e6cd9a04879b20f8e123b", null ], + [ "hyperlink", "elements_8hpp.html#ga8bacc04e0cbde663ccc4a4891e8b50d5", null ], + [ "selectionStyleReset", "elements_8hpp.html#aa7e1317c76cefc5018503de4f6e09ea3", null ], + [ "selectionColor", "elements_8hpp.html#a925a73b7f0eb4b5bc11af23f4ca18019", null ], + [ "selectionBackgroundColor", "elements_8hpp.html#a6c965b8f6450a50a938120b5f6ddea96", null ], + [ "selectionForegroundColor", "elements_8hpp.html#a5d98498c51cfbc03f37e46d46ec8acf5", null ], + [ "selectionStyle", "elements_8hpp.html#a4080865d947eea48cf695531f66a5160", null ], + [ "hbox", "elements_8hpp.html#a552ba6d33b3c9bec586b99fba4c243ac", null ], + [ "vbox", "elements_8hpp.html#gafd28058f0ccbbdf34691a85a7cc9b2e3", null ], + [ "dbox", "elements_8hpp.html#ga901ab1b6b2e0e8c295552168ab206441", null ], + [ "flexbox", "elements_8hpp.html#a168a235aa438b6c72df5861322154be3", null ], + [ "gridbox", "elements_8hpp.html#abcdf409d605edafd3191cd7ba47bcbd1", null ], + [ "hflow", "elements_8hpp.html#a345b31919048562675615d5af78e6322", null ], + [ "vflow", "elements_8hpp.html#ae0da51b614e95a0687727644b5898a23", null ], + [ "flex", "elements_8hpp.html#ga257acd2bd47bab7db879cca2c0e67e23", null ], + [ "flex_grow", "elements_8hpp.html#ga81ed6b31f512e849247f13d249f6f20e", null ], + [ "flex_shrink", "elements_8hpp.html#ga4629196b5ffc280054d35f2a9977e829", null ], + [ "xflex", "elements_8hpp.html#ga0dbba98e14f63f1dd5163cbdc4f42da8", null ], + [ "xflex_grow", "elements_8hpp.html#ga1618cb15307f29eb3d531e7b44c280d3", null ], + [ "xflex_shrink", "elements_8hpp.html#ga95275a9271934cf76e970c6650cc224d", null ], + [ "yflex", "elements_8hpp.html#ga42c7a33df6d890de30fc1ebb2d1b3ca6", null ], + [ "yflex_grow", "elements_8hpp.html#ga7eac3f709e905af8f583aed52093b7ce", null ], + [ "yflex_shrink", "elements_8hpp.html#gaf7d0757f5965aa579bccc125ff909256", null ], + [ "notflex", "elements_8hpp.html#ga845b0ea50d51024aa4e050447b46e1dd", null ], + [ "filler", "elements_8hpp.html#gac2a9ed2d22ec3c8811b61f4a901ed367", null ], + [ "size", "elements_8hpp.html#ga201220986fbdc539e42efe067985cbdb", null ], + [ "frame", "elements_8hpp.html#ad0d6a96f6e1fb6d67d9fa6323062a737", null ], + [ "xframe", "elements_8hpp.html#a2d0617c0912b732f059cf360ac951c49", null ], + [ "yframe", "elements_8hpp.html#a7ea9d3ceb2a977955125c6e4a6072325", null ], + [ "focus", "elements_8hpp.html#gaa2d7d671f184f85e0f396f2610fa6c2e", null ], + [ "select", "elements_8hpp.html#a9e3e2988ed61a129d82d634ad66f7eb1", null ], + [ "focusCursorBlock", "elements_8hpp.html#ga509ef7e7f8913ea3de7efd45e3301ea1", null ], + [ "focusCursorBlockBlinking", "elements_8hpp.html#gadda589914ba8fe863c905b6566557768", null ], + [ "focusCursorBar", "elements_8hpp.html#ga4f89e72e7001064e3eb8189c8317e95b", null ], + [ "focusCursorBarBlinking", "elements_8hpp.html#ga085a7c997e7364c5a54e73c7b84145db", null ], + [ "focusCursorUnderline", "elements_8hpp.html#ga61e1fe02a18c2b18e31ccc9cd3943823", null ], + [ "focusCursorUnderlineBlinking", "elements_8hpp.html#ga33637d59d1e52aa06dd2a94162adbfe9", null ], + [ "vscroll_indicator", "elements_8hpp.html#ga1974176e676afdb96d203e8e0f579219", null ], + [ "hscroll_indicator", "elements_8hpp.html#ga7f48136f949ccbde722dd93a6de4d0de", null ], + [ "reflect", "elements_8hpp.html#aaff8245861617a3d9e846e99de582a63", null ], + [ "clear_under", "elements_8hpp.html#ga17a89519e6b87e12b1e5811a702f7847", null ], + [ "hcenter", "elements_8hpp.html#gaf7d0d1e44c1a5424e42a5cddceacf7f7", null ], + [ "vcenter", "elements_8hpp.html#gad907a8a48bb9f9dfdb06402e9fc12316", null ], + [ "center", "elements_8hpp.html#ga5b11656305fce8427b81daf1c35883f1", null ], + [ "align_right", "elements_8hpp.html#ga778e52afe28f1978f1f7ef065ed92d6d", null ], + [ "nothing", "elements_8hpp.html#ga1bfd3885ac8b40dc82a1103725003c07", null ], + [ "Fit", "elements_8hpp.html#aee138f0b60ddc07682a785f55eb5fda6", null ] +]; \ No newline at end of file diff --git a/elements_8hpp_source.html b/elements_8hpp_source.html new file mode 100644 index 000000000..fb830b802 --- /dev/null +++ b/elements_8hpp_source.html @@ -0,0 +1,555 @@ + + + + + + + + +FTXUI: elements.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
elements.hpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#ifndef FTXUI_DOM_ELEMENTS_HPP
+
5#define FTXUI_DOM_ELEMENTS_HPP
+
6
+
7#include <functional>
+
8#include <memory>
+
9
+
10#include "ftxui/dom/canvas.hpp"
+ + + +
14#include "ftxui/dom/node.hpp"
+
15#include "ftxui/screen/box.hpp"
+ + +
18#include "ftxui/util/ref.hpp"
+
19
+
20namespace ftxui {
+
21class Node;
+
22using Element = std::shared_ptr<Node>;
+
23using Elements = std::vector<Element>;
+
24using Decorator = std::function<Element(Element)>;
+
25using GraphFunction = std::function<std::vector<int>(int, int)>;
+
26
+
27/// @brief BorderStyle is an enumeration that represents the different styles
+
28/// of borders that can be applied to elements in the terminal UI.
+
29///
+
30/// BorderStyle is an enumeration that represents the different styles of
+
31/// borders that can be applied to elements in the terminal UI.
+
32/// It is used to define the visual appearance of borders around elements,
+
33/// such as windows, frames, or separators.
+
34/// @ingroup dom
+ +
43
+
44// Pipe elements into decorator togethers.
+
45// For instance the next lines are equivalents:
+
46// -> text("ftxui") | bold | underlined
+
47// -> underlined(bold(text("FTXUI")))
+ + + + +
52
+
53// --- Widget ---
+
54Element text(std::string text);
+
55Element vtext(std::string text);
+ + + + + + + +
63Element separator(Pixel);
+
64Element separatorCharacter(std::string);
+ +
66 float right,
+
67 Color unselected_color,
+
68 Color selected_color);
+ +
70 float down,
+
71 Color unselected_color,
+
72 Color selected_color);
+
73Element gauge(float progress);
+
74Element gaugeLeft(float progress);
+
75Element gaugeRight(float progress);
+
76Element gaugeUp(float progress);
+
77Element gaugeDown(float progress);
+
78Element gaugeDirection(float progress, Direction direction);
+ + + + + + + + + + +
89Decorator borderWith(const Pixel&);
+
90Element window(Element title, Element content, BorderStyle border = ROUNDED);
+
91Element spinner(int charset_index, size_t image_index);
+
92Element paragraph(const std::string& text);
+
93Element paragraphAlignLeft(const std::string& text);
+
94Element paragraphAlignRight(const std::string& text);
+
95Element paragraphAlignCenter(const std::string& text);
+
96Element paragraphAlignJustify(const std::string& text);
+ + +
99Element canvas(ConstRef<Canvas>);
+
100Element canvas(int width, int height, std::function<void(Canvas&)>);
+
101Element canvas(std::function<void(Canvas&)>);
+
102
+
103// -- Decorator ---
+ + + + + + + + +
112Decorator color(Color);
+
113Decorator bgcolor(Color);
+
114Decorator color(const LinearGradient&);
+
115Decorator bgcolor(const LinearGradient&);
+
116Element color(Color, Element);
+
117Element bgcolor(Color, Element);
+
118Element color(const LinearGradient&, Element);
+
119Element bgcolor(const LinearGradient&, Element);
+
120Decorator focusPosition(int x, int y);
+
121Decorator focusPositionRelative(float x, float y);
+ +
123Decorator hyperlink(std::string link);
+
124Element hyperlink(std::string link, Element child);
+ +
126Decorator selectionColor(Color foreground);
+
127Decorator selectionBackgroundColor(Color foreground);
+
128Decorator selectionForegroundColor(Color foreground);
+
129Decorator selectionStyle(std::function<void(Pixel&)> style);
+
130
+
131// --- Layout is
+
132// Horizontal, Vertical or stacked set of elements.
+ + + +
136Element flexbox(Elements, FlexboxConfig config = FlexboxConfig());
+
137Element gridbox(std::vector<Elements> lines);
+
138
+
139Element hflow(Elements); // Helper: default flexbox with row direction.
+
140Element vflow(Elements); // Helper: default flexbox with column direction.
+
141
+
142// -- Flexibility ---
+
143// Define how to share the remaining space when not all of it is used inside a
+
144// container.
+
145Element flex(Element); // Expand/Minimize if possible/needed.
+
146Element flex_grow(Element); // Expand element if possible.
+
147Element flex_shrink(Element); // Minimize element if needed.
+
148
+
149Element xflex(Element); // Expand/Minimize if possible/needed on X axis.
+
150Element xflex_grow(Element); // Expand element if possible on X axis.
+
151Element xflex_shrink(Element); // Minimize element if needed on X axis.
+
152
+
153Element yflex(Element); // Expand/Minimize if possible/needed on Y axis.
+
154Element yflex_grow(Element); // Expand element if possible on Y axis.
+
155Element yflex_shrink(Element); // Minimize element if needed on Y axis.
+
156
+
157Element notflex(Element); // Reset the flex attribute.
+
158Element filler(); // A blank expandable element.
+
159
+
160// -- Size override;
+ + + +
164
+
165// --- Frame ---
+
166// A frame is a scrollable area. The internal area is potentially larger than
+
167// the external one. The internal area is scrolled in order to make visible the
+
168// focused element.
+ + + + +
173Element select(Element e); // Deprecated - Alias for focus.
+
174
+
175// --- Cursor ---
+
176// Those are similar to `focus`, but also change the shape of the cursor.
+ + + + + + +
183
+
184// --- Misc ---
+ + +
187Decorator reflect(Box& box);
+
188// Before drawing the |element| clear the pixel below. This is useful in
+
189// combinaison with dbox.
+ +
191
+
192// --- Util --------------------------------------------------------------------
+ + + + +
197Element nothing(Element element);
+
198
+
+
199namespace Dimension {
+
200Dimensions Fit(Element&, bool extend_beyond_screen = false);
+
201} // namespace Dimension
+
+
202
+
203} // namespace ftxui
+
204
+
205// Make container able to take any number of children as input.
+
206#include "ftxui/dom/take_any_args.hpp"
+
207
+
208// Include old definitions using wstring.
+ +
210#endif // FTXUI_DOM_ELEMENTS_HPP
+ + + + + + +
Decorator bgcolor(Color)
Decorate using a background color.
+
Element window(Element title, Element content, BorderStyle border=ROUNDED)
Draw window with a title and a border around the element.
+
Element borderDouble(Element)
Draw a double border around the element.
+
Element focusCursorBarBlinking(Element)
Same as focus, but set the cursor shape to be a blinking bar.
Definition frame.cpp:189
+
Element xflex(Element)
Expand/Minimize if possible/needed on the X axis.
Definition flex.cpp:129
+
Element gaugeDirection(float progress, Direction direction)
Draw a high definition progress bar progressing in specified direction.
+
Decorator focusPositionRelative(float x, float y)
Used inside a frame, this force the view to be scrolled toward a a given position....
+
Element separatorStyled(BorderStyle)
Draw a vertical or horizontal separation in between two other elements.
+
Element xflex_grow(Element)
Expand if possible on the X axis.
Definition flex.cpp:147
+
Element underlinedDouble(Element)
Apply a underlinedDouble to text.
+
Element clear_under(Element element)
Before drawing |child|, clear the pixels below. This is useful in combination with dbox.
+
Element borderDashed(Element)
Draw a dashed border around the element.
+
Element separatorEmpty()
Draw a vertical or horizontal separation in between two other elements, using the EMPTY style.
+
Element vscroll_indicator(Element)
Display a vertical scrollbar on the right. Colors follow the content.
+
Element nothing(Element element)
A decoration doing absolutely nothing.
Definition dom/util.cpp:28
+
Decorator size(WidthOrHeight, Constraint, int value)
Apply a constraint on the size of an element.
+
Direction
Direction is an enumeration that represents the four cardinal directions.
Definition direction.hpp:13
+
Element flex(Element)
Make a child element to expand proportionally to the space left in a container.
Definition flex.cpp:123
+
Element paragraphAlignRight(const std::string &text)
Return an element drawing the paragraph on multiple lines, aligned on the right.
+
Element gaugeRight(float progress)
Draw a high definition progress bar progressing from left to right.
+
Element focusCursorUnderlineBlinking(Element)
Same as focus, but set the cursor shape to be a blinking underline.
Definition frame.cpp:217
+
Element bold(Element)
Use a bold font, for elements with more emphasis.
Definition bold.cpp:33
+
Element separatorLight()
Draw a vertical or horizontal separation in between two other elements, using the LIGHT style.
+
Element spinner(int charset_index, size_t image_index)
Useful to represent the effect of time and/or events. This displays an ASCII art "video".
+
Element borderRounded(Element)
Draw a rounded border around the element.
+
Element emptyElement()
Definition dom/util.cpp:140
+
Element yflex(Element)
Expand/Minimize if possible/needed on the Y axis.
Definition flex.cpp:135
+
Element flex_shrink(Element)
Minimize if needed.
Definition flex.cpp:159
+
Element focusCursorBar(Element)
Same as focus, but set the cursor shape to be a still block.
Definition frame.cpp:175
+
Element focusCursorBlock(Element)
Same as focus, but set the cursor shape to be a still block.
Definition frame.cpp:147
+
Element underlined(Element)
Underline the given element.
+
Element center(Element)
Center an element horizontally and vertically.
+
Element focusCursorUnderline(Element)
Same as focus, but set the cursor shape to be a still underline.
Definition frame.cpp:203
+
Element borderHeavy(Element)
Draw a heavy border around the element.
+
Element inverted(Element)
Add a filter that will invert the foreground and the background colors.
Definition inverted.cpp:34
+
Element paragraphAlignCenter(const std::string &text)
Return an element drawing the paragraph on multiple lines, aligned on the center.
+
Element gaugeUp(float progress)
Draw a high definition progress bar progressing from bottom to top.
+
Element text(std::wstring text)
Display a piece of unicode text.
Definition text.cpp:160
+
Element align_right(Element)
Align an element on the right side.
+
Decorator focusPosition(int x, int y)
Used inside a frame, this force the view to be scrolled toward a a given position....
+
Element yflex_grow(Element)
Expand if possible on the Y axis.
Definition flex.cpp:153
+
Element hscroll_indicator(Element)
Display a horizontal scrollbar at the bottom. Colors follow the content.
+
Element flex_grow(Element)
Expand if possible.
Definition flex.cpp:141
+
Element separatorDashed()
Draw a vertical or horizontal separation in between two other elements, using the DASHED style.
+
Element notflex(Element)
Make the element not flexible.
Definition flex.cpp:177
+
Element strikethrough(Element)
Apply a strikethrough to text.
+
Element italic(Element)
Apply a underlinedDouble to text.
Definition italic.cpp:17
+
Element dbox(Elements)
Stack several element on top of each other.
+
Element xflex_shrink(Element)
Minimize if needed on the X axis.
Definition flex.cpp:165
+
Element gaugeLeft(float progress)
Draw a high definition progress bar progressing from right to left.
+
Element separatorCharacter(std::string)
Draw a vertical or horizontal separation in between two other elements.
+
Element vtext(std::wstring text)
Display a piece unicode text vertically.
Definition text.cpp:220
+
Element borderLight(Element)
Draw a light border around the element.
+
Element focus(Element)
Set the child to be the one focused among its siblings.
Definition frame.cpp:101
+
Element paragraphAlignLeft(const std::string &text)
Return an element drawing the paragraph on multiple lines, aligned on the left.
+
Decorator borderWith(const Pixel &)
Same as border but with a constant Pixel around the element.
+
Decorator borderStyled(BorderStyle)
Same as border but with different styles.
+
Element separator()
Draw a vertical or horizontal separation in between two other elements.
+
Element filler()
An element that will take expand proportionally to the space left in a container.
Definition flex.cpp:98
+
Element dim(Element)
Use a light font, for elements with less emphasis.
Definition dim.cpp:33
+
Element automerge(Element child)
Enable character to be automatically merged with others nearby.
Definition automerge.cpp:17
+
Decorator hyperlink(std::string link)
Decorate using a hyperlink. The link will be opened when the user clicks on it. This is supported onl...
Definition hyperlink.cpp:70
+
Element blink(Element)
The text drawn alternates in between visible and hidden.
Definition blink.cpp:33
+
Element vcenter(Element)
Center an element vertically.
+
Element separatorDouble()
Draw a vertical or horizontal separation in between two other elements, using the DOUBLE style.
+
Element focusCursorBlockBlinking(Element)
Same as focus, but set the cursor shape to be a blinking block.
Definition frame.cpp:161
+
Element gauge(float progress)
Draw a high definition progress bar.
+
Element paragraphAlignJustify(const std::string &text)
Return an element drawing the paragraph on multiple lines, aligned using a justified alignment....
+
Element border(Element)
Draw a border around the element.
+
Element separatorHeavy()
Draw a vertical or horizontal separation in between two other elements, using the HEAVY style.
+
Element borderEmpty(Element)
Draw an empty border around the element.
+
Decorator color(Color)
Decorate using a foreground color.
+
Element yflex_shrink(Element)
Minimize if needed on the Y axis.
Definition flex.cpp:171
+
Element hcenter(Element)
Center an element horizontally.
+
Element vbox(Elements)
A container displaying elements vertically one by one.
Definition vbox.cpp:96
+
BorderStyle
BorderStyle is an enumeration that represents the different styles of borders that can be applied to ...
Definition elements.hpp:35
+
Element gaugeDown(float progress)
Draw a high definition progress bar progressing from top to bottom.
+
@ EMPTY
Definition elements.hpp:41
+
@ DOUBLE
Definition elements.hpp:39
+
@ HEAVY
Definition elements.hpp:38
+
@ ROUNDED
Definition elements.hpp:40
+
@ DASHED
Definition elements.hpp:37
+
@ LIGHT
Definition elements.hpp:36
+
Dimensions is a structure that represents the size of the terminal.
Definition terminal.hpp:11
+ +
Dimensions Fit(Element &, bool extend_beyond_screen=false)
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
WidthOrHeight
Definition elements.hpp:161
+ + +
std::function< Element(Element)> Decorator
Definition elements.hpp:24
+
Element flexbox(Elements, FlexboxConfig config=FlexboxConfig())
A container displaying elements on row/columns and capable of wrapping on the next column/row when fu...
Definition flexbox.cpp:251
+
Element separatorVSelector(float up, float down, Color unselected_color, Color selected_color)
Draw an vertical bar, with the area in between up/downcolored differently.
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+
Element xframe(Element)
Same as frame, but only on the x-axis.
Definition frame.cpp:126
+
Element hflow(Elements)
A container displaying elements in rows from left to right. When filled, it starts on a new row below...
Definition flexbox.cpp:269
+
Decorator selectionStyle(std::function< void(Pixel &)> style)
Set the style of an element when selected.
+
Element separatorHSelector(float left, float right, Color unselected_color, Color selected_color)
Draw a horizontal bar, with the area in between left/right colored differently.
+
Element hbox(Elements)
A container displaying elements horizontally one by one.
Definition hbox.cpp:94
+
Element canvas(ConstRef< Canvas >)
Produce an element from a Canvas, or a reference to a Canvas.
+
std::vector< Element > Elements
Definition elements.hpp:23
+
Decorator selectionForegroundColor(Color foreground)
Set the foreground color of an element when selected. Note that the style is applied on top of the ex...
+
Component operator|(Component component, ComponentDecorator decorator)
+
Decorator selectionBackgroundColor(Color foreground)
Set the background color of an element when selected. Note that the style is applied on top of the ex...
+
Element yframe(Element)
Same as frame, but only on the y-axis.
Definition frame.cpp:134
+
Decorator selectionColor(Color foreground)
Set the color of an element when selected.
+
Element select(Element e)
Set the child to be the one focused among its siblings.
Definition frame.cpp:108
+
Element selectionStyleReset(Element)
Reset the selection style of an element.
+
Decorator reflect(Box &box)
Definition reflect.cpp:43
+
std::function< std::vector< int >(int, int)> GraphFunction
Definition elements.hpp:25
+
Element gridbox(std::vector< Elements > lines)
A container displaying a grid of elements.
+
Elements paragraph(std::wstring text)
+
Element frame(Element)
Allow an element to be displayed inside a 'virtual' area. It size can be larger than its container....
Definition frame.cpp:118
+
Component & operator|=(Component &component, ComponentDecorator decorator)
+ +
@ LESS_THAN
Definition elements.hpp:162
+ +
@ GREATER_THAN
Definition elements.hpp:162
+
Element vflow(Elements)
A container displaying elements in rows from top to bottom. When filled, it starts on a new columns o...
Definition flexbox.cpp:289
+
Element graph(GraphFunction)
Draw a graph using a GraphFunction.
+ + +
std::uint8_t left
Definition screen.cpp:130
+
std::uint8_t down
Definition screen.cpp:133
+
std::uint8_t right
Definition screen.cpp:132
+ +
+
+ + + + + diff --git a/event_8cpp.html b/event_8cpp.html new file mode 100644 index 000000000..ba79d7d32 --- /dev/null +++ b/event_8cpp.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: event.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
event.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+
+
+ + + + + diff --git a/event_8cpp_source.html b/event_8cpp_source.html new file mode 100644 index 000000000..63d076406 --- /dev/null +++ b/event_8cpp_source.html @@ -0,0 +1,871 @@ + + + + + + + + +FTXUI: event.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
event.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <map> // for map
+
5#include <string>
+
6#include <utility> // for move
+
7
+ +
9#include "ftxui/component/mouse.hpp" // for Mouse
+
10#include "ftxui/screen/string.hpp" // for to_wstring
+
11
+
12// Disable warning for shadowing variable, for every compilers. Indeed, there is
+
13// a static Event for every letter of the alphabet:
+
14#ifdef __clang__
+
15#pragma clang diagnostic ignored "-Wshadow"
+
16#elif __GNUC__
+
17#pragma GCC diagnostic ignored "-Wshadow"
+
18#elif defined(_MSC_VER)
+
19#pragma warning(disable : 6244)
+
20#pragma warning(disable : 6246)
+
21#endif
+
22
+
23namespace ftxui {
+
24
+
25/// @brief An event corresponding to a given typed character.
+
26/// @param input The character typed by the user.
+
27// static
+
+
28Event Event::Character(std::string input) {
+
29 Event event;
+
30 event.input_ = std::move(input);
+
31 event.type_ = Type::Character;
+
32 return event;
+
33}
+
+
34
+
35/// @brief An event corresponding to a given typed character.
+
36/// @param c The character typed by the user.
+
37// static
+
+
38Event Event::Character(char c) {
+
39 return Event::Character(std::string{c});
+
40}
+
+
41
+
42/// @brief An event corresponding to a given typed character.
+
43/// @param c The character typed by the user.
+
44// static
+
+
45Event Event::Character(wchar_t c) {
+
46 return Event::Character(to_string(std::wstring{c}));
+
47}
+
+
48
+
49/// @brief An event corresponding to a given typed character.
+
50/// @param input The sequence of character send by the terminal.
+
51/// @param mouse The mouse state.
+
52// static
+
+
53Event Event::Mouse(std::string input, struct Mouse mouse) {
+
54 Event event;
+
55 event.input_ = std::move(input);
+
56 event.type_ = Type::Mouse;
+
57 event.data_.mouse = mouse; // NOLINT
+
58 return event;
+
59}
+
+
60
+
61/// @brief An event corresponding to a terminal DCS (Device Control String).
+
62// static
+
+
63Event Event::CursorShape(std::string input, int shape) {
+
64 Event event;
+
65 event.input_ = std::move(input);
+
66 event.type_ = Type::CursorShape;
+
67 event.data_.cursor_shape = shape; // NOLINT
+
68 return event;
+
69}
+
+
70
+
71/// @brief An custom event whose meaning is defined by the user of the library.
+
72/// @param input An arbitrary sequence of character defined by the developer.
+
73// static
+
+
74Event Event::Special(std::string input) {
+
75 Event event;
+
76 event.input_ = std::move(input);
+
77 return event;
+
78}
+
+
79
+
80/// @internal
+
81// static
+
+
82Event Event::CursorPosition(std::string input, int x, int y) {
+
83 Event event;
+
84 event.input_ = std::move(input);
+
85 event.type_ = Type::CursorPosition;
+
86 event.data_.cursor = {x, y}; // NOLINT
+
87 return event;
+
88}
+
+
89
+
90/// @brief Return a string representation of the event.
+
+
91std::string Event::DebugString() const {
+
92 static std::map<Event, const char*> event_to_string = {
+
93 // --- Arrow ---
+
94 {Event::ArrowLeft, "Event::ArrowLeft"},
+
95 {Event::ArrowRight, "Event::ArrowRight"},
+
96 {Event::ArrowUp, "Event::ArrowUp"},
+
97 {Event::ArrowDown, "Event::ArrowDown"},
+
98
+
99 // --- ArrowCtrl ---
+
100 {Event::ArrowLeftCtrl, "Event::ArrowLeftCtrl"},
+
101 {Event::ArrowRightCtrl, "Event::ArrowRightCtrl"},
+
102 {Event::ArrowUpCtrl, "Event::ArrowUpCtrl"},
+
103 {Event::ArrowDownCtrl, "Event::ArrowDownCtrl"},
+
104
+
105 // --- Other ---
+
106 {Event::Backspace, "Event::Backspace"},
+
107 {Event::Delete, "Event::Delete"},
+
108 {Event::Escape, "Event::Escape"},
+
109 {Event::Return, "Event::Return"},
+
110 {Event::Tab, "Event::Tab"},
+
111 {Event::TabReverse, "Event::TabReverse"},
+
112
+
113 // --- Function keys ---
+
114 {Event::F1, "Event::F1"},
+
115 {Event::F2, "Event::F2"},
+
116 {Event::F3, "Event::F3"},
+
117 {Event::F4, "Event::F4"},
+
118 {Event::F5, "Event::F5"},
+
119 {Event::F6, "Event::F6"},
+
120 {Event::F7, "Event::F7"},
+
121 {Event::F8, "Event::F8"},
+
122 {Event::F9, "Event::F9"},
+
123 {Event::F10, "Event::F10"},
+
124 {Event::F11, "Event::F11"},
+
125 {Event::F12, "Event::F12"},
+
126
+
127 // --- Navigation keys ---
+
128 {Event::Insert, "Event::Insert"},
+
129 {Event::Home, "Event::Home"},
+
130 {Event::End, "Event::End"},
+
131 {Event::PageUp, "Event::PageUp"},
+
132 {Event::PageDown, "Event::PageDown"},
+
133
+
134 // --- Control keys ---
+
135 {Event::CtrlA, "Event::CtrlA"},
+
136 {Event::CtrlB, "Event::CtrlB"},
+
137 {Event::CtrlC, "Event::CtrlC"},
+
138 {Event::CtrlD, "Event::CtrlD"},
+
139 {Event::CtrlE, "Event::CtrlE"},
+
140 {Event::CtrlF, "Event::CtrlF"},
+
141 {Event::CtrlG, "Event::CtrlG"},
+
142 {Event::CtrlH, "Event::CtrlH"},
+
143 {Event::CtrlI, "Event::CtrlI"},
+
144 {Event::CtrlJ, "Event::CtrlJ"},
+
145 {Event::CtrlK, "Event::CtrlK"},
+
146 {Event::CtrlL, "Event::CtrlL"},
+
147 {Event::CtrlM, "Event::CtrlM"},
+
148 {Event::CtrlN, "Event::CtrlN"},
+
149 {Event::CtrlO, "Event::CtrlO"},
+
150 {Event::CtrlP, "Event::CtrlP"},
+
151 {Event::CtrlQ, "Event::CtrlQ"},
+
152 {Event::CtrlR, "Event::CtrlR"},
+
153 {Event::CtrlS, "Event::CtrlS"},
+
154 {Event::CtrlT, "Event::CtrlT"},
+
155 {Event::CtrlU, "Event::CtrlU"},
+
156 {Event::CtrlV, "Event::CtrlV"},
+
157 {Event::CtrlW, "Event::CtrlW"},
+
158 {Event::CtrlX, "Event::CtrlX"},
+
159 {Event::CtrlY, "Event::CtrlY"},
+
160 {Event::CtrlZ, "Event::CtrlZ"},
+
161
+
162 // --- Alt keys ---
+
163 {Event::AltA, "Event::AltA"},
+
164 {Event::AltB, "Event::AltB"},
+
165 {Event::AltC, "Event::AltC"},
+
166 {Event::AltD, "Event::AltD"},
+
167 {Event::AltE, "Event::AltE"},
+
168 {Event::AltF, "Event::AltF"},
+
169 {Event::AltG, "Event::AltG"},
+
170 {Event::AltH, "Event::AltH"},
+
171 {Event::AltI, "Event::AltI"},
+
172 {Event::AltJ, "Event::AltJ"},
+
173 {Event::AltK, "Event::AltK"},
+
174 {Event::AltL, "Event::AltL"},
+
175 {Event::AltM, "Event::AltM"},
+
176 {Event::AltN, "Event::AltN"},
+
177 {Event::AltO, "Event::AltO"},
+
178 {Event::AltP, "Event::AltP"},
+
179 {Event::AltQ, "Event::AltQ"},
+
180 {Event::AltR, "Event::AltR"},
+
181 {Event::AltS, "Event::AltS"},
+
182 {Event::AltT, "Event::AltT"},
+
183 {Event::AltU, "Event::AltU"},
+
184 {Event::AltV, "Event::AltV"},
+
185 {Event::AltW, "Event::AltW"},
+
186 {Event::AltX, "Event::AltX"},
+
187 {Event::AltY, "Event::AltY"},
+
188 {Event::AltZ, "Event::AltZ"},
+
189
+
190 // --- CtrlAlt keys ---
+
191 {Event::CtrlAltA, "Event::CtrlAltA"},
+
192 {Event::CtrlAltB, "Event::CtrlAltB"},
+
193 {Event::CtrlAltC, "Event::CtrlAltC"},
+
194 {Event::CtrlAltD, "Event::CtrlAltD"},
+
195 {Event::CtrlAltE, "Event::CtrlAltE"},
+
196 {Event::CtrlAltF, "Event::CtrlAltF"},
+
197 {Event::CtrlAltG, "Event::CtrlAltG"},
+
198 {Event::CtrlAltH, "Event::CtrlAltH"},
+
199 {Event::CtrlAltI, "Event::CtrlAltI"},
+
200 {Event::CtrlAltJ, "Event::CtrlAltJ"},
+
201 {Event::CtrlAltK, "Event::CtrlAltK"},
+
202 {Event::CtrlAltL, "Event::CtrlAltL"},
+
203 {Event::CtrlAltM, "Event::CtrlAltM"},
+
204 {Event::CtrlAltN, "Event::CtrlAltN"},
+
205 {Event::CtrlAltO, "Event::CtrlAltO"},
+
206 {Event::CtrlAltP, "Event::CtrlAltP"},
+
207 {Event::CtrlAltQ, "Event::CtrlAltQ"},
+
208 {Event::CtrlAltR, "Event::CtrlAltR"},
+
209 {Event::CtrlAltS, "Event::CtrlAltS"},
+
210 {Event::CtrlAltT, "Event::CtrlAltT"},
+
211 {Event::CtrlAltU, "Event::CtrlAltU"},
+
212 {Event::CtrlAltV, "Event::CtrlAltV"},
+
213 {Event::CtrlAltW, "Event::CtrlAltW"},
+
214 {Event::CtrlAltX, "Event::CtrlAltX"},
+
215 {Event::CtrlAltY, "Event::CtrlAltY"},
+
216 {Event::CtrlAltZ, "Event::CtrlAltZ"},
+
217
+
218 // --- Custom ---
+
219 {Event::Custom, "Event::Custom"},
+
220 };
+
221
+
222 static std::map<Mouse::Button, const char*> mouse_button_string = {
+
223 {Mouse::Button::Left, ".button = Mouse::Left"},
+
224 {Mouse::Button::Middle, ".button = Mouse::Middle"},
+
225 {Mouse::Button::Right, ".button = Mouse::Right"},
+
226 {Mouse::Button::WheelUp, ".button = Mouse::WheelUp"},
+
227 {Mouse::Button::WheelDown, ".button = Mouse::WheelDown"},
+
228 {Mouse::Button::None, ".button = Mouse::None"},
+
229 {Mouse::Button::WheelLeft, ".button = Mouse::WheelLeft"},
+
230 {Mouse::Button::WheelRight, ".button = Mouse::WheelRight"},
+
231 };
+
232
+
233 static std::map<Mouse::Motion, const char*> mouse_motion_string = {
+
234 {Mouse::Motion::Pressed, ".motion = Mouse::Pressed"},
+
235 {Mouse::Motion::Released, ".motion = Mouse::Released"},
+
236 {Mouse::Motion::Moved, ".motion = Mouse::Moved"},
+
237 };
+
238
+
239 switch (type_) {
+
240 case Type::Character: {
+
241 return "Event::Character(\"" + input_ + "\")";
+
242 }
+
243 case Type::Mouse: {
+
244 std::string out = "Event::Mouse(\"...\", Mouse{";
+
245 out += std::string(mouse_button_string[data_.mouse.button]);
+
246 out += ", ";
+
247 out += std::string(mouse_motion_string[data_.mouse.motion]);
+
248 out += ", ";
+
249 if (data_.mouse.shift) {
+
250 out += ".shift = true, ";
+
251 }
+
252 if (data_.mouse.meta) {
+
253 out += ".meta = true, ";
+
254 }
+
255 if (data_.mouse.control) {
+
256 out += ".control = true, ";
+
257 }
+
258 out += ".x = " + std::to_string(data_.mouse.x);
+
259 out += ", ";
+
260 out += ".y = " + std::to_string(data_.mouse.y);
+
261 out += "})";
+
262 return out;
+
263 }
+
264 case Type::CursorShape:
+
265 return "Event::CursorShape(" + input_ + ", " +
+
266 std::to_string(data_.cursor_shape) + ")";
+
267 case Type::CursorPosition:
+
268 return "Event::CursorPosition(" + input_ + ", " +
+
269 std::to_string(data_.cursor.x) + ", " +
+
270 std::to_string(data_.cursor.y) + ")";
+
271 default: {
+
272 auto event_it = event_to_string.find(*this);
+
273 if (event_it != event_to_string.end()) {
+
274 return event_it->second;
+
275 }
+
276
+
277 return "";
+
278 }
+
279 }
+
280 return "";
+
281}
+
+
282
+
283// clang-format off
+
284// NOLINTBEGIN
+
285
+
286// --- Arrow ---
+
287const Event Event::ArrowLeft = Event::Special("\x1B[D");
+
288const Event Event::ArrowRight = Event::Special("\x1B[C");
+
289const Event Event::ArrowUp = Event::Special("\x1B[A");
+
290const Event Event::ArrowDown = Event::Special("\x1B[B");
+
291const Event Event::ArrowLeftCtrl = Event::Special("\x1B[1;5D");
+
292const Event Event::ArrowRightCtrl = Event::Special("\x1B[1;5C");
+
293const Event Event::ArrowUpCtrl = Event::Special("\x1B[1;5A");
+
294const Event Event::ArrowDownCtrl = Event::Special("\x1B[1;5B");
+ +
296const Event Event::Delete = Event::Special("\x1B[3~");
+
297const Event Event::Escape = Event::Special("\x1B");
+
298const Event Event::Return = Event::Special({10});
+
299const Event Event::Tab = Event::Special({9});
+
300const Event Event::TabReverse = Event::Special({27, 91, 90});
+
301
+
302// See https://invisible-island.net/xterm/xterm-function-keys.html
+
303// We follow xterm-new / vterm-xf86-v4 / mgt / screen
+
304const Event Event::F1 = Event::Special("\x1BOP");
+
305const Event Event::F2 = Event::Special("\x1BOQ");
+
306const Event Event::F3 = Event::Special("\x1BOR");
+
307const Event Event::F4 = Event::Special("\x1BOS");
+
308const Event Event::F5 = Event::Special("\x1B[15~");
+
309const Event Event::F6 = Event::Special("\x1B[17~");
+
310const Event Event::F7 = Event::Special("\x1B[18~");
+
311const Event Event::F8 = Event::Special("\x1B[19~");
+
312const Event Event::F9 = Event::Special("\x1B[20~");
+
313const Event Event::F10 = Event::Special("\x1B[21~");
+
314const Event Event::F11 = Event::Special("\x1B[23~");
+
315const Event Event::F12 = Event::Special("\x1B[24~");
+
316
+
317const Event Event::Insert = Event::Special("\x1B[2~");
+
318const Event Event::Home = Event::Special({27, 91, 72});
+
319const Event Event::End = Event::Special({27, 91, 70});
+
320const Event Event::PageUp = Event::Special({27, 91, 53, 126});
+
321const Event Event::PageDown = Event::Special({27, 91, 54, 126});
+
322const Event Event::Custom = Event::Special({0});
+
323
+
324const Event Event::a = Event::Character("a");
+
325const Event Event::b = Event::Character("b");
+
326const Event Event::c = Event::Character("c");
+
327const Event Event::d = Event::Character("d");
+
328const Event Event::e = Event::Character("e");
+
329const Event Event::f = Event::Character("f");
+
330const Event Event::g = Event::Character("g");
+
331const Event Event::h = Event::Character("h");
+
332const Event Event::i = Event::Character("i");
+
333const Event Event::j = Event::Character("j");
+
334const Event Event::k = Event::Character("k");
+
335const Event Event::l = Event::Character("l");
+
336const Event Event::m = Event::Character("m");
+
337const Event Event::n = Event::Character("n");
+
338const Event Event::o = Event::Character("o");
+
339const Event Event::p = Event::Character("p");
+
340const Event Event::q = Event::Character("q");
+
341const Event Event::r = Event::Character("r");
+
342const Event Event::s = Event::Character("s");
+
343const Event Event::t = Event::Character("t");
+
344const Event Event::u = Event::Character("u");
+
345const Event Event::v = Event::Character("v");
+
346const Event Event::w = Event::Character("w");
+
347const Event Event::x = Event::Character("x");
+
348const Event Event::y = Event::Character("y");
+
349const Event Event::z = Event::Character("z");
+
350
+
351const Event Event::A = Event::Character("A");
+
352const Event Event::B = Event::Character("B");
+
353const Event Event::C = Event::Character("C");
+
354const Event Event::D = Event::Character("D");
+
355const Event Event::E = Event::Character("E");
+
356const Event Event::F = Event::Character("F");
+
357const Event Event::G = Event::Character("G");
+
358const Event Event::H = Event::Character("H");
+
359const Event Event::I = Event::Character("I");
+
360const Event Event::J = Event::Character("J");
+
361const Event Event::K = Event::Character("K");
+
362const Event Event::L = Event::Character("L");
+
363const Event Event::M = Event::Character("M");
+
364const Event Event::N = Event::Character("N");
+
365const Event Event::O = Event::Character("O");
+
366const Event Event::P = Event::Character("P");
+
367const Event Event::Q = Event::Character("Q");
+
368const Event Event::R = Event::Character("R");
+
369const Event Event::S = Event::Character("S");
+
370const Event Event::T = Event::Character("T");
+
371const Event Event::U = Event::Character("U");
+
372const Event Event::V = Event::Character("V");
+
373const Event Event::W = Event::Character("W");
+
374const Event Event::X = Event::Character("X");
+
375const Event Event::Y = Event::Character("Y");
+
376const Event Event::Z = Event::Character("Z");
+
377
+
378const Event Event::CtrlA = Event::Special("\x01");
+
379const Event Event::CtrlB = Event::Special("\x02");
+
380const Event Event::CtrlC = Event::Special("\x03");
+
381const Event Event::CtrlD = Event::Special("\x04");
+
382const Event Event::CtrlE = Event::Special("\x05");
+
383const Event Event::CtrlF = Event::Special("\x06");
+
384const Event Event::CtrlG = Event::Special("\x07");
+
385const Event Event::CtrlH = Event::Special("\x08");
+
386const Event Event::CtrlI = Event::Special("\x09");
+
387const Event Event::CtrlJ = Event::Special("\x0a");
+
388const Event Event::CtrlK = Event::Special("\x0b");
+
389const Event Event::CtrlL = Event::Special("\x0c");
+
390const Event Event::CtrlM = Event::Special("\x0d");
+
391const Event Event::CtrlN = Event::Special("\x0e");
+
392const Event Event::CtrlO = Event::Special("\x0f");
+
393const Event Event::CtrlP = Event::Special("\x10");
+
394const Event Event::CtrlQ = Event::Special("\x11");
+
395const Event Event::CtrlR = Event::Special("\x12");
+
396const Event Event::CtrlS = Event::Special("\x13");
+
397const Event Event::CtrlT = Event::Special("\x14");
+
398const Event Event::CtrlU = Event::Special("\x15");
+
399const Event Event::CtrlV = Event::Special("\x16");
+
400const Event Event::CtrlW = Event::Special("\x17");
+
401const Event Event::CtrlX = Event::Special("\x18");
+
402const Event Event::CtrlY = Event::Special("\x19");
+
403const Event Event::CtrlZ = Event::Special("\x1a");
+
404
+
405const Event Event::AltA = Event::Special("\x1b""a");
+
406const Event Event::AltB = Event::Special("\x1b""b");
+
407const Event Event::AltC = Event::Special("\x1b""c");
+
408const Event Event::AltD = Event::Special("\x1b""d");
+
409const Event Event::AltE = Event::Special("\x1b""e");
+
410const Event Event::AltF = Event::Special("\x1b""f");
+
411const Event Event::AltG = Event::Special("\x1b""g");
+
412const Event Event::AltH = Event::Special("\x1b""h");
+
413const Event Event::AltI = Event::Special("\x1b""i");
+
414const Event Event::AltJ = Event::Special("\x1b""j");
+
415const Event Event::AltK = Event::Special("\x1b""k");
+
416const Event Event::AltL = Event::Special("\x1b""l");
+
417const Event Event::AltM = Event::Special("\x1b""m");
+
418const Event Event::AltN = Event::Special("\x1b""n");
+
419const Event Event::AltO = Event::Special("\x1b""o");
+
420const Event Event::AltP = Event::Special("\x1b""p");
+
421const Event Event::AltQ = Event::Special("\x1b""q");
+
422const Event Event::AltR = Event::Special("\x1b""r");
+
423const Event Event::AltS = Event::Special("\x1b""s");
+
424const Event Event::AltT = Event::Special("\x1b""t");
+
425const Event Event::AltU = Event::Special("\x1b""u");
+
426const Event Event::AltV = Event::Special("\x1b""v");
+
427const Event Event::AltW = Event::Special("\x1b""w");
+
428const Event Event::AltX = Event::Special("\x1b""x");
+
429const Event Event::AltY = Event::Special("\x1b""y");
+
430const Event Event::AltZ = Event::Special("\x1b""z");
+
431
+
432const Event Event::CtrlAltA = Event::Special("\x1b\x01");
+
433const Event Event::CtrlAltB = Event::Special("\x1b\x02");
+
434const Event Event::CtrlAltC = Event::Special("\x1b\x03");
+
435const Event Event::CtrlAltD = Event::Special("\x1b\x04");
+
436const Event Event::CtrlAltE = Event::Special("\x1b\x05");
+
437const Event Event::CtrlAltF = Event::Special("\x1b\x06");
+
438const Event Event::CtrlAltG = Event::Special("\x1b\x07");
+
439const Event Event::CtrlAltH = Event::Special("\x1b\x08");
+
440const Event Event::CtrlAltI = Event::Special("\x1b\x09");
+
441const Event Event::CtrlAltJ = Event::Special("\x1b\x0a");
+
442const Event Event::CtrlAltK = Event::Special("\x1b\x0b");
+
443const Event Event::CtrlAltL = Event::Special("\x1b\x0c");
+
444const Event Event::CtrlAltM = Event::Special("\x1b\x0d");
+
445const Event Event::CtrlAltN = Event::Special("\x1b\x0e");
+
446const Event Event::CtrlAltO = Event::Special("\x1b\x0f");
+
447const Event Event::CtrlAltP = Event::Special("\x1b\x10");
+
448const Event Event::CtrlAltQ = Event::Special("\x1b\x11");
+
449const Event Event::CtrlAltR = Event::Special("\x1b\x12");
+
450const Event Event::CtrlAltS = Event::Special("\x1b\x13");
+
451const Event Event::CtrlAltT = Event::Special("\x1b\x14");
+
452const Event Event::CtrlAltU = Event::Special("\x1b\x15");
+
453const Event Event::CtrlAltV = Event::Special("\x1b\x16");
+
454const Event Event::CtrlAltW = Event::Special("\x1b\x17");
+
455const Event Event::CtrlAltX = Event::Special("\x1b\x18");
+
456const Event Event::CtrlAltY = Event::Special("\x1b\x19");
+
457const Event Event::CtrlAltZ = Event::Special("\x1b\x1a");
+
458
+
459// NOLINTEND
+
460// clang-format on
+
461
+
462} // namespace ftxui
+ +
static const Event TabReverse
Definition event.hpp:56
+
static const Event j
Definition event.hpp:78
+
static const Event CtrlC
Definition event.hpp:71
+ + + + + + +
@ WheelRight
Supported terminal only.
Definition mouse.hpp:20
+ +
static const Event CtrlP
Definition event.hpp:84
+
static const Event CtrlV
Definition event.hpp:90
+
static const Event ArrowLeftCtrl
Definition event.hpp:45
+
static const Event CtrlL
Definition event.hpp:80
+
static const Event AltT
Definition event.hpp:88
+
static const Event w
Definition event.hpp:91
+
static const Event CtrlAltX
Definition event.hpp:92
+
static const Event D
Definition event.hpp:72
+ + + +
static const Event CtrlAltN
Definition event.hpp:82
+
static const Event a
Definition event.hpp:69
+
static const Event AltH
Definition event.hpp:76
+
static const Event AltF
Definition event.hpp:74
+
static const Event K
Definition event.hpp:79
+
static const Event T
Definition event.hpp:88
+
static const Event CtrlAltC
Definition event.hpp:71
+
static const Event X
Definition event.hpp:92
+
static const Event CtrlE
Definition event.hpp:73
+
static const Event Q
Definition event.hpp:85
+
static const Event u
Definition event.hpp:89
+
static const Event PageUp
Definition event.hpp:62
+
static const Event h
Definition event.hpp:76
+
static const Event CtrlAltF
Definition event.hpp:74
+
static const Event CtrlZ
Definition event.hpp:94
+
static const Event J
Definition event.hpp:78
+
static const Event CtrlU
Definition event.hpp:89
+
static const Event AltQ
Definition event.hpp:85
+
static const Event b
Definition event.hpp:70
+
static const Event Escape
Definition event.hpp:54
+
static const Event AltY
Definition event.hpp:93
+
static const Event CtrlAltI
Definition event.hpp:77
+
static const Event AltL
Definition event.hpp:80
+
static const Event AltW
Definition event.hpp:91
+
static const Event F12
Definition event.hpp:66
+
static const Event E
Definition event.hpp:73
+
static const Event m
Definition event.hpp:81
+
static const Event N
Definition event.hpp:82
+
static const Event CtrlAltP
Definition event.hpp:84
+
static const Event CtrlAltE
Definition event.hpp:73
+
static const Event F5
Definition event.hpp:66
+
static const Event CtrlF
Definition event.hpp:74
+
static const Event F3
Definition event.hpp:66
+
static const Event CtrlAltJ
Definition event.hpp:78
+
static const Event z
Definition event.hpp:94
+
static const Event AltK
Definition event.hpp:79
+
static const Event B
Definition event.hpp:70
+
static const Event H
Definition event.hpp:76
+
static const Event CtrlX
Definition event.hpp:92
+
static const Event F9
Definition event.hpp:66
+
static const Event AltC
Definition event.hpp:71
+
static const Event CtrlB
Definition event.hpp:70
+
static const Event CtrlAltH
Definition event.hpp:76
+
static const Event O
Definition event.hpp:83
+
static const Event R
Definition event.hpp:86
+
static const Event AltM
Definition event.hpp:81
+
static const Event CtrlR
Definition event.hpp:86
+
static const Event CtrlAltW
Definition event.hpp:91
+
static const Event CtrlAltO
Definition event.hpp:83
+
static const Event CtrlY
Definition event.hpp:93
+
static const Event Custom
Definition event.hpp:97
+
static const Event A
Definition event.hpp:69
+
static const Event AltG
Definition event.hpp:75
+
static const Event p
Definition event.hpp:84
+
static const Event l
Definition event.hpp:80
+
static const Event CtrlH
Definition event.hpp:76
+
struct Mouse mouse
Definition event.hpp:144
+
std::string DebugString() const
Return a string representation of the event.
Definition event.cpp:91
+
static const Event AltO
Definition event.hpp:83
+
static const Event CtrlJ
Definition event.hpp:78
+
static const Event CtrlAltM
Definition event.hpp:81
+
static const Event CtrlS
Definition event.hpp:87
+
static const Event Z
Definition event.hpp:94
+
static const Event AltR
Definition event.hpp:86
+
static const Event CtrlW
Definition event.hpp:91
+
static const Event CtrlN
Definition event.hpp:82
+
static const Event F2
Definition event.hpp:66
+
static const Event CtrlM
Definition event.hpp:81
+
static const Event G
Definition event.hpp:75
+
static const Event Backspace
Definition event.hpp:51
+
static const Event d
Definition event.hpp:72
+
static const Event CtrlAltR
Definition event.hpp:86
+
static const Event CtrlK
Definition event.hpp:79
+
static const Event x
Definition event.hpp:92
+
static const Event F7
Definition event.hpp:66
+
static const Event ArrowUp
Definition event.hpp:42
+
const std::string & input() const
Definition event.hpp:104
+
static const Event Tab
Definition event.hpp:55
+
static const Event r
Definition event.hpp:86
+
static const Event AltU
Definition event.hpp:89
+
static const Event CtrlQ
Definition event.hpp:85
+
static const Event CtrlAltZ
Definition event.hpp:94
+
static const Event AltN
Definition event.hpp:82
+
static const Event AltA
Definition event.hpp:69
+
static const Event ArrowDown
Definition event.hpp:43
+
static const Event End
Definition event.hpp:61
+
static const Event F11
Definition event.hpp:66
+
static const Event CtrlG
Definition event.hpp:75
+
static const Event n
Definition event.hpp:82
+
static const Event q
Definition event.hpp:85
+
static const Event AltZ
Definition event.hpp:94
+
static const Event Home
Definition event.hpp:60
+
static const Event C
Definition event.hpp:71
+
static const Event AltD
Definition event.hpp:72
+
static const Event CtrlAltY
Definition event.hpp:93
+
static const Event AltJ
Definition event.hpp:78
+
static const Event F8
Definition event.hpp:66
+
static const Event CtrlAltL
Definition event.hpp:80
+
static const Event U
Definition event.hpp:89
+
static const Event o
Definition event.hpp:83
+
static const Event AltB
Definition event.hpp:70
+
static const Event F4
Definition event.hpp:66
+
static const Event t
Definition event.hpp:88
+
static const Event y
Definition event.hpp:93
+
static const Event ArrowUpCtrl
Definition event.hpp:47
+
static const Event k
Definition event.hpp:79
+
static const Event CtrlAltS
Definition event.hpp:87
+
static const Event s
Definition event.hpp:87
+
static const Event I
Definition event.hpp:77
+
static const Event CtrlT
Definition event.hpp:88
+
static const Event F
Definition event.hpp:74
+
static const Event AltI
Definition event.hpp:77
+
static const Event F10
Definition event.hpp:66
+
static const Event AltP
Definition event.hpp:84
+
static const Event PageDown
Definition event.hpp:63
+
static const Event Y
Definition event.hpp:93
+
static const Event CtrlAltK
Definition event.hpp:79
+
static const Event F6
Definition event.hpp:66
+
static const Event CtrlAltG
Definition event.hpp:75
+
static const Event CtrlA
Definition event.hpp:69
+
static const Event i
Definition event.hpp:77
+
static const Event AltS
Definition event.hpp:87
+
static const Event g
Definition event.hpp:75
+
static const Event F1
Definition event.hpp:66
+
static const Event S
Definition event.hpp:87
+
static const Event Return
Definition event.hpp:53
+
static const Event CtrlAltU
Definition event.hpp:89
+
static const Event V
Definition event.hpp:90
+
static const Event CtrlAltT
Definition event.hpp:88
+
static const Event CtrlAltA
Definition event.hpp:69
+
static const Event AltE
Definition event.hpp:73
+
static const Event P
Definition event.hpp:84
+
static const Event CtrlD
Definition event.hpp:72
+
static const Event ArrowLeft
Definition event.hpp:40
+
static const Event CtrlAltB
Definition event.hpp:70
+
static const Event AltV
Definition event.hpp:90
+
static const Event v
Definition event.hpp:90
+
static const Event e
Definition event.hpp:73
+
static const Event CtrlO
Definition event.hpp:83
+
static const Event Delete
Definition event.hpp:52
+
static const Event CtrlAltV
Definition event.hpp:90
+
static const Event ArrowDownCtrl
Definition event.hpp:48
+
static const Event AltX
Definition event.hpp:92
+
static const Event CtrlAltD
Definition event.hpp:72
+
static const Event L
Definition event.hpp:80
+
static const Event W
Definition event.hpp:91
+
static const Event f
Definition event.hpp:74
+
static const Event Insert
Definition event.hpp:59
+
static const Event CtrlI
Definition event.hpp:77
+
static const Event ArrowRightCtrl
Definition event.hpp:46
+
static const Event c
Definition event.hpp:71
+
static const Event CtrlAltQ
Definition event.hpp:85
+
static const Event M
Definition event.hpp:81
+
static Event Special(std::string)
An custom event whose meaning is defined by the user of the library.
Definition event.cpp:74
+
static const Event ArrowRight
Definition event.hpp:41
+
Represent an event. It can be key press event, a terminal resize, or more ...
Definition event.hpp:29
+
A mouse event. It contains the coordinate of the mouse, the button pressed and the modifier (shift,...
Definition mouse.hpp:11
+ +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::string to_string(const std::wstring &s)
Convert a std::wstring into a UTF8 std::string.
Definition string.cpp:1566
+ +
+
+ + + + + diff --git a/event_8cppm.html b/event_8cppm.html new file mode 100644 index 000000000..c96522a23 --- /dev/null +++ b/event_8cppm.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: event.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
event.cppm File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+
+
+ + + + + diff --git a/event_8cppm_source.html b/event_8cppm_source.html new file mode 100644 index 000000000..f02ddcf0a --- /dev/null +++ b/event_8cppm_source.html @@ -0,0 +1,234 @@ + + + + + + + + +FTXUI: event.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
event.cppm
+
+
+Go to the documentation of this file.
1/// @module ftxui.component.event
+
2/// @brief Module file for the Event struct of the Component module
+
3
+
4module;
+
5
+ +
7
+
8export module ftxui.component.event;
+
9
+
10/**
+
11 * @namespace ftxui
+
12 * @brief The FTXUI ftxui:: namespace
+
13 */
+
14export namespace ftxui {
+ + +
17
+
18 using ftxui::Event;
+
19}
+ +
It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ft...
+
ScreenInteractive is a Screen that can handle events, run a main loop, and manage components.
+
Represent an event. It can be key press event, a terminal resize, or more ...
Definition event.hpp:29
+
Module file for the Event struct of the Component module.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
+
+ + + + + diff --git a/event_8hpp.html b/event_8hpp.html new file mode 100644 index 000000000..c476663d0 --- /dev/null +++ b/event_8hpp.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: event.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
event.hpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Classes

struct  Event
 Represent an event. It can be key press event, a terminal resize, or more ... More...
 
+ + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+
+
+ + + + + diff --git a/event_8hpp_source.html b/event_8hpp_source.html new file mode 100644 index 000000000..b8de12027 --- /dev/null +++ b/event_8hpp_source.html @@ -0,0 +1,555 @@ + + + + + + + + +FTXUI: event.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
event.hpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#ifndef FTXUI_COMPONENT_EVENT_HPP
+
5#define FTXUI_COMPONENT_EVENT_HPP
+
6
+
7#include <ftxui/component/mouse.hpp> // for Mouse
+
8#include <string> // for string, operator==
+
9
+
10namespace ftxui {
+
11
+
12class ScreenInteractive;
+
13class ComponentBase;
+
14
+
15/// @brief Represent an event. It can be key press event, a terminal resize, or
+
16/// more ...
+
17///
+
18/// For example:
+
19/// - Printable character can be created using Event::Character('a').
+
20/// - Some special are predefined, like Event::ArrowLeft.
+
21/// - One can find arbitrary code for special Events using:
+
22/// ./example/util/print_key_press
+
23/// For instance, CTLR+A maps to Event::Special({1});
+
24///
+
25/// Useful documentation about xterm specification:
+
26/// https://invisible-island.net/xterm/ctlseqs/ctlseqs.html
+
27///
+
28/// @ingroup component
+
+
29struct Event {
+
30 // --- Constructor section ---------------------------------------------------
+
31 static Event Character(std::string);
+
32 static Event Character(char);
+
33 static Event Character(wchar_t);
+
34 static Event Special(std::string);
+
35 static Event Mouse(std::string, Mouse mouse);
+
36 static Event CursorPosition(std::string, int x, int y); // Internal
+
37 static Event CursorShape(std::string, int shape); // Internal
+
38
+
39 // --- Arrow ---
+
40 static const Event ArrowLeft;
+
41 static const Event ArrowRight;
+
42 static const Event ArrowUp;
+
43 static const Event ArrowDown;
+
44
+
45 static const Event ArrowLeftCtrl;
+
46 static const Event ArrowRightCtrl;
+
47 static const Event ArrowUpCtrl;
+
48 static const Event ArrowDownCtrl;
+
49
+
50 // --- Other ---
+
51 static const Event Backspace;
+
52 static const Event Delete;
+
53 static const Event Return;
+
54 static const Event Escape;
+
55 static const Event Tab;
+
56 static const Event TabReverse;
+
57
+
58 // --- Navigation keys ---
+
59 static const Event Insert;
+
60 static const Event Home;
+
61 static const Event End;
+
62 static const Event PageUp;
+
63 static const Event PageDown;
+
64
+
65 // --- Function keys ---
+
66 static const Event F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12;
+
67
+
68 // --- Control keys ---
+
69 static const Event a, A, CtrlA, AltA, CtrlAltA;
+
70 static const Event b, B, CtrlB, AltB, CtrlAltB;
+
71 static const Event c, C, CtrlC, AltC, CtrlAltC;
+
72 static const Event d, D, CtrlD, AltD, CtrlAltD;
+
73 static const Event e, E, CtrlE, AltE, CtrlAltE;
+
74 static const Event f, F, CtrlF, AltF, CtrlAltF;
+
75 static const Event g, G, CtrlG, AltG, CtrlAltG;
+
76 static const Event h, H, CtrlH, AltH, CtrlAltH;
+
77 static const Event i, I, CtrlI, AltI, CtrlAltI;
+
78 static const Event j, J, CtrlJ, AltJ, CtrlAltJ;
+
79 static const Event k, K, CtrlK, AltK, CtrlAltK;
+
80 static const Event l, L, CtrlL, AltL, CtrlAltL;
+
81 static const Event m, M, CtrlM, AltM, CtrlAltM;
+
82 static const Event n, N, CtrlN, AltN, CtrlAltN;
+
83 static const Event o, O, CtrlO, AltO, CtrlAltO;
+
84 static const Event p, P, CtrlP, AltP, CtrlAltP;
+
85 static const Event q, Q, CtrlQ, AltQ, CtrlAltQ;
+
86 static const Event r, R, CtrlR, AltR, CtrlAltR;
+
87 static const Event s, S, CtrlS, AltS, CtrlAltS;
+
88 static const Event t, T, CtrlT, AltT, CtrlAltT;
+
89 static const Event u, U, CtrlU, AltU, CtrlAltU;
+
90 static const Event v, V, CtrlV, AltV, CtrlAltV;
+
91 static const Event w, W, CtrlW, AltW, CtrlAltW;
+
92 static const Event x, X, CtrlX, AltX, CtrlAltX;
+
93 static const Event y, Y, CtrlY, AltY, CtrlAltY;
+
94 static const Event z, Z, CtrlZ, AltZ, CtrlAltZ;
+
95
+
96 // --- Custom ---
+
97 static const Event Custom;
+
98
+
99 //--- Method section ---------------------------------------------------------
+
100 bool operator==(const Event& other) const { return input_ == other.input_; }
+
101 bool operator!=(const Event& other) const { return !operator==(other); }
+
102 bool operator<(const Event& other) const { return input_ < other.input_; }
+
103
+
104 const std::string& input() const { return input_; }
+
105
+
106 bool is_character() const { return type_ == Type::Character; }
+
107 std::string character() const { return input_; }
+
108
+
109 bool is_mouse() const { return type_ == Type::Mouse; }
+
110 struct Mouse& mouse() { return data_.mouse; }
+
111
+
112 // --- Internal Method section -----------------------------------------------
+
113 bool is_cursor_position() const { return type_ == Type::CursorPosition; }
+
114 int cursor_x() const { return data_.cursor.x; }
+
115 int cursor_y() const { return data_.cursor.y; }
+
116
+
117 bool is_cursor_shape() const { return type_ == Type::CursorShape; }
+
118 int cursor_shape() const { return data_.cursor_shape; }
+
119
+
120 // Debug
+
121 std::string DebugString() const;
+
122
+
123 //--- State section ----------------------------------------------------------
+ +
125
+
126 private:
+
127 friend ComponentBase;
+
128 friend ScreenInteractive;
+
129 enum class Type {
+
130 Unknown,
+
131 Character,
+
132 Mouse,
+
133 CursorPosition,
+
134 CursorShape,
+
135 };
+
136 Type type_ = Type::Unknown;
+
137
+
138 struct Cursor {
+
139 int x = 0;
+
140 int y = 0;
+
141 };
+
142
+
143 union {
+
144 struct Mouse mouse;
+
145 struct Cursor cursor;
+ +
147 } data_ = {};
+
148
+
149 std::string input_;
+
150};
+
+
151
+
152} // namespace ftxui
+
153
+
154#endif /* end of include guard: FTXUI_COMPONENT_EVENT_HPP */
+
static const Event TabReverse
Definition event.hpp:56
+
int cursor_shape() const
Definition event.hpp:118
+
static const Event j
Definition event.hpp:78
+
static const Event CtrlC
Definition event.hpp:71
+
static const Event CtrlP
Definition event.hpp:84
+
static const Event CtrlV
Definition event.hpp:90
+
static const Event ArrowLeftCtrl
Definition event.hpp:45
+
static const Event CtrlL
Definition event.hpp:80
+
static const Event AltT
Definition event.hpp:88
+
std::string character() const
Definition event.hpp:107
+
static const Event w
Definition event.hpp:91
+
static const Event CtrlAltX
Definition event.hpp:92
+
static const Event D
Definition event.hpp:72
+
static const Event CtrlAltN
Definition event.hpp:82
+
static const Event a
Definition event.hpp:69
+
static Event CursorShape(std::string, int shape)
An event corresponding to a terminal DCS (Device Control String).
Definition event.cpp:63
+
static const Event AltH
Definition event.hpp:76
+
static const Event AltF
Definition event.hpp:74
+
static const Event K
Definition event.hpp:79
+
int cursor_y() const
Definition event.hpp:115
+
static const Event T
Definition event.hpp:88
+
static const Event CtrlAltC
Definition event.hpp:71
+
static const Event X
Definition event.hpp:92
+
int cursor_x() const
Definition event.hpp:114
+
static const Event CtrlE
Definition event.hpp:73
+
static const Event Q
Definition event.hpp:85
+
static const Event u
Definition event.hpp:89
+
static const Event PageUp
Definition event.hpp:62
+
static const Event h
Definition event.hpp:76
+
static const Event CtrlAltF
Definition event.hpp:74
+
static const Event CtrlZ
Definition event.hpp:94
+
static const Event J
Definition event.hpp:78
+
int cursor_shape
Definition event.hpp:146
+
static const Event CtrlU
Definition event.hpp:89
+
static const Event AltQ
Definition event.hpp:85
+
static const Event b
Definition event.hpp:70
+
static const Event Escape
Definition event.hpp:54
+
static const Event AltY
Definition event.hpp:93
+
static const Event CtrlAltI
Definition event.hpp:77
+
bool is_mouse() const
Definition event.hpp:109
+
static const Event AltL
Definition event.hpp:80
+
static const Event AltW
Definition event.hpp:91
+
static const Event F12
Definition event.hpp:66
+
struct Mouse & mouse()
Definition event.hpp:110
+
static const Event E
Definition event.hpp:73
+
static const Event m
Definition event.hpp:81
+
static const Event N
Definition event.hpp:82
+
bool is_cursor_position() const
Definition event.hpp:113
+
static const Event CtrlAltP
Definition event.hpp:84
+
static const Event CtrlAltE
Definition event.hpp:73
+
static const Event F5
Definition event.hpp:66
+
static const Event CtrlF
Definition event.hpp:74
+
static const Event F3
Definition event.hpp:66
+
static const Event CtrlAltJ
Definition event.hpp:78
+
static const Event z
Definition event.hpp:94
+
static const Event AltK
Definition event.hpp:79
+
static const Event B
Definition event.hpp:70
+
static const Event H
Definition event.hpp:76
+
static const Event CtrlX
Definition event.hpp:92
+
static const Event F9
Definition event.hpp:66
+
static const Event AltC
Definition event.hpp:71
+
static const Event CtrlB
Definition event.hpp:70
+
static const Event CtrlAltH
Definition event.hpp:76
+
static const Event O
Definition event.hpp:83
+
ScreenInteractive * screen_
Definition event.hpp:124
+
static const Event R
Definition event.hpp:86
+
static const Event AltM
Definition event.hpp:81
+
static const Event CtrlR
Definition event.hpp:86
+
static const Event CtrlAltW
Definition event.hpp:91
+
static const Event CtrlAltO
Definition event.hpp:83
+
static const Event CtrlY
Definition event.hpp:93
+
static const Event Custom
Definition event.hpp:97
+
static const Event A
Definition event.hpp:69
+
static const Event AltG
Definition event.hpp:75
+
static const Event p
Definition event.hpp:84
+
static const Event l
Definition event.hpp:80
+
static const Event CtrlH
Definition event.hpp:76
+
bool operator<(const Event &other) const
Definition event.hpp:102
+
struct Mouse mouse
Definition event.hpp:144
+
std::string DebugString() const
Return a string representation of the event.
Definition event.cpp:91
+
static Event Character(std::string)
An event corresponding to a given typed character.
Definition event.cpp:28
+
static const Event AltO
Definition event.hpp:83
+
static const Event CtrlJ
Definition event.hpp:78
+
static const Event CtrlAltM
Definition event.hpp:81
+
static const Event CtrlS
Definition event.hpp:87
+
static const Event Z
Definition event.hpp:94
+
static const Event AltR
Definition event.hpp:86
+
static const Event CtrlW
Definition event.hpp:91
+
static const Event CtrlN
Definition event.hpp:82
+
static const Event F2
Definition event.hpp:66
+
static const Event CtrlM
Definition event.hpp:81
+
static const Event G
Definition event.hpp:75
+
static const Event Backspace
Definition event.hpp:51
+
static const Event d
Definition event.hpp:72
+
static const Event CtrlAltR
Definition event.hpp:86
+
static const Event CtrlK
Definition event.hpp:79
+
static const Event x
Definition event.hpp:92
+
static const Event F7
Definition event.hpp:66
+
static const Event ArrowUp
Definition event.hpp:42
+
const std::string & input() const
Definition event.hpp:104
+
static const Event Tab
Definition event.hpp:55
+
static const Event r
Definition event.hpp:86
+
static const Event AltU
Definition event.hpp:89
+
static const Event CtrlQ
Definition event.hpp:85
+
static const Event CtrlAltZ
Definition event.hpp:94
+
static const Event AltN
Definition event.hpp:82
+
static const Event AltA
Definition event.hpp:69
+
static const Event ArrowDown
Definition event.hpp:43
+
struct Cursor cursor
Definition event.hpp:145
+
static const Event End
Definition event.hpp:61
+
static const Event F11
Definition event.hpp:66
+
static const Event CtrlG
Definition event.hpp:75
+
static const Event n
Definition event.hpp:82
+
static const Event q
Definition event.hpp:85
+
static const Event AltZ
Definition event.hpp:94
+
static const Event Home
Definition event.hpp:60
+
static const Event C
Definition event.hpp:71
+
static const Event AltD
Definition event.hpp:72
+
static const Event CtrlAltY
Definition event.hpp:93
+
static const Event AltJ
Definition event.hpp:78
+
static const Event F8
Definition event.hpp:66
+
static const Event CtrlAltL
Definition event.hpp:80
+
static const Event U
Definition event.hpp:89
+
static const Event o
Definition event.hpp:83
+
static const Event AltB
Definition event.hpp:70
+
static const Event F4
Definition event.hpp:66
+
static const Event t
Definition event.hpp:88
+
static const Event y
Definition event.hpp:93
+
static const Event ArrowUpCtrl
Definition event.hpp:47
+
static const Event k
Definition event.hpp:79
+
static const Event CtrlAltS
Definition event.hpp:87
+
static const Event s
Definition event.hpp:87
+
static const Event I
Definition event.hpp:77
+
static const Event CtrlT
Definition event.hpp:88
+
static const Event F
Definition event.hpp:74
+
static const Event AltI
Definition event.hpp:77
+
static const Event F10
Definition event.hpp:66
+
static const Event AltP
Definition event.hpp:84
+
static const Event PageDown
Definition event.hpp:63
+
static const Event Y
Definition event.hpp:93
+
static const Event CtrlAltK
Definition event.hpp:79
+
static Event CursorPosition(std::string, int x, int y)
Definition event.cpp:82
+
static const Event F6
Definition event.hpp:66
+
static const Event CtrlAltG
Definition event.hpp:75
+
static const Event CtrlA
Definition event.hpp:69
+
static const Event i
Definition event.hpp:77
+
static const Event AltS
Definition event.hpp:87
+
static const Event g
Definition event.hpp:75
+
static const Event F1
Definition event.hpp:66
+
static const Event S
Definition event.hpp:87
+
static const Event Return
Definition event.hpp:53
+
static const Event CtrlAltU
Definition event.hpp:89
+
bool operator==(const Event &other) const
Definition event.hpp:100
+
static const Event V
Definition event.hpp:90
+
static const Event CtrlAltT
Definition event.hpp:88
+
static const Event CtrlAltA
Definition event.hpp:69
+
static const Event AltE
Definition event.hpp:73
+
static const Event P
Definition event.hpp:84
+
static const Event CtrlD
Definition event.hpp:72
+
static const Event ArrowLeft
Definition event.hpp:40
+
static const Event CtrlAltB
Definition event.hpp:70
+
bool operator!=(const Event &other) const
Definition event.hpp:101
+
static const Event AltV
Definition event.hpp:90
+
static const Event v
Definition event.hpp:90
+
static const Event e
Definition event.hpp:73
+
bool is_character() const
Definition event.hpp:106
+
static const Event CtrlO
Definition event.hpp:83
+
static const Event Delete
Definition event.hpp:52
+
static const Event CtrlAltV
Definition event.hpp:90
+
static const Event ArrowDownCtrl
Definition event.hpp:48
+
static const Event AltX
Definition event.hpp:92
+
static const Event CtrlAltD
Definition event.hpp:72
+
static const Event L
Definition event.hpp:80
+
static const Event W
Definition event.hpp:91
+
static const Event f
Definition event.hpp:74
+
static const Event Insert
Definition event.hpp:59
+
static const Event CtrlI
Definition event.hpp:77
+
static const Event ArrowRightCtrl
Definition event.hpp:46
+
bool is_cursor_shape() const
Definition event.hpp:117
+
static const Event c
Definition event.hpp:71
+
static const Event CtrlAltQ
Definition event.hpp:85
+
static const Event M
Definition event.hpp:81
+
static Event Special(std::string)
An custom event whose meaning is defined by the user of the library.
Definition event.cpp:74
+
static const Event ArrowRight
Definition event.hpp:41
+
It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ft...
+
ScreenInteractive is a Screen that can handle events, run a main loop, and manage components.
+
Represent an event. It can be key press event, a terminal resize, or more ...
Definition event.hpp:29
+
A mouse event. It contains the coordinate of the mouse, the button pressed and the modifier (shift,...
Definition mouse.hpp:11
+ +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
+
+ + + + + diff --git a/examples.html b/examples.html new file mode 100644 index 000000000..ca5e31633 --- /dev/null +++ b/examples.html @@ -0,0 +1,296 @@ + + + + + + + + +FTXUI: Examples + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Examples
+
+
+
Here is a list of all examples:
+
+
+ + + + + diff --git a/examples.js b/examples.js new file mode 100644 index 000000000..3e443bb11 --- /dev/null +++ b/examples.js @@ -0,0 +1,89 @@ +var examples = +[ + [ "examples/component/button.cpp", "examples_2component_2button_8cpp-example.html", null ], + [ "examples/component/button_animated.cpp", "examples_2component_2button_animated_8cpp-example.html", null ], + [ "examples/component/button_in_frame.cpp", "examples_2component_2button_in_frame_8cpp-example.html", null ], + [ "examples/component/button_style.cpp", "examples_2component_2button_style_8cpp-example.html", null ], + [ "examples/component/canvas_animated.cpp", "examples_2component_2canvas_animated_8cpp-example.html", null ], + [ "examples/component/checkbox.cpp", "examples_2component_2checkbox_8cpp-example.html", null ], + [ "examples/component/checkbox_in_frame.cpp", "examples_2component_2checkbox_in_frame_8cpp-example.html", null ], + [ "examples/component/collapsible.cpp", "examples_2component_2collapsible_8cpp-example.html", null ], + [ "examples/component/composition.cpp", "examples_2component_2composition_8cpp-example.html", null ], + [ "examples/component/custom_loop.cpp", "examples_2component_2custom_loop_8cpp-example.html", null ], + [ "examples/component/dropdown.cpp", "examples_2component_2dropdown_8cpp-example.html", null ], + [ "examples/component/dropdown_custom.cpp", "examples_2component_2dropdown_custom_8cpp-example.html", null ], + [ "examples/component/flexbox_gallery.cpp", "examples_2component_2flexbox_gallery_8cpp-example.html", null ], + [ "examples/component/focus.cpp", "examples_2component_2focus_8cpp-example.html", null ], + [ "examples/component/focus_cursor.cpp", "examples_2component_2focus_cursor_8cpp-example.html", null ], + [ "examples/component/gallery.cpp", "examples_2component_2gallery_8cpp-example.html", null ], + [ "examples/component/homescreen.cpp", "examples_2component_2homescreen_8cpp-example.html", null ], + [ "examples/component/input.cpp", "examples_2component_2input_8cpp-example.html", null ], + [ "examples/component/input_in_frame.cpp", "examples_2component_2input_in_frame_8cpp-example.html", null ], + [ "examples/component/input_style.cpp", "examples_2component_2input_style_8cpp-example.html", null ], + [ "examples/component/linear_gradient_gallery.cpp", "examples_2component_2linear_gradient_gallery_8cpp-example.html", null ], + [ "examples/component/maybe.cpp", "examples_2component_2maybe_8cpp-example.html", null ], + [ "examples/component/menu.cpp", "examples_2component_2menu_8cpp-example.html", null ], + [ "examples/component/menu2.cpp", "examples_2component_2menu2_8cpp-example.html", null ], + [ "examples/component/menu_entries.cpp", "examples_2component_2menu_entries_8cpp-example.html", null ], + [ "examples/component/menu_entries_animated.cpp", "examples_2component_2menu_entries_animated_8cpp-example.html", null ], + [ "examples/component/menu_in_frame.cpp", "examples_2component_2menu_in_frame_8cpp-example.html", null ], + [ "examples/component/menu_in_frame_horizontal.cpp", "examples_2component_2menu_in_frame_horizontal_8cpp-example.html", null ], + [ "examples/component/menu_multiple.cpp", "examples_2component_2menu_multiple_8cpp-example.html", null ], + [ "examples/component/menu_style.cpp", "examples_2component_2menu_style_8cpp-example.html", null ], + [ "examples/component/menu_underline_animated_gallery.cpp", "examples_2component_2menu_underline_animated_gallery_8cpp-example.html", null ], + [ "examples/component/modal_dialog.cpp", "examples_2component_2modal_dialog_8cpp-example.html", null ], + [ "examples/component/modal_dialog_custom.cpp", "examples_2component_2modal_dialog_custom_8cpp-example.html", null ], + [ "examples/component/nested_screen.cpp", "examples_2component_2nested_screen_8cpp-example.html", null ], + [ "examples/component/print_key_press.cpp", "examples_2component_2print_key_press_8cpp-example.html", null ], + [ "examples/component/radiobox.cpp", "examples_2component_2radiobox_8cpp-example.html", null ], + [ "examples/component/radiobox_in_frame.cpp", "examples_2component_2radiobox_in_frame_8cpp-example.html", null ], + [ "examples/component/renderer.cpp", "examples_2component_2renderer_8cpp-example.html", null ], + [ "examples/component/resizable_split.cpp", "examples_2component_2resizable_split_8cpp-example.html", null ], + [ "examples/component/scrollbar.cpp", "examples_2component_2scrollbar_8cpp-example.html", null ], + [ "examples/component/selection.cpp", "examples_2component_2selection_8cpp-example.html", null ], + [ "examples/component/slider.cpp", "examples_2component_2slider_8cpp-example.html", null ], + [ "examples/component/slider_direction.cpp", "examples_2component_2slider_direction_8cpp-example.html", null ], + [ "examples/component/slider_rgb.cpp", "examples_2component_2slider_rgb_8cpp-example.html", null ], + [ "examples/component/tab_horizontal.cpp", "examples_2component_2tab_horizontal_8cpp-example.html", null ], + [ "examples/component/tab_vertical.cpp", "examples_2component_2tab_vertical_8cpp-example.html", null ], + [ "examples/component/textarea.cpp", "examples_2component_2textarea_8cpp-example.html", null ], + [ "examples/component/toggle.cpp", "examples_2component_2toggle_8cpp-example.html", null ], + [ "examples/component/window.cpp", "examples_2component_2window_8cpp-example.html", null ], + [ "examples/component/with_restored_io.cpp", "examples_2component_2with_restored_io_8cpp-example.html", null ], + [ "examples/dom/border.cpp", "examples_2dom_2border_8cpp-example.html", null ], + [ "examples/dom/border_colored.cpp", "examples_2dom_2border_colored_8cpp-example.html", null ], + [ "examples/dom/border_style.cpp", "examples_2dom_2border_style_8cpp-example.html", null ], + [ "examples/dom/canvas.cpp", "examples_2dom_2canvas_8cpp-example.html", null ], + [ "examples/dom/color_gallery.cpp", "examples_2dom_2color_gallery_8cpp-example.html", null ], + [ "examples/dom/color_info_palette256.cpp", "examples_2dom_2color_info_palette256_8cpp-example.html", null ], + [ "examples/dom/color_truecolor_HSV.cpp", "examples_2dom_2color_truecolor_HSV_8cpp-example.html", null ], + [ "examples/dom/color_truecolor_RGB.cpp", "examples_2dom_2color_truecolor_RGB_8cpp-example.html", null ], + [ "examples/dom/dbox.cpp", "examples_2dom_2dbox_8cpp-example.html", null ], + [ "examples/dom/gauge.cpp", "examples_2dom_2gauge_8cpp-example.html", null ], + [ "examples/dom/gauge_direction.cpp", "examples_2dom_2gauge_direction_8cpp-example.html", null ], + [ "examples/dom/graph.cpp", "examples_2dom_2graph_8cpp-example.html", null ], + [ "examples/dom/gridbox.cpp", "examples_2dom_2gridbox_8cpp-example.html", null ], + [ "examples/dom/hflow.cpp", "examples_2dom_2hflow_8cpp-example.html", null ], + [ "examples/dom/html_like.cpp", "examples_2dom_2html_like_8cpp-example.html", null ], + [ "examples/dom/linear_gradient.cpp", "examples_2dom_2linear_gradient_8cpp-example.html", null ], + [ "examples/dom/package_manager.cpp", "examples_2dom_2package_manager_8cpp-example.html", null ], + [ "examples/dom/paragraph.cpp", "examples_2dom_2paragraph_8cpp-example.html", null ], + [ "examples/dom/separator.cpp", "examples_2dom_2separator_8cpp-example.html", null ], + [ "examples/dom/separator_style.cpp", "examples_2dom_2separator_style_8cpp-example.html", null ], + [ "examples/dom/size.cpp", "examples_2dom_2size_8cpp-example.html", null ], + [ "examples/dom/spinner.cpp", "examples_2dom_2spinner_8cpp-example.html", null ], + [ "examples/dom/style_blink.cpp", "examples_2dom_2style_blink_8cpp-example.html", null ], + [ "examples/dom/style_bold.cpp", "examples_2dom_2style_bold_8cpp-example.html", null ], + [ "examples/dom/style_color.cpp", "examples_2dom_2style_color_8cpp-example.html", null ], + [ "examples/dom/style_dim.cpp", "examples_2dom_2style_dim_8cpp-example.html", null ], + [ "examples/dom/style_gallery.cpp", "examples_2dom_2style_gallery_8cpp-example.html", null ], + [ "examples/dom/style_hyperlink.cpp", "examples_2dom_2style_hyperlink_8cpp-example.html", null ], + [ "examples/dom/style_inverted.cpp", "examples_2dom_2style_inverted_8cpp-example.html", null ], + [ "examples/dom/style_italic.cpp", "examples_2dom_2style_italic_8cpp-example.html", null ], + [ "examples/dom/style_strikethrough.cpp", "examples_2dom_2style_strikethrough_8cpp-example.html", null ], + [ "examples/dom/style_underlined.cpp", "examples_2dom_2style_underlined_8cpp-example.html", null ], + [ "examples/dom/style_underlined_double.cpp", "examples_2dom_2style_underlined_double_8cpp-example.html", null ], + [ "examples/dom/table.cpp", "examples_2dom_2table_8cpp-example.html", null ], + [ "examples/dom/vbox_hbox.cpp", "examples_2dom_2vbox_hbox_8cpp-example.html", null ], + [ "examples/dom/vflow.cpp", "examples_2dom_2vflow_8cpp-example.html", null ] +]; \ No newline at end of file diff --git a/examples/component/ftxui_example_button.js b/examples/component/ftxui_example_button.js new file mode 100644 index 000000000..2d83491ab --- /dev/null +++ b/examples/component/ftxui_example_button.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_button.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={40224:function(){throw"Canceled!"},40242:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_button.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=40216;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=52856;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_button.wasm b/examples/component/ftxui_example_button.wasm new file mode 100755 index 000000000..738c091cf Binary files /dev/null and b/examples/component/ftxui_example_button.wasm differ diff --git a/examples/component/ftxui_example_button.worker.js b/examples/component/ftxui_example_button.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_button.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_button_animated.js b/examples/component/ftxui_example_button_animated.js new file mode 100644 index 000000000..2f97aa61c --- /dev/null +++ b/examples/component/ftxui_example_button_animated.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_button_animated.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={39048:function(){throw"Canceled!"},39066:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_button_animated.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=39040;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=51944;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_button_animated.wasm b/examples/component/ftxui_example_button_animated.wasm new file mode 100755 index 000000000..a19821edb Binary files /dev/null and b/examples/component/ftxui_example_button_animated.wasm differ diff --git a/examples/component/ftxui_example_button_animated.worker.js b/examples/component/ftxui_example_button_animated.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_button_animated.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_button_in_frame.js b/examples/component/ftxui_example_button_in_frame.js new file mode 100644 index 000000000..46e8f7da8 --- /dev/null +++ b/examples/component/ftxui_example_button_in_frame.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_button_in_frame.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={39408:function(){throw"Canceled!"},39426:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_button_in_frame.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=39400;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=52040;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_button_in_frame.wasm b/examples/component/ftxui_example_button_in_frame.wasm new file mode 100755 index 000000000..5372fba96 Binary files /dev/null and b/examples/component/ftxui_example_button_in_frame.wasm differ diff --git a/examples/component/ftxui_example_button_in_frame.worker.js b/examples/component/ftxui_example_button_in_frame.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_button_in_frame.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_button_style.js b/examples/component/ftxui_example_button_style.js new file mode 100644 index 000000000..8d361362e --- /dev/null +++ b/examples/component/ftxui_example_button_style.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_button_style.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={40648:function(){throw"Canceled!"},40666:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_button_style.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=40640;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=53272;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_button_style.wasm b/examples/component/ftxui_example_button_style.wasm new file mode 100755 index 000000000..13fc2cce0 Binary files /dev/null and b/examples/component/ftxui_example_button_style.wasm differ diff --git a/examples/component/ftxui_example_button_style.worker.js b/examples/component/ftxui_example_button_style.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_button_style.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_canvas_animated.js b/examples/component/ftxui_example_canvas_animated.js new file mode 100644 index 000000000..db83a72cc --- /dev/null +++ b/examples/component/ftxui_example_canvas_animated.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_canvas_animated.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={48792:function(){throw"Canceled!"},48810:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_canvas_animated.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"h":___cxa_allocate_exception,"s":___cxa_thread_atexit,"g":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"i":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=48784;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=61432;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_canvas_animated.wasm b/examples/component/ftxui_example_canvas_animated.wasm new file mode 100755 index 000000000..cb85324cb Binary files /dev/null and b/examples/component/ftxui_example_canvas_animated.wasm differ diff --git a/examples/component/ftxui_example_canvas_animated.worker.js b/examples/component/ftxui_example_canvas_animated.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_canvas_animated.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_checkbox.js b/examples/component/ftxui_example_checkbox.js new file mode 100644 index 000000000..e87523162 --- /dev/null +++ b/examples/component/ftxui_example_checkbox.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_checkbox.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={29736:function(){throw"Canceled!"},29754:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_checkbox.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=29728;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=41768;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_checkbox.wasm b/examples/component/ftxui_example_checkbox.wasm new file mode 100755 index 000000000..729273fc3 Binary files /dev/null and b/examples/component/ftxui_example_checkbox.wasm differ diff --git a/examples/component/ftxui_example_checkbox.worker.js b/examples/component/ftxui_example_checkbox.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_checkbox.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_checkbox_in_frame.js b/examples/component/ftxui_example_checkbox_in_frame.js new file mode 100644 index 000000000..37d0ef819 --- /dev/null +++ b/examples/component/ftxui_example_checkbox_in_frame.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_checkbox_in_frame.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={31504:function(){throw"Canceled!"},31522:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_checkbox_in_frame.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=31496;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=43976;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_checkbox_in_frame.wasm b/examples/component/ftxui_example_checkbox_in_frame.wasm new file mode 100755 index 000000000..1254f8a05 Binary files /dev/null and b/examples/component/ftxui_example_checkbox_in_frame.wasm differ diff --git a/examples/component/ftxui_example_checkbox_in_frame.worker.js b/examples/component/ftxui_example_checkbox_in_frame.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_checkbox_in_frame.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_collapsible.js b/examples/component/ftxui_example_collapsible.js new file mode 100644 index 000000000..a11dbee94 --- /dev/null +++ b/examples/component/ftxui_example_collapsible.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_collapsible.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={32248:function(){throw"Canceled!"},32266:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_collapsible.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=32240;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=44280;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_collapsible.wasm b/examples/component/ftxui_example_collapsible.wasm new file mode 100755 index 000000000..df0404885 Binary files /dev/null and b/examples/component/ftxui_example_collapsible.wasm differ diff --git a/examples/component/ftxui_example_collapsible.worker.js b/examples/component/ftxui_example_collapsible.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_collapsible.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_composition.js b/examples/component/ftxui_example_composition.js new file mode 100644 index 000000000..7a6276d7d --- /dev/null +++ b/examples/component/ftxui_example_composition.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_composition.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={39104:function(){throw"Canceled!"},39122:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_composition.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=39096;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=51736;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_composition.wasm b/examples/component/ftxui_example_composition.wasm new file mode 100755 index 000000000..39cb0939f Binary files /dev/null and b/examples/component/ftxui_example_composition.wasm differ diff --git a/examples/component/ftxui_example_composition.worker.js b/examples/component/ftxui_example_composition.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_composition.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_custom_loop.js b/examples/component/ftxui_example_custom_loop.js new file mode 100644 index 000000000..5464a2aae --- /dev/null +++ b/examples/component/ftxui_example_custom_loop.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_custom_loop.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={29608:function(){throw"Canceled!"},29626:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_custom_loop.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=29600;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=42216;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_custom_loop.wasm b/examples/component/ftxui_example_custom_loop.wasm new file mode 100755 index 000000000..d99809592 Binary files /dev/null and b/examples/component/ftxui_example_custom_loop.wasm differ diff --git a/examples/component/ftxui_example_custom_loop.worker.js b/examples/component/ftxui_example_custom_loop.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_custom_loop.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_dropdown.js b/examples/component/ftxui_example_dropdown.js new file mode 100644 index 000000000..4c9d85ceb --- /dev/null +++ b/examples/component/ftxui_example_dropdown.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_dropdown.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={34576:function(){throw"Canceled!"},34594:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_dropdown.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=34568;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=47192;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_dropdown.wasm b/examples/component/ftxui_example_dropdown.wasm new file mode 100755 index 000000000..e241967d8 Binary files /dev/null and b/examples/component/ftxui_example_dropdown.wasm differ diff --git a/examples/component/ftxui_example_dropdown.worker.js b/examples/component/ftxui_example_dropdown.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_dropdown.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_dropdown_custom.js b/examples/component/ftxui_example_dropdown_custom.js new file mode 100644 index 000000000..3ec1a5b6a --- /dev/null +++ b/examples/component/ftxui_example_dropdown_custom.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_dropdown_custom.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={41608:function(){throw"Canceled!"},41626:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_dropdown_custom.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=41600;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=54232;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_dropdown_custom.wasm b/examples/component/ftxui_example_dropdown_custom.wasm new file mode 100755 index 000000000..e3316535a Binary files /dev/null and b/examples/component/ftxui_example_dropdown_custom.wasm differ diff --git a/examples/component/ftxui_example_dropdown_custom.worker.js b/examples/component/ftxui_example_dropdown_custom.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_dropdown_custom.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_flexbox_gallery.js b/examples/component/ftxui_example_flexbox_gallery.js new file mode 100644 index 000000000..bed572038 --- /dev/null +++ b/examples/component/ftxui_example_flexbox_gallery.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_flexbox_gallery.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={41536:function(){throw"Canceled!"},41554:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_flexbox_gallery.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=41528;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=54168;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_flexbox_gallery.wasm b/examples/component/ftxui_example_flexbox_gallery.wasm new file mode 100755 index 000000000..c820fd07e Binary files /dev/null and b/examples/component/ftxui_example_flexbox_gallery.wasm differ diff --git a/examples/component/ftxui_example_flexbox_gallery.worker.js b/examples/component/ftxui_example_flexbox_gallery.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_flexbox_gallery.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_focus.js b/examples/component/ftxui_example_focus.js new file mode 100644 index 000000000..75a5c1add --- /dev/null +++ b/examples/component/ftxui_example_focus.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_focus.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={39192:function(){throw"Canceled!"},39210:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_focus.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=39184;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=52088;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_focus.wasm b/examples/component/ftxui_example_focus.wasm new file mode 100755 index 000000000..3fb9f27fc Binary files /dev/null and b/examples/component/ftxui_example_focus.wasm differ diff --git a/examples/component/ftxui_example_focus.worker.js b/examples/component/ftxui_example_focus.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_focus.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_focus_cursor.js b/examples/component/ftxui_example_focus_cursor.js new file mode 100644 index 000000000..b5ed3fe77 --- /dev/null +++ b/examples/component/ftxui_example_focus_cursor.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_focus_cursor.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={29480:function(){throw"Canceled!"},29498:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_focus_cursor.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=29472;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=41512;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_focus_cursor.wasm b/examples/component/ftxui_example_focus_cursor.wasm new file mode 100755 index 000000000..cad93f76c Binary files /dev/null and b/examples/component/ftxui_example_focus_cursor.wasm differ diff --git a/examples/component/ftxui_example_focus_cursor.worker.js b/examples/component/ftxui_example_focus_cursor.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_focus_cursor.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_gallery.js b/examples/component/ftxui_example_gallery.js new file mode 100644 index 000000000..182ee515a --- /dev/null +++ b/examples/component/ftxui_example_gallery.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_gallery.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={58832:function(){throw"Canceled!"},58850:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_gallery.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=58824;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=71736;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_gallery.wasm b/examples/component/ftxui_example_gallery.wasm new file mode 100755 index 000000000..70e2a0c0f Binary files /dev/null and b/examples/component/ftxui_example_gallery.wasm differ diff --git a/examples/component/ftxui_example_gallery.worker.js b/examples/component/ftxui_example_gallery.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_gallery.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_homescreen.js b/examples/component/ftxui_example_homescreen.js new file mode 100644 index 000000000..308df7291 --- /dev/null +++ b/examples/component/ftxui_example_homescreen.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_homescreen.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={67272:function(){throw"Canceled!"},67290:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_homescreen.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=67264;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=80424;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_homescreen.wasm b/examples/component/ftxui_example_homescreen.wasm new file mode 100755 index 000000000..87cae131b Binary files /dev/null and b/examples/component/ftxui_example_homescreen.wasm differ diff --git a/examples/component/ftxui_example_homescreen.worker.js b/examples/component/ftxui_example_homescreen.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_homescreen.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_input.js b/examples/component/ftxui_example_input.js new file mode 100644 index 000000000..34cf86b6b --- /dev/null +++ b/examples/component/ftxui_example_input.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_input.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={51680:function(){throw"Canceled!"},51698:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_input.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=51672;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=64312;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_input.wasm b/examples/component/ftxui_example_input.wasm new file mode 100755 index 000000000..1eedf7e16 Binary files /dev/null and b/examples/component/ftxui_example_input.wasm differ diff --git a/examples/component/ftxui_example_input.worker.js b/examples/component/ftxui_example_input.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_input.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_input_in_frame.js b/examples/component/ftxui_example_input_in_frame.js new file mode 100644 index 000000000..0939467d3 --- /dev/null +++ b/examples/component/ftxui_example_input_in_frame.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_input_in_frame.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={50712:function(){throw"Canceled!"},50730:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_input_in_frame.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=50704;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=63192;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_input_in_frame.wasm b/examples/component/ftxui_example_input_in_frame.wasm new file mode 100755 index 000000000..eedf821a1 Binary files /dev/null and b/examples/component/ftxui_example_input_in_frame.wasm differ diff --git a/examples/component/ftxui_example_input_in_frame.worker.js b/examples/component/ftxui_example_input_in_frame.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_input_in_frame.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_input_style.js b/examples/component/ftxui_example_input_style.js new file mode 100644 index 000000000..600d601b8 --- /dev/null +++ b/examples/component/ftxui_example_input_style.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_input_style.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={55024:function(){throw"Canceled!"},55042:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_input_style.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=55016;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=67656;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_input_style.wasm b/examples/component/ftxui_example_input_style.wasm new file mode 100755 index 000000000..fba53d3b6 Binary files /dev/null and b/examples/component/ftxui_example_input_style.wasm differ diff --git a/examples/component/ftxui_example_input_style.worker.js b/examples/component/ftxui_example_input_style.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_input_style.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_linear_gradient_gallery.js b/examples/component/ftxui_example_linear_gradient_gallery.js new file mode 100644 index 000000000..93edd3e92 --- /dev/null +++ b/examples/component/ftxui_example_linear_gradient_gallery.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_linear_gradient_gallery.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={40440:function(){throw"Canceled!"},40458:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_linear_gradient_gallery.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=40432;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=52760;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_linear_gradient_gallery.wasm b/examples/component/ftxui_example_linear_gradient_gallery.wasm new file mode 100755 index 000000000..06eeb4366 Binary files /dev/null and b/examples/component/ftxui_example_linear_gradient_gallery.wasm differ diff --git a/examples/component/ftxui_example_linear_gradient_gallery.worker.js b/examples/component/ftxui_example_linear_gradient_gallery.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_linear_gradient_gallery.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_maybe.js b/examples/component/ftxui_example_maybe.js new file mode 100644 index 000000000..2343f3379 --- /dev/null +++ b/examples/component/ftxui_example_maybe.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_maybe.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={40136:function(){throw"Canceled!"},40154:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_maybe.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=40128;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=52616;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_maybe.wasm b/examples/component/ftxui_example_maybe.wasm new file mode 100755 index 000000000..75d341e3e Binary files /dev/null and b/examples/component/ftxui_example_maybe.wasm differ diff --git a/examples/component/ftxui_example_maybe.worker.js b/examples/component/ftxui_example_maybe.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_maybe.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_menu.js b/examples/component/ftxui_example_menu.js new file mode 100644 index 000000000..aa666488a --- /dev/null +++ b/examples/component/ftxui_example_menu.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_menu.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={37512:function(){throw"Canceled!"},37530:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_menu.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=37504;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=49704;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_menu.wasm b/examples/component/ftxui_example_menu.wasm new file mode 100755 index 000000000..92354e392 Binary files /dev/null and b/examples/component/ftxui_example_menu.wasm differ diff --git a/examples/component/ftxui_example_menu.worker.js b/examples/component/ftxui_example_menu.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_menu.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_menu2.js b/examples/component/ftxui_example_menu2.js new file mode 100644 index 000000000..c60d6efbb --- /dev/null +++ b/examples/component/ftxui_example_menu2.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_menu2.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={39360:function(){throw"Canceled!"},39378:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_menu2.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=39352;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=52264;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_menu2.wasm b/examples/component/ftxui_example_menu2.wasm new file mode 100755 index 000000000..3ef27a034 Binary files /dev/null and b/examples/component/ftxui_example_menu2.wasm differ diff --git a/examples/component/ftxui_example_menu2.worker.js b/examples/component/ftxui_example_menu2.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_menu2.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_menu_entries.js b/examples/component/ftxui_example_menu_entries.js new file mode 100644 index 000000000..794a7ffca --- /dev/null +++ b/examples/component/ftxui_example_menu_entries.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_menu_entries.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={39320:function(){throw"Canceled!"},39338:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_menu_entries.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=39312;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=51944;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_menu_entries.wasm b/examples/component/ftxui_example_menu_entries.wasm new file mode 100755 index 000000000..4ededb767 Binary files /dev/null and b/examples/component/ftxui_example_menu_entries.wasm differ diff --git a/examples/component/ftxui_example_menu_entries.worker.js b/examples/component/ftxui_example_menu_entries.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_menu_entries.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_menu_entries_animated.js b/examples/component/ftxui_example_menu_entries_animated.js new file mode 100644 index 000000000..6c70f2f12 --- /dev/null +++ b/examples/component/ftxui_example_menu_entries_animated.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_menu_entries_animated.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={38224:function(){throw"Canceled!"},38242:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_menu_entries_animated.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=38216;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=50856;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_menu_entries_animated.wasm b/examples/component/ftxui_example_menu_entries_animated.wasm new file mode 100755 index 000000000..6adec9e33 Binary files /dev/null and b/examples/component/ftxui_example_menu_entries_animated.wasm differ diff --git a/examples/component/ftxui_example_menu_entries_animated.worker.js b/examples/component/ftxui_example_menu_entries_animated.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_menu_entries_animated.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_menu_in_frame.js b/examples/component/ftxui_example_menu_in_frame.js new file mode 100644 index 000000000..cc4fa6dad --- /dev/null +++ b/examples/component/ftxui_example_menu_in_frame.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_menu_in_frame.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={39816:function(){throw"Canceled!"},39834:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_menu_in_frame.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=39808;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=52440;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_menu_in_frame.wasm b/examples/component/ftxui_example_menu_in_frame.wasm new file mode 100755 index 000000000..f0b937b3e Binary files /dev/null and b/examples/component/ftxui_example_menu_in_frame.wasm differ diff --git a/examples/component/ftxui_example_menu_in_frame.worker.js b/examples/component/ftxui_example_menu_in_frame.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_menu_in_frame.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_menu_in_frame_horizontal.js b/examples/component/ftxui_example_menu_in_frame_horizontal.js new file mode 100644 index 000000000..e03931092 --- /dev/null +++ b/examples/component/ftxui_example_menu_in_frame_horizontal.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_menu_in_frame_horizontal.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={39280:function(){throw"Canceled!"},39298:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_menu_in_frame_horizontal.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=39272;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=51480;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_menu_in_frame_horizontal.wasm b/examples/component/ftxui_example_menu_in_frame_horizontal.wasm new file mode 100755 index 000000000..a3de5178f Binary files /dev/null and b/examples/component/ftxui_example_menu_in_frame_horizontal.wasm differ diff --git a/examples/component/ftxui_example_menu_in_frame_horizontal.worker.js b/examples/component/ftxui_example_menu_in_frame_horizontal.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_menu_in_frame_horizontal.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_menu_multiple.js b/examples/component/ftxui_example_menu_multiple.js new file mode 100644 index 000000000..8eaa02261 --- /dev/null +++ b/examples/component/ftxui_example_menu_multiple.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_menu_multiple.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={39928:function(){throw"Canceled!"},39946:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_menu_multiple.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=39920;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=52552;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_menu_multiple.wasm b/examples/component/ftxui_example_menu_multiple.wasm new file mode 100755 index 000000000..9520dc258 Binary files /dev/null and b/examples/component/ftxui_example_menu_multiple.wasm differ diff --git a/examples/component/ftxui_example_menu_multiple.worker.js b/examples/component/ftxui_example_menu_multiple.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_menu_multiple.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_menu_style.js b/examples/component/ftxui_example_menu_style.js new file mode 100644 index 000000000..904b23da5 --- /dev/null +++ b/examples/component/ftxui_example_menu_style.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_menu_style.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={46384:function(){throw"Canceled!"},46402:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_menu_style.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=46376;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=59016;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_menu_style.wasm b/examples/component/ftxui_example_menu_style.wasm new file mode 100755 index 000000000..883a363ab Binary files /dev/null and b/examples/component/ftxui_example_menu_style.wasm differ diff --git a/examples/component/ftxui_example_menu_style.worker.js b/examples/component/ftxui_example_menu_style.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_menu_style.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_menu_underline_animated_gallery.js b/examples/component/ftxui_example_menu_underline_animated_gallery.js new file mode 100644 index 000000000..115570b1d --- /dev/null +++ b/examples/component/ftxui_example_menu_underline_animated_gallery.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_menu_underline_animated_gallery.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={42800:function(){throw"Canceled!"},42818:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_menu_underline_animated_gallery.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=42792;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=55432;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_menu_underline_animated_gallery.wasm b/examples/component/ftxui_example_menu_underline_animated_gallery.wasm new file mode 100755 index 000000000..b790d38f4 Binary files /dev/null and b/examples/component/ftxui_example_menu_underline_animated_gallery.wasm differ diff --git a/examples/component/ftxui_example_menu_underline_animated_gallery.worker.js b/examples/component/ftxui_example_menu_underline_animated_gallery.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_menu_underline_animated_gallery.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_modal_dialog.js b/examples/component/ftxui_example_modal_dialog.js new file mode 100644 index 000000000..ec9a27fad --- /dev/null +++ b/examples/component/ftxui_example_modal_dialog.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function allocateUTF8OnStack(str){var size=lengthBytesUTF8(str)+1;var ret=stackAlloc(size);stringToUTF8Array(str,HEAP8,ret,size);return ret}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_modal_dialog.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={41648:function(){throw"Canceled!"},41666:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_modal_dialog.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=41640;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=54424;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];args=args||[];var argc=args.length+1;var argv=stackAlloc((argc+1)*4);HEAP32[argv>>2]=allocateUTF8OnStack(thisProgram);for(var i=1;i>2)+i]=allocateUTF8OnStack(args[i-1])}HEAP32[(argv>>2)+argc]=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_modal_dialog.wasm b/examples/component/ftxui_example_modal_dialog.wasm new file mode 100755 index 000000000..dd1f9169b Binary files /dev/null and b/examples/component/ftxui_example_modal_dialog.wasm differ diff --git a/examples/component/ftxui_example_modal_dialog.worker.js b/examples/component/ftxui_example_modal_dialog.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_modal_dialog.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_modal_dialog_custom.js b/examples/component/ftxui_example_modal_dialog_custom.js new file mode 100644 index 000000000..be686d2a4 --- /dev/null +++ b/examples/component/ftxui_example_modal_dialog_custom.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_modal_dialog_custom.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={40928:function(){throw"Canceled!"},40946:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_modal_dialog_custom.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=40920;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=53560;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_modal_dialog_custom.wasm b/examples/component/ftxui_example_modal_dialog_custom.wasm new file mode 100755 index 000000000..d35020a3e Binary files /dev/null and b/examples/component/ftxui_example_modal_dialog_custom.wasm differ diff --git a/examples/component/ftxui_example_modal_dialog_custom.worker.js b/examples/component/ftxui_example_modal_dialog_custom.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_modal_dialog_custom.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_nested_screen.js b/examples/component/ftxui_example_nested_screen.js new file mode 100644 index 000000000..b5b08dfdc --- /dev/null +++ b/examples/component/ftxui_example_nested_screen.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_nested_screen.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={39152:function(){throw"Canceled!"},39170:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_nested_screen.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=39144;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=51784;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_nested_screen.wasm b/examples/component/ftxui_example_nested_screen.wasm new file mode 100755 index 000000000..d62bf7bb0 Binary files /dev/null and b/examples/component/ftxui_example_nested_screen.wasm differ diff --git a/examples/component/ftxui_example_nested_screen.worker.js b/examples/component/ftxui_example_nested_screen.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_nested_screen.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_print_key_press.js b/examples/component/ftxui_example_print_key_press.js new file mode 100644 index 000000000..42ece0d51 --- /dev/null +++ b/examples/component/ftxui_example_print_key_press.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_print_key_press.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={34656:function(){throw"Canceled!"},34674:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_print_key_press.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=34648;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=47320;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_print_key_press.wasm b/examples/component/ftxui_example_print_key_press.wasm new file mode 100755 index 000000000..473e8e01d Binary files /dev/null and b/examples/component/ftxui_example_print_key_press.wasm differ diff --git a/examples/component/ftxui_example_print_key_press.worker.js b/examples/component/ftxui_example_print_key_press.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_print_key_press.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_radiobox.js b/examples/component/ftxui_example_radiobox.js new file mode 100644 index 000000000..ebecefabe --- /dev/null +++ b/examples/component/ftxui_example_radiobox.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_radiobox.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={29712:function(){throw"Canceled!"},29730:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_radiobox.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=29704;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=41752;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_radiobox.wasm b/examples/component/ftxui_example_radiobox.wasm new file mode 100755 index 000000000..694562497 Binary files /dev/null and b/examples/component/ftxui_example_radiobox.wasm differ diff --git a/examples/component/ftxui_example_radiobox.worker.js b/examples/component/ftxui_example_radiobox.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_radiobox.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_radiobox_in_frame.js b/examples/component/ftxui_example_radiobox_in_frame.js new file mode 100644 index 000000000..c6e99ec1f --- /dev/null +++ b/examples/component/ftxui_example_radiobox_in_frame.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_radiobox_in_frame.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={31608:function(){throw"Canceled!"},31626:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_radiobox_in_frame.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=31600;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=44072;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_radiobox_in_frame.wasm b/examples/component/ftxui_example_radiobox_in_frame.wasm new file mode 100755 index 000000000..80c00b781 Binary files /dev/null and b/examples/component/ftxui_example_radiobox_in_frame.wasm differ diff --git a/examples/component/ftxui_example_radiobox_in_frame.worker.js b/examples/component/ftxui_example_radiobox_in_frame.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_radiobox_in_frame.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_renderer.js b/examples/component/ftxui_example_renderer.js new file mode 100644 index 000000000..87074a152 --- /dev/null +++ b/examples/component/ftxui_example_renderer.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_renderer.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={39024:function(){throw"Canceled!"},39042:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_renderer.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=39016;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=51512;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_renderer.wasm b/examples/component/ftxui_example_renderer.wasm new file mode 100755 index 000000000..5ce5576a0 Binary files /dev/null and b/examples/component/ftxui_example_renderer.wasm differ diff --git a/examples/component/ftxui_example_renderer.worker.js b/examples/component/ftxui_example_renderer.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_renderer.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_resizable_split.js b/examples/component/ftxui_example_resizable_split.js new file mode 100644 index 000000000..019c84711 --- /dev/null +++ b/examples/component/ftxui_example_resizable_split.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_resizable_split.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={31528:function(){throw"Canceled!"},31546:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_resizable_split.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=31520;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=44136;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_resizable_split.wasm b/examples/component/ftxui_example_resizable_split.wasm new file mode 100755 index 000000000..19c3fcb4e Binary files /dev/null and b/examples/component/ftxui_example_resizable_split.wasm differ diff --git a/examples/component/ftxui_example_resizable_split.worker.js b/examples/component/ftxui_example_resizable_split.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_resizable_split.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_scrollbar.js b/examples/component/ftxui_example_scrollbar.js new file mode 100644 index 000000000..1c25ee7f4 --- /dev/null +++ b/examples/component/ftxui_example_scrollbar.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_scrollbar.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={41400:function(){throw"Canceled!"},41418:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_scrollbar.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=41392;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=54152;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_scrollbar.wasm b/examples/component/ftxui_example_scrollbar.wasm new file mode 100755 index 000000000..5b5128c1d Binary files /dev/null and b/examples/component/ftxui_example_scrollbar.wasm differ diff --git a/examples/component/ftxui_example_scrollbar.worker.js b/examples/component/ftxui_example_scrollbar.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_scrollbar.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_selection.js b/examples/component/ftxui_example_selection.js new file mode 100644 index 000000000..3de8e5d75 --- /dev/null +++ b/examples/component/ftxui_example_selection.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_selection.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={42200:function(){throw"Canceled!"},42218:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_selection.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=42192;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=54856;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_selection.wasm b/examples/component/ftxui_example_selection.wasm new file mode 100755 index 000000000..ad3c0f0ac Binary files /dev/null and b/examples/component/ftxui_example_selection.wasm differ diff --git a/examples/component/ftxui_example_selection.worker.js b/examples/component/ftxui_example_selection.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_selection.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_slider.js b/examples/component/ftxui_example_slider.js new file mode 100644 index 000000000..a23c28c80 --- /dev/null +++ b/examples/component/ftxui_example_slider.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_slider.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={35896:function(){throw"Canceled!"},35914:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_slider.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"h":___cxa_allocate_exception,"s":___cxa_thread_atexit,"g":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"o":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"i":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"n":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"p":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=35888;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=48216;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_slider.wasm b/examples/component/ftxui_example_slider.wasm new file mode 100755 index 000000000..33d0243c9 Binary files /dev/null and b/examples/component/ftxui_example_slider.wasm differ diff --git a/examples/component/ftxui_example_slider.worker.js b/examples/component/ftxui_example_slider.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_slider.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_slider_direction.js b/examples/component/ftxui_example_slider_direction.js new file mode 100644 index 000000000..f9dbdcd7f --- /dev/null +++ b/examples/component/ftxui_example_slider_direction.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_slider_direction.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={36680:function(){throw"Canceled!"},36698:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_slider_direction.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=36672;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=49e3;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_slider_direction.wasm b/examples/component/ftxui_example_slider_direction.wasm new file mode 100755 index 000000000..a3f77469c Binary files /dev/null and b/examples/component/ftxui_example_slider_direction.wasm differ diff --git a/examples/component/ftxui_example_slider_direction.worker.js b/examples/component/ftxui_example_slider_direction.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_slider_direction.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_slider_rgb.js b/examples/component/ftxui_example_slider_rgb.js new file mode 100644 index 000000000..429db1a06 --- /dev/null +++ b/examples/component/ftxui_example_slider_rgb.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_slider_rgb.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={38192:function(){throw"Canceled!"},38210:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_slider_rgb.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=38184;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=51096;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_slider_rgb.wasm b/examples/component/ftxui_example_slider_rgb.wasm new file mode 100755 index 000000000..f8c208d4a Binary files /dev/null and b/examples/component/ftxui_example_slider_rgb.wasm differ diff --git a/examples/component/ftxui_example_slider_rgb.worker.js b/examples/component/ftxui_example_slider_rgb.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_slider_rgb.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_tab_horizontal.js b/examples/component/ftxui_example_tab_horizontal.js new file mode 100644 index 000000000..c27ec58a6 --- /dev/null +++ b/examples/component/ftxui_example_tab_horizontal.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_tab_horizontal.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={41104:function(){throw"Canceled!"},41122:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_tab_horizontal.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=41096;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=53736;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_tab_horizontal.wasm b/examples/component/ftxui_example_tab_horizontal.wasm new file mode 100755 index 000000000..33cd0d25f Binary files /dev/null and b/examples/component/ftxui_example_tab_horizontal.wasm differ diff --git a/examples/component/ftxui_example_tab_horizontal.worker.js b/examples/component/ftxui_example_tab_horizontal.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_tab_horizontal.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_tab_vertical.js b/examples/component/ftxui_example_tab_vertical.js new file mode 100644 index 000000000..262d3c740 --- /dev/null +++ b/examples/component/ftxui_example_tab_vertical.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_tab_vertical.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={40416:function(){throw"Canceled!"},40434:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_tab_vertical.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=40408;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=53048;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_tab_vertical.wasm b/examples/component/ftxui_example_tab_vertical.wasm new file mode 100755 index 000000000..975207ad0 Binary files /dev/null and b/examples/component/ftxui_example_tab_vertical.wasm differ diff --git a/examples/component/ftxui_example_tab_vertical.worker.js b/examples/component/ftxui_example_tab_vertical.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_tab_vertical.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_textarea.js b/examples/component/ftxui_example_textarea.js new file mode 100644 index 000000000..881e4de32 --- /dev/null +++ b/examples/component/ftxui_example_textarea.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_textarea.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={51312:function(){throw"Canceled!"},51330:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_textarea.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=51304;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=63944;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_textarea.wasm b/examples/component/ftxui_example_textarea.wasm new file mode 100755 index 000000000..7e6849f93 Binary files /dev/null and b/examples/component/ftxui_example_textarea.wasm differ diff --git a/examples/component/ftxui_example_textarea.worker.js b/examples/component/ftxui_example_textarea.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_textarea.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_toggle.js b/examples/component/ftxui_example_toggle.js new file mode 100644 index 000000000..1bd931350 --- /dev/null +++ b/examples/component/ftxui_example_toggle.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_toggle.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={39840:function(){throw"Canceled!"},39858:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_toggle.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=39832;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=52040;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_toggle.wasm b/examples/component/ftxui_example_toggle.wasm new file mode 100755 index 000000000..1af73d6df Binary files /dev/null and b/examples/component/ftxui_example_toggle.wasm differ diff --git a/examples/component/ftxui_example_toggle.worker.js b/examples/component/ftxui_example_toggle.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_toggle.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_window.js b/examples/component/ftxui_example_window.js new file mode 100644 index 000000000..d03025884 --- /dev/null +++ b/examples/component/ftxui_example_window.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_window.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={40736:function(){throw"Canceled!"},40754:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_window.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=40728;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=53496;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_window.wasm b/examples/component/ftxui_example_window.wasm new file mode 100755 index 000000000..47e468a62 Binary files /dev/null and b/examples/component/ftxui_example_window.wasm differ diff --git a/examples/component/ftxui_example_window.worker.js b/examples/component/ftxui_example_window.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_window.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/component/ftxui_example_with_restored_io.js b/examples/component/ftxui_example_with_restored_io.js new file mode 100644 index 000000000..646c1fc83 --- /dev/null +++ b/examples/component/ftxui_example_with_restored_io.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_with_restored_io.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["K"];addOnInit(Module["asm"]["I"]);PThread.tlsInitFunctions.push(Module["asm"]["M"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={40176:function(){throw"Canceled!"},40194:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}var ERRNO_CODES={EPERM:63,ENOENT:44,ESRCH:71,EINTR:27,EIO:29,ENXIO:60,E2BIG:1,ENOEXEC:45,EBADF:8,ECHILD:12,EAGAIN:6,EWOULDBLOCK:6,ENOMEM:48,EACCES:2,EFAULT:21,ENOTBLK:105,EBUSY:10,EEXIST:20,EXDEV:75,ENODEV:43,ENOTDIR:54,EISDIR:31,EINVAL:28,ENFILE:41,EMFILE:33,ENOTTY:59,ETXTBSY:74,EFBIG:22,ENOSPC:51,ESPIPE:70,EROFS:69,EMLINK:34,EPIPE:64,EDOM:18,ERANGE:68,ENOMSG:49,EIDRM:24,ECHRNG:106,EL2NSYNC:156,EL3HLT:107,EL3RST:108,ELNRNG:109,EUNATCH:110,ENOCSI:111,EL2HLT:112,EDEADLK:16,ENOLCK:46,EBADE:113,EBADR:114,EXFULL:115,ENOANO:104,EBADRQC:103,EBADSLT:102,EDEADLOCK:16,EBFONT:101,ENOSTR:100,ENODATA:116,ETIME:117,ENOSR:118,ENONET:119,ENOPKG:120,EREMOTE:121,ENOLINK:47,EADV:122,ESRMNT:123,ECOMM:124,EPROTO:65,EMULTIHOP:36,EDOTDOT:125,EBADMSG:9,ENOTUNIQ:126,EBADFD:127,EREMCHG:128,ELIBACC:129,ELIBBAD:130,ELIBSCN:131,ELIBMAX:132,ELIBEXEC:133,ENOSYS:52,ENOTEMPTY:55,ENAMETOOLONG:37,ELOOP:32,EOPNOTSUPP:138,EPFNOSUPPORT:139,ECONNRESET:15,ENOBUFS:42,EAFNOSUPPORT:5,EPROTOTYPE:67,ENOTSOCK:57,ENOPROTOOPT:50,ESHUTDOWN:140,ECONNREFUSED:14,EADDRINUSE:3,ECONNABORTED:13,ENETUNREACH:40,ENETDOWN:38,ETIMEDOUT:73,EHOSTDOWN:142,EHOSTUNREACH:23,EINPROGRESS:26,EALREADY:7,EDESTADDRREQ:17,EMSGSIZE:35,EPROTONOSUPPORT:66,ESOCKTNOSUPPORT:137,EADDRNOTAVAIL:4,ENETRESET:39,EISCONN:30,ENOTCONN:53,ETOOMANYREFS:141,EUSERS:136,EDQUOT:19,ESTALE:72,ENOTSUP:138,ENOMEDIUM:148,EILSEQ:25,EOVERFLOW:61,ECANCELED:11,ENOTRECOVERABLE:56,EOWNERDEAD:62,ESTRPIPE:135};function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_with_restored_io.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var _emscripten_get_now_is_monotonic=true;function setErrNo(value){HEAP32[___errno_location()>>2]=value;return value}function _clock_gettime(clk_id,tp){var now;if(clk_id===0){now=Date.now()}else if((clk_id===1||clk_id===4)&&_emscripten_get_now_is_monotonic){now=_emscripten_get_now()}else{setErrNo(28);return-1}HEAP32[tp>>2]=now/1e3|0;HEAP32[tp+4>>2]=now%1e3*1e3*1e3|0;return 0}var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function _pthread_cleanup_push(routine,arg){PThread.threadExitHandlers.push(function(){wasmTable.get(routine)(arg)})}function ___cxa_thread_atexit(a0,a1){return _pthread_cleanup_push(a0,a1)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function ___sys_ioctl(fd,op,varargs){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,fd,op,varargs);SYSCALLS.varargs=varargs;try{var stream=SYSCALLS.getStreamFromFD(fd);switch(op){case 21509:case 21505:{if(!stream.tty)return-59;return 0}case 21510:case 21511:case 21512:case 21506:case 21507:case 21508:{if(!stream.tty)return-59;return 0}case 21519:{if(!stream.tty)return-59;var argp=SYSCALLS.get();HEAP32[argp>>2]=0;return 0}case 21520:{if(!stream.tty)return-59;return-28}case 21531:{var argp=SYSCALLS.get();return FS.ioctl(stream,op,argp)}case 21523:{if(!stream.tty)return-59;return 0}case 21524:{if(!stream.tty)return-59;return 0}default:abort("bad ioctl syscall "+op)}}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return-e.errno}}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(9,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function _raise(sig){setErrNo(ERRNO_CODES.ENOSYS);return-1}var __sigalrm_handler=0;function _signal(sig,func){if(sig==14){__sigalrm_handler=func}else{}return 0}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var GLctx;var proxiedFunctionTable=[null,_atexit,___sys_ioctl,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"c":___assert_fail,"z":___call_main,"i":___cxa_allocate_exception,"s":___cxa_thread_atexit,"h":___cxa_throw,"r":___sys_ioctl,"E":__emscripten_notify_thread_queue,"j":_abort,"x":_clock_gettime,"p":_emscripten_asm_const_int,"y":_emscripten_check_blocking_allowed,"g":_emscripten_conditional_set_current_thread_status,"e":_emscripten_futex_wait,"f":_emscripten_futex_wake,"d":_emscripten_get_now,"v":_emscripten_memcpy_big,"B":_emscripten_receive_on_main_thread_js,"w":_emscripten_resize_heap,"C":_emscripten_set_canvas_element_size,"o":_emscripten_set_current_thread_status,"A":_emscripten_set_thread_name,"D":_emscripten_webgl_create_context,"G":_environ_get,"H":_environ_sizes_get,"q":_fd_close,"l":_fd_read,"t":_fd_seek,"k":_fd_write,"u":initPthreadsJS,"a":wasmMemory,"m":_pthread_create,"n":_raise,"b":_signal,"F":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["I"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["J"]).apply(null,arguments)};var _ftxui_on_resize=Module["_ftxui_on_resize"]=function(){return(_ftxui_on_resize=Module["_ftxui_on_resize"]=Module["asm"]["L"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["M"]).apply(null,arguments)};var ___errno_location=Module["___errno_location"]=function(){return(___errno_location=Module["___errno_location"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["O"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["P"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["R"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["S"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["T"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["U"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["W"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["X"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["Y"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["Z"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["_"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["$"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["aa"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["ba"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["ca"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["da"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["ea"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=40168;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=52696;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/component/ftxui_example_with_restored_io.wasm b/examples/component/ftxui_example_with_restored_io.wasm new file mode 100755 index 000000000..2d4dd822b Binary files /dev/null and b/examples/component/ftxui_example_with_restored_io.wasm differ diff --git a/examples/component/ftxui_example_with_restored_io.worker.js b/examples/component/ftxui_example_with_restored_io.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/component/ftxui_example_with_restored_io.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_border.js b/examples/dom/ftxui_example_border.js new file mode 100644 index 000000000..9bed24d04 --- /dev/null +++ b/examples/dom/ftxui_example_border.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_border.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={22968:function(){throw"Canceled!"},22986:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_border.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"g":_abort,"k":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"j":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"c":_emscripten_futex_wake,"e":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"i":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"f":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"h":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=22960;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=28852;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_border.wasm b/examples/dom/ftxui_example_border.wasm new file mode 100755 index 000000000..030726aa3 Binary files /dev/null and b/examples/dom/ftxui_example_border.wasm differ diff --git a/examples/dom/ftxui_example_border.worker.js b/examples/dom/ftxui_example_border.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_border.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_border_colored.js b/examples/dom/ftxui_example_border_colored.js new file mode 100644 index 000000000..67af8a821 --- /dev/null +++ b/examples/dom/ftxui_example_border_colored.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_border_colored.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={29224:function(){throw"Canceled!"},29242:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_border_colored.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"g":_abort,"k":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"j":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"c":_emscripten_futex_wake,"e":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"i":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"f":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"h":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=29216;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=35252;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_border_colored.wasm b/examples/dom/ftxui_example_border_colored.wasm new file mode 100755 index 000000000..28c7f8a72 Binary files /dev/null and b/examples/dom/ftxui_example_border_colored.wasm differ diff --git a/examples/dom/ftxui_example_border_colored.worker.js b/examples/dom/ftxui_example_border_colored.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_border_colored.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_border_style.js b/examples/dom/ftxui_example_border_style.js new file mode 100644 index 000000000..25c274c4e --- /dev/null +++ b/examples/dom/ftxui_example_border_style.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_border_style.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={22760:function(){throw"Canceled!"},22778:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_border_style.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"g":_abort,"k":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"j":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"c":_emscripten_futex_wake,"e":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"i":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"f":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"h":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=22752;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=28644;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_border_style.wasm b/examples/dom/ftxui_example_border_style.wasm new file mode 100755 index 000000000..71d5da8ff Binary files /dev/null and b/examples/dom/ftxui_example_border_style.wasm differ diff --git a/examples/dom/ftxui_example_border_style.worker.js b/examples/dom/ftxui_example_border_style.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_border_style.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_canvas.js b/examples/dom/ftxui_example_canvas.js new file mode 100644 index 000000000..dc7c7d65f --- /dev/null +++ b/examples/dom/ftxui_example_canvas.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_canvas.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={27048:function(){throw"Canceled!"},27066:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_canvas.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"w":___call_main,"g":___cxa_allocate_exception,"f":___cxa_throw,"C":__emscripten_notify_thread_queue,"i":_abort,"m":_emscripten_asm_const_int,"v":_emscripten_check_blocking_allowed,"l":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"c":_emscripten_futex_wake,"e":_emscripten_get_now,"t":_emscripten_memcpy_big,"y":_emscripten_receive_on_main_thread_js,"u":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"k":_emscripten_set_current_thread_status,"x":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"z":_fd_close,"q":_fd_read,"r":_fd_seek,"h":_fd_write,"s":initPthreadsJS,"a":wasmMemory,"j":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=27040;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=32948;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_canvas.wasm b/examples/dom/ftxui_example_canvas.wasm new file mode 100755 index 000000000..39698025c Binary files /dev/null and b/examples/dom/ftxui_example_canvas.wasm differ diff --git a/examples/dom/ftxui_example_canvas.worker.js b/examples/dom/ftxui_example_canvas.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_canvas.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_color_gallery.js b/examples/dom/ftxui_example_color_gallery.js new file mode 100644 index 000000000..a587c9468 --- /dev/null +++ b/examples/dom/ftxui_example_color_gallery.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_color_gallery.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={30304:function(){throw"Canceled!"},30322:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_color_gallery.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"g":_abort,"k":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"j":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"c":_emscripten_futex_wake,"e":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"i":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"f":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"h":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=30296;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=36340;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_color_gallery.wasm b/examples/dom/ftxui_example_color_gallery.wasm new file mode 100755 index 000000000..3c5a733b8 Binary files /dev/null and b/examples/dom/ftxui_example_color_gallery.wasm differ diff --git a/examples/dom/ftxui_example_color_gallery.worker.js b/examples/dom/ftxui_example_color_gallery.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_color_gallery.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_color_info_palette256.js b/examples/dom/ftxui_example_color_info_palette256.js new file mode 100644 index 000000000..064883c0e --- /dev/null +++ b/examples/dom/ftxui_example_color_info_palette256.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_color_info_palette256.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={28352:function(){throw"Canceled!"},28370:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_color_info_palette256.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"g":_abort,"k":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"j":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"c":_emscripten_futex_wake,"e":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"i":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"f":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"h":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=28344;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=33812;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_color_info_palette256.wasm b/examples/dom/ftxui_example_color_info_palette256.wasm new file mode 100755 index 000000000..8e6414ca0 Binary files /dev/null and b/examples/dom/ftxui_example_color_info_palette256.wasm differ diff --git a/examples/dom/ftxui_example_color_info_palette256.worker.js b/examples/dom/ftxui_example_color_info_palette256.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_color_info_palette256.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_color_truecolor_HSV.js b/examples/dom/ftxui_example_color_truecolor_HSV.js new file mode 100644 index 000000000..835f364d4 --- /dev/null +++ b/examples/dom/ftxui_example_color_truecolor_HSV.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_color_truecolor_HSV.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={28768:function(){throw"Canceled!"},28786:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_color_truecolor_HSV.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"g":_abort,"k":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"j":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"c":_emscripten_futex_wake,"e":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"i":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"f":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"h":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=28760;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=34228;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_color_truecolor_HSV.wasm b/examples/dom/ftxui_example_color_truecolor_HSV.wasm new file mode 100755 index 000000000..741a53dc4 Binary files /dev/null and b/examples/dom/ftxui_example_color_truecolor_HSV.wasm differ diff --git a/examples/dom/ftxui_example_color_truecolor_HSV.worker.js b/examples/dom/ftxui_example_color_truecolor_HSV.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_color_truecolor_HSV.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_color_truecolor_RGB.js b/examples/dom/ftxui_example_color_truecolor_RGB.js new file mode 100644 index 000000000..e396acf85 --- /dev/null +++ b/examples/dom/ftxui_example_color_truecolor_RGB.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_color_truecolor_RGB.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={28768:function(){throw"Canceled!"},28786:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_color_truecolor_RGB.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"g":_abort,"k":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"j":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"c":_emscripten_futex_wake,"e":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"i":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"f":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"h":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=28760;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=34660;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_color_truecolor_RGB.wasm b/examples/dom/ftxui_example_color_truecolor_RGB.wasm new file mode 100755 index 000000000..28f219529 Binary files /dev/null and b/examples/dom/ftxui_example_color_truecolor_RGB.wasm differ diff --git a/examples/dom/ftxui_example_color_truecolor_RGB.worker.js b/examples/dom/ftxui_example_color_truecolor_RGB.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_color_truecolor_RGB.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_dbox.js b/examples/dom/ftxui_example_dbox.js new file mode 100644 index 000000000..aa0120aa5 --- /dev/null +++ b/examples/dom/ftxui_example_dbox.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_dbox.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={23344:function(){throw"Canceled!"},23362:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_dbox.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"g":_abort,"k":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"j":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"c":_emscripten_futex_wake,"e":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"i":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"f":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"h":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=23336;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=29236;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_dbox.wasm b/examples/dom/ftxui_example_dbox.wasm new file mode 100755 index 000000000..8c19e7e61 Binary files /dev/null and b/examples/dom/ftxui_example_dbox.wasm differ diff --git a/examples/dom/ftxui_example_dbox.worker.js b/examples/dom/ftxui_example_dbox.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_dbox.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_gauge.js b/examples/dom/ftxui_example_gauge.js new file mode 100644 index 000000000..bf3311423 --- /dev/null +++ b/examples/dom/ftxui_example_gauge.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_gauge.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={22928:function(){throw"Canceled!"},22946:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_gauge.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"i":_abort,"g":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"f":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"e":_emscripten_futex_wake,"c":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"k":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"h":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"j":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=22920;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=28648;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_gauge.wasm b/examples/dom/ftxui_example_gauge.wasm new file mode 100755 index 000000000..54023e365 Binary files /dev/null and b/examples/dom/ftxui_example_gauge.wasm differ diff --git a/examples/dom/ftxui_example_gauge.worker.js b/examples/dom/ftxui_example_gauge.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_gauge.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_gauge_direction.js b/examples/dom/ftxui_example_gauge_direction.js new file mode 100644 index 000000000..1095ebfa1 --- /dev/null +++ b/examples/dom/ftxui_example_gauge_direction.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_gauge_direction.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={23888:function(){throw"Canceled!"},23906:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_gauge_direction.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"i":_abort,"g":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"f":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"e":_emscripten_futex_wake,"c":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"k":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"h":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"j":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=23880;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=30184;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_gauge_direction.wasm b/examples/dom/ftxui_example_gauge_direction.wasm new file mode 100755 index 000000000..8f7634fcb Binary files /dev/null and b/examples/dom/ftxui_example_gauge_direction.wasm differ diff --git a/examples/dom/ftxui_example_gauge_direction.worker.js b/examples/dom/ftxui_example_gauge_direction.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_gauge_direction.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_graph.js b/examples/dom/ftxui_example_graph.js new file mode 100644 index 000000000..c303d0465 --- /dev/null +++ b/examples/dom/ftxui_example_graph.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_graph.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={33928:function(){throw"Canceled!"},33946:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_graph.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"i":_abort,"g":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"f":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"e":_emscripten_futex_wake,"c":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"k":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"h":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"j":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=33920;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=40072;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_graph.wasm b/examples/dom/ftxui_example_graph.wasm new file mode 100755 index 000000000..6132537b8 Binary files /dev/null and b/examples/dom/ftxui_example_graph.wasm differ diff --git a/examples/dom/ftxui_example_graph.worker.js b/examples/dom/ftxui_example_graph.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_graph.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_gridbox.js b/examples/dom/ftxui_example_gridbox.js new file mode 100644 index 000000000..1604c011c --- /dev/null +++ b/examples/dom/ftxui_example_gridbox.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_gridbox.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={23128:function(){throw"Canceled!"},23146:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_gridbox.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"w":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"g":_abort,"k":_emscripten_asm_const_int,"v":_emscripten_check_blocking_allowed,"j":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"c":_emscripten_futex_wake,"e":_emscripten_get_now,"t":_emscripten_memcpy_big,"y":_emscripten_receive_on_main_thread_js,"u":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"i":_emscripten_set_current_thread_status,"x":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"z":_fd_close,"q":_fd_read,"r":_fd_seek,"f":_fd_write,"s":initPthreadsJS,"a":wasmMemory,"h":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=23120;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=29012;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_gridbox.wasm b/examples/dom/ftxui_example_gridbox.wasm new file mode 100755 index 000000000..d98cf0ceb Binary files /dev/null and b/examples/dom/ftxui_example_gridbox.wasm differ diff --git a/examples/dom/ftxui_example_gridbox.worker.js b/examples/dom/ftxui_example_gridbox.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_gridbox.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_hflow.js b/examples/dom/ftxui_example_hflow.js new file mode 100644 index 000000000..b38547054 --- /dev/null +++ b/examples/dom/ftxui_example_hflow.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_hflow.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={24520:function(){throw"Canceled!"},24538:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_hflow.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"w":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"g":_abort,"k":_emscripten_asm_const_int,"v":_emscripten_check_blocking_allowed,"j":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"c":_emscripten_futex_wake,"e":_emscripten_get_now,"t":_emscripten_memcpy_big,"y":_emscripten_receive_on_main_thread_js,"u":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"i":_emscripten_set_current_thread_status,"x":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"z":_fd_close,"q":_fd_read,"r":_fd_seek,"f":_fd_write,"s":initPthreadsJS,"a":wasmMemory,"h":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=24512;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=30404;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_hflow.wasm b/examples/dom/ftxui_example_hflow.wasm new file mode 100755 index 000000000..3de23f98b Binary files /dev/null and b/examples/dom/ftxui_example_hflow.wasm differ diff --git a/examples/dom/ftxui_example_hflow.worker.js b/examples/dom/ftxui_example_hflow.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_hflow.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_html_like.js b/examples/dom/ftxui_example_html_like.js new file mode 100644 index 000000000..2b100baa1 --- /dev/null +++ b/examples/dom/ftxui_example_html_like.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_html_like.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={32416:function(){throw"Canceled!"},32434:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_html_like.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"i":_abort,"g":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"f":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"e":_emscripten_futex_wake,"c":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"k":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"h":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"j":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=32408;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=38632;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_html_like.wasm b/examples/dom/ftxui_example_html_like.wasm new file mode 100755 index 000000000..b58fb22b9 Binary files /dev/null and b/examples/dom/ftxui_example_html_like.wasm differ diff --git a/examples/dom/ftxui_example_html_like.worker.js b/examples/dom/ftxui_example_html_like.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_html_like.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_linear_gradient.js b/examples/dom/ftxui_example_linear_gradient.js new file mode 100644 index 000000000..ef1eee49a --- /dev/null +++ b/examples/dom/ftxui_example_linear_gradient.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_linear_gradient.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={32216:function(){throw"Canceled!"},32234:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_linear_gradient.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"g":___cxa_allocate_exception,"f":___cxa_throw,"C":__emscripten_notify_thread_queue,"i":_abort,"m":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"l":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"c":_emscripten_futex_wake,"e":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"k":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"h":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"j":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=32208;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=37668;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_linear_gradient.wasm b/examples/dom/ftxui_example_linear_gradient.wasm new file mode 100755 index 000000000..0d31aa508 Binary files /dev/null and b/examples/dom/ftxui_example_linear_gradient.wasm differ diff --git a/examples/dom/ftxui_example_linear_gradient.worker.js b/examples/dom/ftxui_example_linear_gradient.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_linear_gradient.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_package_manager.js b/examples/dom/ftxui_example_package_manager.js new file mode 100644 index 000000000..bb957b162 --- /dev/null +++ b/examples/dom/ftxui_example_package_manager.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_package_manager.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={31264:function(){throw"Canceled!"},31282:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_package_manager.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"i":_abort,"g":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"f":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"e":_emscripten_futex_wake,"c":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"k":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"h":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"j":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=31256;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=37576;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_package_manager.wasm b/examples/dom/ftxui_example_package_manager.wasm new file mode 100755 index 000000000..0cca50df8 Binary files /dev/null and b/examples/dom/ftxui_example_package_manager.wasm differ diff --git a/examples/dom/ftxui_example_package_manager.worker.js b/examples/dom/ftxui_example_package_manager.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_package_manager.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_paragraph.js b/examples/dom/ftxui_example_paragraph.js new file mode 100644 index 000000000..744392f8f --- /dev/null +++ b/examples/dom/ftxui_example_paragraph.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_paragraph.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={25120:function(){throw"Canceled!"},25138:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_paragraph.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"i":_abort,"g":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"f":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"e":_emscripten_futex_wake,"c":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"k":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"h":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"j":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=25112;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=31192;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_paragraph.wasm b/examples/dom/ftxui_example_paragraph.wasm new file mode 100755 index 000000000..0a2aaf0f5 Binary files /dev/null and b/examples/dom/ftxui_example_paragraph.wasm differ diff --git a/examples/dom/ftxui_example_paragraph.worker.js b/examples/dom/ftxui_example_paragraph.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_paragraph.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_separator.js b/examples/dom/ftxui_example_separator.js new file mode 100644 index 000000000..d7e971997 --- /dev/null +++ b/examples/dom/ftxui_example_separator.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_separator.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={23392:function(){throw"Canceled!"},23410:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_separator.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"g":_abort,"k":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"j":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"c":_emscripten_futex_wake,"e":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"i":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"f":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"h":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=23384;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=29428;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_separator.wasm b/examples/dom/ftxui_example_separator.wasm new file mode 100755 index 000000000..4cb960fa0 Binary files /dev/null and b/examples/dom/ftxui_example_separator.wasm differ diff --git a/examples/dom/ftxui_example_separator.worker.js b/examples/dom/ftxui_example_separator.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_separator.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_separator_style.js b/examples/dom/ftxui_example_separator_style.js new file mode 100644 index 000000000..783e95c4b --- /dev/null +++ b/examples/dom/ftxui_example_separator_style.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_separator_style.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={23216:function(){throw"Canceled!"},23234:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_separator_style.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"g":_abort,"k":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"j":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"c":_emscripten_futex_wake,"e":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"i":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"f":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"h":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=23208;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=29252;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_separator_style.wasm b/examples/dom/ftxui_example_separator_style.wasm new file mode 100755 index 000000000..a213069c1 Binary files /dev/null and b/examples/dom/ftxui_example_separator_style.wasm differ diff --git a/examples/dom/ftxui_example_separator_style.worker.js b/examples/dom/ftxui_example_separator_style.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_separator_style.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_size.js b/examples/dom/ftxui_example_size.js new file mode 100644 index 000000000..8052f8dcd --- /dev/null +++ b/examples/dom/ftxui_example_size.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_size.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={23840:function(){throw"Canceled!"},23858:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_size.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"g":_abort,"k":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"j":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"c":_emscripten_futex_wake,"e":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"i":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"f":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"h":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=23832;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=29732;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_size.wasm b/examples/dom/ftxui_example_size.wasm new file mode 100755 index 000000000..1f703e6c6 Binary files /dev/null and b/examples/dom/ftxui_example_size.wasm differ diff --git a/examples/dom/ftxui_example_size.worker.js b/examples/dom/ftxui_example_size.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_size.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_spinner.js b/examples/dom/ftxui_example_spinner.js new file mode 100644 index 000000000..93da2e156 --- /dev/null +++ b/examples/dom/ftxui_example_spinner.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_spinner.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={25272:function(){throw"Canceled!"},25290:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_spinner.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"i":_abort,"g":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"f":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"e":_emscripten_futex_wake,"c":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"k":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"h":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"j":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=25264;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=31576;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_spinner.wasm b/examples/dom/ftxui_example_spinner.wasm new file mode 100755 index 000000000..aba545ee2 Binary files /dev/null and b/examples/dom/ftxui_example_spinner.wasm differ diff --git a/examples/dom/ftxui_example_spinner.worker.js b/examples/dom/ftxui_example_spinner.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_spinner.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_style_blink.js b/examples/dom/ftxui_example_style_blink.js new file mode 100644 index 000000000..eec9dab0c --- /dev/null +++ b/examples/dom/ftxui_example_style_blink.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_style_blink.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={22720:function(){throw"Canceled!"},22738:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_style_blink.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"g":_abort,"k":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"j":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"c":_emscripten_futex_wake,"e":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"i":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"f":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"h":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=22712;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=28180;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_style_blink.wasm b/examples/dom/ftxui_example_style_blink.wasm new file mode 100755 index 000000000..8ac801e29 Binary files /dev/null and b/examples/dom/ftxui_example_style_blink.wasm differ diff --git a/examples/dom/ftxui_example_style_blink.worker.js b/examples/dom/ftxui_example_style_blink.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_style_blink.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_style_bold.js b/examples/dom/ftxui_example_style_bold.js new file mode 100644 index 000000000..72fe55e95 --- /dev/null +++ b/examples/dom/ftxui_example_style_bold.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_style_bold.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={22704:function(){throw"Canceled!"},22722:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_style_bold.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"g":_abort,"k":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"j":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"c":_emscripten_futex_wake,"e":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"i":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"f":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"h":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=22696;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=28164;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_style_bold.wasm b/examples/dom/ftxui_example_style_bold.wasm new file mode 100755 index 000000000..523c104e3 Binary files /dev/null and b/examples/dom/ftxui_example_style_bold.wasm differ diff --git a/examples/dom/ftxui_example_style_bold.worker.js b/examples/dom/ftxui_example_style_bold.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_style_bold.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_style_color.js b/examples/dom/ftxui_example_style_color.js new file mode 100644 index 000000000..aff0bdb4f --- /dev/null +++ b/examples/dom/ftxui_example_style_color.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_style_color.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={31840:function(){throw"Canceled!"},31858:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_style_color.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"g":___cxa_allocate_exception,"f":___cxa_throw,"C":__emscripten_notify_thread_queue,"i":_abort,"m":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"l":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"c":_emscripten_futex_wake,"e":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"k":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"h":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"j":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=31832;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=37300;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_style_color.wasm b/examples/dom/ftxui_example_style_color.wasm new file mode 100755 index 000000000..f3c6f65b3 Binary files /dev/null and b/examples/dom/ftxui_example_style_color.wasm differ diff --git a/examples/dom/ftxui_example_style_color.worker.js b/examples/dom/ftxui_example_style_color.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_style_color.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_style_dim.js b/examples/dom/ftxui_example_style_dim.js new file mode 100644 index 000000000..a7a7a9363 --- /dev/null +++ b/examples/dom/ftxui_example_style_dim.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_style_dim.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={22704:function(){throw"Canceled!"},22722:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_style_dim.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"g":_abort,"k":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"j":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"c":_emscripten_futex_wake,"e":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"i":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"f":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"h":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=22696;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=28164;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_style_dim.wasm b/examples/dom/ftxui_example_style_dim.wasm new file mode 100755 index 000000000..b4cc3a2a4 Binary files /dev/null and b/examples/dom/ftxui_example_style_dim.wasm differ diff --git a/examples/dom/ftxui_example_style_dim.worker.js b/examples/dom/ftxui_example_style_dim.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_style_dim.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_style_gallery.js b/examples/dom/ftxui_example_style_gallery.js new file mode 100644 index 000000000..27bb5eada --- /dev/null +++ b/examples/dom/ftxui_example_style_gallery.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_style_gallery.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={31640:function(){throw"Canceled!"},31658:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_style_gallery.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"g":_abort,"k":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"j":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"c":_emscripten_futex_wake,"e":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"i":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"f":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"h":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=31632;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=37092;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_style_gallery.wasm b/examples/dom/ftxui_example_style_gallery.wasm new file mode 100755 index 000000000..36e51fd71 Binary files /dev/null and b/examples/dom/ftxui_example_style_gallery.wasm differ diff --git a/examples/dom/ftxui_example_style_gallery.worker.js b/examples/dom/ftxui_example_style_gallery.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_style_gallery.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_style_hyperlink.js b/examples/dom/ftxui_example_style_hyperlink.js new file mode 100644 index 000000000..a219fae9a --- /dev/null +++ b/examples/dom/ftxui_example_style_hyperlink.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_style_hyperlink.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={22440:function(){throw"Canceled!"},22458:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_style_hyperlink.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"g":_abort,"k":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"j":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"c":_emscripten_futex_wake,"e":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"i":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"f":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"h":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=22432;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=27892;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_style_hyperlink.wasm b/examples/dom/ftxui_example_style_hyperlink.wasm new file mode 100755 index 000000000..cd2dd3f92 Binary files /dev/null and b/examples/dom/ftxui_example_style_hyperlink.wasm differ diff --git a/examples/dom/ftxui_example_style_hyperlink.worker.js b/examples/dom/ftxui_example_style_hyperlink.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_style_hyperlink.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_style_inverted.js b/examples/dom/ftxui_example_style_inverted.js new file mode 100644 index 000000000..797a0b5c9 --- /dev/null +++ b/examples/dom/ftxui_example_style_inverted.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_style_inverted.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={22720:function(){throw"Canceled!"},22738:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_style_inverted.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"g":_abort,"k":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"j":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"c":_emscripten_futex_wake,"e":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"i":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"f":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"h":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=22712;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=28180;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_style_inverted.wasm b/examples/dom/ftxui_example_style_inverted.wasm new file mode 100755 index 000000000..79e5ddc59 Binary files /dev/null and b/examples/dom/ftxui_example_style_inverted.wasm differ diff --git a/examples/dom/ftxui_example_style_inverted.worker.js b/examples/dom/ftxui_example_style_inverted.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_style_inverted.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_style_italic.js b/examples/dom/ftxui_example_style_italic.js new file mode 100644 index 000000000..8d69eb2a1 --- /dev/null +++ b/examples/dom/ftxui_example_style_italic.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_style_italic.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={22768:function(){throw"Canceled!"},22786:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_style_italic.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"g":_abort,"k":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"j":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"c":_emscripten_futex_wake,"e":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"i":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"f":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"h":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=22760;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=28228;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_style_italic.wasm b/examples/dom/ftxui_example_style_italic.wasm new file mode 100755 index 000000000..25c296335 Binary files /dev/null and b/examples/dom/ftxui_example_style_italic.wasm differ diff --git a/examples/dom/ftxui_example_style_italic.worker.js b/examples/dom/ftxui_example_style_italic.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_style_italic.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_style_strikethrough.js b/examples/dom/ftxui_example_style_strikethrough.js new file mode 100644 index 000000000..850d1e32a --- /dev/null +++ b/examples/dom/ftxui_example_style_strikethrough.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_style_strikethrough.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={22784:function(){throw"Canceled!"},22802:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_style_strikethrough.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"g":_abort,"k":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"j":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"c":_emscripten_futex_wake,"e":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"i":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"f":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"h":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=22776;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=28244;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_style_strikethrough.wasm b/examples/dom/ftxui_example_style_strikethrough.wasm new file mode 100755 index 000000000..798b40d78 Binary files /dev/null and b/examples/dom/ftxui_example_style_strikethrough.wasm differ diff --git a/examples/dom/ftxui_example_style_strikethrough.worker.js b/examples/dom/ftxui_example_style_strikethrough.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_style_strikethrough.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_style_underlined.js b/examples/dom/ftxui_example_style_underlined.js new file mode 100644 index 000000000..c339d4b90 --- /dev/null +++ b/examples/dom/ftxui_example_style_underlined.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_style_underlined.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={22736:function(){throw"Canceled!"},22754:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_style_underlined.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"g":_abort,"k":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"j":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"c":_emscripten_futex_wake,"e":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"i":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"f":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"h":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=22728;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=28196;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_style_underlined.wasm b/examples/dom/ftxui_example_style_underlined.wasm new file mode 100755 index 000000000..dd26a2812 Binary files /dev/null and b/examples/dom/ftxui_example_style_underlined.wasm differ diff --git a/examples/dom/ftxui_example_style_underlined.worker.js b/examples/dom/ftxui_example_style_underlined.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_style_underlined.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_style_underlined_double.js b/examples/dom/ftxui_example_style_underlined_double.js new file mode 100644 index 000000000..cf9a8d0f5 --- /dev/null +++ b/examples/dom/ftxui_example_style_underlined_double.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_style_underlined_double.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={22800:function(){throw"Canceled!"},22818:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_style_underlined_double.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"g":_abort,"k":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"j":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"c":_emscripten_futex_wake,"e":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"i":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"f":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"h":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=22792;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=28260;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_style_underlined_double.wasm b/examples/dom/ftxui_example_style_underlined_double.wasm new file mode 100755 index 000000000..fd2296556 Binary files /dev/null and b/examples/dom/ftxui_example_style_underlined_double.wasm differ diff --git a/examples/dom/ftxui_example_style_underlined_double.worker.js b/examples/dom/ftxui_example_style_underlined_double.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_style_underlined_double.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_table.js b/examples/dom/ftxui_example_table.js new file mode 100644 index 000000000..a6f8b4d94 --- /dev/null +++ b/examples/dom/ftxui_example_table.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_table.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={31296:function(){throw"Canceled!"},31314:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_table.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"x":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"g":_abort,"k":_emscripten_asm_const_int,"w":_emscripten_check_blocking_allowed,"j":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"c":_emscripten_futex_wake,"e":_emscripten_get_now,"u":_emscripten_memcpy_big,"z":_emscripten_receive_on_main_thread_js,"v":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"i":_emscripten_set_current_thread_status,"y":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"r":_fd_close,"q":_fd_read,"s":_fd_seek,"f":_fd_write,"t":initPthreadsJS,"a":wasmMemory,"h":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=31288;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=37332;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_table.wasm b/examples/dom/ftxui_example_table.wasm new file mode 100755 index 000000000..04e328306 Binary files /dev/null and b/examples/dom/ftxui_example_table.wasm differ diff --git a/examples/dom/ftxui_example_table.worker.js b/examples/dom/ftxui_example_table.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_table.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_vbox_hbox.js b/examples/dom/ftxui_example_vbox_hbox.js new file mode 100644 index 000000000..6331726e1 --- /dev/null +++ b/examples/dom/ftxui_example_vbox_hbox.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_vbox_hbox.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={22088:function(){throw"Canceled!"},22106:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_vbox_hbox.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"w":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"g":_abort,"k":_emscripten_asm_const_int,"v":_emscripten_check_blocking_allowed,"j":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"c":_emscripten_futex_wake,"e":_emscripten_get_now,"t":_emscripten_memcpy_big,"y":_emscripten_receive_on_main_thread_js,"u":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"i":_emscripten_set_current_thread_status,"x":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"z":_fd_close,"q":_fd_read,"r":_fd_seek,"f":_fd_write,"s":initPthreadsJS,"a":wasmMemory,"h":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=22080;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=27540;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_vbox_hbox.wasm b/examples/dom/ftxui_example_vbox_hbox.wasm new file mode 100755 index 000000000..019f6638d Binary files /dev/null and b/examples/dom/ftxui_example_vbox_hbox.wasm differ diff --git a/examples/dom/ftxui_example_vbox_hbox.worker.js b/examples/dom/ftxui_example_vbox_hbox.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_vbox_hbox.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/dom/ftxui_example_vflow.js b/examples/dom/ftxui_example_vflow.js new file mode 100644 index 000000000..e07290c00 --- /dev/null +++ b/examples/dom/ftxui_example_vflow.js @@ -0,0 +1 @@ +var Module=typeof Module!=="undefined"?Module:{};var moduleOverrides={};var key;for(key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var arguments_=[];var thisProgram="./this.program";var quit_=function(status,toThrow){throw toThrow};var ENVIRONMENT_IS_WEB=false;var ENVIRONMENT_IS_WORKER=false;var ENVIRONMENT_IS_NODE=false;var ENVIRONMENT_IS_SHELL=false;ENVIRONMENT_IS_WEB=typeof window==="object";ENVIRONMENT_IS_WORKER=typeof importScripts==="function";ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string";ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_PTHREAD=Module["ENVIRONMENT_IS_PTHREAD"]||false;var _scriptDir=typeof document!=="undefined"&&document.currentScript?document.currentScript.src:undefined;if(ENVIRONMENT_IS_WORKER){_scriptDir=self.location.href}else if(ENVIRONMENT_IS_NODE){_scriptDir=__filename}var scriptDirectory="";function locateFile(path){if(Module["locateFile"]){return Module["locateFile"](path,scriptDirectory)}return scriptDirectory+path}var read_,readAsync,readBinary,setWindowTitle;var nodeFS;var nodePath;if(ENVIRONMENT_IS_NODE){if(ENVIRONMENT_IS_WORKER){scriptDirectory=require("path").dirname(scriptDirectory)+"/"}else{scriptDirectory=__dirname+"/"}read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret};if(process["argv"].length>1){thisProgram=process["argv"][1].replace(/\\/g,"/")}arguments_=process["argv"].slice(2);if(typeof module!=="undefined"){module["exports"]=Module}process["on"]("uncaughtException",function(ex){if(!(ex instanceof ExitStatus)){throw ex}});process["on"]("unhandledRejection",abort);quit_=function(status){process["exit"](status)};Module["inspect"]=function(){return"[Emscripten Module object]"};var nodeWorkerThreads;try{nodeWorkerThreads=require("worker_threads")}catch(e){console.error('The "worker_threads" module is not supported in this node.js build - perhaps a newer version is needed?');throw e}global.Worker=nodeWorkerThreads.Worker}else if(ENVIRONMENT_IS_SHELL){if(typeof read!="undefined"){read_=function shell_read(f){return read(f)}}readBinary=function readBinary(f){var data;if(typeof readbuffer==="function"){return new Uint8Array(readbuffer(f))}data=read(f,"binary");assert(typeof data==="object");return data};if(typeof scriptArgs!="undefined"){arguments_=scriptArgs}else if(typeof arguments!="undefined"){arguments_=arguments}if(typeof quit==="function"){quit_=function(status){quit(status)}}if(typeof print!=="undefined"){if(typeof console==="undefined")console={};console.log=print;console.warn=console.error=typeof printErr!=="undefined"?printErr:print}}else if(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER){if(ENVIRONMENT_IS_WORKER){scriptDirectory=self.location.href}else if(typeof document!=="undefined"&&document.currentScript){scriptDirectory=document.currentScript.src}if(scriptDirectory.indexOf("blob:")!==0){scriptDirectory=scriptDirectory.substr(0,scriptDirectory.lastIndexOf("/")+1)}else{scriptDirectory=""}if(ENVIRONMENT_IS_NODE){read_=function shell_read(filename,binary){if(!nodeFS)nodeFS=require("fs");if(!nodePath)nodePath=require("path");filename=nodePath["normalize"](filename);return nodeFS["readFileSync"](filename,binary?null:"utf8")};readBinary=function readBinary(filename){var ret=read_(filename,true);if(!ret.buffer){ret=new Uint8Array(ret)}assert(ret.buffer);return ret}}else{read_=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.send(null);return xhr.responseText};if(ENVIRONMENT_IS_WORKER){readBinary=function(url){var xhr=new XMLHttpRequest;xhr.open("GET",url,false);xhr.responseType="arraybuffer";xhr.send(null);return new Uint8Array(xhr.response)}}readAsync=function(url,onload,onerror){var xhr=new XMLHttpRequest;xhr.open("GET",url,true);xhr.responseType="arraybuffer";xhr.onload=function(){if(xhr.status==200||xhr.status==0&&xhr.response){onload(xhr.response);return}onerror()};xhr.onerror=onerror;xhr.send(null)}}setWindowTitle=function(title){document.title=title}}else{}if(ENVIRONMENT_IS_NODE){if(typeof performance==="undefined"){global.performance=require("perf_hooks").performance}}var out=Module["print"]||console.log.bind(console);var err=Module["printErr"]||console.warn.bind(console);for(key in moduleOverrides){if(moduleOverrides.hasOwnProperty(key)){Module[key]=moduleOverrides[key]}}moduleOverrides=null;if(Module["arguments"])arguments_=Module["arguments"];if(Module["thisProgram"])thisProgram=Module["thisProgram"];if(Module["quit"])quit_=Module["quit"];var STACK_ALIGN=16;function alignMemory(size,factor){if(!factor)factor=STACK_ALIGN;return Math.ceil(size/factor)*factor}function warnOnce(text){if(!warnOnce.shown)warnOnce.shown={};if(!warnOnce.shown[text]){warnOnce.shown[text]=1;err(text)}}var Atomics_load=Atomics.load;var Atomics_store=Atomics.store;var Atomics_compareExchange=Atomics.compareExchange;var wasmBinary;if(Module["wasmBinary"])wasmBinary=Module["wasmBinary"];var noExitRuntime=Module["noExitRuntime"]||true;if(typeof WebAssembly!=="object"){abort("no native wasm support detected")}var wasmMemory;var wasmModule;var ABORT=false;var EXITSTATUS;function assert(condition,text){if(!condition){abort("Assertion failed: "+text)}}function UTF8ArrayToString(heap,idx,maxBytesToRead){var endIdx=idx+maxBytesToRead;var str="";while(!(idx>=endIdx)){var u0=heap[idx++];if(!u0)return str;if(!(u0&128)){str+=String.fromCharCode(u0);continue}var u1=heap[idx++]&63;if((u0&224)==192){str+=String.fromCharCode((u0&31)<<6|u1);continue}var u2=heap[idx++]&63;if((u0&240)==224){u0=(u0&15)<<12|u1<<6|u2}else{u0=(u0&7)<<18|u1<<12|u2<<6|heap[idx++]&63}if(u0<65536){str+=String.fromCharCode(u0)}else{var ch=u0-65536;str+=String.fromCharCode(55296|ch>>10,56320|ch&1023)}}return str}function UTF8ToString(ptr,maxBytesToRead){return ptr?UTF8ArrayToString(HEAPU8,ptr,maxBytesToRead):""}function stringToUTF8Array(str,heap,outIdx,maxBytesToWrite){if(!(maxBytesToWrite>0))return 0;var startIdx=outIdx;var endIdx=outIdx+maxBytesToWrite-1;for(var i=0;i=55296&&u<=57343){var u1=str.charCodeAt(++i);u=65536+((u&1023)<<10)|u1&1023}if(u<=127){if(outIdx>=endIdx)break;heap[outIdx++]=u}else if(u<=2047){if(outIdx+1>=endIdx)break;heap[outIdx++]=192|u>>6;heap[outIdx++]=128|u&63}else if(u<=65535){if(outIdx+2>=endIdx)break;heap[outIdx++]=224|u>>12;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}else{if(outIdx+3>=endIdx)break;heap[outIdx++]=240|u>>18;heap[outIdx++]=128|u>>12&63;heap[outIdx++]=128|u>>6&63;heap[outIdx++]=128|u&63}}heap[outIdx]=0;return outIdx-startIdx}function stringToUTF8(str,outPtr,maxBytesToWrite){return stringToUTF8Array(str,HEAPU8,outPtr,maxBytesToWrite)}function lengthBytesUTF8(str){var len=0;for(var i=0;i=55296&&u<=57343)u=65536+((u&1023)<<10)|str.charCodeAt(++i)&1023;if(u<=127)++len;else if(u<=2047)len+=2;else if(u<=65535)len+=3;else len+=4}return len}function writeArrayToMemory(array,buffer){HEAP8.set(array,buffer)}function writeAsciiToMemory(str,buffer,dontAddNull){for(var i=0;i>0]=str.charCodeAt(i)}if(!dontAddNull)HEAP8[buffer>>0]=0}var buffer,HEAP8,HEAPU8,HEAP16,HEAPU16,HEAP32,HEAPU32,HEAPF32,HEAPF64;if(ENVIRONMENT_IS_PTHREAD){buffer=Module["buffer"]}function updateGlobalBufferAndViews(buf){buffer=buf;Module["HEAP8"]=HEAP8=new Int8Array(buf);Module["HEAP16"]=HEAP16=new Int16Array(buf);Module["HEAP32"]=HEAP32=new Int32Array(buf);Module["HEAPU8"]=HEAPU8=new Uint8Array(buf);Module["HEAPU16"]=HEAPU16=new Uint16Array(buf);Module["HEAPU32"]=HEAPU32=new Uint32Array(buf);Module["HEAPF32"]=HEAPF32=new Float32Array(buf);Module["HEAPF64"]=HEAPF64=new Float64Array(buf)}var INITIAL_MEMORY=Module["INITIAL_MEMORY"]||16777216;if(ENVIRONMENT_IS_PTHREAD){wasmMemory=Module["wasmMemory"];buffer=Module["buffer"]}else{if(Module["wasmMemory"]){wasmMemory=Module["wasmMemory"]}else{wasmMemory=new WebAssembly.Memory({"initial":INITIAL_MEMORY/65536,"maximum":INITIAL_MEMORY/65536,"shared":true});if(!(wasmMemory.buffer instanceof SharedArrayBuffer)){err("requested a shared WebAssembly.Memory but the returned buffer is not a SharedArrayBuffer, indicating that while the browser has SharedArrayBuffer it does not have WebAssembly threads support - you may need to set a flag");if(ENVIRONMENT_IS_NODE){console.log("(on node you may need: --experimental-wasm-threads --experimental-wasm-bulk-memory and also use a recent version)")}throw Error("bad memory")}}}if(wasmMemory){buffer=wasmMemory.buffer}INITIAL_MEMORY=buffer.byteLength;updateGlobalBufferAndViews(buffer);var wasmTable;var __ATPRERUN__=[];var __ATINIT__=[];var __ATMAIN__=[];var __ATEXIT__=[];var __ATPOSTRUN__=[];var runtimeInitialized=false;var runtimeExited=false;function preRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["preRun"]){if(typeof Module["preRun"]=="function")Module["preRun"]=[Module["preRun"]];while(Module["preRun"].length){addOnPreRun(Module["preRun"].shift())}}callRuntimeCallbacks(__ATPRERUN__)}function initRuntime(){runtimeInitialized=true;if(ENVIRONMENT_IS_PTHREAD)return;if(!Module["noFSInit"]&&!FS.init.initialized)FS.init();TTY.init();callRuntimeCallbacks(__ATINIT__)}function preMain(){if(ENVIRONMENT_IS_PTHREAD)return;FS.ignorePermissions=false;callRuntimeCallbacks(__ATMAIN__)}function exitRuntime(){if(ENVIRONMENT_IS_PTHREAD)return;runtimeExited=true}function postRun(){if(ENVIRONMENT_IS_PTHREAD)return;if(Module["postRun"]){if(typeof Module["postRun"]=="function")Module["postRun"]=[Module["postRun"]];while(Module["postRun"].length){addOnPostRun(Module["postRun"].shift())}}callRuntimeCallbacks(__ATPOSTRUN__)}function addOnPreRun(cb){__ATPRERUN__.unshift(cb)}function addOnInit(cb){__ATINIT__.unshift(cb)}function addOnPostRun(cb){__ATPOSTRUN__.unshift(cb)}var runDependencies=0;var runDependencyWatcher=null;var dependenciesFulfilled=null;function getUniqueRunDependency(id){return id}function addRunDependency(id){assert(!ENVIRONMENT_IS_PTHREAD,"addRunDependency cannot be used in a pthread worker");runDependencies++;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}}function removeRunDependency(id){runDependencies--;if(Module["monitorRunDependencies"]){Module["monitorRunDependencies"](runDependencies)}if(runDependencies==0){if(runDependencyWatcher!==null){clearInterval(runDependencyWatcher);runDependencyWatcher=null}if(dependenciesFulfilled){var callback=dependenciesFulfilled;dependenciesFulfilled=null;callback()}}}Module["preloadedImages"]={};Module["preloadedAudios"]={};function abort(what){if(Module["onAbort"]){Module["onAbort"](what)}if(ENVIRONMENT_IS_PTHREAD)console.error("Pthread aborting at "+(new Error).stack);what+="";err(what);ABORT=true;EXITSTATUS=1;what="abort("+what+"). Build with -s ASSERTIONS=1 for more info.";var e=new WebAssembly.RuntimeError(what);throw e}var dataURIPrefix="data:application/octet-stream;base64,";function isDataURI(filename){return filename.startsWith(dataURIPrefix)}function isFileURI(filename){return filename.startsWith("file://")}var wasmBinaryFile="ftxui_example_vflow.wasm";if(!isDataURI(wasmBinaryFile)){wasmBinaryFile=locateFile(wasmBinaryFile)}function getBinary(file){try{if(file==wasmBinaryFile&&wasmBinary){return new Uint8Array(wasmBinary)}if(readBinary){return readBinary(file)}else{throw"both async and sync fetching of the wasm failed"}}catch(err){abort(err)}}function getBinaryPromise(){if(!wasmBinary&&(ENVIRONMENT_IS_WEB||ENVIRONMENT_IS_WORKER)){if(typeof fetch==="function"&&!isFileURI(wasmBinaryFile)){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){if(!response["ok"]){throw"failed to load wasm binary file at '"+wasmBinaryFile+"'"}return response["arrayBuffer"]()}).catch(function(){return getBinary(wasmBinaryFile)})}else{if(readAsync){return new Promise(function(resolve,reject){readAsync(wasmBinaryFile,function(response){resolve(new Uint8Array(response))},reject)})}}}return Promise.resolve().then(function(){return getBinary(wasmBinaryFile)})}function createWasm(){var info={"a":asmLibraryArg};function receiveInstance(instance,module){var exports=instance.exports;Module["asm"]=exports;wasmTable=Module["asm"]["F"];addOnInit(Module["asm"]["D"]);PThread.tlsInitFunctions.push(Module["asm"]["G"]);wasmModule=module;if(!ENVIRONMENT_IS_PTHREAD){removeRunDependency("wasm-instantiate")}}if(!ENVIRONMENT_IS_PTHREAD){addRunDependency("wasm-instantiate")}function receiveInstantiationResult(result){receiveInstance(result["instance"],result["module"])}function instantiateArrayBuffer(receiver){return getBinaryPromise().then(function(binary){var result=WebAssembly.instantiate(binary,info);return result}).then(receiver,function(reason){err("failed to asynchronously prepare wasm: "+reason);abort(reason)})}function instantiateAsync(){if(!wasmBinary&&typeof WebAssembly.instantiateStreaming==="function"&&!isDataURI(wasmBinaryFile)&&!isFileURI(wasmBinaryFile)&&typeof fetch==="function"){return fetch(wasmBinaryFile,{credentials:"same-origin"}).then(function(response){var result=WebAssembly.instantiateStreaming(response,info);return result.then(receiveInstantiationResult,function(reason){err("wasm streaming compile failed: "+reason);err("falling back to ArrayBuffer instantiation");return instantiateArrayBuffer(receiveInstantiationResult)})})}else{return instantiateArrayBuffer(receiveInstantiationResult)}}if(Module["instantiateWasm"]){try{var exports=Module["instantiateWasm"](info,receiveInstance);return exports}catch(e){err("Module.instantiateWasm callback failed with error: "+e);return false}}instantiateAsync();return{}}var tempDouble;var tempI64;var ASM_CONSTS={24216:function(){throw"Canceled!"},24234:function($0,$1){setTimeout(function(){__emscripten_do_dispatch_to_thread($0,$1)},0)}};function initPthreadsJS(){PThread.initRuntime()}function callRuntimeCallbacks(callbacks){while(callbacks.length>0){var callback=callbacks.shift();if(typeof callback=="function"){callback(Module);continue}var func=callback.func;if(typeof func==="number"){if(callback.arg===undefined){wasmTable.get(func)()}else{wasmTable.get(func)(callback.arg)}}else{func(callback.arg===undefined?null:callback.arg)}}}function _emscripten_futex_wake(addr,count){if(addr<=0||addr>HEAP8.length||addr&3!=0||count<0)return-28;if(count==0)return 0;if(count>=2147483647)count=Infinity;var mainThreadWaitAddress=Atomics.load(HEAP32,__emscripten_main_thread_futex>>2);var mainThreadWoken=0;if(mainThreadWaitAddress==addr){var loadedAddr=Atomics.compareExchange(HEAP32,__emscripten_main_thread_futex>>2,mainThreadWaitAddress,0);if(loadedAddr==mainThreadWaitAddress){--count;mainThreadWoken=1;if(count<=0)return 1}}var ret=Atomics.notify(HEAP32,addr>>2,count);if(ret>=0)return ret+mainThreadWoken;throw"Atomics.notify returned an unexpected value "+ret}Module["_emscripten_futex_wake"]=_emscripten_futex_wake;function killThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! killThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in killThread!";HEAP32[pthread_ptr+12>>2]=0;var pthread=PThread.pthreads[pthread_ptr];pthread.worker.terminate();PThread.freeThreadData(pthread);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(pthread.worker),1);pthread.worker.pthread=undefined}function cancelThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cancelThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cancelThread!";var pthread=PThread.pthreads[pthread_ptr];pthread.worker.postMessage({"cmd":"cancel"})}function cleanupThread(pthread_ptr){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! cleanupThread() can only ever be called from main application thread!";if(!pthread_ptr)throw"Internal Error! Null pthread_ptr in cleanupThread!";var pthread=PThread.pthreads[pthread_ptr];if(pthread){HEAP32[pthread_ptr+12>>2]=0;var worker=pthread.worker;PThread.returnWorkerToPool(worker)}}var PThread={unusedWorkers:[],runningWorkers:[],tlsInitFunctions:[],initMainThreadBlock:function(){},initRuntime:function(){var tb=_malloc(228);for(var i=0;i<228/4;++i)HEAPU32[tb/4+i]=0;HEAP32[tb+12>>2]=tb;var headPtr=tb+152;HEAP32[headPtr>>2]=headPtr;var tlsMemory=_malloc(512);for(var i=0;i<128;++i)HEAPU32[tlsMemory/4+i]=0;Atomics.store(HEAPU32,tb+100>>2,tlsMemory);Atomics.store(HEAPU32,tb+40>>2,tb);__emscripten_thread_init(tb,!ENVIRONMENT_IS_WORKER,1);_emscripten_register_main_browser_thread_id(tb)},initWorker:function(){},pthreads:{},threadExitHandlers:[],runExitHandlers:function(){while(PThread.threadExitHandlers.length>0){PThread.threadExitHandlers.pop()()}if(ENVIRONMENT_IS_PTHREAD&&_pthread_self())___pthread_tsd_run_dtors()},runExitHandlersAndDeinitThread:function(tb,exitCode){Atomics.store(HEAPU32,tb+56>>2,1);Atomics.store(HEAPU32,tb+60>>2,0);PThread.runExitHandlers();Atomics.store(HEAPU32,tb+4>>2,exitCode);Atomics.store(HEAPU32,tb+0>>2,1);_emscripten_futex_wake(tb+0,2147483647);__emscripten_thread_init(0,0,0)},setExitStatus:function(status){EXITSTATUS=status},threadExit:function(exitCode){var tb=_pthread_self();if(tb){PThread.runExitHandlersAndDeinitThread(tb,exitCode);if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exit"})}}},threadCancel:function(){PThread.runExitHandlersAndDeinitThread(_pthread_self(),-1);postMessage({"cmd":"cancelDone"})},terminateAllThreads:function(){for(var t in PThread.pthreads){var pthread=PThread.pthreads[t];if(pthread&&pthread.worker){PThread.returnWorkerToPool(pthread.worker)}}PThread.pthreads={};for(var i=0;i>2];HEAP32[pthread.threadInfoStruct+100>>2]=0;_free(tlsMemory);_free(pthread.threadInfoStruct)}pthread.threadInfoStruct=0;if(pthread.allocatedOwnStack&&pthread.stackBase)_free(pthread.stackBase);pthread.stackBase=0;if(pthread.worker)pthread.worker.pthread=null},returnWorkerToPool:function(worker){PThread.runWithoutMainThreadQueuedCalls(function(){delete PThread.pthreads[worker.pthread.threadInfoStruct];PThread.unusedWorkers.push(worker);PThread.runningWorkers.splice(PThread.runningWorkers.indexOf(worker),1);PThread.freeThreadData(worker.pthread);worker.pthread=undefined})},runWithoutMainThreadQueuedCalls:function(func){HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=0;try{func()}finally{HEAP32[__emscripten_allow_main_runtime_queued_calls>>2]=1}},receiveObjectTransfer:function(data){},threadInit:function(){for(var i in PThread.tlsInitFunctions){PThread.tlsInitFunctions[i]()}},loadWasmModuleToWorker:function(worker,onFinishedLoading){worker.onmessage=function(e){var d=e["data"];var cmd=d["cmd"];if(worker.pthread)PThread.currentProxiedOperationCallerThread=worker.pthread.threadInfoStruct;if(d["targetThread"]&&d["targetThread"]!=_pthread_self()){var thread=PThread.pthreads[d.targetThread];if(thread){thread.worker.postMessage(e.data,d["transferList"])}else{console.error('Internal error! Worker sent a message "'+cmd+'" to target pthread '+d["targetThread"]+", but that thread no longer exists!")}PThread.currentProxiedOperationCallerThread=undefined;return}if(cmd==="processQueuedMainThreadWork"){_emscripten_main_thread_process_queued_calls()}else if(cmd==="spawnThread"){spawnThread(e.data)}else if(cmd==="cleanupThread"){cleanupThread(d["thread"])}else if(cmd==="killThread"){killThread(d["thread"])}else if(cmd==="cancelThread"){cancelThread(d["thread"])}else if(cmd==="loaded"){worker.loaded=true;if(onFinishedLoading)onFinishedLoading(worker);if(worker.runPthread){worker.runPthread();delete worker.runPthread}}else if(cmd==="print"){out("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="printErr"){err("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="alert"){alert("Thread "+d["threadId"]+": "+d["text"])}else if(cmd==="exit"){var detached=worker.pthread&&Atomics.load(HEAPU32,worker.pthread.threadInfoStruct+64>>2);if(detached){PThread.returnWorkerToPool(worker)}}else if(cmd==="exitProcess"){try{exit(d["returnCode"])}catch(e){if(e instanceof ExitStatus)return;throw e}}else if(cmd==="cancelDone"){PThread.returnWorkerToPool(worker)}else if(cmd==="objectTransfer"){PThread.receiveObjectTransfer(e.data)}else if(e.data.target==="setimmediate"){worker.postMessage(e.data)}else{err("worker sent an unknown command "+cmd)}PThread.currentProxiedOperationCallerThread=undefined};worker.onerror=function(e){err("pthread sent an error! "+e.filename+":"+e.lineno+": "+e.message)};if(ENVIRONMENT_IS_NODE){worker.on("message",function(data){worker.onmessage({data:data})});worker.on("error",function(data){worker.onerror(data)});worker.on("exit",function(data){})}worker.postMessage({"cmd":"load","urlOrBlob":Module["mainScriptUrlOrBlob"]||_scriptDir,"wasmMemory":wasmMemory,"wasmModule":wasmModule})},allocateUnusedWorker:function(){var pthreadMainJs=locateFile("ftxui_example_vflow.worker.js");PThread.unusedWorkers.push(new Worker(pthreadMainJs))},getNewWorker:function(){if(PThread.unusedWorkers.length==0){PThread.allocateUnusedWorker();PThread.loadWasmModuleToWorker(PThread.unusedWorkers[0])}return PThread.unusedWorkers.pop()},busySpinWait:function(msecs){var t=performance.now()+msecs;while(performance.now()0}Module["keepRuntimeAlive"]=keepRuntimeAlive;function ___assert_fail(condition,filename,line,func){abort("Assertion failed: "+UTF8ToString(condition)+", at: "+[filename?UTF8ToString(filename):"unknown filename",line,func?UTF8ToString(func):"unknown function"])}function ___call_main(argc,argv){var returnCode=_main(argc,argv)}var _emscripten_get_now;if(ENVIRONMENT_IS_NODE){_emscripten_get_now=function(){var t=process["hrtime"]();return t[0]*1e3+t[1]/1e6}}else if(ENVIRONMENT_IS_PTHREAD){_emscripten_get_now=function(){return performance.now()-Module["__performance_now_clock_drift"]}}else if(typeof dateNow!=="undefined"){_emscripten_get_now=dateNow}else _emscripten_get_now=function(){return performance.now()};var ExceptionInfoAttrs={DESTRUCTOR_OFFSET:0,REFCOUNT_OFFSET:4,TYPE_OFFSET:8,CAUGHT_OFFSET:12,RETHROWN_OFFSET:13,SIZE:16};function ___cxa_allocate_exception(size){return _malloc(size+ExceptionInfoAttrs.SIZE)+ExceptionInfoAttrs.SIZE}function _atexit(func,arg){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(1,1,func,arg)}function ExceptionInfo(excPtr){this.excPtr=excPtr;this.ptr=excPtr-ExceptionInfoAttrs.SIZE;this.set_type=function(type){HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]=type};this.get_type=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.TYPE_OFFSET>>2]};this.set_destructor=function(destructor){HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]=destructor};this.get_destructor=function(){return HEAP32[this.ptr+ExceptionInfoAttrs.DESTRUCTOR_OFFSET>>2]};this.set_refcount=function(refcount){HEAP32[this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2]=refcount};this.set_caught=function(caught){caught=caught?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]=caught};this.get_caught=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.CAUGHT_OFFSET>>0]!=0};this.set_rethrown=function(rethrown){rethrown=rethrown?1:0;HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]=rethrown};this.get_rethrown=function(){return HEAP8[this.ptr+ExceptionInfoAttrs.RETHROWN_OFFSET>>0]!=0};this.init=function(type,destructor){this.set_type(type);this.set_destructor(destructor);this.set_refcount(0);this.set_caught(false);this.set_rethrown(false)};this.add_ref=function(){Atomics.add(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1)};this.release_ref=function(){var prev=Atomics.sub(HEAP32,this.ptr+ExceptionInfoAttrs.REFCOUNT_OFFSET>>2,1);return prev===1}}var exceptionLast=0;var uncaughtExceptionCount=0;function ___cxa_throw(ptr,type,destructor){var info=new ExceptionInfo(ptr);info.init(type,destructor);exceptionLast=ptr;uncaughtExceptionCount++;throw ptr}function __emscripten_notify_thread_queue(targetThreadId,mainThreadId){if(targetThreadId==mainThreadId){postMessage({"cmd":"processQueuedMainThreadWork"})}else if(ENVIRONMENT_IS_PTHREAD){postMessage({"targetThread":targetThreadId,"cmd":"processThreadQueue"})}else{var pthread=PThread.pthreads[targetThreadId];var worker=pthread&&pthread.worker;if(!worker){return}worker.postMessage({"cmd":"processThreadQueue"})}return 1}function _abort(){abort()}var readAsmConstArgsArray=[];function readAsmConstArgs(sigPtr,buf){readAsmConstArgsArray.length=0;var ch;buf>>=2;while(ch=HEAPU8[sigPtr++]){var double=ch<105;if(double&&buf&1)buf++;readAsmConstArgsArray.push(double?HEAPF64[buf++>>1]:HEAP32[buf]);++buf}return readAsmConstArgsArray}function _emscripten_asm_const_int(code,sigPtr,argbuf){var args=readAsmConstArgs(sigPtr,argbuf);return ASM_CONSTS[code].apply(null,args)}function _emscripten_check_blocking_allowed(){if(ENVIRONMENT_IS_NODE)return;if(ENVIRONMENT_IS_WORKER)return;warnOnce("Blocking on the main thread is very dangerous, see https://emscripten.org/docs/porting/pthreads.html#blocking-on-the-main-browser-thread")}function _emscripten_conditional_set_current_thread_status(expectedStatus,newStatus){}function _emscripten_futex_wait(addr,val,timeout){if(addr<=0||addr>HEAP8.length||addr&3!=0)return-28;if(!ENVIRONMENT_IS_WEB){var ret=Atomics.wait(HEAP32,addr>>2,val,timeout);if(ret==="timed-out")return-73;if(ret==="not-equal")return-6;if(ret==="ok")return 0;throw"Atomics.wait returned an unexpected value "+ret}else{if(Atomics.load(HEAP32,addr>>2)!=val){return-6}var tNow=performance.now();var tEnd=tNow+timeout;var lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr);while(1){tNow=performance.now();if(tNow>tEnd){lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);return-73}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,0);if(lastAddr==0){break}_emscripten_main_thread_process_queued_calls();if(Atomics.load(HEAP32,addr>>2)!=val){return-6}lastAddr=Atomics.exchange(HEAP32,__emscripten_main_thread_futex>>2,addr)}return 0}}function _emscripten_memcpy_big(dest,src,num){HEAPU8.copyWithin(dest,src,src+num)}function _emscripten_proxy_to_main_thread_js(index,sync){var numCallArgs=arguments.length-2;var stack=stackSave();var serializedNumCallArgs=numCallArgs;var args=stackAlloc(serializedNumCallArgs*8);var b=args>>3;for(var i=0;i>3;for(var i=0;i>>0;abortOnCannotGrowMemory(requestedSize)}var JSEvents={inEventHandler:0,removeAllEventListeners:function(){for(var i=JSEvents.eventHandlers.length-1;i>=0;--i){JSEvents._removeHandler(i)}JSEvents.eventHandlers=[];JSEvents.deferredCalls=[]},registerRemoveEventListeners:function(){if(!JSEvents.removeEventListenersRegistered){__ATEXIT__.push(JSEvents.removeAllEventListeners);JSEvents.removeEventListenersRegistered=true}},deferredCalls:[],deferCall:function(targetFunction,precedence,argsList){function arraysHaveEqualContent(arrA,arrB){if(arrA.length!=arrB.length)return false;for(var i in arrA){if(arrA[i]!=arrB[i])return false}return true}for(var i in JSEvents.deferredCalls){var call=JSEvents.deferredCalls[i];if(call.targetFunction==targetFunction&&arraysHaveEqualContent(call.argsList,argsList)){return}}JSEvents.deferredCalls.push({targetFunction:targetFunction,precedence:precedence,argsList:argsList});JSEvents.deferredCalls.sort(function(x,y){return x.precedence>2]=eventTypeId;HEAP32[varargs+4>>2]=eventData;HEAP32[varargs+8>>2]=userData;__emscripten_call_on_thread(0,targetThread,637534208,eventHandlerFunc,eventData,varargs);stackRestore(stackTop)},getTargetThreadForEventCallback:function(targetThread){switch(targetThread){case 1:return 0;case 2:return PThread.currentProxiedOperationCallerThread;default:return targetThread}},getNodeNameForTarget:function(target){if(!target)return"";if(target==window)return"#window";if(target==screen)return"#screen";return target&&target.nodeName?target.nodeName:""},fullscreenEnabled:function(){return document.fullscreenEnabled||document.webkitFullscreenEnabled}};function stringToNewUTF8(jsString){var length=lengthBytesUTF8(jsString)+1;var cString=_malloc(length);stringToUTF8(jsString,cString,length);return cString}function _emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height){var stackTop=stackSave();var varargs=stackAlloc(12);var targetCanvasPtr=0;if(targetCanvas){targetCanvasPtr=stringToNewUTF8(targetCanvas)}HEAP32[varargs>>2]=targetCanvasPtr;HEAP32[varargs+4>>2]=width;HEAP32[varargs+8>>2]=height;__emscripten_call_on_thread(0,targetThread,657457152,0,targetCanvasPtr,varargs);stackRestore(stackTop)}function _emscripten_set_offscreencanvas_size_on_target_thread(targetThread,targetCanvas,width,height){targetCanvas=targetCanvas?UTF8ToString(targetCanvas):"";_emscripten_set_offscreencanvas_size_on_target_thread_js(targetThread,targetCanvas,width,height)}function maybeCStringToJsString(cString){return cString>2?UTF8ToString(cString):cString}var specialHTMLTargets=[0,typeof document!=="undefined"?document:0,typeof window!=="undefined"?window:0];function findEventTarget(target){target=maybeCStringToJsString(target);var domElement=specialHTMLTargets[target]||(typeof document!=="undefined"?document.querySelector(target):undefined);return domElement}function findCanvasEventTarget(target){return findEventTarget(target)}function _emscripten_set_canvas_element_size_calling_thread(target,width,height){var canvas=findCanvasEventTarget(target);if(!canvas)return-4;if(canvas.canvasSharedPtr){HEAP32[canvas.canvasSharedPtr>>2]=width;HEAP32[canvas.canvasSharedPtr+4>>2]=height}if(canvas.offscreenCanvas||!canvas.controlTransferredOffscreen){if(canvas.offscreenCanvas)canvas=canvas.offscreenCanvas;var autoResizeViewport=false;if(canvas.GLctxObject&&canvas.GLctxObject.GLctx){var prevViewport=canvas.GLctxObject.GLctx.getParameter(2978);autoResizeViewport=prevViewport[0]===0&&prevViewport[1]===0&&prevViewport[2]===canvas.width&&prevViewport[3]===canvas.height}canvas.width=width;canvas.height=height;if(autoResizeViewport){canvas.GLctxObject.GLctx.viewport(0,0,width,height)}}else if(canvas.canvasSharedPtr){var targetThread=HEAP32[canvas.canvasSharedPtr+8>>2];_emscripten_set_offscreencanvas_size_on_target_thread(targetThread,target,width,height);return 1}else{return-4}return 0}function _emscripten_set_canvas_element_size_main_thread(target,width,height){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(2,1,target,width,height);return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}function _emscripten_set_canvas_element_size(target,width,height){var canvas=findCanvasEventTarget(target);if(canvas){return _emscripten_set_canvas_element_size_calling_thread(target,width,height)}else{return _emscripten_set_canvas_element_size_main_thread(target,width,height)}}function _emscripten_set_current_thread_status(newStatus){}function _emscripten_set_thread_name(threadId,name){}function __webgl_enable_ANGLE_instanced_arrays(ctx){var ext=ctx.getExtension("ANGLE_instanced_arrays");if(ext){ctx["vertexAttribDivisor"]=function(index,divisor){ext["vertexAttribDivisorANGLE"](index,divisor)};ctx["drawArraysInstanced"]=function(mode,first,count,primcount){ext["drawArraysInstancedANGLE"](mode,first,count,primcount)};ctx["drawElementsInstanced"]=function(mode,count,type,indices,primcount){ext["drawElementsInstancedANGLE"](mode,count,type,indices,primcount)};return 1}}function __webgl_enable_OES_vertex_array_object(ctx){var ext=ctx.getExtension("OES_vertex_array_object");if(ext){ctx["createVertexArray"]=function(){return ext["createVertexArrayOES"]()};ctx["deleteVertexArray"]=function(vao){ext["deleteVertexArrayOES"](vao)};ctx["bindVertexArray"]=function(vao){ext["bindVertexArrayOES"](vao)};ctx["isVertexArray"]=function(vao){return ext["isVertexArrayOES"](vao)};return 1}}function __webgl_enable_WEBGL_draw_buffers(ctx){var ext=ctx.getExtension("WEBGL_draw_buffers");if(ext){ctx["drawBuffers"]=function(n,bufs){ext["drawBuffersWEBGL"](n,bufs)};return 1}}function __webgl_enable_WEBGL_multi_draw(ctx){return!!(ctx.multiDrawWebgl=ctx.getExtension("WEBGL_multi_draw"))}var GL={counter:1,buffers:[],programs:[],framebuffers:[],renderbuffers:[],textures:[],shaders:[],vaos:[],contexts:{},offscreenCanvases:{},queries:[],stringCache:{},unpackAlignment:4,recordError:function recordError(errorCode){if(!GL.lastError){GL.lastError=errorCode}},getNewId:function(table){var ret=GL.counter++;for(var i=table.length;i>2]:-1;source+=UTF8ToString(HEAP32[string+i*4>>2],len<0?undefined:len)}return source},createContext:function(canvas,webGLContextAttributes){if(!canvas.getContextSafariWebGL2Fixed){canvas.getContextSafariWebGL2Fixed=canvas.getContext;canvas.getContext=function(ver,attrs){var gl=canvas.getContextSafariWebGL2Fixed(ver,attrs);return ver=="webgl"==gl instanceof WebGLRenderingContext?gl:null}}var ctx=canvas.getContext("webgl",webGLContextAttributes);if(!ctx)return 0;var handle=GL.registerContext(ctx,webGLContextAttributes);return handle},registerContext:function(ctx,webGLContextAttributes){var handle=_malloc(8);HEAP32[handle+4>>2]=_pthread_self();var context={handle:handle,attributes:webGLContextAttributes,version:webGLContextAttributes.majorVersion,GLctx:ctx};if(ctx.canvas)ctx.canvas.GLctxObject=context;GL.contexts[handle]=context;if(typeof webGLContextAttributes.enableExtensionsByDefault==="undefined"||webGLContextAttributes.enableExtensionsByDefault){GL.initExtensions(context)}return handle},makeContextCurrent:function(contextHandle){GL.currentContext=GL.contexts[contextHandle];Module.ctx=GLctx=GL.currentContext&&GL.currentContext.GLctx;return!(contextHandle&&!GLctx)},getContext:function(contextHandle){return GL.contexts[contextHandle]},deleteContext:function(contextHandle){if(GL.currentContext===GL.contexts[contextHandle])GL.currentContext=null;if(typeof JSEvents==="object")JSEvents.removeAllHandlersOnTarget(GL.contexts[contextHandle].GLctx.canvas);if(GL.contexts[contextHandle]&&GL.contexts[contextHandle].GLctx.canvas)GL.contexts[contextHandle].GLctx.canvas.GLctxObject=undefined;_free(GL.contexts[contextHandle].handle);GL.contexts[contextHandle]=null},initExtensions:function(context){if(!context)context=GL.currentContext;if(context.initExtensionsDone)return;context.initExtensionsDone=true;var GLctx=context.GLctx;__webgl_enable_ANGLE_instanced_arrays(GLctx);__webgl_enable_OES_vertex_array_object(GLctx);__webgl_enable_WEBGL_draw_buffers(GLctx);{GLctx.disjointTimerQueryExt=GLctx.getExtension("EXT_disjoint_timer_query")}__webgl_enable_WEBGL_multi_draw(GLctx);var exts=GLctx.getSupportedExtensions()||[];exts.forEach(function(ext){if(!ext.includes("lose_context")&&!ext.includes("debug")){GLctx.getExtension(ext)}})}};var __emscripten_webgl_power_preferences=["default","low-power","high-performance"];function _emscripten_webgl_do_create_context(target,attributes){var a=attributes>>2;var powerPreference=HEAP32[a+(24>>2)];var contextAttributes={"alpha":!!HEAP32[a+(0>>2)],"depth":!!HEAP32[a+(4>>2)],"stencil":!!HEAP32[a+(8>>2)],"antialias":!!HEAP32[a+(12>>2)],"premultipliedAlpha":!!HEAP32[a+(16>>2)],"preserveDrawingBuffer":!!HEAP32[a+(20>>2)],"powerPreference":__emscripten_webgl_power_preferences[powerPreference],"failIfMajorPerformanceCaveat":!!HEAP32[a+(28>>2)],majorVersion:HEAP32[a+(32>>2)],minorVersion:HEAP32[a+(36>>2)],enableExtensionsByDefault:HEAP32[a+(40>>2)],explicitSwapControl:HEAP32[a+(44>>2)],proxyContextToMainThread:HEAP32[a+(48>>2)],renderViaOffscreenBackBuffer:HEAP32[a+(52>>2)]};var canvas=findCanvasEventTarget(target);if(!canvas){return 0}if(contextAttributes.explicitSwapControl){return 0}var contextHandle=GL.createContext(canvas,contextAttributes);return contextHandle}function _emscripten_webgl_create_context(a0,a1){return _emscripten_webgl_do_create_context(a0,a1)}var ENV={};function getExecutableName(){return thisProgram||"./this.program"}function getEnvStrings(){if(!getEnvStrings.strings){var lang=(typeof navigator==="object"&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8";var env={"USER":"web_user","LOGNAME":"web_user","PATH":"/","PWD":"/","HOME":"/home/web_user","LANG":lang,"_":getExecutableName()};for(var x in ENV){env[x]=ENV[x]}var strings=[];for(var x in env){strings.push(x+"="+env[x])}getEnvStrings.strings=strings}return getEnvStrings.strings}var PATH={splitPath:function(filename){var splitPathRe=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return splitPathRe.exec(filename).slice(1)},normalizeArray:function(parts,allowAboveRoot){var up=0;for(var i=parts.length-1;i>=0;i--){var last=parts[i];if(last==="."){parts.splice(i,1)}else if(last===".."){parts.splice(i,1);up++}else if(up){parts.splice(i,1);up--}}if(allowAboveRoot){for(;up;up--){parts.unshift("..")}}return parts},normalize:function(path){var isAbsolute=path.charAt(0)==="/",trailingSlash=path.substr(-1)==="/";path=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),!isAbsolute).join("/");if(!path&&!isAbsolute){path="."}if(path&&trailingSlash){path+="/"}return(isAbsolute?"/":"")+path},dirname:function(path){var result=PATH.splitPath(path),root=result[0],dir=result[1];if(!root&&!dir){return"."}if(dir){dir=dir.substr(0,dir.length-1)}return root+dir},basename:function(path){if(path==="/")return"/";path=PATH.normalize(path);path=path.replace(/\/$/,"");var lastSlash=path.lastIndexOf("/");if(lastSlash===-1)return path;return path.substr(lastSlash+1)},extname:function(path){return PATH.splitPath(path)[3]},join:function(){var paths=Array.prototype.slice.call(arguments,0);return PATH.normalize(paths.join("/"))},join2:function(l,r){return PATH.normalize(l+"/"+r)}};function getRandomDevice(){if(typeof crypto==="object"&&typeof crypto["getRandomValues"]==="function"){var randomBuffer=new Uint8Array(1);return function(){crypto.getRandomValues(randomBuffer);return randomBuffer[0]}}else if(ENVIRONMENT_IS_NODE){try{var crypto_module=require("crypto");return function(){return crypto_module["randomBytes"](1)[0]}}catch(e){}}return function(){abort("randomDevice")}}var PATH_FS={resolve:function(){var resolvedPath="",resolvedAbsolute=false;for(var i=arguments.length-1;i>=-1&&!resolvedAbsolute;i--){var path=i>=0?arguments[i]:FS.cwd();if(typeof path!=="string"){throw new TypeError("Arguments to path.resolve must be strings")}else if(!path){return""}resolvedPath=path+"/"+resolvedPath;resolvedAbsolute=path.charAt(0)==="/"}resolvedPath=PATH.normalizeArray(resolvedPath.split("/").filter(function(p){return!!p}),!resolvedAbsolute).join("/");return(resolvedAbsolute?"/":"")+resolvedPath||"."},relative:function(from,to){from=PATH_FS.resolve(from).substr(1);to=PATH_FS.resolve(to).substr(1);function trim(arr){var start=0;for(;start=0;end--){if(arr[end]!=="")break}if(start>end)return[];return arr.slice(start,end-start+1)}var fromParts=trim(from.split("/"));var toParts=trim(to.split("/"));var length=Math.min(fromParts.length,toParts.length);var samePartsLength=length;for(var i=0;i0){result=buf.slice(0,bytesRead).toString("utf-8")}else{result=null}}else if(typeof window!="undefined"&&typeof window.prompt=="function"){result=window.prompt("Input: ");if(result!==null){result+="\n"}}else if(typeof readline=="function"){result=readline();if(result!==null){result+="\n"}}if(!result){return null}tty.input=intArrayFromString(result,true)}return tty.input.shift()},put_char:function(tty,val){if(val===null||val===10){out(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){out(UTF8ArrayToString(tty.output,0));tty.output=[]}}},default_tty1_ops:{put_char:function(tty,val){if(val===null||val===10){err(UTF8ArrayToString(tty.output,0));tty.output=[]}else{if(val!=0)tty.output.push(val)}},flush:function(tty){if(tty.output&&tty.output.length>0){err(UTF8ArrayToString(tty.output,0));tty.output=[]}}}};function mmapAlloc(size){var alignedSize=alignMemory(size,16384);var ptr=_malloc(alignedSize);while(size=newCapacity)return;var CAPACITY_DOUBLING_MAX=1024*1024;newCapacity=Math.max(newCapacity,prevCapacity*(prevCapacity>>0);if(prevCapacity!=0)newCapacity=Math.max(newCapacity,256);var oldContents=node.contents;node.contents=new Uint8Array(newCapacity);if(node.usedBytes>0)node.contents.set(oldContents.subarray(0,node.usedBytes),0)},resizeFileStorage:function(node,newSize){if(node.usedBytes==newSize)return;if(newSize==0){node.contents=null;node.usedBytes=0}else{var oldContents=node.contents;node.contents=new Uint8Array(newSize);if(oldContents){node.contents.set(oldContents.subarray(0,Math.min(newSize,node.usedBytes)))}node.usedBytes=newSize}},node_ops:{getattr:function(node){var attr={};attr.dev=FS.isChrdev(node.mode)?node.id:1;attr.ino=node.id;attr.mode=node.mode;attr.nlink=1;attr.uid=0;attr.gid=0;attr.rdev=node.rdev;if(FS.isDir(node.mode)){attr.size=4096}else if(FS.isFile(node.mode)){attr.size=node.usedBytes}else if(FS.isLink(node.mode)){attr.size=node.link.length}else{attr.size=0}attr.atime=new Date(node.timestamp);attr.mtime=new Date(node.timestamp);attr.ctime=new Date(node.timestamp);attr.blksize=4096;attr.blocks=Math.ceil(attr.size/attr.blksize);return attr},setattr:function(node,attr){if(attr.mode!==undefined){node.mode=attr.mode}if(attr.timestamp!==undefined){node.timestamp=attr.timestamp}if(attr.size!==undefined){MEMFS.resizeFileStorage(node,attr.size)}},lookup:function(parent,name){throw FS.genericErrors[44]},mknod:function(parent,name,mode,dev){return MEMFS.createNode(parent,name,mode,dev)},rename:function(old_node,new_dir,new_name){if(FS.isDir(old_node.mode)){var new_node;try{new_node=FS.lookupNode(new_dir,new_name)}catch(e){}if(new_node){for(var i in new_node.contents){throw new FS.ErrnoError(55)}}}delete old_node.parent.contents[old_node.name];old_node.parent.timestamp=Date.now();old_node.name=new_name;new_dir.contents[new_name]=old_node;new_dir.timestamp=old_node.parent.timestamp;old_node.parent=new_dir},unlink:function(parent,name){delete parent.contents[name];parent.timestamp=Date.now()},rmdir:function(parent,name){var node=FS.lookupNode(parent,name);for(var i in node.contents){throw new FS.ErrnoError(55)}delete parent.contents[name];parent.timestamp=Date.now()},readdir:function(node){var entries=[".",".."];for(var key in node.contents){if(!node.contents.hasOwnProperty(key)){continue}entries.push(key)}return entries},symlink:function(parent,newname,oldpath){var node=MEMFS.createNode(parent,newname,511|40960,0);node.link=oldpath;return node},readlink:function(node){if(!FS.isLink(node.mode)){throw new FS.ErrnoError(28)}return node.link}},stream_ops:{read:function(stream,buffer,offset,length,position){var contents=stream.node.contents;if(position>=stream.node.usedBytes)return 0;var size=Math.min(stream.node.usedBytes-position,length);if(size>8&&contents.subarray){buffer.set(contents.subarray(position,position+size),offset)}else{for(var i=0;i0||position+length8){throw new FS.ErrnoError(32)}var parts=PATH.normalizeArray(path.split("/").filter(function(p){return!!p}),false);var current=FS.root;var current_path="/";for(var i=0;i40){throw new FS.ErrnoError(32)}}}}return{path:current_path,node:current}},getPath:function(node){var path;while(true){if(FS.isRoot(node)){var mount=node.mount.mountpoint;if(!path)return mount;return mount[mount.length-1]!=="/"?mount+"/"+path:mount+path}path=path?node.name+"/"+path:node.name;node=node.parent}},hashName:function(parentid,name){var hash=0;for(var i=0;i>>0)%FS.nameTable.length},hashAddNode:function(node){var hash=FS.hashName(node.parent.id,node.name);node.name_next=FS.nameTable[hash];FS.nameTable[hash]=node},hashRemoveNode:function(node){var hash=FS.hashName(node.parent.id,node.name);if(FS.nameTable[hash]===node){FS.nameTable[hash]=node.name_next}else{var current=FS.nameTable[hash];while(current){if(current.name_next===node){current.name_next=node.name_next;break}current=current.name_next}}},lookupNode:function(parent,name){var errCode=FS.mayLookup(parent);if(errCode){throw new FS.ErrnoError(errCode,parent)}var hash=FS.hashName(parent.id,name);for(var node=FS.nameTable[hash];node;node=node.name_next){var nodeName=node.name;if(node.parent.id===parent.id&&nodeName===name){return node}}return FS.lookup(parent,name)},createNode:function(parent,name,mode,rdev){var node=new FS.FSNode(parent,name,mode,rdev);FS.hashAddNode(node);return node},destroyNode:function(node){FS.hashRemoveNode(node)},isRoot:function(node){return node===node.parent},isMountpoint:function(node){return!!node.mounted},isFile:function(mode){return(mode&61440)===32768},isDir:function(mode){return(mode&61440)===16384},isLink:function(mode){return(mode&61440)===40960},isChrdev:function(mode){return(mode&61440)===8192},isBlkdev:function(mode){return(mode&61440)===24576},isFIFO:function(mode){return(mode&61440)===4096},isSocket:function(mode){return(mode&49152)===49152},flagModes:{"r":0,"r+":2,"w":577,"w+":578,"a":1089,"a+":1090},modeStringToFlags:function(str){var flags=FS.flagModes[str];if(typeof flags==="undefined"){throw new Error("Unknown file open mode: "+str)}return flags},flagsToPermissionString:function(flag){var perms=["r","w","rw"][flag&3];if(flag&512){perms+="w"}return perms},nodePermissions:function(node,perms){if(FS.ignorePermissions){return 0}if(perms.includes("r")&&!(node.mode&292)){return 2}else if(perms.includes("w")&&!(node.mode&146)){return 2}else if(perms.includes("x")&&!(node.mode&73)){return 2}return 0},mayLookup:function(dir){var errCode=FS.nodePermissions(dir,"x");if(errCode)return errCode;if(!dir.node_ops.lookup)return 2;return 0},mayCreate:function(dir,name){try{var node=FS.lookupNode(dir,name);return 20}catch(e){}return FS.nodePermissions(dir,"wx")},mayDelete:function(dir,name,isdir){var node;try{node=FS.lookupNode(dir,name)}catch(e){return e.errno}var errCode=FS.nodePermissions(dir,"wx");if(errCode){return errCode}if(isdir){if(!FS.isDir(node.mode)){return 54}if(FS.isRoot(node)||FS.getPath(node)===FS.cwd()){return 10}}else{if(FS.isDir(node.mode)){return 31}}return 0},mayOpen:function(node,flags){if(!node){return 44}if(FS.isLink(node.mode)){return 32}else if(FS.isDir(node.mode)){if(FS.flagsToPermissionString(flags)!=="r"||flags&512){return 31}}return FS.nodePermissions(node,FS.flagsToPermissionString(flags))},MAX_OPEN_FDS:4096,nextfd:function(fd_start,fd_end){fd_start=fd_start||0;fd_end=fd_end||FS.MAX_OPEN_FDS;for(var fd=fd_start;fd<=fd_end;fd++){if(!FS.streams[fd]){return fd}}throw new FS.ErrnoError(33)},getStream:function(fd){return FS.streams[fd]},createStream:function(stream,fd_start,fd_end){if(!FS.FSStream){FS.FSStream=function(){};FS.FSStream.prototype={object:{get:function(){return this.node},set:function(val){this.node=val}},isRead:{get:function(){return(this.flags&2097155)!==1}},isWrite:{get:function(){return(this.flags&2097155)!==0}},isAppend:{get:function(){return this.flags&1024}}}}var newStream=new FS.FSStream;for(var p in stream){newStream[p]=stream[p]}stream=newStream;var fd=FS.nextfd(fd_start,fd_end);stream.fd=fd;FS.streams[fd]=stream;return stream},closeStream:function(fd){FS.streams[fd]=null},chrdev_stream_ops:{open:function(stream){var device=FS.getDevice(stream.node.rdev);stream.stream_ops=device.stream_ops;if(stream.stream_ops.open){stream.stream_ops.open(stream)}},llseek:function(){throw new FS.ErrnoError(70)}},major:function(dev){return dev>>8},minor:function(dev){return dev&255},makedev:function(ma,mi){return ma<<8|mi},registerDevice:function(dev,ops){FS.devices[dev]={stream_ops:ops}},getDevice:function(dev){return FS.devices[dev]},getMounts:function(mount){var mounts=[];var check=[mount];while(check.length){var m=check.pop();mounts.push(m);check.push.apply(check,m.mounts)}return mounts},syncfs:function(populate,callback){if(typeof populate==="function"){callback=populate;populate=false}FS.syncFSRequests++;if(FS.syncFSRequests>1){err("warning: "+FS.syncFSRequests+" FS.syncfs operations in flight at once, probably just doing extra work")}var mounts=FS.getMounts(FS.root.mount);var completed=0;function doCallback(errCode){FS.syncFSRequests--;return callback(errCode)}function done(errCode){if(errCode){if(!done.errored){done.errored=true;return doCallback(errCode)}return}if(++completed>=mounts.length){doCallback(null)}}mounts.forEach(function(mount){if(!mount.type.syncfs){return done(null)}mount.type.syncfs(mount,populate,done)})},mount:function(type,opts,mountpoint){var root=mountpoint==="/";var pseudo=!mountpoint;var node;if(root&&FS.root){throw new FS.ErrnoError(10)}else if(!root&&!pseudo){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});mountpoint=lookup.path;node=lookup.node;if(FS.isMountpoint(node)){throw new FS.ErrnoError(10)}if(!FS.isDir(node.mode)){throw new FS.ErrnoError(54)}}var mount={type:type,opts:opts,mountpoint:mountpoint,mounts:[]};var mountRoot=type.mount(mount);mountRoot.mount=mount;mount.root=mountRoot;if(root){FS.root=mountRoot}else if(node){node.mounted=mount;if(node.mount){node.mount.mounts.push(mount)}}return mountRoot},unmount:function(mountpoint){var lookup=FS.lookupPath(mountpoint,{follow_mount:false});if(!FS.isMountpoint(lookup.node)){throw new FS.ErrnoError(28)}var node=lookup.node;var mount=node.mounted;var mounts=FS.getMounts(mount);Object.keys(FS.nameTable).forEach(function(hash){var current=FS.nameTable[hash];while(current){var next=current.name_next;if(mounts.includes(current.mount)){FS.destroyNode(current)}current=next}});node.mounted=null;var idx=node.mount.mounts.indexOf(mount);node.mount.mounts.splice(idx,1)},lookup:function(parent,name){return parent.node_ops.lookup(parent,name)},mknod:function(path,mode,dev){var lookup=FS.lookupPath(path,{parent:true});var parent=lookup.node;var name=PATH.basename(path);if(!name||name==="."||name===".."){throw new FS.ErrnoError(28)}var errCode=FS.mayCreate(parent,name);if(errCode){throw new FS.ErrnoError(errCode)}if(!parent.node_ops.mknod){throw new FS.ErrnoError(63)}return parent.node_ops.mknod(parent,name,mode,dev)},create:function(path,mode){mode=mode!==undefined?mode:438;mode&=4095;mode|=32768;return FS.mknod(path,mode,0)},mkdir:function(path,mode){mode=mode!==undefined?mode:511;mode&=511|512;mode|=16384;return FS.mknod(path,mode,0)},mkdirTree:function(path,mode){var dirs=path.split("/");var d="";for(var i=0;ithis.length-1||idx<0){return undefined}var chunkOffset=idx%this.chunkSize;var chunkNum=idx/this.chunkSize|0;return this.getter(chunkNum)[chunkOffset]};LazyUint8Array.prototype.setDataGetter=function LazyUint8Array_setDataGetter(getter){this.getter=getter};LazyUint8Array.prototype.cacheLength=function LazyUint8Array_cacheLength(){var xhr=new XMLHttpRequest;xhr.open("HEAD",url,false);xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);var datalength=Number(xhr.getResponseHeader("Content-length"));var header;var hasByteServing=(header=xhr.getResponseHeader("Accept-Ranges"))&&header==="bytes";var usesGzip=(header=xhr.getResponseHeader("Content-Encoding"))&&header==="gzip";var chunkSize=1024*1024;if(!hasByteServing)chunkSize=datalength;var doXHR=function(from,to){if(from>to)throw new Error("invalid range ("+from+", "+to+") or no bytes requested!");if(to>datalength-1)throw new Error("only "+datalength+" bytes available! programmer error!");var xhr=new XMLHttpRequest;xhr.open("GET",url,false);if(datalength!==chunkSize)xhr.setRequestHeader("Range","bytes="+from+"-"+to);if(typeof Uint8Array!="undefined")xhr.responseType="arraybuffer";if(xhr.overrideMimeType){xhr.overrideMimeType("text/plain; charset=x-user-defined")}xhr.send(null);if(!(xhr.status>=200&&xhr.status<300||xhr.status===304))throw new Error("Couldn't load "+url+". Status: "+xhr.status);if(xhr.response!==undefined){return new Uint8Array(xhr.response||[])}else{return intArrayFromString(xhr.responseText||"",true)}};var lazyArray=this;lazyArray.setDataGetter(function(chunkNum){var start=chunkNum*chunkSize;var end=(chunkNum+1)*chunkSize-1;end=Math.min(end,datalength-1);if(typeof lazyArray.chunks[chunkNum]==="undefined"){lazyArray.chunks[chunkNum]=doXHR(start,end)}if(typeof lazyArray.chunks[chunkNum]==="undefined")throw new Error("doXHR failed!");return lazyArray.chunks[chunkNum]});if(usesGzip||!datalength){chunkSize=datalength=1;datalength=this.getter(0).length;chunkSize=datalength;out("LazyFiles on gzip forces download of the whole file when length is accessed")}this._length=datalength;this._chunkSize=chunkSize;this.lengthKnown=true};if(typeof XMLHttpRequest!=="undefined"){if(!ENVIRONMENT_IS_WORKER)throw"Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc";var lazyArray=new LazyUint8Array;Object.defineProperties(lazyArray,{length:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._length}},chunkSize:{get:function(){if(!this.lengthKnown){this.cacheLength()}return this._chunkSize}}});var properties={isDevice:false,contents:lazyArray}}else{var properties={isDevice:false,url:url}}var node=FS.createFile(parent,name,properties,canRead,canWrite);if(properties.contents){node.contents=properties.contents}else if(properties.url){node.contents=null;node.url=properties.url}Object.defineProperties(node,{usedBytes:{get:function(){return this.contents.length}}});var stream_ops={};var keys=Object.keys(node.stream_ops);keys.forEach(function(key){var fn=node.stream_ops[key];stream_ops[key]=function forceLoadLazyFile(){FS.forceLoadFile(node);return fn.apply(null,arguments)}});stream_ops.read=function stream_ops_read(stream,buffer,offset,length,position){FS.forceLoadFile(node);var contents=stream.node.contents;if(position>=contents.length)return 0;var size=Math.min(contents.length-position,length);if(contents.slice){for(var i=0;i>2]=stat.dev;HEAP32[buf+4>>2]=0;HEAP32[buf+8>>2]=stat.ino;HEAP32[buf+12>>2]=stat.mode;HEAP32[buf+16>>2]=stat.nlink;HEAP32[buf+20>>2]=stat.uid;HEAP32[buf+24>>2]=stat.gid;HEAP32[buf+28>>2]=stat.rdev;HEAP32[buf+32>>2]=0;tempI64=[stat.size>>>0,(tempDouble=stat.size,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+40>>2]=tempI64[0],HEAP32[buf+44>>2]=tempI64[1];HEAP32[buf+48>>2]=4096;HEAP32[buf+52>>2]=stat.blocks;HEAP32[buf+56>>2]=stat.atime.getTime()/1e3|0;HEAP32[buf+60>>2]=0;HEAP32[buf+64>>2]=stat.mtime.getTime()/1e3|0;HEAP32[buf+68>>2]=0;HEAP32[buf+72>>2]=stat.ctime.getTime()/1e3|0;HEAP32[buf+76>>2]=0;tempI64=[stat.ino>>>0,(tempDouble=stat.ino,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[buf+80>>2]=tempI64[0],HEAP32[buf+84>>2]=tempI64[1];return 0},doMsync:function(addr,stream,len,flags,offset){var buffer=HEAPU8.slice(addr,addr+len);FS.msync(stream,buffer,offset,len,flags)},doMkdir:function(path,mode){path=PATH.normalize(path);if(path[path.length-1]==="/")path=path.substr(0,path.length-1);FS.mkdir(path,mode,0);return 0},doMknod:function(path,mode,dev){switch(mode&61440){case 32768:case 8192:case 24576:case 4096:case 49152:break;default:return-28}FS.mknod(path,mode,dev);return 0},doReadlink:function(path,buf,bufsize){if(bufsize<=0)return-28;var ret=FS.readlink(path);var len=Math.min(bufsize,lengthBytesUTF8(ret));var endChar=HEAP8[buf+len];stringToUTF8(ret,buf,bufsize+1);HEAP8[buf+len]=endChar;return len},doAccess:function(path,amode){if(amode&~7){return-28}var node;var lookup=FS.lookupPath(path,{follow:true});node=lookup.node;if(!node){return-44}var perms="";if(amode&4)perms+="r";if(amode&2)perms+="w";if(amode&1)perms+="x";if(perms&&FS.nodePermissions(node,perms)){return-2}return 0},doDup:function(path,flags,suggestFD){var suggest=FS.getStream(suggestFD);if(suggest)FS.close(suggest);return FS.open(path,flags,0,suggestFD,suggestFD).fd},doReadv:function(stream,iov,iovcnt,offset){var ret=0;for(var i=0;i>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.read(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr;if(curr>2];var len=HEAP32[iov+(i*8+4)>>2];var curr=FS.write(stream,HEAP8,ptr,len,offset);if(curr<0)return-1;ret+=curr}return ret},varargs:undefined,get:function(){SYSCALLS.varargs+=4;var ret=HEAP32[SYSCALLS.varargs-4>>2];return ret},getStr:function(ptr){var ret=UTF8ToString(ptr);return ret},getStreamFromFD:function(fd){var stream=FS.getStream(fd);if(!stream)throw new FS.ErrnoError(8);return stream},get64:function(low,high){return low}};function _environ_get(__environ,environ_buf){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(3,1,__environ,environ_buf);try{var bufSize=0;getEnvStrings().forEach(function(string,i){var ptr=environ_buf+bufSize;HEAP32[__environ+i*4>>2]=ptr;writeAsciiToMemory(string,ptr);bufSize+=string.length+1});return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _environ_sizes_get(penviron_count,penviron_buf_size){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(4,1,penviron_count,penviron_buf_size);try{var strings=getEnvStrings();HEAP32[penviron_count>>2]=strings.length;var bufSize=0;strings.forEach(function(string){bufSize+=string.length+1});HEAP32[penviron_buf_size>>2]=bufSize;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_close(fd){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(5,1,fd);try{var stream=SYSCALLS.getStreamFromFD(fd);FS.close(stream);return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_read(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(6,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doReadv(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_seek(fd,offset_low,offset_high,whence,newOffset){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(7,1,fd,offset_low,offset_high,whence,newOffset);try{var stream=SYSCALLS.getStreamFromFD(fd);var HIGH_OFFSET=4294967296;var offset=offset_high*HIGH_OFFSET+(offset_low>>>0);var DOUBLE_LIMIT=9007199254740992;if(offset<=-DOUBLE_LIMIT||offset>=DOUBLE_LIMIT){return-61}FS.llseek(stream,offset,whence);tempI64=[stream.position>>>0,(tempDouble=stream.position,+Math.abs(tempDouble)>=1?tempDouble>0?(Math.min(+Math.floor(tempDouble/4294967296),4294967295)|0)>>>0:~~+Math.ceil((tempDouble-+(~~tempDouble>>>0))/4294967296)>>>0:0)],HEAP32[newOffset>>2]=tempI64[0],HEAP32[newOffset+4>>2]=tempI64[1];if(stream.getdents&&offset===0&&whence===0)stream.getdents=null;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function _fd_write(fd,iov,iovcnt,pnum){if(ENVIRONMENT_IS_PTHREAD)return _emscripten_proxy_to_main_thread_js(8,1,fd,iov,iovcnt,pnum);try{var stream=SYSCALLS.getStreamFromFD(fd);var num=SYSCALLS.doWritev(stream,iov,iovcnt);HEAP32[pnum>>2]=num;return 0}catch(e){if(typeof FS==="undefined"||!(e instanceof FS.ErrnoError))abort(e);return e.errno}}function spawnThread(threadParams){if(ENVIRONMENT_IS_PTHREAD)throw"Internal Error! spawnThread() can only ever be called from main application thread!";var worker=PThread.getNewWorker();if(!worker){return 6}if(worker.pthread!==undefined)throw"Internal error!";if(!threadParams.pthread_ptr)throw"Internal error, no pthread ptr!";PThread.runningWorkers.push(worker);var tlsMemory=_malloc(128*4);for(var i=0;i<128;++i){HEAP32[tlsMemory+i*4>>2]=0}var stackHigh=threadParams.stackBase+threadParams.stackSize;var pthread=PThread.pthreads[threadParams.pthread_ptr]={worker:worker,stackBase:threadParams.stackBase,stackSize:threadParams.stackSize,allocatedOwnStack:threadParams.allocatedOwnStack,threadInfoStruct:threadParams.pthread_ptr};var tis=pthread.threadInfoStruct>>2;Atomics.store(HEAPU32,tis+(64>>2),threadParams.detached);Atomics.store(HEAPU32,tis+(100>>2),tlsMemory);Atomics.store(HEAPU32,tis+(40>>2),pthread.threadInfoStruct);Atomics.store(HEAPU32,tis+(80>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(76>>2),stackHigh);Atomics.store(HEAPU32,tis+(104>>2),threadParams.stackSize);Atomics.store(HEAPU32,tis+(104+8>>2),stackHigh);Atomics.store(HEAPU32,tis+(104+12>>2),threadParams.detached);var global_libc=_emscripten_get_global_libc();var global_locale=global_libc+40;Atomics.store(HEAPU32,tis+(172>>2),global_locale);worker.pthread=pthread;var msg={"cmd":"run","start_routine":threadParams.startRoutine,"arg":threadParams.arg,"threadInfoStruct":threadParams.pthread_ptr,"stackBase":threadParams.stackBase,"stackSize":threadParams.stackSize};worker.runPthread=function(){msg.time=performance.now();worker.postMessage(msg,threadParams.transferList)};if(worker.loaded){worker.runPthread();delete worker.runPthread}return 0}function _pthread_create(pthread_ptr,attr,start_routine,arg){if(typeof SharedArrayBuffer==="undefined"){err("Current environment does not support SharedArrayBuffer, pthreads are not available!");return 6}if(!pthread_ptr){err("pthread_create called with a null thread pointer!");return 28}var transferList=[];var error=0;if(ENVIRONMENT_IS_PTHREAD&&(transferList.length===0||error)){return _emscripten_sync_run_in_main_thread_4(687865856,pthread_ptr,attr,start_routine,arg)}if(error)return error;var stackSize=0;var stackBase=0;var detached=0;if(attr&&attr!=-1){stackSize=HEAP32[attr>>2];stackSize+=81920;stackBase=HEAP32[attr+8>>2];detached=HEAP32[attr+12>>2]!==0}else{stackSize=2097152}var allocatedOwnStack=stackBase==0;if(allocatedOwnStack){stackBase=_memalign(16,stackSize)}else{stackBase-=stackSize;assert(stackBase>0)}var threadInfoStruct=_malloc(228);for(var i=0;i<228>>2;++i)HEAPU32[(threadInfoStruct>>2)+i]=0;HEAP32[pthread_ptr>>2]=threadInfoStruct;HEAP32[threadInfoStruct+12>>2]=threadInfoStruct;var headPtr=threadInfoStruct+152;HEAP32[headPtr>>2]=headPtr;var threadParams={stackBase:stackBase,stackSize:stackSize,allocatedOwnStack:allocatedOwnStack,detached:detached,startRoutine:start_routine,pthread_ptr:threadInfoStruct,arg:arg,transferList:transferList};if(ENVIRONMENT_IS_PTHREAD){threadParams.cmd="spawnThread";postMessage(threadParams,transferList);return 0}return spawnThread(threadParams)}function __isLeapYear(year){return year%4===0&&(year%100!==0||year%400===0)}function __arraySum(array,index){var sum=0;for(var i=0;i<=index;sum+=array[i++]){}return sum}var __MONTH_DAYS_LEAP=[31,29,31,30,31,30,31,31,30,31,30,31];var __MONTH_DAYS_REGULAR=[31,28,31,30,31,30,31,31,30,31,30,31];function __addDays(date,days){var newDate=new Date(date.getTime());while(days>0){var leap=__isLeapYear(newDate.getFullYear());var currentMonth=newDate.getMonth();var daysInCurrentMonth=(leap?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR)[currentMonth];if(days>daysInCurrentMonth-newDate.getDate()){days-=daysInCurrentMonth-newDate.getDate()+1;newDate.setDate(1);if(currentMonth<11){newDate.setMonth(currentMonth+1)}else{newDate.setMonth(0);newDate.setFullYear(newDate.getFullYear()+1)}}else{newDate.setDate(newDate.getDate()+days);return newDate}}return newDate}function _strftime(s,maxsize,format,tm){var tm_zone=HEAP32[tm+40>>2];var date={tm_sec:HEAP32[tm>>2],tm_min:HEAP32[tm+4>>2],tm_hour:HEAP32[tm+8>>2],tm_mday:HEAP32[tm+12>>2],tm_mon:HEAP32[tm+16>>2],tm_year:HEAP32[tm+20>>2],tm_wday:HEAP32[tm+24>>2],tm_yday:HEAP32[tm+28>>2],tm_isdst:HEAP32[tm+32>>2],tm_gmtoff:HEAP32[tm+36>>2],tm_zone:tm_zone?UTF8ToString(tm_zone):""};var pattern=UTF8ToString(format);var EXPANSION_RULES_1={"%c":"%a %b %d %H:%M:%S %Y","%D":"%m/%d/%y","%F":"%Y-%m-%d","%h":"%b","%r":"%I:%M:%S %p","%R":"%H:%M","%T":"%H:%M:%S","%x":"%m/%d/%y","%X":"%H:%M:%S","%Ec":"%c","%EC":"%C","%Ex":"%m/%d/%y","%EX":"%H:%M:%S","%Ey":"%y","%EY":"%Y","%Od":"%d","%Oe":"%e","%OH":"%H","%OI":"%I","%Om":"%m","%OM":"%M","%OS":"%S","%Ou":"%u","%OU":"%U","%OV":"%V","%Ow":"%w","%OW":"%W","%Oy":"%y"};for(var rule in EXPANSION_RULES_1){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_1[rule])}var WEEKDAYS=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];var MONTHS=["January","February","March","April","May","June","July","August","September","October","November","December"];function leadingSomething(value,digits,character){var str=typeof value==="number"?value.toString():value||"";while(str.length0?1:0}var compare;if((compare=sgn(date1.getFullYear()-date2.getFullYear()))===0){if((compare=sgn(date1.getMonth()-date2.getMonth()))===0){compare=sgn(date1.getDate()-date2.getDate())}}return compare}function getFirstWeekStartDate(janFourth){switch(janFourth.getDay()){case 0:return new Date(janFourth.getFullYear()-1,11,29);case 1:return janFourth;case 2:return new Date(janFourth.getFullYear(),0,3);case 3:return new Date(janFourth.getFullYear(),0,2);case 4:return new Date(janFourth.getFullYear(),0,1);case 5:return new Date(janFourth.getFullYear()-1,11,31);case 6:return new Date(janFourth.getFullYear()-1,11,30)}}function getWeekBasedYear(date){var thisDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);var janFourthThisYear=new Date(thisDate.getFullYear(),0,4);var janFourthNextYear=new Date(thisDate.getFullYear()+1,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);if(compareByDay(firstWeekStartThisYear,thisDate)<=0){if(compareByDay(firstWeekStartNextYear,thisDate)<=0){return thisDate.getFullYear()+1}else{return thisDate.getFullYear()}}else{return thisDate.getFullYear()-1}}var EXPANSION_RULES_2={"%a":function(date){return WEEKDAYS[date.tm_wday].substring(0,3)},"%A":function(date){return WEEKDAYS[date.tm_wday]},"%b":function(date){return MONTHS[date.tm_mon].substring(0,3)},"%B":function(date){return MONTHS[date.tm_mon]},"%C":function(date){var year=date.tm_year+1900;return leadingNulls(year/100|0,2)},"%d":function(date){return leadingNulls(date.tm_mday,2)},"%e":function(date){return leadingSomething(date.tm_mday,2," ")},"%g":function(date){return getWeekBasedYear(date).toString().substring(2)},"%G":function(date){return getWeekBasedYear(date)},"%H":function(date){return leadingNulls(date.tm_hour,2)},"%I":function(date){var twelveHour=date.tm_hour;if(twelveHour==0)twelveHour=12;else if(twelveHour>12)twelveHour-=12;return leadingNulls(twelveHour,2)},"%j":function(date){return leadingNulls(date.tm_mday+__arraySum(__isLeapYear(date.tm_year+1900)?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,date.tm_mon-1),3)},"%m":function(date){return leadingNulls(date.tm_mon+1,2)},"%M":function(date){return leadingNulls(date.tm_min,2)},"%n":function(){return"\n"},"%p":function(date){if(date.tm_hour>=0&&date.tm_hour<12){return"AM"}else{return"PM"}},"%S":function(date){return leadingNulls(date.tm_sec,2)},"%t":function(){return"\t"},"%u":function(date){return date.tm_wday||7},"%U":function(date){var janFirst=new Date(date.tm_year+1900,0,1);var firstSunday=janFirst.getDay()===0?janFirst:__addDays(janFirst,7-janFirst.getDay());var endDate=new Date(date.tm_year+1900,date.tm_mon,date.tm_mday);if(compareByDay(firstSunday,endDate)<0){var februaryFirstUntilEndMonth=__arraySum(__isLeapYear(endDate.getFullYear())?__MONTH_DAYS_LEAP:__MONTH_DAYS_REGULAR,endDate.getMonth()-1)-31;var firstSundayUntilEndJanuary=31-firstSunday.getDate();var days=firstSundayUntilEndJanuary+februaryFirstUntilEndMonth+endDate.getDate();return leadingNulls(Math.ceil(days/7),2)}return compareByDay(firstSunday,janFirst)===0?"01":"00"},"%V":function(date){var janFourthThisYear=new Date(date.tm_year+1900,0,4);var janFourthNextYear=new Date(date.tm_year+1901,0,4);var firstWeekStartThisYear=getFirstWeekStartDate(janFourthThisYear);var firstWeekStartNextYear=getFirstWeekStartDate(janFourthNextYear);var endDate=__addDays(new Date(date.tm_year+1900,0,1),date.tm_yday);if(compareByDay(endDate,firstWeekStartThisYear)<0){return"53"}if(compareByDay(firstWeekStartNextYear,endDate)<=0){return"01"}var daysDifference;if(firstWeekStartThisYear.getFullYear()=0;off=Math.abs(off)/60;off=off/60*100+off%60;return(ahead?"+":"-")+String("0000"+off).slice(-4)},"%Z":function(date){return date.tm_zone},"%%":function(){return"%"}};for(var rule in EXPANSION_RULES_2){if(pattern.includes(rule)){pattern=pattern.replace(new RegExp(rule,"g"),EXPANSION_RULES_2[rule](date))}}var bytes=intArrayFromString(pattern,false);if(bytes.length>maxsize){return 0}writeArrayToMemory(bytes,s);return bytes.length-1}function _strftime_l(s,maxsize,format,tm){return _strftime(s,maxsize,format,tm)}if(!ENVIRONMENT_IS_PTHREAD)PThread.initMainThreadBlock();var GLctx;var FSNode=function(parent,name,mode,rdev){if(!parent){parent=this}this.parent=parent;this.mount=parent.mount;this.mounted=null;this.id=FS.nextInode++;this.name=name;this.mode=mode;this.node_ops={};this.stream_ops={};this.rdev=rdev};var readMode=292|73;var writeMode=146;Object.defineProperties(FSNode.prototype,{read:{get:function(){return(this.mode&readMode)===readMode},set:function(val){val?this.mode|=readMode:this.mode&=~readMode}},write:{get:function(){return(this.mode&writeMode)===writeMode},set:function(val){val?this.mode|=writeMode:this.mode&=~writeMode}},isFolder:{get:function(){return FS.isDir(this.mode)}},isDevice:{get:function(){return FS.isChrdev(this.mode)}}});FS.FSNode=FSNode;FS.staticInit();var proxiedFunctionTable=[null,_atexit,_emscripten_set_canvas_element_size_main_thread,_environ_get,_environ_sizes_get,_fd_close,_fd_read,_fd_seek,_fd_write];function intArrayFromString(stringy,dontAddNull,length){var len=length>0?length:lengthBytesUTF8(stringy)+1;var u8array=new Array(len);var numBytesWritten=stringToUTF8Array(stringy,u8array,0,u8array.length);if(dontAddNull)u8array.length=numBytesWritten;return u8array}var asmLibraryArg={"b":___assert_fail,"w":___call_main,"m":___cxa_allocate_exception,"l":___cxa_throw,"C":__emscripten_notify_thread_queue,"g":_abort,"k":_emscripten_asm_const_int,"v":_emscripten_check_blocking_allowed,"j":_emscripten_conditional_set_current_thread_status,"d":_emscripten_futex_wait,"c":_emscripten_futex_wake,"e":_emscripten_get_now,"t":_emscripten_memcpy_big,"y":_emscripten_receive_on_main_thread_js,"u":_emscripten_resize_heap,"A":_emscripten_set_canvas_element_size,"i":_emscripten_set_current_thread_status,"x":_emscripten_set_thread_name,"B":_emscripten_webgl_create_context,"o":_environ_get,"p":_environ_sizes_get,"z":_fd_close,"q":_fd_read,"r":_fd_seek,"f":_fd_write,"s":initPthreadsJS,"a":wasmMemory,"h":_pthread_create,"n":_strftime_l};var asm=createWasm();var ___wasm_call_ctors=Module["___wasm_call_ctors"]=function(){return(___wasm_call_ctors=Module["___wasm_call_ctors"]=Module["asm"]["D"]).apply(null,arguments)};var _main=Module["_main"]=function(){return(_main=Module["_main"]=Module["asm"]["E"]).apply(null,arguments)};var _emscripten_tls_init=Module["_emscripten_tls_init"]=function(){return(_emscripten_tls_init=Module["_emscripten_tls_init"]=Module["asm"]["G"]).apply(null,arguments)};var _emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=function(){return(_emscripten_get_global_libc=Module["_emscripten_get_global_libc"]=Module["asm"]["H"]).apply(null,arguments)};var _pthread_self=Module["_pthread_self"]=function(){return(_pthread_self=Module["_pthread_self"]=Module["asm"]["I"]).apply(null,arguments)};var ___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=function(){return(___pthread_tsd_run_dtors=Module["___pthread_tsd_run_dtors"]=Module["asm"]["J"]).apply(null,arguments)};var _emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=function(){return(_emscripten_current_thread_process_queued_calls=Module["_emscripten_current_thread_process_queued_calls"]=Module["asm"]["K"]).apply(null,arguments)};var _emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=function(){return(_emscripten_register_main_browser_thread_id=Module["_emscripten_register_main_browser_thread_id"]=Module["asm"]["L"]).apply(null,arguments)};var __emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=function(){return(__emscripten_do_dispatch_to_thread=Module["__emscripten_do_dispatch_to_thread"]=Module["asm"]["M"]).apply(null,arguments)};var _emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=function(){return(_emscripten_sync_run_in_main_thread_4=Module["_emscripten_sync_run_in_main_thread_4"]=Module["asm"]["N"]).apply(null,arguments)};var _emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=function(){return(_emscripten_main_thread_process_queued_calls=Module["_emscripten_main_thread_process_queued_calls"]=Module["asm"]["O"]).apply(null,arguments)};var _emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=function(){return(_emscripten_run_in_main_runtime_thread_js=Module["_emscripten_run_in_main_runtime_thread_js"]=Module["asm"]["P"]).apply(null,arguments)};var __emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=function(){return(__emscripten_call_on_thread=Module["__emscripten_call_on_thread"]=Module["asm"]["Q"]).apply(null,arguments)};var _emscripten_proxy_main=Module["_emscripten_proxy_main"]=function(){return(_emscripten_proxy_main=Module["_emscripten_proxy_main"]=Module["asm"]["R"]).apply(null,arguments)};var __emscripten_thread_init=Module["__emscripten_thread_init"]=function(){return(__emscripten_thread_init=Module["__emscripten_thread_init"]=Module["asm"]["S"]).apply(null,arguments)};var stackSave=Module["stackSave"]=function(){return(stackSave=Module["stackSave"]=Module["asm"]["T"]).apply(null,arguments)};var stackRestore=Module["stackRestore"]=function(){return(stackRestore=Module["stackRestore"]=Module["asm"]["U"]).apply(null,arguments)};var stackAlloc=Module["stackAlloc"]=function(){return(stackAlloc=Module["stackAlloc"]=Module["asm"]["V"]).apply(null,arguments)};var _emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=function(){return(_emscripten_stack_set_limits=Module["_emscripten_stack_set_limits"]=Module["asm"]["W"]).apply(null,arguments)};var _free=Module["_free"]=function(){return(_free=Module["_free"]=Module["asm"]["X"]).apply(null,arguments)};var _malloc=Module["_malloc"]=function(){return(_malloc=Module["_malloc"]=Module["asm"]["Y"]).apply(null,arguments)};var _memalign=Module["_memalign"]=function(){return(_memalign=Module["_memalign"]=Module["asm"]["Z"]).apply(null,arguments)};var __emscripten_allow_main_runtime_queued_calls=Module["__emscripten_allow_main_runtime_queued_calls"]=24208;var __emscripten_main_thread_futex=Module["__emscripten_main_thread_futex"]=30100;Module["PThread"]=PThread;Module["PThread"]=PThread;Module["wasmMemory"]=wasmMemory;Module["ExitStatus"]=ExitStatus;var calledRun;function ExitStatus(status){this.name="ExitStatus";this.message="Program terminated with exit("+status+")";this.status=status}var calledMain=false;dependenciesFulfilled=function runCaller(){if(!calledRun)run();if(!calledRun)dependenciesFulfilled=runCaller};function callMain(args){var entryFunction=Module["_emscripten_proxy_main"];var argc=0;var argv=0;try{var ret=entryFunction(argc,argv)}finally{calledMain=true}}function run(args){args=args||arguments_;if(runDependencies>0){return}if(ENVIRONMENT_IS_PTHREAD){initRuntime();postMessage({"cmd":"loaded"});return}preRun();if(runDependencies>0){return}function doRun(){if(calledRun)return;calledRun=true;Module["calledRun"]=true;if(ABORT)return;initRuntime();preMain();if(Module["onRuntimeInitialized"])Module["onRuntimeInitialized"]();if(shouldRunNow)callMain(args);postRun()}if(Module["setStatus"]){Module["setStatus"]("Running...");setTimeout(function(){setTimeout(function(){Module["setStatus"]("")},1);doRun()},1)}else{doRun()}}Module["run"]=run;function exit(status,implicit){EXITSTATUS=status;if(implicit&&keepRuntimeAlive()&&status===0){return}if(!implicit){if(ENVIRONMENT_IS_PTHREAD){postMessage({"cmd":"exitProcess","returnCode":status});throw new ExitStatus(status)}else{}}if(keepRuntimeAlive()){}else{PThread.terminateAllThreads();exitRuntime();if(Module["onExit"])Module["onExit"](status);ABORT=true}quit_(status,new ExitStatus(status))}if(Module["preInit"]){if(typeof Module["preInit"]=="function")Module["preInit"]=[Module["preInit"]];while(Module["preInit"].length>0){Module["preInit"].pop()()}}var shouldRunNow=true;if(Module["noInitialRun"])shouldRunNow=false;if(ENVIRONMENT_IS_PTHREAD){noExitRuntime=false;PThread.initWorker()}run(); diff --git a/examples/dom/ftxui_example_vflow.wasm b/examples/dom/ftxui_example_vflow.wasm new file mode 100755 index 000000000..e1986027e Binary files /dev/null and b/examples/dom/ftxui_example_vflow.wasm differ diff --git a/examples/dom/ftxui_example_vflow.worker.js b/examples/dom/ftxui_example_vflow.worker.js new file mode 100644 index 000000000..440270de2 --- /dev/null +++ b/examples/dom/ftxui_example_vflow.worker.js @@ -0,0 +1 @@ +var Module={};function threadPrintErr(){var text=Array.prototype.slice.call(arguments).join(" ");console.error(text)}function threadAlert(){var text=Array.prototype.slice.call(arguments).join(" ");postMessage({cmd:"alert",text:text,threadId:Module["_pthread_self"]()})}var err=threadPrintErr;this.alert=threadAlert;Module["instantiateWasm"]=function(info,receiveInstance){var instance=new WebAssembly.Instance(Module["wasmModule"],info);receiveInstance(instance);Module["wasmModule"]=null;return instance.exports};function moduleLoaded(){}this.onmessage=function(e){try{if(e.data.cmd==="load"){Module["wasmModule"]=e.data.wasmModule;Module["wasmMemory"]=e.data.wasmMemory;Module["buffer"]=Module["wasmMemory"].buffer;Module["ENVIRONMENT_IS_PTHREAD"]=true;if(typeof e.data.urlOrBlob==="string"){importScripts(e.data.urlOrBlob)}else{var objectUrl=URL.createObjectURL(e.data.urlOrBlob);importScripts(objectUrl);URL.revokeObjectURL(objectUrl)}moduleLoaded()}else if(e.data.cmd==="objectTransfer"){Module["PThread"].receiveObjectTransfer(e.data)}else if(e.data.cmd==="run"){Module["__performance_now_clock_drift"]=performance.now()-e.data.time;Module["__emscripten_thread_init"](e.data.threadInfoStruct,0,0);var max=e.data.stackBase;var top=e.data.stackBase+e.data.stackSize;Module["establishStackSpace"](top,max);Module["PThread"].receiveObjectTransfer(e.data);Module["PThread"].threadInit();try{var result=Module["invokeEntryPoint"](e.data.start_routine,e.data.arg);if(Module["keepRuntimeAlive"]()){Module["PThread"].setExitStatus(result)}else{Module["PThread"].threadExit(result)}}catch(ex){if(ex==="Canceled!"){Module["PThread"].threadCancel()}else if(ex!="unwind"){if(ex instanceof Module["ExitStatus"]){if(Module["keepRuntimeAlive"]()){}else{Module["PThread"].threadExit(ex.status)}}else{Module["PThread"].threadExit(-2);throw ex}}}}else if(e.data.cmd==="cancel"){if(Module["_pthread_self"]()){Module["PThread"].threadCancel()}}else if(e.data.target==="setimmediate"){}else if(e.data.cmd==="processThreadQueue"){if(Module["_pthread_self"]()){Module["_emscripten_current_thread_process_queued_calls"]()}}else{err("worker.js received unknown command "+e.data.cmd);err(e.data)}}catch(ex){err("worker.js onmessage() captured an uncaught exception: "+ex);if(ex&&ex.stack)err(ex.stack);throw ex}};if(typeof process==="object"&&typeof process.versions==="object"&&typeof process.versions.node==="string"){self={location:{href:__filename}};var onmessage=this.onmessage;var nodeWorkerThreads=require("worker_threads");global.Worker=nodeWorkerThreads.Worker;var parentPort=nodeWorkerThreads.parentPort;parentPort.on("message",function(data){onmessage({data:data})});var nodeFS=require("fs");var nodeRead=function(filename){return nodeFS.readFileSync(filename,"utf8")};function globalEval(x){global.require=require;global.Module=Module;eval.call(null,x)}importScripts=function(f){globalEval(nodeRead(f))};postMessage=function(msg){parentPort.postMessage(msg)};if(typeof performance==="undefined"){performance={now:function(){return Date.now()}}}} diff --git a/examples/index.css b/examples/index.css new file mode 100644 index 000000000..24597d565 --- /dev/null +++ b/examples/index.css @@ -0,0 +1,180 @@ +@import url(https://fonts.googleapis.com/css?family=Khula:700); + +html { + --toc-width: 250px; +} + +body { + background-color: #EEE; + padding: 0px; + margin: 0px; + font-family: Khula, Helvetica, sans-serif; + font-size: 130%; +} + +.page { + max-width: 1300px; + margin: auto; + padding: 10px; +} + +a { + box-shadow: inset 0 0 0 0 #54b3d6; + color: #0087b9; + margin: 0 -.25rem; + padding: 0 .25rem; + transition: color .3s ease-in-out, + box-shadow .3s ease-in-out; +} + +a:hover { + box-shadow: inset 120px 0 0 0 #54b3d6; + color: white; +} + +h1 { + text-decoration: underline; + width: 100%; + background-color: rgba(100, 100, 255, 0.5); + padding: 10px; + margin: 0; +} + + +#selectExample { + flex: 1; +} + +#selectExample, +#selectExample option { + font-size: 16px; + font-family: sans-serif; + font-weight: 700; + line-height: 1.3; + border: 0px; + background-color: #bbb; + color: black; +} + +#selectExample:focus { + outline: none; +} + +#terminal { + width: 100%; + height 500px; + height: calc(clamp(200px, 100vh - 300px, 900px)); + overflow: hidden; + border: none; + padding: 10px; + margin: 10px; +} + +#terminalContainer { + overflow: hidden; + border-radius: 10px; + box-shadow: 0px 2px 10px 0px rgba(0, 0, 0, 0.75), + 0px 2px 80px 0px rgba(0, 0, 0, 0.50); + background-color: black; +} + +.fakeButtons { + height: 10px; + width: 10px; + border-radius: 50%; + border: 1px solid #000; + margin: 6px; + background-color: #ff3b47; + border-color: #9d252b; + display: inline-block; +} + +.fakeMinimize { + left: 11px; + background-color: #ffc100; + border-color: #9d802c; +} + +.fakeZoom { + left: 16px; + background-color: #00d742; + border-color: #049931; +} + +.fakeMenu { + display: flex; + flex-direction: row; + width: 100%; + box-sizing: border-box; + height: 25px; + background-color: #bbb; + color: black; + margin: 0 auto; + overflow: hidden; +} + +.toc-container { + position: fixed; + left: 0; + top: 0; + bottom: 0; + width: var(--toc-width); + background: white; + padding: 0; + overflow-y: auto; + overflow-x: hidden; + scrollbar-width: thin; +} + +.toc-title { + font-weight: bold; + margin-bottom: 5px; + font-size: 0.9em; + color: #555; + + position: sticky; + transition: position 1.0s ease-in-out; + top: 0; + z-index: 1; + padding: 20px; + margin: 0; + + border-bottom: 1px solid #ddd; + + /* Gradient background for the title */ + background-color: #f0f0f0; +} + +.toc-item { + padding: 3px 8px; + margin: 0; + cursor: pointer; + font-size: 0.85em; + border-radius: 3px; + transition: background 0.2s; +} + +.toc-item:hover { + background: #f0f0f0; +} + +.toc-item.selected { + background: #e0e0e0; + font-weight: bold; +} + +@media (max-width: 1024px) { + .toc-container { + display: none; + } + + .page { + margin-left: 0; + } +} + +@media (min-width: 1025px) { + .page { + margin-left: calc(var(--toc-width) + 20px); + } +} diff --git a/examples/index.html b/examples/index.html new file mode 100644 index 000000000..d38f97505 --- /dev/null +++ b/examples/index.html @@ -0,0 +1,37 @@ + + + + + FTXUI examples WebAssembly + + + + + + +
+
+
+ + +
+

+ FTXUI is a simple + functional C++ library for terminal user interface.
+ This showcases the: ./example/ + folder. See source. +

+ +
+
+
+
+
+ +
+
+
+
+ + diff --git a/examples/index.mjs b/examples/index.mjs new file mode 100644 index 000000000..059210647 --- /dev/null +++ b/examples/index.mjs @@ -0,0 +1,160 @@ +import xterm from 'https://cdn.jsdelivr.net/npm/xterm@4.18.0/+esm' +import xterm_addon_webgl from 'https://cdn.jsdelivr.net/npm/xterm-addon-webgl@0.11.4/+esm' +import xterm_addon_fit from 'https://cdn.jsdelivr.net/npm/xterm-addon-fit@0.5.0/+esm' + +// Add COOP/COEP via a ServiceWorker to use SharedArrayBuffer +if ("serviceWorker" in navigator && !window.crossOriginIsolated) { + const url_sw = new URL("./sw.js", location.href); + const registration = await navigator.serviceWorker.register(url_sw); + window.location.reload(); // Reload to ensure the COOP/COEP headers are set. +} + +const example_list = "component/button;component/button_animated;component/button_in_frame;component/button_style;component/canvas_animated;component/checkbox;component/checkbox_in_frame;component/collapsible;component/composition;component/custom_loop;component/dropdown;component/dropdown_custom;component/flexbox_gallery;component/focus;component/focus_cursor;component/gallery;component/homescreen;component/input;component/input_in_frame;component/input_style;component/linear_gradient_gallery;component/maybe;component/menu;component/menu2;component/menu_entries;component/menu_entries_animated;component/menu_in_frame;component/menu_in_frame_horizontal;component/menu_multiple;component/menu_style;component/menu_underline_animated_gallery;component/modal_dialog;component/modal_dialog_custom;component/nested_screen;component/print_key_press;component/radiobox;component/radiobox_in_frame;component/renderer;component/resizable_split;component/scrollbar;component/selection;component/slider;component/slider_direction;component/slider_rgb;component/tab_horizontal;component/tab_vertical;component/textarea;component/toggle;component/window;component/with_restored_io;dom/border;dom/border_colored;dom/border_style;dom/canvas;dom/color_gallery;dom/color_info_palette256;dom/color_truecolor_HSV;dom/color_truecolor_RGB;dom/dbox;dom/gauge;dom/gauge_direction;dom/graph;dom/gridbox;dom/hflow;dom/html_like;dom/linear_gradient;dom/package_manager;dom/paragraph;dom/separator;dom/separator_style;dom/size;dom/spinner;dom/style_blink;dom/style_bold;dom/style_color;dom/style_dim;dom/style_gallery;dom/style_hyperlink;dom/style_inverted;dom/style_italic;dom/style_strikethrough;dom/style_underlined;dom/style_underlined_double;dom/table;dom/vbox_hbox;dom/vflow".split(";"); +const url_search_params = new URLSearchParams(window.location.search); + +const select = document.getElementById("selectExample"); +for(const example of example_list) { + const option = document.createElement("option"); + option.textContent = example; + option.value = example; + select.appendChild(option); +} +const example = url_search_params.get("file") || "dom/color_gallery"; +select.selectedIndex = example_list.findIndex(path => path == example) || 0; +select.addEventListener("change", () => { + history.pushState({}, "", "?file=" + example_list[select.selectedIndex]); + location.reload(); +}); + +const term_element = document.querySelector('#terminal'); +const term = new xterm.Terminal(); +term.options.scrollback = 0; +term.open(term_element); +const fit_addon = new xterm_addon_fit.FitAddon(); +const webgl_addon = new xterm_addon_webgl.WebglAddon(); +term.loadAddon(webgl_addon); +term.loadAddon(fit_addon); + +const stdin_buffer = []; +const stdout_buffer = []; +const stderr_buffer = []; + +const stdin = () => { + return stdin_buffer.shift() || 0; +} + +const stdout = code => { + if (code == 0) { + term.write(new Uint8Array(stdout_buffer)); + stdout_buffer.length = 0; + } else { + stdout_buffer.push(code) + } +} + +const stderr = code => { + if (code == 0 || code == 10) { + console.error(String.fromCodePoint(...stderr_buffer)); + stderr_buffer.length = 0; + } else { + stderr_buffer.push(code) + } +} + +const onBinary = e => { + for(const c of e) + stdin_buffer.push(c.charCodeAt(0)); +} + +term.onBinary(onBinary); +term.onData(onBinary) +term.resize(140,43); + +window.Module = { + preRun: () => { + FS.init(stdin, stdout, stderr); + }, + postRun: [], + onRuntimeInitialized: () => { + if (window.Module._ftxui_on_resize == undefined) + return; + fit_addon.fit(); + + const resize_handler = () => { + const {cols, rows} = fit_addon.proposeDimensions(); + term.resize(cols, rows); + window.Module._ftxui_on_resize(cols, rows); + fit_addon.fit(); + }; + const resize_observer = new ResizeObserver(resize_handler); + resize_observer.observe(term_element); + resize_handler(); + }, +}; + +const source = document.querySelector("#source"); +source.href = "https://github.com/ArthurSonzogni/FTXUI/blob/main/examples/" + example + ".cpp"; + +const words = example.split('/') +words[1] = "ftxui_example_" + words[1] + ".js" +document.querySelector("#example_script").src = words.join('/'); + + +// Table of Contents (TOC) for quick navigation. + +// Get select element +const selectEl = document.querySelector('select#selectExample'); +if (!selectEl) { + console.error('select#selectExample not found'); +} else { + // Get TOC container + const tocContainer = document.querySelector('.toc-container'); + const tocList = tocContainer.querySelector('.toc-list'); + + // Group options by directory + const groupedOptions = Array.from(selectEl.options).reduce((acc, option) => { + const [dir, file] = option.text.split('/'); + if (!acc[dir]) { + acc[dir] = []; + } + acc[dir].push({ option, file }); + return acc; + }, {}); + + // Generate TOC items + for (const dir in groupedOptions) { + const dirContainer = document.createElement('div'); + + const dirHeader = document.createElement('div'); + dirHeader.textContent = dir; + dirHeader.className = 'toc-title'; + dirContainer.appendChild(dirHeader); + + groupedOptions[dir].forEach(({ option, file }) => { + const tocItem = document.createElement('div'); + tocItem.textContent = file; + tocItem.className = 'toc-item'; + + if (selectEl.options[selectEl.selectedIndex].value === option.value) { + tocItem.classList.add('selected'); + } + + // Click handler + tocItem.addEventListener('click', () => { + for(let i=0; i self.skipWaiting()); +self.addEventListener("activate", e => e.waitUntil(self.clients.claim())); +self.addEventListener("fetch", e => { + if (e.request.mode != 'navigate' && + !e.request.url.includes(".worker.js")) { + return; + } + + e.respondWith((async () => { + const response = await fetch(e.request); + + const newHeaders = new Headers(response.headers); + newHeaders.set("Cross-Origin-Embedder-Policy", "require-corp"); + newHeaders.set("Cross-Origin-Opener-Policy", "same-origin"); + + const moddedResponse = new Response(response.body, { + status: response.status, + statusText: response.statusText, + headers: newHeaders, + }); + + return moddedResponse; + })()); +}); diff --git a/examples_2component_2button_8cpp-example.html b/examples_2component_2button_8cpp-example.html new file mode 100644 index 000000000..e537817eb --- /dev/null +++ b/examples_2component_2button_8cpp-example.html @@ -0,0 +1,282 @@ + + + + + + + + +FTXUI: examples/component/button.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/button.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <memory> // for shared_ptr, __shared_ptr_access
+
#include <string> // for operator+, to_string
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Button, Horizontal, Renderer
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for separator, gauge, text, Element, operator|, vbox, border
+
+
using namespace ftxui;
+
+
// This is a helper function to create a button with a custom style.
+
// The style is defined by a lambda function that takes an EntryState and
+
// returns an Element.
+
// We are using `center` to center the text inside the button, then `border` to
+
// add a border around the button, and finally `flex` to make the button fill
+
// the available space.
+ +
auto option = ButtonOption::Animated();
+
option.transform = [](const EntryState& s) {
+
auto element = text(s.label);
+
if (s.focused) {
+
element |= bold;
+
}
+
return element | center | borderEmpty | flex;
+
};
+
return option;
+
}
+
+
int main() {
+
int value = 50;
+
+
// clang-format off
+
auto btn_dec_01 = Button("-1", [&] { value += 1; }, Style());
+
auto btn_inc_01 = Button("+1", [&] { value -= 1; }, Style());
+
auto btn_dec_10 = Button("-10", [&] { value -= 10; }, Style());
+
auto btn_inc_10 = Button("+10", [&] { value += 10; }, Style());
+
// clang-format on
+
+
// The tree of components. This defines how to navigate using the keyboard.
+
// The selected `row` is shared to get a grid layout.
+
int row = 0;
+
auto buttons = Container::Vertical({
+
Container::Horizontal({btn_dec_01, btn_inc_01}, &row) | flex,
+
Container::Horizontal({btn_dec_10, btn_inc_10}, &row) | flex,
+
});
+
+
// Modify the way to render them on screen:
+
auto component = Renderer(buttons, [&] {
+
return vbox({
+
text("value = " + std::to_string(value)),
+
separator(),
+
buttons->Render() | flex,
+
}) |
+
flex | border;
+
});
+
+
auto screen = ScreenInteractive::FitComponent();
+
screen.Loop(component);
+
return 0;
+
}
+ + + + +
ButtonOption Style()
+ +
Option for the AnimatedButton component.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
arguments for transform from |ButtonOption|, |CheckboxOption|, |RadioboxOption|, |MenuEntryOption|,...
+
+
+ + + + + diff --git a/examples_2component_2button_8cpp.html b/examples_2component_2button_8cpp.html new file mode 100644 index 000000000..307b95723 --- /dev/null +++ b/examples_2component_2button_8cpp.html @@ -0,0 +1,264 @@ + + + + + + + + +FTXUI: button.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
button.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + +

+Functions

ButtonOption Style ()
 
int main ()
 
+

Function Documentation

+ +

◆ Style()

+ +
+
+ + + + + + + +
ButtonOption Style ()
+
+
Examples
examples/component/button.cpp.
+
+ +

Definition at line 21 of file examples/component/button.cpp.

+ +
+
+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+
Examples
examples/component/button.cpp, examples/component/button_animated.cpp, examples/component/button_in_frame.cpp, examples/component/button_style.cpp, examples/component/canvas_animated.cpp, examples/component/checkbox.cpp, examples/component/checkbox_in_frame.cpp, examples/component/collapsible.cpp, examples/component/composition.cpp, examples/component/custom_loop.cpp, examples/component/dropdown.cpp, examples/component/dropdown_custom.cpp, examples/component/flexbox_gallery.cpp, examples/component/focus.cpp, examples/component/focus_cursor.cpp, examples/component/gallery.cpp, examples/component/homescreen.cpp, examples/component/input.cpp, examples/component/input_in_frame.cpp, examples/component/input_style.cpp, examples/component/linear_gradient_gallery.cpp, examples/component/maybe.cpp, examples/component/menu.cpp, examples/component/menu2.cpp, examples/component/menu_entries.cpp, examples/component/menu_entries_animated.cpp, examples/component/menu_in_frame.cpp, examples/component/menu_in_frame_horizontal.cpp, examples/component/menu_multiple.cpp, examples/component/menu_style.cpp, examples/component/menu_underline_animated_gallery.cpp, examples/component/modal_dialog.cpp, examples/component/modal_dialog_custom.cpp, examples/component/nested_screen.cpp, examples/component/print_key_press.cpp, examples/component/radiobox.cpp, examples/component/radiobox_in_frame.cpp, examples/component/renderer.cpp, examples/component/resizable_split.cpp, examples/component/scrollbar.cpp, examples/component/selection.cpp, examples/component/slider.cpp, examples/component/slider_direction.cpp, examples/component/slider_rgb.cpp, examples/component/tab_horizontal.cpp, examples/component/tab_vertical.cpp, examples/component/textarea.cpp, examples/component/toggle.cpp, examples/component/window.cpp, examples/component/with_restored_io.cpp, examples/dom/border.cpp, examples/dom/border_colored.cpp, examples/dom/border_style.cpp, examples/dom/canvas.cpp, examples/dom/color_gallery.cpp, examples/dom/color_info_palette256.cpp, examples/dom/color_truecolor_HSV.cpp, examples/dom/color_truecolor_RGB.cpp, examples/dom/dbox.cpp, examples/dom/gauge.cpp, examples/dom/gauge_direction.cpp, examples/dom/graph.cpp, examples/dom/gridbox.cpp, examples/dom/hflow.cpp, examples/dom/html_like.cpp, examples/dom/linear_gradient.cpp, examples/dom/package_manager.cpp, examples/dom/paragraph.cpp, examples/dom/separator.cpp, examples/dom/separator_style.cpp, examples/dom/size.cpp, examples/dom/spinner.cpp, examples/dom/style_blink.cpp, examples/dom/style_bold.cpp, examples/dom/style_color.cpp, examples/dom/style_dim.cpp, examples/dom/style_gallery.cpp, examples/dom/style_hyperlink.cpp, examples/dom/style_inverted.cpp, examples/dom/style_italic.cpp, examples/dom/style_strikethrough.cpp, examples/dom/style_underlined.cpp, examples/dom/style_underlined_double.cpp, examples/dom/table.cpp, examples/dom/vbox_hbox.cpp, and examples/dom/vflow.cpp.
+
+ +

Definition at line 33 of file examples/component/button.cpp.

+ +
+
+
+
+ + + + + diff --git a/examples_2component_2button_8cpp.js b/examples_2component_2button_8cpp.js new file mode 100644 index 000000000..b611b34ed --- /dev/null +++ b/examples_2component_2button_8cpp.js @@ -0,0 +1,5 @@ +var examples_2component_2button_8cpp = +[ + [ "Style", "examples_2component_2button_8cpp.html#a98e3b8d17caf902b7bf0fe47562cea08", null ], + [ "main", "examples_2component_2button_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/examples_2component_2button_8cpp_source.html b/examples_2component_2button_8cpp_source.html new file mode 100644 index 000000000..8f5d29e13 --- /dev/null +++ b/examples_2component_2button_8cpp_source.html @@ -0,0 +1,299 @@ + + + + + + + + +FTXUI: button.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/button.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <memory> // for shared_ptr, __shared_ptr_access
+
5#include <string> // for operator+, to_string
+
6
+
7#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
8#include "ftxui/component/component.hpp" // for Button, Horizontal, Renderer
+
9#include "ftxui/component/component_base.hpp" // for ComponentBase
+
10#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
11#include "ftxui/dom/elements.hpp" // for separator, gauge, text, Element, operator|, vbox, border
+
12
+
13using namespace ftxui;
+
14
+
15// This is a helper function to create a button with a custom style.
+
16// The style is defined by a lambda function that takes an EntryState and
+
17// returns an Element.
+
18// We are using `center` to center the text inside the button, then `border` to
+
19// add a border around the button, and finally `flex` to make the button fill
+
20// the available space.
+
+ +
22 auto option = ButtonOption::Animated();
+
23 option.transform = [](const EntryState& s) {
+
24 auto element = text(s.label);
+
25 if (s.focused) {
+
26 element |= bold;
+
27 }
+
28 return element | center | borderEmpty | flex;
+
29 };
+
30 return option;
+
31}
+
+
32
+
+
33int main() {
+
34 int value = 50;
+
35
+
36 // clang-format off
+
37 auto btn_dec_01 = Button("-1", [&] { value += 1; }, Style());
+
38 auto btn_inc_01 = Button("+1", [&] { value -= 1; }, Style());
+
39 auto btn_dec_10 = Button("-10", [&] { value -= 10; }, Style());
+
40 auto btn_inc_10 = Button("+10", [&] { value += 10; }, Style());
+
41 // clang-format on
+
42
+
43 // The tree of components. This defines how to navigate using the keyboard.
+
44 // The selected `row` is shared to get a grid layout.
+
45 int row = 0;
+
46 auto buttons = Container::Vertical({
+
47 Container::Horizontal({btn_dec_01, btn_inc_01}, &row) | flex,
+
48 Container::Horizontal({btn_dec_10, btn_inc_10}, &row) | flex,
+
49 });
+
50
+
51 // Modify the way to render them on screen:
+
52 auto component = Renderer(buttons, [&] {
+
53 return vbox({
+
54 text("value = " + std::to_string(value)),
+
55 separator(),
+
56 buttons->Render() | flex,
+
57 }) |
+
58 flex | border;
+
59 });
+
60
+
61 auto screen = ScreenInteractive::FitComponent();
+
62 screen.Loop(component);
+
63 return 0;
+
64}
+
+ + + + +
ButtonOption Style()
+ +
static ButtonOption Animated()
Create a ButtonOption, using animated colors.
+
static ScreenInteractive FitComponent()
+
Component Horizontal(Components children)
A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow...
+
Component Button(ButtonOption options)
Draw a button. Execute a function when clicked.
+
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
+
Component Vertical(Components children)
A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
+
Option for the AnimatedButton component.
+
virtual void Render(Screen &screen)
Display an element on a ftxui::Screen.
Definition node.cpp:59
+
Element flex(Element)
Make a child element to expand proportionally to the space left in a container.
Definition flex.cpp:123
+
Element bold(Element)
Use a bold font, for elements with more emphasis.
Definition bold.cpp:33
+
Element text(std::wstring text)
Display a piece of unicode text.
Definition text.cpp:160
+
Element separator()
Draw a vertical or horizontal separation in between two other elements.
+
Element vbox(Elements)
A container displaying elements vertically one by one.
Definition vbox.cpp:96
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
arguments for transform from |ButtonOption|, |CheckboxOption|, |RadioboxOption|, |MenuEntryOption|,...
+
+
+ + + + + diff --git a/examples_2component_2button_animated_8cpp-example.html b/examples_2component_2button_animated_8cpp-example.html new file mode 100644 index 000000000..bca1b9247 --- /dev/null +++ b/examples_2component_2button_animated_8cpp-example.html @@ -0,0 +1,262 @@ + + + + + + + + +FTXUI: examples/component/button_animated.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/button_animated.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <memory> // for shared_ptr, __shared_ptr_access
+
#include <string> // for operator+, to_string
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Button, Horizontal, Renderer
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/component_options.hpp" // for ButtonOption
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for gauge, separator, text, vbox, operator|, Element, border
+
#include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Green, Color::Red
+
+
using namespace ftxui;
+
+
int main() {
+
int value = 50;
+
+
// The tree of components. This defines how to navigate using the keyboard.
+
auto buttons = Container::Horizontal({
+
Button(
+
"Decrease", [&] { value--; }, ButtonOption::Animated(Color::Red)),
+
Button(
+
"Reset", [&] { value = 50; }, ButtonOption::Animated(Color::Green)),
+
Button(
+
"Increase", [&] { value++; }, ButtonOption::Animated(Color::Blue)),
+
});
+
+
// Modify the way to render them on screen:
+
auto component = Renderer(buttons, [&] {
+
return vbox({
+
vbox({
+
text("value = " + std::to_string(value)),
+
separator(),
+
gauge(value * 0.01f),
+
}) | border,
+
buttons->Render(),
+
});
+
});
+
+
auto screen = ScreenInteractive::FitComponent();
+
screen.Loop(component);
+
return 0;
+
}
+ + + + + + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/examples_2component_2button_in_frame_8cpp-example.html b/examples_2component_2button_in_frame_8cpp-example.html new file mode 100644 index 000000000..ab31ca6ca --- /dev/null +++ b/examples_2component_2button_in_frame_8cpp-example.html @@ -0,0 +1,264 @@ + + + + + + + + +FTXUI: examples/component/button_in_frame.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/button_in_frame.cpp
+
+
+
// Copyright 2022 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <memory> // for allocator, __shared_ptr_access, shared_ptr
+
#include <string> // for to_string, operator+
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Button, Renderer, Vertical
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/component_options.hpp" // for ButtonOption
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for operator|, text, Element, hbox, separator, size, vbox, border, frame, vscroll_indicator, HEIGHT, LESS_THAN
+
#include "ftxui/screen/color.hpp" // for Color, Color::Default, Color::GrayDark, Color::White
+
+
using namespace ftxui;
+
+
int main() {
+
int counter = 0;
+
auto on_click = [&] { counter++; };
+
+
auto style = ButtonOption::Animated(Color::Default, Color::GrayDark,
+
Color::Default, Color::White);
+
+
auto container = Container::Vertical({});
+
for (int i = 0; i < 30; ++i) {
+
auto button = Button("Button " + std::to_string(i), on_click, style);
+
container->Add(button);
+
}
+
+
auto renderer = Renderer(container, [&] {
+
return vbox({
+
hbox({
+
text("Counter:"),
+
text(std::to_string(counter)),
+
}),
+
separator(),
+
container->Render() | vscroll_indicator | frame |
+
size(HEIGHT, LESS_THAN, 20),
+
}) |
+
border;
+
});
+
+
auto screen = ScreenInteractive::FitComponent();
+
screen.Loop(renderer);
+
+
return 0;
+
}
+ + + + + + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/examples_2component_2button_style_8cpp-example.html b/examples_2component_2button_style_8cpp-example.html new file mode 100644 index 000000000..9ba683c93 --- /dev/null +++ b/examples_2component_2button_style_8cpp-example.html @@ -0,0 +1,277 @@ + + + + + + + + +FTXUI: examples/component/button_style.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/button_style.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <string> // for operator+, to_string
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Button, Vertical, Renderer, Horizontal, operator|
+
#include "ftxui/component/component_base.hpp" // for Component
+
#include "ftxui/component/component_options.hpp" // for ButtonOption
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for Element, separator, text, border
+
#include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Green, Color::Red
+
+
using namespace ftxui;
+
+
int main() {
+
int value = 0;
+
auto action = [&] { value++; };
+
auto action_renderer =
+
Renderer([&] { return text("count = " + std::to_string(value)); });
+
+
auto buttons =
+
Container::Vertical({
+
action_renderer,
+
Renderer([] { return separator(); }),
+
Container::Horizontal({
+
Container::Vertical({
+
Button("Ascii 1", action, ButtonOption::Ascii()),
+
Button("Ascii 2", action, ButtonOption::Ascii()),
+
Button("Ascii 3", action, ButtonOption::Ascii()),
+
}),
+
Renderer([] { return separator(); }),
+
Container::Vertical({
+
Button("Simple 1", action, ButtonOption::Simple()),
+
Button("Simple 2", action, ButtonOption::Simple()),
+
Button("Simple 3", action, ButtonOption::Simple()),
+
}),
+
Renderer([] { return separator(); }),
+
Container::Vertical({
+
Button("Animated 1", action, ButtonOption::Animated()),
+
Button("Animated 2", action, ButtonOption::Animated()),
+
Button("Animated 3", action, ButtonOption::Animated()),
+
}),
+
Renderer([] { return separator(); }),
+
Container::Vertical({
+
Button("Animated 4", action,
+
ButtonOption::Animated(Color::Red)),
+
Button("Animated 5", action,
+
ButtonOption::Animated(Color::Green)),
+
Button("Animated 6", action,
+
ButtonOption::Animated(Color::Blue)),
+
}),
+
}),
+
}) |
+
border;
+
+
auto screen = ScreenInteractive::FitComponent();
+
screen.Loop(buttons);
+
return 0;
+
}
+ + + + + + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/examples_2component_2canvas_animated_8cpp-example.html b/examples_2component_2canvas_animated_8cpp-example.html new file mode 100644 index 000000000..565b959c8 --- /dev/null +++ b/examples_2component_2canvas_animated_8cpp-example.html @@ -0,0 +1,490 @@ + + + + + + + + +FTXUI: examples/component/canvas_animated.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/canvas_animated.cpp
+
+
+
// Copyright 2021 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSED file.
+
#include <cmath> // for sin, cos
+
#include <ftxui/dom/elements.hpp> // for canvas, Element, separator, hbox, operator|, border
+
#include <ftxui/screen/screen.hpp> // for Pixel
+
#include <memory> // for allocator, shared_ptr, __shared_ptr_access
+
#include <string> // for string, basic_string
+
#include <utility> // for move
+
#include <vector> // for vector, __alloc_traits<>::value_type
+
+
#include "ftxui/component/component.hpp" // for Renderer, CatchEvent, Horizontal, Menu, Tab
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/event.hpp" // for Event
+
#include "ftxui/component/mouse.hpp" // for Mouse
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
#include "ftxui/dom/canvas.hpp" // for Canvas
+
#include "ftxui/screen/color.hpp" // for Color, Color::Red, Color::Blue, Color::Green, ftxui
+
+
int main() {
+
using namespace ftxui;
+
+
int mouse_x = 0;
+
int mouse_y = 0;
+
+
// A triangle following the mouse, using braille characters.
+
auto renderer_line_braille = Renderer([&] {
+
auto c = Canvas(100, 100);
+
c.DrawText(0, 0, "Several lines (braille)");
+
c.DrawPointLine(mouse_x, mouse_y, 80, 10, Color::Red);
+
c.DrawPointLine(80, 10, 80, 40, Color::Blue);
+
c.DrawPointLine(80, 40, mouse_x, mouse_y, Color::Green);
+
return canvas(std::move(c));
+
});
+
+
// A triangle following the mouse, using block characters.
+
auto renderer_line_block = Renderer([&] {
+
auto c = Canvas(100, 100);
+
c.DrawText(0, 0, "Several lines (block)");
+
c.DrawBlockLine(mouse_x, mouse_y, 80, 10, Color::Red);
+
c.DrawBlockLine(80, 10, 80, 40, Color::Blue);
+
c.DrawBlockLine(80, 40, mouse_x, mouse_y, Color::Green);
+
return canvas(std::move(c));
+
});
+
+
// A circle following the mouse, using braille characters.
+
auto renderer_circle_braille = Renderer([&] {
+
auto c = Canvas(100, 100);
+
c.DrawText(0, 0, "A circle (braille)");
+
c.DrawPointCircle(mouse_x, mouse_y, 30);
+
return canvas(std::move(c));
+
});
+
+
// A circle following the mouse, using block characters.
+
auto renderer_circle_block = Renderer([&] {
+
auto c = Canvas(100, 100);
+
c.DrawText(0, 0, "A circle (block)");
+
c.DrawBlockCircle(mouse_x, mouse_y, 30);
+
return canvas(std::move(c));
+
});
+
+
// A filled circle following the mouse, using braille characters.
+
auto renderer_circle_filled_braille = Renderer([&] {
+
auto c = Canvas(100, 100);
+
c.DrawText(0, 0, "A circle filled (braille)");
+
c.DrawPointCircleFilled(mouse_x, mouse_y, 30);
+
return canvas(std::move(c));
+
});
+
+
// A filled circle following the mouse, using block characters.
+
auto renderer_circle_filled_block = Renderer([&] {
+
auto c = Canvas(100, 100);
+
c.DrawText(0, 0, "A circle filled (block)");
+
c.DrawBlockCircleFilled(mouse_x, mouse_y, 30);
+
return canvas(std::move(c));
+
});
+
+
// An ellipse following the mouse, using braille characters.
+
auto renderer_ellipse_braille = Renderer([&] {
+
auto c = Canvas(100, 100);
+
c.DrawText(0, 0, "An ellipse (braille)");
+
c.DrawPointEllipse(mouse_x / 2, mouse_y / 2, mouse_x / 2, mouse_y / 2);
+
return canvas(std::move(c));
+
});
+
+
// An ellipse following the mouse, using block characters.
+
auto renderer_ellipse_block = Renderer([&] {
+
auto c = Canvas(100, 100);
+
c.DrawText(0, 0, "An ellipse (block)");
+
c.DrawBlockEllipse(mouse_x / 2, mouse_y / 2, mouse_x / 2, mouse_y / 2);
+
return canvas(std::move(c));
+
});
+
+
// An ellipse following the mouse filled, using braille characters.
+
auto renderer_ellipse_filled_braille = Renderer([&] {
+
auto c = Canvas(100, 100);
+
c.DrawText(0, 0, "A filled ellipse (braille)");
+
c.DrawPointEllipseFilled(mouse_x / 2, mouse_y / 2, mouse_x / 2,
+
mouse_y / 2);
+
return canvas(std::move(c));
+
});
+
+
// An ellipse following the mouse filled, using block characters.
+
auto renderer_ellipse_filled_block = Renderer([&] {
+
auto c = Canvas(100, 100);
+
c.DrawText(0, 0, "A filled ellipse (block)");
+
c.DrawBlockEllipseFilled(mouse_x / 2, mouse_y / 2, mouse_x / 2,
+
mouse_y / 2);
+
c.DrawBlockEllipse(mouse_x / 2, mouse_y / 2, mouse_x / 2, mouse_y / 2);
+
return canvas(std::move(c));
+
});
+
+
// A text following the mouse
+
auto renderer_text = Renderer([&] {
+
auto c = Canvas(100, 100);
+
c.DrawText(0, 0, "A piece of text");
+
c.DrawText(mouse_x, mouse_y, "This is a piece of text with effects",
+
[](Pixel& p) {
+
p.foreground_color = Color::Red;
+
p.underlined = true;
+
p.bold = true;
+
});
+
return canvas(std::move(c));
+
});
+
+
auto renderer_plot_1 = Renderer([&] {
+
auto c = Canvas(100, 100);
+
c.DrawText(0, 0, "A graph");
+
+
std::vector<int> ys(100);
+
for (int x = 0; x < 100; x++) {
+
float dx = float(x - mouse_x);
+
float dy = 50.f;
+
ys[x] = int(dy + 20 * cos(dx * 0.14) + 10 * sin(dx * 0.42));
+
}
+
for (int x = 1; x < 99; x++) {
+
c.DrawPointLine(x, ys[x], x + 1, ys[x + 1]);
+
}
+
+
return canvas(std::move(c));
+
});
+
+
auto renderer_plot_2 = Renderer([&] {
+
auto c = Canvas(100, 100);
+
c.DrawText(0, 0, "A symmetrical graph filled");
+
std::vector<int> ys(100);
+
for (int x = 0; x < 100; x++) {
+
ys[x] = int(30 + //
+
10 * cos(x * 0.2 - mouse_x * 0.05) + //
+
5 * sin(x * 0.4) + //
+
5 * sin(x * 0.3 - mouse_y * 0.05)); //
+
}
+
for (int x = 0; x < 100; x++) {
+
c.DrawPointLine(x, 50 + ys[x], x, 50 - ys[x], Color::Red);
+
}
+
+
return canvas(std::move(c));
+
});
+
+
auto renderer_plot_3 = Renderer([&] {
+
auto c = Canvas(100, 100);
+
c.DrawText(0, 0, "A 2D gaussian plot");
+
int size = 15;
+
+
// mouse_x = 5mx + 3*my
+
// mouse_y = 0mx + -5my + 90
+
float my = (mouse_y - 90) / -5.f;
+
float mx = (mouse_x - 3 * my) / 5.f;
+
std::vector<std::vector<float>> ys(size, std::vector<float>(size));
+
for (int y = 0; y < size; y++) {
+
for (int x = 0; x < size; x++) {
+
float dx = x - mx;
+
float dy = y - my;
+
ys[y][x] = -1.5 + 3.0 * std::exp(-0.2f * (dx * dx + dy * dy));
+
}
+
}
+
for (int y = 0; y < size; y++) {
+
for (int x = 0; x < size; x++) {
+
if (x != 0) {
+
c.DrawPointLine(
+
5 * (x - 1) + 3 * (y - 0), 90 - 5 * (y - 0) - 5 * ys[y][x - 1],
+
5 * (x - 0) + 3 * (y - 0), 90 - 5 * (y - 0) - 5 * ys[y][x]);
+
}
+
if (y != 0) {
+
c.DrawPointLine(
+
5 * (x - 0) + 3 * (y - 1), 90 - 5 * (y - 1) - 5 * ys[y - 1][x],
+
5 * (x - 0) + 3 * (y - 0), 90 - 5 * (y - 0) - 5 * ys[y][x]);
+
}
+
}
+
}
+
+
return canvas(std::move(c));
+
});
+
+
int selected_tab = 12;
+
auto tab = Container::Tab(
+
{
+
renderer_line_braille,
+
renderer_line_block,
+
renderer_circle_braille,
+
renderer_circle_block,
+
renderer_circle_filled_braille,
+
renderer_circle_filled_block,
+
renderer_ellipse_braille,
+
renderer_ellipse_block,
+
renderer_ellipse_filled_braille,
+
renderer_ellipse_filled_block,
+
+
renderer_plot_1,
+
renderer_plot_2,
+
renderer_plot_3,
+
+
renderer_text,
+
},
+
&selected_tab);
+
+
// This capture the last mouse position.
+
auto tab_with_mouse = CatchEvent(tab, [&](Event e) {
+
if (e.is_mouse()) {
+
mouse_x = (e.mouse().x - 1) * 2;
+
mouse_y = (e.mouse().y - 1) * 4;
+
}
+
return false;
+
});
+
+
std::vector<std::string> tab_titles = {
+
"line (braille)",
+
"line (block)",
+
"circle (braille)",
+
"circle (block)",
+
"circle filled (braille)",
+
"circle filled (block)",
+
"ellipse (braille)",
+
"ellipse (block)",
+
"ellipse filled (braille)",
+
"ellipse filled (block)",
+
"plot_1 simple",
+
"plot_2 filled",
+
"plot_3 3D",
+
"text",
+
};
+
auto tab_toggle = Menu(&tab_titles, &selected_tab);
+
+
auto component = Container::Horizontal({
+
tab_with_mouse,
+
tab_toggle,
+
});
+
+
// Add some separator to decorate the whole component:
+
auto component_renderer = Renderer(component, [&] {
+
return hbox({
+
tab_with_mouse->Render(),
+
separator(),
+
tab_toggle->Render(),
+
}) |
+
border;
+
});
+
+
auto screen = ScreenInteractive::FitComponent();
+
screen.Loop(component_renderer);
+
+
return 0;
+
}
+ + + + + + + +
bool is_mouse() const
Definition event.hpp:109
+
struct Mouse mouse
Definition event.hpp:144
+
Represent an event. It can be key press event, a terminal resize, or more ...
Definition event.hpp:29
+
Canvas is a drawable buffer associated with drawing operations.
Definition canvas.hpp:38
+
Color foreground_color
Definition pixel.hpp:49
+
bool bold
Definition pixel.hpp:29
+
bool underlined
Definition pixel.hpp:33
+
A Unicode character and its associated style.
Definition pixel.hpp:15
+ +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2component_2checkbox_8cpp-example.html b/examples_2component_2checkbox_8cpp-example.html new file mode 100644 index 000000000..919d4d417 --- /dev/null +++ b/examples_2component_2checkbox_8cpp-example.html @@ -0,0 +1,253 @@ + + + + + + + + +FTXUI: examples/component/checkbox.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/checkbox.cpp
+
+
+
// Copyright 2021 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <array> // for array
+
#include <iostream>
+
#include <memory> // for shared_ptr, __shared_ptr_access
+
#include <string> // for operator+, to_string
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Checkbox, Renderer, Vertical
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, vscroll_indicator, HEIGHT, LESS_THAN
+
+
using namespace ftxui;
+
+
int main() {
+
bool download = false;
+
bool upload = false;
+
bool ping = false;
+
+
auto container = Container::Vertical({
+
Checkbox("Download", &download),
+
Checkbox("Upload", &upload),
+
Checkbox("Ping", &ping),
+
});
+
+
auto screen = ScreenInteractive::FitComponent();
+
screen.Loop(container);
+
+
std::cout << "---" << std::endl;
+
std::cout << "Download: " << download << std::endl;
+
std::cout << "Upload: " << upload << std::endl;
+
std::cout << "Ping: " << ping << std::endl;
+
std::cout << "---" << std::endl;
+
+
return 0;
+
}
+ + + + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/examples_2component_2checkbox_8cpp.html b/examples_2component_2checkbox_8cpp.html new file mode 100644 index 000000000..8b4d569ca --- /dev/null +++ b/examples_2component_2checkbox_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: checkbox.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
checkbox.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 17 of file examples/component/checkbox.cpp.

+ +
+
+
+
+ + + + + diff --git a/examples_2component_2checkbox_8cpp.js b/examples_2component_2checkbox_8cpp.js new file mode 100644 index 000000000..1201d715d --- /dev/null +++ b/examples_2component_2checkbox_8cpp.js @@ -0,0 +1,4 @@ +var examples_2component_2checkbox_8cpp = +[ + [ "main", "examples_2component_2checkbox_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/examples_2component_2checkbox_8cpp_source.html b/examples_2component_2checkbox_8cpp_source.html new file mode 100644 index 000000000..5df6b7074 --- /dev/null +++ b/examples_2component_2checkbox_8cpp_source.html @@ -0,0 +1,259 @@ + + + + + + + + +FTXUI: checkbox.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/checkbox.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2021 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <array> // for array
+
5#include <iostream>
+
6#include <memory> // for shared_ptr, __shared_ptr_access
+
7#include <string> // for operator+, to_string
+
8
+
9#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
10#include "ftxui/component/component.hpp" // for Checkbox, Renderer, Vertical
+
11#include "ftxui/component/component_base.hpp" // for ComponentBase
+
12#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
13#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, vscroll_indicator, HEIGHT, LESS_THAN
+
14
+
15using namespace ftxui;
+
16
+
+
17int main() {
+
18 bool download = false;
+
19 bool upload = false;
+
20 bool ping = false;
+
21
+
22 auto container = Container::Vertical({
+
23 Checkbox("Download", &download),
+
24 Checkbox("Upload", &upload),
+
25 Checkbox("Ping", &ping),
+
26 });
+
27
+
28 auto screen = ScreenInteractive::FitComponent();
+
29 screen.Loop(container);
+
30
+
31 std::cout << "---" << std::endl;
+
32 std::cout << "Download: " << download << std::endl;
+
33 std::cout << "Upload: " << upload << std::endl;
+
34 std::cout << "Ping: " << ping << std::endl;
+
35 std::cout << "---" << std::endl;
+
36
+
37 return 0;
+
38}
+
+ + + + + +
static ScreenInteractive FitComponent()
+
Component Vertical(Components children)
A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
+
Component Checkbox(CheckboxOption options)
Draw checkable element.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/examples_2component_2checkbox_in_frame_8cpp-example.html b/examples_2component_2checkbox_in_frame_8cpp-example.html new file mode 100644 index 000000000..833bf13a1 --- /dev/null +++ b/examples_2component_2checkbox_in_frame_8cpp-example.html @@ -0,0 +1,249 @@ + + + + + + + + +FTXUI: examples/component/checkbox_in_frame.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/checkbox_in_frame.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <array> // for array
+
#include <memory> // for shared_ptr, __shared_ptr_access
+
#include <string> // for operator+, to_string
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Checkbox, Renderer, Vertical
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, vscroll_indicator, HEIGHT, LESS_THAN
+
+
using namespace ftxui;
+
+
int main() {
+
std::array<bool, 30> states;
+
+
auto container = Container::Vertical({});
+
for (int i = 0; i < 30; ++i) {
+
states[i] = false;
+
container->Add(Checkbox("Checkbox" + std::to_string(i), &states[i]));
+
}
+
+
auto renderer = Renderer(container, [&] {
+
return container->Render() | vscroll_indicator | frame |
+
size(HEIGHT, LESS_THAN, 10) | border;
+
});
+
+
auto screen = ScreenInteractive::FitComponent();
+
screen.Loop(renderer);
+
+
return 0;
+
}
+ + + + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/examples_2component_2collapsible_8cpp-example.html b/examples_2component_2collapsible_8cpp-example.html new file mode 100644 index 000000000..749e18acb --- /dev/null +++ b/examples_2component_2collapsible_8cpp-example.html @@ -0,0 +1,275 @@ + + + + + + + + +FTXUI: examples/component/collapsible.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/collapsible.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <memory> // for allocator, make_shared, __shared_ptr_access
+
#include <utility> // for move
+
#include <vector> // for vector
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Collapsible, Renderer, Vertical
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for text, hbox, Element
+
+
using namespace ftxui;
+
+
// Take a list of component, display them vertically, one column shifted to the
+
// right.
+
Component Inner(std::vector<Component> children) {
+
Component vlist = Container::Vertical(std::move(children));
+
return Renderer(vlist, [vlist] {
+
return hbox({
+
text(" "),
+
vlist->Render(),
+
});
+
});
+
}
+
+ +
return std::make_shared<ComponentBase>();
+
}
+
+
int main() {
+
auto component =
+
Collapsible("Collapsible 1",
+ +
Collapsible("Collapsible 1.1",
+ +
Collapsible("Collapsible 1.1.1", Empty()),
+
Collapsible("Collapsible 1.1.2", Empty()),
+
Collapsible("Collapsible 1.1.3", Empty()),
+
})),
+
Collapsible("Collapsible 1.2",
+ +
Collapsible("Collapsible 1.2.1", Empty()),
+
Collapsible("Collapsible 1.2.2", Empty()),
+
Collapsible("Collapsible 1.2.3", Empty()),
+
})),
+
Collapsible("Collapsible 1.3",
+ +
Collapsible("Collapsible 1.3.1", Empty()),
+
Collapsible("Collapsible 1.3.2", Empty()),
+
Collapsible("Collapsible 1.3.3", Empty()),
+
})),
+
}));
+
+
ScreenInteractive::FitComponent().Loop(component);
+
}
+ + + + + +
Component Inner(std::vector< Component > children)
+
Component Empty()
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< ComponentBase > Component
+ +
+
+ + + + + diff --git a/examples_2component_2collapsible_8cpp.html b/examples_2component_2collapsible_8cpp.html new file mode 100644 index 000000000..45276792d --- /dev/null +++ b/examples_2component_2collapsible_8cpp.html @@ -0,0 +1,285 @@ + + + + + + + + +FTXUI: collapsible.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
collapsible.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + + + +

+Functions

Component Inner (std::vector< Component > children)
 
Component Empty ()
 
int main ()
 
+

Function Documentation

+ +

◆ Inner()

+ +
+
+ + + + + + + +
Component Inner (std::vector< Component > children)
+
+
Examples
examples/component/collapsible.cpp.
+
+ +

Definition at line 18 of file examples/component/collapsible.cpp.

+ +
+
+ +

◆ Empty()

+ +
+
+ + + + + + + +
Component Empty ()
+
+
Examples
examples/component/collapsible.cpp.
+
+ +

Definition at line 28 of file examples/component/collapsible.cpp.

+ +
+
+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 32 of file examples/component/collapsible.cpp.

+ +
+
+
+
+ + + + + diff --git a/examples_2component_2collapsible_8cpp.js b/examples_2component_2collapsible_8cpp.js new file mode 100644 index 000000000..82b74dd5d --- /dev/null +++ b/examples_2component_2collapsible_8cpp.js @@ -0,0 +1,6 @@ +var examples_2component_2collapsible_8cpp = +[ + [ "Inner", "examples_2component_2collapsible_8cpp.html#a74bf63b8448df7b03bd98ae6de127c0a", null ], + [ "Empty", "examples_2component_2collapsible_8cpp.html#aacbbfcb3c5bc93d26a5c681172e27eae", null ], + [ "main", "examples_2component_2collapsible_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/examples_2component_2collapsible_8cpp_source.html b/examples_2component_2collapsible_8cpp_source.html new file mode 100644 index 000000000..b2ae3b27a --- /dev/null +++ b/examples_2component_2collapsible_8cpp_source.html @@ -0,0 +1,290 @@ + + + + + + + + +FTXUI: collapsible.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/collapsible.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <memory> // for allocator, make_shared, __shared_ptr_access
+
5#include <utility> // for move
+
6#include <vector> // for vector
+
7
+
8#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
9#include "ftxui/component/component.hpp" // for Collapsible, Renderer, Vertical
+
10#include "ftxui/component/component_base.hpp" // for ComponentBase
+
11#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
+
12#include "ftxui/dom/elements.hpp" // for text, hbox, Element
+
13
+
14using namespace ftxui;
+
15
+
16// Take a list of component, display them vertically, one column shifted to the
+
17// right.
+
+
18Component Inner(std::vector<Component> children) {
+
19 Component vlist = Container::Vertical(std::move(children));
+
20 return Renderer(vlist, [vlist] {
+
21 return hbox({
+
22 text(" "),
+
23 vlist->Render(),
+
24 });
+
25 });
+
26}
+
+
27
+
+ +
29 return std::make_shared<ComponentBase>();
+
30}
+
+
31
+
+
32int main() {
+
33 auto component =
+
34 Collapsible("Collapsible 1",
+
35 Inner({
+
36 Collapsible("Collapsible 1.1",
+
37 Inner({
+
38 Collapsible("Collapsible 1.1.1", Empty()),
+
39 Collapsible("Collapsible 1.1.2", Empty()),
+
40 Collapsible("Collapsible 1.1.3", Empty()),
+
41 })),
+
42 Collapsible("Collapsible 1.2",
+
43 Inner({
+
44 Collapsible("Collapsible 1.2.1", Empty()),
+
45 Collapsible("Collapsible 1.2.2", Empty()),
+
46 Collapsible("Collapsible 1.2.3", Empty()),
+
47 })),
+
48 Collapsible("Collapsible 1.3",
+
49 Inner({
+
50 Collapsible("Collapsible 1.3.1", Empty()),
+
51 Collapsible("Collapsible 1.3.2", Empty()),
+
52 Collapsible("Collapsible 1.3.3", Empty()),
+
53 })),
+
54 }));
+
55
+ +
57}
+
+ + + + +
Component Inner(std::vector< Component > children)
+
Component Empty()
+ +
Element Render()
Draw the component. Build a ftxui::Element to be drawn on the ftxui::Screen representing this ftxui::...
+
static ScreenInteractive FitComponent()
+
void Loop(Component)
Execute the main loop.
+
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
+
Component Vertical(Components children)
A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
+
Element text(std::wstring text)
Display a piece of unicode text.
Definition text.cpp:160
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
Element hbox(Elements)
A container displaying elements horizontally one by one.
Definition hbox.cpp:94
+
Component Collapsible(ConstStringRef label, Component child, Ref< bool > show=false)
A collapsible component. It displays a checkbox with an arrow. Once activated, the child is displayed...
+
std::shared_ptr< ComponentBase > Component
+ +
+
+ + + + + diff --git a/examples_2component_2composition_8cpp-example.html b/examples_2component_2composition_8cpp-example.html new file mode 100644 index 000000000..6fe8cb01e --- /dev/null +++ b/examples_2component_2composition_8cpp-example.html @@ -0,0 +1,278 @@ + + + + + + + + +FTXUI: examples/component/composition.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/composition.cpp
+
+
+
// Copyright 2021 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <memory> // for allocator, shared_ptr, __shared_ptr_access
+
#include <string> // for operator+, to_string
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Button, Horizontal, Renderer
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for text, separator, Element, operator|, vbox, border
+
+
using namespace ftxui;
+
+
// An example of how to compose multiple components into one and maintain their
+
// interactiveness.
+
int main() {
+
auto left_count = 0;
+
auto right_count = 0;
+
+
auto left_buttons = Container::Horizontal({
+
Button("Decrease", [&] { left_count--; }),
+
Button("Increase", [&] { left_count++; }),
+
});
+
+
auto right_buttons = Container::Horizontal({
+
Button("Decrease", [&] { right_count--; }),
+
Button("Increase", [&] { right_count++; }),
+
});
+
+
// Renderer decorates its child with a new rendering function. The way the
+
// children reacts to events is maintained.
+
auto leftpane = Renderer(left_buttons, [&] {
+
return vbox({
+
text("This is the left control"),
+
separator(),
+
text("Left button count: " + std::to_string(left_count)),
+
left_buttons->Render(),
+
}) |
+
border;
+
});
+
+
auto rightpane = Renderer(right_buttons, [&] {
+
return vbox({
+
text("This is the right control"),
+
separator(),
+
text("Right button count: " + std::to_string(right_count)),
+
right_buttons->Render(),
+
}) |
+
border;
+
});
+
+
// Container groups components togethers. To render a Container::Horizontal,
+
// it render its children side by side. It maintains their interactiveness and
+
// provide the logic to navigate from one to the other using the arrow keys.
+
auto composition = Container::Horizontal({leftpane, rightpane});
+
+
auto screen = ScreenInteractive::FitComponent();
+
screen.Loop(composition);
+
return 0;
+
}
+
+
// Thanks to Chris Morgan for this example!
+ + + + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/examples_2component_2custom_loop_8cpp-example.html b/examples_2component_2custom_loop_8cpp-example.html new file mode 100644 index 000000000..b5ef98726 --- /dev/null +++ b/examples_2component_2custom_loop_8cpp-example.html @@ -0,0 +1,272 @@ + + + + + + + + +FTXUI: examples/component/custom_loop.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/custom_loop.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <stdlib.h> // for EXIT_SUCCESS
+
#include <chrono> // for milliseconds
+
#include <ftxui/component/event.hpp> // for Event
+
#include <ftxui/component/mouse.hpp> // for ftxui
+
#include <ftxui/dom/elements.hpp> // for text, separator, Element, operator|, vbox, border
+
#include <memory> // for allocator, shared_ptr
+
#include <string> // for operator+, to_string
+
#include <thread> // for sleep_for
+
+
#include "ftxui/component/component.hpp" // for CatchEvent, Renderer, operator|=
+
#include "ftxui/component/loop.hpp" // for Loop
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
+
int main() {
+
using namespace ftxui;
+
auto screen = ScreenInteractive::FitComponent();
+
+
// Create a component counting the number of frames drawn and event handled.
+
int custom_loop_count = 0;
+
int frame_count = 0;
+
int event_count = 0;
+
auto component = Renderer([&] {
+
frame_count++;
+
return vbox({
+
text("This demonstrates using a custom ftxui::Loop. It "),
+
text("runs at 100 iterations per seconds. The FTXUI events "),
+
text("are all processed once per iteration and a new frame "),
+
text("is rendered as needed"),
+
separator(),
+
text("ftxui event count: " + std::to_string(event_count)),
+
text("ftxui frame count: " + std::to_string(frame_count)),
+
text("Custom loop count: " + std::to_string(custom_loop_count)),
+
}) |
+
border;
+
});
+
+
component |= CatchEvent([&](Event) -> bool {
+
event_count++;
+
return false;
+
});
+
+
Loop loop(&screen, component);
+
+
while (!loop.HasQuitted()) {
+
custom_loop_count++;
+
loop.RunOnce();
+
std::this_thread::sleep_for(std::chrono::milliseconds(10));
+
}
+
+
return EXIT_SUCCESS;
+
}
+ + + + +
Loop is a class that manages the event loop for a component.
Definition loop.hpp:56
+
Represent an event. It can be key press event, a terminal resize, or more ...
Definition event.hpp:29
+ + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/examples_2component_2dropdown_8cpp-example.html b/examples_2component_2dropdown_8cpp-example.html new file mode 100644 index 000000000..c569c3e4d --- /dev/null +++ b/examples_2component_2dropdown_8cpp-example.html @@ -0,0 +1,257 @@ + + + + + + + + +FTXUI: examples/component/dropdown.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/dropdown.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <string> // for basic_string, string, allocator
+
#include <vector> // for vector
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Dropdown, Horizontal, Vertical
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
+
int main() {
+
using namespace ftxui;
+
+
std::vector<std::string> entries = {
+
"tribute", "clearance", "ally", "bend", "electronics",
+
"module", "era", "cultural", "sniff", "nationalism",
+
"negotiation", "deliver", "figure", "east", "tribute",
+
"clearance", "ally", "bend", "electronics", "module",
+
"era", "cultural", "sniff", "nationalism", "negotiation",
+
"deliver", "figure", "east", "tribute", "clearance",
+
"ally", "bend", "electronics", "module", "era",
+
"cultural", "sniff", "nationalism", "negotiation", "deliver",
+
"figure", "east",
+
};
+
+
int selected_1 = 0;
+
int selected_2 = 0;
+
int selected_3 = 0;
+
int selected_4 = 0;
+
+
auto layout = Container::Vertical({
+
Container::Horizontal({
+
Dropdown(&entries, &selected_1),
+
Dropdown(&entries, &selected_2),
+
}),
+
Container::Horizontal({
+
Dropdown(&entries, &selected_3),
+
Dropdown(&entries, &selected_4),
+
}),
+
});
+
+
auto screen = ScreenInteractive::FitComponent();
+
screen.Loop(layout);
+
}
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/examples_2component_2dropdown_8cpp.html b/examples_2component_2dropdown_8cpp.html new file mode 100644 index 000000000..808c56fd8 --- /dev/null +++ b/examples_2component_2dropdown_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: dropdown.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
dropdown.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 11 of file examples/component/dropdown.cpp.

+ +
+
+
+
+ + + + + diff --git a/examples_2component_2dropdown_8cpp.js b/examples_2component_2dropdown_8cpp.js new file mode 100644 index 000000000..75eb3309f --- /dev/null +++ b/examples_2component_2dropdown_8cpp.js @@ -0,0 +1,4 @@ +var examples_2component_2dropdown_8cpp = +[ + [ "main", "examples_2component_2dropdown_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/examples_2component_2dropdown_8cpp_source.html b/examples_2component_2dropdown_8cpp_source.html new file mode 100644 index 000000000..7662a046e --- /dev/null +++ b/examples_2component_2dropdown_8cpp_source.html @@ -0,0 +1,260 @@ + + + + + + + + +FTXUI: dropdown.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/dropdown.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <string> // for basic_string, string, allocator
+
5#include <vector> // for vector
+
6
+
7#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
8#include "ftxui/component/component.hpp" // for Dropdown, Horizontal, Vertical
+
9#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
10
+
+
11int main() {
+
12 using namespace ftxui;
+
13
+
14 std::vector<std::string> entries = {
+
15 "tribute", "clearance", "ally", "bend", "electronics",
+
16 "module", "era", "cultural", "sniff", "nationalism",
+
17 "negotiation", "deliver", "figure", "east", "tribute",
+
18 "clearance", "ally", "bend", "electronics", "module",
+
19 "era", "cultural", "sniff", "nationalism", "negotiation",
+
20 "deliver", "figure", "east", "tribute", "clearance",
+
21 "ally", "bend", "electronics", "module", "era",
+
22 "cultural", "sniff", "nationalism", "negotiation", "deliver",
+
23 "figure", "east",
+
24 };
+
25
+
26 int selected_1 = 0;
+
27 int selected_2 = 0;
+
28 int selected_3 = 0;
+
29 int selected_4 = 0;
+
30
+
31 auto layout = Container::Vertical({
+
32 Container::Horizontal({
+
33 Dropdown(&entries, &selected_1),
+
34 Dropdown(&entries, &selected_2),
+
35 }),
+
36 Container::Horizontal({
+
37 Dropdown(&entries, &selected_3),
+
38 Dropdown(&entries, &selected_4),
+
39 }),
+
40 });
+
41
+
42 auto screen = ScreenInteractive::FitComponent();
+
43 screen.Loop(layout);
+
44}
+
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/examples_2component_2dropdown_custom_8cpp-example.html b/examples_2component_2dropdown_custom_8cpp-example.html new file mode 100644 index 000000000..7eec482c8 --- /dev/null +++ b/examples_2component_2dropdown_custom_8cpp-example.html @@ -0,0 +1,319 @@ + + + + + + + + +FTXUI: examples/component/dropdown_custom.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/dropdown_custom.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <string> // for basic_string, string, allocator
+
#include <vector> // for vector
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Dropdown, Horizontal, Vertical
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
+
int main() {
+
using namespace ftxui;
+
+
std::vector<std::string> entries = {
+
"tribute", "clearance", "ally", "bend", "electronics",
+
"module", "era", "cultural", "sniff", "nationalism",
+
"negotiation", "deliver", "figure", "east", "tribute",
+
"clearance", "ally", "bend", "electronics", "module",
+
"era", "cultural", "sniff", "nationalism", "negotiation",
+
"deliver", "figure", "east", "tribute", "clearance",
+
"ally", "bend", "electronics", "module", "era",
+
"cultural", "sniff", "nationalism", "negotiation", "deliver",
+
"figure", "east",
+
};
+
+
auto dropdown_1 = Dropdown({
+
.radiobox = {.entries = &entries},
+
.transform =
+
[](bool open, Element checkbox, Element radiobox) {
+
if (open) {
+
return vbox({
+
checkbox | inverted,
+
radiobox | vscroll_indicator | frame |
+
size(HEIGHT, LESS_THAN, 10),
+
filler(),
+
});
+
}
+
return vbox({
+
checkbox,
+
filler(),
+
});
+
},
+
});
+
+
auto dropdown_2 = Dropdown({
+
.radiobox = {.entries = &entries},
+
.transform =
+
[](bool open, Element checkbox, Element radiobox) {
+
if (open) {
+
return vbox({
+
checkbox | inverted,
+
radiobox | vscroll_indicator | frame |
+
size(HEIGHT, LESS_THAN, 10) | bgcolor(Color::Blue),
+
filler(),
+
});
+
}
+
return vbox({
+
checkbox | bgcolor(Color::Blue),
+
filler(),
+
});
+
},
+
});
+
+
auto dropdown_3 = Dropdown({
+
.radiobox =
+
{
+
.entries = &entries,
+
.transform =
+
[](const EntryState& s) {
+
auto t = text(s.label) | borderEmpty;
+
if (s.active) {
+
t |= bold;
+
}
+
if (s.focused) {
+
t |= inverted;
+
}
+
return t;
+
},
+
},
+
.transform =
+
[](bool open, Element checkbox, Element radiobox) {
+
checkbox |= borderEmpty;
+
if (open) {
+
return vbox({
+
checkbox | inverted,
+
radiobox | vscroll_indicator | frame |
+
size(HEIGHT, LESS_THAN, 20) | bgcolor(Color::Red),
+
filler(),
+
});
+
}
+
return vbox({
+
checkbox | bgcolor(Color::Red),
+
filler(),
+
});
+
},
+
});
+
+
auto screen = ScreenInteractive::FitComponent();
+
screen.Loop(Container::Horizontal({
+
dropdown_1,
+
dropdown_2,
+
dropdown_3,
+
}));
+
}
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+ +
arguments for transform from |ButtonOption|, |CheckboxOption|, |RadioboxOption|, |MenuEntryOption|,...
+
+
+ + + + + diff --git a/examples_2component_2flexbox_gallery_8cpp-example.html b/examples_2component_2flexbox_gallery_8cpp-example.html new file mode 100644 index 000000000..55bd36d01 --- /dev/null +++ b/examples_2component_2flexbox_gallery_8cpp-example.html @@ -0,0 +1,425 @@ + + + + + + + + +FTXUI: examples/component/flexbox_gallery.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/flexbox_gallery.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <stddef.h> // for size_t
+
#include <memory> // for shared_ptr, __shared_ptr_access, allocator
+
#include <string> // for string, basic_string, to_string, operator+, char_traits
+
#include <vector> // for vector
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Radiobox, Vertical, Checkbox, Horizontal, Renderer, ResizableSplitBottom, ResizableSplitRight
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for text, window, operator|, vbox, hbox, Element, flexbox, bgcolor, filler, flex, size, border, hcenter, color, EQUAL, bold, dim, notflex, xflex_grow, yflex_grow, HEIGHT, WIDTH
+
#include "ftxui/dom/flexbox_config.hpp" // for FlexboxConfig, FlexboxConfig::AlignContent, FlexboxConfig::JustifyContent, FlexboxConfig::AlignContent::Center, FlexboxConfig::AlignItems, FlexboxConfig::Direction, FlexboxConfig::JustifyContent::Center, FlexboxConfig::Wrap
+
#include "ftxui/screen/color.hpp" // for Color, Color::Black
+
+
using namespace ftxui;
+
+
int main() {
+
auto screen = ScreenInteractive::Fullscreen();
+
+
int direction_index = 0;
+
int wrap_index = 0;
+
int justify_content_index = 0;
+
int align_items_index = 0;
+
int align_content_index = 0;
+
+
std::vector<std::string> directions = {
+
"Row",
+
"RowInversed",
+
"Column",
+
"ColumnInversed",
+
};
+
+
std::vector<std::string> wraps = {
+
"NoWrap",
+
"Wrap",
+
"WrapInversed",
+
};
+
+
std::vector<std::string> justify_content = {
+
"FlexStart", "FlexEnd", "Center", "Stretch",
+
"SpaceBetween", "SpaceAround", "SpaceEvenly",
+
};
+
+
std::vector<std::string> align_items = {
+
"FlexStart",
+
"FlexEnd",
+
"Center",
+
"Stretch",
+
};
+
+
std::vector<std::string> align_content = {
+
"FlexStart", "FlexEnd", "Center", "Stretch",
+
"SpaceBetween", "SpaceAround", "SpaceEvenly",
+
};
+
+
auto radiobox_direction = Radiobox(&directions, &direction_index);
+
auto radiobox_wrap = Radiobox(&wraps, &wrap_index);
+
auto radiobox_justify_content =
+
Radiobox(&justify_content, &justify_content_index);
+
auto radiobox_align_items = Radiobox(&align_items, &align_items_index);
+
auto radiobox_align_content = Radiobox(&align_content, &align_content_index);
+
+
bool element_xflex_grow = false;
+
bool element_yflex_grow = false;
+
bool group_xflex_grow = true;
+
bool group_yflex_grow = true;
+
auto checkbox_element_xflex_grow =
+
Checkbox("element |= xflex_grow", &element_xflex_grow);
+
auto checkbox_element_yflex_grow =
+
Checkbox("element |= yflex_grow", &element_yflex_grow);
+
auto checkbox_group_xflex_grow =
+
Checkbox("group |= xflex_grow", &group_xflex_grow);
+
auto checkbox_group_yflex_grow =
+
Checkbox("group |= yflex_grow", &group_yflex_grow);
+
+
auto make_box = [&](size_t dimx, size_t dimy, size_t index) {
+
std::string title = std::to_string(dimx) + "x" + std::to_string(dimy);
+
auto element = window(text(title) | hcenter | bold,
+
text(std::to_string(index)) | hcenter | dim) |
+
size(WIDTH, EQUAL, dimx) | size(HEIGHT, EQUAL, dimy) |
+
bgcolor(Color::HSV(index * 25, 255, 255)) |
+
color(Color::Black);
+
if (element_xflex_grow) {
+
element = element | xflex_grow;
+
}
+
if (element_yflex_grow) {
+
element = element | yflex_grow;
+
}
+
return element;
+
};
+
+
auto content_renderer = Renderer([&] {
+
FlexboxConfig config;
+
config.direction = static_cast<FlexboxConfig::Direction>(direction_index);
+
config.wrap = static_cast<FlexboxConfig::Wrap>(wrap_index);
+
config.justify_content =
+
static_cast<FlexboxConfig::JustifyContent>(justify_content_index);
+
config.align_items =
+
static_cast<FlexboxConfig::AlignItems>(align_items_index);
+
config.align_content =
+
static_cast<FlexboxConfig::AlignContent>(align_content_index);
+
+
auto group = flexbox(
+
{
+
make_box(8, 4, 0),
+
make_box(9, 6, 1),
+
make_box(11, 6, 2),
+
make_box(10, 4, 3),
+
make_box(13, 7, 4),
+
make_box(12, 4, 5),
+
make_box(12, 5, 6),
+
make_box(10, 4, 7),
+
make_box(12, 4, 8),
+
make_box(10, 5, 9),
+
},
+
config);
+
+
group = group | bgcolor(Color::Black);
+
+
group = group | notflex;
+
+
if (!group_xflex_grow) {
+
group = hbox(group, filler());
+
}
+
if (!group_yflex_grow) {
+
group = vbox(group, filler());
+
}
+
+
group = group | flex;
+
return group;
+
});
+
+
auto center = FlexboxConfig()
+
.Set(FlexboxConfig::JustifyContent::Center)
+
.Set(FlexboxConfig::AlignContent::Center);
+
int space_right = 10;
+
int space_bottom = 1;
+
content_renderer = ResizableSplitRight(
+
Renderer([&] { return flexbox({text("resizable")}, center); }),
+
content_renderer, &space_right);
+
content_renderer = ResizableSplitBottom(
+
Renderer([&] { return flexbox({text("resizable")}, center); }),
+
content_renderer, &space_bottom);
+
+
auto main_container = Container::Vertical({
+
Container::Horizontal({
+
radiobox_direction,
+
radiobox_wrap,
+
Container::Vertical({
+
checkbox_element_xflex_grow,
+
checkbox_element_yflex_grow,
+
checkbox_group_xflex_grow,
+
checkbox_group_yflex_grow,
+
}),
+
}),
+
Container::Horizontal({
+
radiobox_justify_content,
+
radiobox_align_items,
+
radiobox_align_content,
+
}),
+
content_renderer,
+
});
+
+
auto main_renderer = Renderer(main_container, [&] {
+
return vbox({
+
vbox({hbox({
+
window(text("FlexboxConfig::Direction"),
+
radiobox_direction->Render()),
+
window(text("FlexboxConfig::Wrap"), radiobox_wrap->Render()),
+
window(text("Misc:"),
+
vbox({
+
checkbox_element_xflex_grow->Render(),
+
checkbox_element_yflex_grow->Render(),
+
checkbox_group_xflex_grow->Render(),
+
checkbox_group_yflex_grow->Render(),
+
})),
+
}),
+
hbox({
+
window(text("FlexboxConfig::JustifyContent"),
+
radiobox_justify_content->Render()),
+
window(text("FlexboxConfig::AlignItems"),
+
radiobox_align_items->Render()),
+
window(text("FlexboxConfig::AlignContent"),
+
radiobox_align_content->Render()),
+
})}),
+
content_renderer->Render() | flex | border,
+
});
+
});
+
+
screen.Loop(main_renderer);
+
+
return 0;
+
}
+ + + + + + +
Element make_box(int x, int y)
+ + + + + + + + + +
JustifyContent justify_content
+ +
FlexboxConfig & Set(FlexboxConfig::Direction)
Set the flexbox direction.
+
FlexboxConfig is a configuration structure that defines the layout properties for a flexbox container...
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/examples_2component_2focus_8cpp-example.html b/examples_2component_2focus_8cpp-example.html new file mode 100644 index 000000000..128f0a109 --- /dev/null +++ b/examples_2component_2focus_8cpp-example.html @@ -0,0 +1,288 @@ + + + + + + + + +FTXUI: examples/component/focus.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/focus.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <memory> // for allocator, shared_ptr, __shared_ptr_access
+
#include <string> // for operator+, char_traits, to_string, string
+
#include <vector> // for vector
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Slider, Renderer, Vertical
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for Elements, Element, operator|, separator, text, focusPositionRelative, size, border, flex, frame, bgcolor, gridbox, vbox, EQUAL, center, HEIGHT, WIDTH
+
#include "ftxui/screen/color.hpp" // for Color
+
+
using namespace ftxui;
+
+
Element make_box(int x, int y) {
+
std::string title = "(" + std::to_string(x) + ", " + std::to_string(y) + ")";
+
return text(title) | center | size(WIDTH, EQUAL, 18) |
+
size(HEIGHT, EQUAL, 9) | border |
+
bgcolor(Color::HSV(x * 255 / 15, 255, y * 255 / 15));
+
};
+
+ +
std::vector<Elements> rows;
+
for (int i = 0; i < 15; i++) {
+
std::vector<Element> cols;
+
for (int j = 0; j < 15; j++) {
+
cols.push_back(make_box(i, j));
+
}
+
rows.push_back(cols);
+
}
+
+
return gridbox(rows);
+
};
+
+
int main() {
+
float focus_x = 0.5f;
+
float focus_y = 0.5f;
+
+
auto slider_x = Slider("x", &focus_x, 0.f, 1.f, 0.01f);
+
auto slider_y = Slider("y", &focus_y, 0.f, 1.f, 0.01f);
+
+
auto renderer = Renderer(
+
Container::Vertical({
+
slider_x,
+
slider_y,
+
}),
+
[&] {
+
auto title = "focusPositionRelative(" + //
+
std::to_string(focus_x) + ", " + //
+
std::to_string(focus_y) + ")"; //
+
return vbox({
+
text(title),
+
separator(),
+
slider_x->Render(),
+
slider_y->Render(),
+
separator(),
+
make_grid() | focusPositionRelative(focus_x, focus_y) |
+
frame | flex,
+
}) |
+
border;
+
});
+
+
auto screen = ScreenInteractive::Fullscreen();
+
screen.Loop(renderer);
+
+
return 0;
+
}
+ + + + + + +
Element make_grid()
+
Element make_box(int x, int y)
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+ +
+
+ + + + + diff --git a/examples_2component_2focus_8cpp.html b/examples_2component_2focus_8cpp.html new file mode 100644 index 000000000..cca7ae4ca --- /dev/null +++ b/examples_2component_2focus_8cpp.html @@ -0,0 +1,289 @@ + + + + + + + + +FTXUI: focus.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
focus.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + + + +

+Functions

Element make_box (int x, int y)
 
Element make_grid ()
 
int main ()
 
+

Function Documentation

+ +

◆ make_box()

+ + + +

◆ make_grid()

+ +
+
+ + + + + + + +
Element make_grid ()
+
+
Examples
examples/component/focus.cpp.
+
+ +

Definition at line 24 of file examples/component/focus.cpp.

+ +
+
+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 37 of file examples/component/focus.cpp.

+ +
+
+
+
+ + + + + diff --git a/examples_2component_2focus_8cpp.js b/examples_2component_2focus_8cpp.js new file mode 100644 index 000000000..863606792 --- /dev/null +++ b/examples_2component_2focus_8cpp.js @@ -0,0 +1,6 @@ +var examples_2component_2focus_8cpp = +[ + [ "make_box", "examples_2component_2focus_8cpp.html#a9ffb8a33ec5d0133f63f791d526df1c7", null ], + [ "make_grid", "examples_2component_2focus_8cpp.html#a9543e1b98f00db8484ee0c856a1d4cca", null ], + [ "main", "examples_2component_2focus_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/examples_2component_2focus_8cpp_source.html b/examples_2component_2focus_8cpp_source.html new file mode 100644 index 000000000..b0fab78b9 --- /dev/null +++ b/examples_2component_2focus_8cpp_source.html @@ -0,0 +1,311 @@ + + + + + + + + +FTXUI: focus.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/focus.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <memory> // for allocator, shared_ptr, __shared_ptr_access
+
5#include <string> // for operator+, char_traits, to_string, string
+
6#include <vector> // for vector
+
7
+
8#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
9#include "ftxui/component/component.hpp" // for Slider, Renderer, Vertical
+
10#include "ftxui/component/component_base.hpp" // for ComponentBase
+
11#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
12#include "ftxui/dom/elements.hpp" // for Elements, Element, operator|, separator, text, focusPositionRelative, size, border, flex, frame, bgcolor, gridbox, vbox, EQUAL, center, HEIGHT, WIDTH
+
13#include "ftxui/screen/color.hpp" // for Color
+
14
+
15using namespace ftxui;
+
16
+
+
17Element make_box(int x, int y) {
+
18 std::string title = "(" + std::to_string(x) + ", " + std::to_string(y) + ")";
+
19 return text(title) | center | size(WIDTH, EQUAL, 18) |
+
20 size(HEIGHT, EQUAL, 9) | border |
+
21 bgcolor(Color::HSV(x * 255 / 15, 255, y * 255 / 15));
+
22};
+
+
23
+
+ +
25 std::vector<Elements> rows;
+
26 for (int i = 0; i < 15; i++) {
+
27 std::vector<Element> cols;
+
28 for (int j = 0; j < 15; j++) {
+
29 cols.push_back(make_box(i, j));
+
30 }
+
31 rows.push_back(cols);
+
32 }
+
33
+
34 return gridbox(rows);
+
35};
+
+
36
+
+
37int main() {
+
38 float focus_x = 0.5f;
+
39 float focus_y = 0.5f;
+
40
+
41 auto slider_x = Slider("x", &focus_x, 0.f, 1.f, 0.01f);
+
42 auto slider_y = Slider("y", &focus_y, 0.f, 1.f, 0.01f);
+
43
+
44 auto renderer = Renderer(
+
45 Container::Vertical({
+
46 slider_x,
+
47 slider_y,
+
48 }),
+
49 [&] {
+
50 auto title = "focusPositionRelative(" + //
+
51 std::to_string(focus_x) + ", " + //
+
52 std::to_string(focus_y) + ")"; //
+
53 return vbox({
+
54 text(title),
+
55 separator(),
+
56 slider_x->Render(),
+
57 slider_y->Render(),
+
58 separator(),
+
59 make_grid() | focusPositionRelative(focus_x, focus_y) |
+
60 frame | flex,
+
61 }) |
+
62 border;
+
63 });
+
64
+
65 auto screen = ScreenInteractive::Fullscreen();
+
66 screen.Loop(renderer);
+
67
+
68 return 0;
+
69}
+
+ + + + + +
Element make_grid()
+
Element make_box(int x, int y)
+ +
static ScreenInteractive Fullscreen()
+
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
+
virtual void Render(Screen &screen)
Display an element on a ftxui::Screen.
Definition node.cpp:59
+
Decorator bgcolor(Color)
Decorate using a background color.
+
Decorator focusPositionRelative(float x, float y)
Used inside a frame, this force the view to be scrolled toward a a given position....
+
Decorator size(WidthOrHeight, Constraint, int value)
Apply a constraint on the size of an element.
+
Element flex(Element)
Make a child element to expand proportionally to the space left in a container.
Definition flex.cpp:123
+
Element text(std::wstring text)
Display a piece of unicode text.
Definition text.cpp:160
+
Element separator()
Draw a vertical or horizontal separation in between two other elements.
+
Element vbox(Elements)
A container displaying elements vertically one by one.
Definition vbox.cpp:96
+
static Color HSV(uint8_t hue, uint8_t saturation, uint8_t value)
Build a Color from its HSV representation. https://en.wikipedia.org/wiki/HSL_and_HSV.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
std::shared_ptr< Node > Element
Definition elements.hpp:22
+
Component Slider(SliderOption< T > options)
A slider in any direction.
+
Element gridbox(std::vector< Elements > lines)
A container displaying a grid of elements.
+ + +
+
+ + + + + diff --git a/examples_2component_2focus_cursor_8cpp-example.html b/examples_2component_2focus_cursor_8cpp-example.html new file mode 100644 index 000000000..fbddec9e1 --- /dev/null +++ b/examples_2component_2focus_cursor_8cpp-example.html @@ -0,0 +1,254 @@ + + + + + + + + +FTXUI: examples/component/focus_cursor.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/focus_cursor.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <ftxui/component/captured_mouse.hpp> // for ftxui
+
#include <string> // for allocator, operator+, char_traits, string
+
+
#include "ftxui/component/component.hpp" // for Renderer, Vertical
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive, Component
+
#include "ftxui/dom/elements.hpp" // for text, Decorator, focus, focusCursorBar, focusCursorBarBlinking, focusCursorBlock, focusCursorBlockBlinking, focusCursorUnderline, focusCursorUnderlineBlinking, hbox, Element
+
+
using namespace ftxui;
+
+
Component Instance(std::string label, Decorator focusCursor) {
+
return Renderer([=](bool focused) {
+
if (focused) {
+
return hbox({
+
text("> " + label + " "),
+
focusCursor(text(" ")),
+
});
+
}
+
return text(" " + label + " ");
+
});
+
};
+
+
int main() {
+
auto screen = ScreenInteractive::Fullscreen();
+
screen.Loop(Container::Vertical({
+
Instance("focus", focus),
+
Instance("focusCursorBlock", focusCursorBlock),
+
Instance("focusCursorBlockBlinking", focusCursorBlockBlinking),
+
Instance("focusCursorBar", focusCursorBar),
+
Instance("focusCursorBarBlinking", focusCursorBarBlinking),
+
Instance("focusCursorUnderline", focusCursorUnderline),
+
Instance("focusCursorUnderlineBlinking", focusCursorUnderlineBlinking),
+
}));
+
return 0;
+
}
+ + + + +
Component Instance(std::string label, Decorator focusCursor)
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::function< Element(Element)> Decorator
Definition elements.hpp:24
+
std::shared_ptr< ComponentBase > Component
+ +
+
+ + + + + diff --git a/examples_2component_2gallery_8cpp-example.html b/examples_2component_2gallery_8cpp-example.html new file mode 100644 index 000000000..fdcb0efe3 --- /dev/null +++ b/examples_2component_2gallery_8cpp-example.html @@ -0,0 +1,371 @@ + + + + + + + + +FTXUI: examples/component/gallery.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/gallery.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <functional> // for function
+
#include <memory> // for shared_ptr, allocator, __shared_ptr_access
+
#include <string> // for string, basic_string
+
#include <vector> // for vector
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Slider, Checkbox, Vertical, Renderer, Button, Input, Menu, Radiobox, Toggle
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for separator, operator|, Element, size, xflex, text, WIDTH, hbox, vbox, EQUAL, border, GREATER_THAN
+
+
using namespace ftxui;
+
+
// Display a component nicely with a title on the left.
+
Component Wrap(std::string name, Component component) {
+
return Renderer(component, [name, component] {
+
return hbox({
+
text(name) | size(WIDTH, EQUAL, 8),
+
separator(),
+
component->Render() | xflex,
+
}) |
+
xflex;
+
});
+
}
+
+
int main() {
+
auto screen = ScreenInteractive::FitComponent();
+
+
// -- Menu
+
// ----------------------------------------------------------------------
+
const std::vector<std::string> menu_entries = {
+
"Menu 1",
+
"Menu 2",
+
"Menu 3",
+
"Menu 4",
+
};
+
int menu_selected = 0;
+
auto menu = Menu(&menu_entries, &menu_selected);
+
menu = Wrap("Menu", menu);
+
+
// -- Toggle------------------------------------------------------------------
+
int toggle_selected = 0;
+
std::vector<std::string> toggle_entries = {
+
"Toggle_1",
+
"Toggle_2",
+
};
+
auto toggle = Toggle(&toggle_entries, &toggle_selected);
+
toggle = Wrap("Toggle", toggle);
+
+
// -- Checkbox ---------------------------------------------------------------
+
bool checkbox_1_selected = false;
+
bool checkbox_2_selected = false;
+
bool checkbox_3_selected = false;
+
bool checkbox_4_selected = false;
+
+
auto checkboxes = Container::Vertical({
+
Checkbox("checkbox1", &checkbox_1_selected),
+
Checkbox("checkbox2", &checkbox_2_selected),
+
Checkbox("checkbox3", &checkbox_3_selected),
+
Checkbox("checkbox4", &checkbox_4_selected),
+
});
+
checkboxes = Wrap("Checkbox", checkboxes);
+
+
// -- Radiobox ---------------------------------------------------------------
+
int radiobox_selected = 0;
+
std::vector<std::string> radiobox_entries = {
+
"Radiobox 1",
+
"Radiobox 2",
+
"Radiobox 3",
+
"Radiobox 4",
+
};
+
auto radiobox = Radiobox(&radiobox_entries, &radiobox_selected);
+
radiobox = Wrap("Radiobox", radiobox);
+
+
// -- Input ------------------------------------------------------------------
+
std::string input_label;
+
auto input = Input(&input_label, "placeholder");
+
input = Wrap("Input", input);
+
+
// -- Button -----------------------------------------------------------------
+
std::string button_label = "Quit";
+
std::function<void()> on_button_clicked_;
+
auto button = Button(&button_label, screen.ExitLoopClosure());
+
button = Wrap("Button", button);
+
+
// -- Slider -----------------------------------------------------------------
+
int slider_value_1 = 12;
+
int slider_value_2 = 56;
+
int slider_value_3 = 128;
+
auto sliders = Container::Vertical({
+
Slider("R:", &slider_value_1, 0, 256, 1),
+
Slider("G:", &slider_value_2, 0, 256, 1),
+
Slider("B:", &slider_value_3, 0, 256, 1),
+
});
+
sliders = Wrap("Slider", sliders);
+
+
// A large text:
+
auto lorel_ipsum = Renderer([] {
+
return vbox({
+
text("Lorem ipsum dolor sit amet, consectetur adipiscing elit. "),
+
text("Sed do eiusmod tempor incididunt ut labore et dolore magna "
+
"aliqua. "),
+
text("Ut enim ad minim veniam, quis nostrud exercitation ullamco "
+
"laboris nisi ut aliquip ex ea commodo consequat. "),
+
text("Duis aute irure dolor in reprehenderit in voluptate velit esse "
+
"cillum dolore eu fugiat nulla pariatur. "),
+
text("Excepteur sint occaecat cupidatat non proident, sunt in culpa "
+
"qui officia deserunt mollit anim id est laborum. "),
+
+
});
+
});
+
lorel_ipsum = Wrap("Lorel Ipsum", lorel_ipsum);
+
+
// -- Layout
+
// -----------------------------------------------------------------
+
auto layout = Container::Vertical({
+
menu,
+
toggle,
+
checkboxes,
+
radiobox,
+
input,
+
sliders,
+
button,
+
lorel_ipsum,
+
});
+
+
auto component = Renderer(layout, [&] {
+
return vbox({
+
menu->Render(),
+
separator(),
+
toggle->Render(),
+
separator(),
+
checkboxes->Render(),
+
separator(),
+
radiobox->Render(),
+
separator(),
+
input->Render(),
+
separator(),
+
sliders->Render(),
+
separator(),
+
button->Render(),
+
separator(),
+
lorel_ipsum->Render(),
+
}) |
+
xflex | size(WIDTH, GREATER_THAN, 40) | border;
+
});
+
+
screen.Loop(component);
+
+
return 0;
+
}
+ + + + + +
Component Wrap(std::string name, Component component)
Definition gallery.cpp:18
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< ComponentBase > Component
+ +
+
+ + + + + diff --git a/examples_2component_2homescreen_8cpp-example.html b/examples_2component_2homescreen_8cpp-example.html new file mode 100644 index 000000000..a1f4f63fd --- /dev/null +++ b/examples_2component_2homescreen_8cpp-example.html @@ -0,0 +1,763 @@ + + + + + + + + +FTXUI: examples/component/homescreen.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/homescreen.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <stddef.h> // for size_t
+
#include <array> // for array
+
#include <atomic> // for atomic
+
#include <chrono> // for operator""s, chrono_literals
+
#include <cmath> // for sin
+ +
#include <functional> // for ref, reference_wrapper, function
+
#include <memory> // for allocator, shared_ptr, __shared_ptr_access
+
#include <string> // for string, basic_string, char_traits, operator+, to_string
+
#include <thread> // for sleep_for, thread
+
#include <utility> // for move
+
#include <vector> // for vector
+
+
#include "../dom/color_info_sorted_2d.ipp" // for ColorInfoSorted2D
+
#include "ftxui/component/component.hpp" // for Checkbox, Renderer, Horizontal, Vertical, Input, Menu, Radiobox, ResizableSplitLeft, Tab
+
#include "ftxui/component/component_base.hpp" // for ComponentBase, Component
+
#include "ftxui/component/component_options.hpp" // for MenuOption, InputOption
+
#include "ftxui/component/event.hpp" // for Event, Event::Custom
+
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for text, color, operator|, bgcolor, filler, Element, vbox, size, hbox, separator, flex, window, graph, EQUAL, paragraph, WIDTH, hcenter, Elements, bold, vscroll_indicator, HEIGHT, flexbox, hflow, border, frame, flex_grow, gauge, paragraphAlignCenter, paragraphAlignJustify, paragraphAlignLeft, paragraphAlignRight, dim, spinner, LESS_THAN, center, yframe, GREATER_THAN
+
#include "ftxui/dom/flexbox_config.hpp" // for FlexboxConfig
+
#include "ftxui/screen/color.hpp" // for Color, Color::BlueLight, Color::RedLight, Color::Black, Color::Blue, Color::Cyan, Color::CyanLight, Color::GrayDark, Color::GrayLight, Color::Green, Color::GreenLight, Color::Magenta, Color::MagentaLight, Color::Red, Color::White, Color::Yellow, Color::YellowLight, Color::Default, Color::Palette256, ftxui
+
#include "ftxui/screen/color_info.hpp" // for ColorInfo
+
#include "ftxui/screen/terminal.hpp" // for Size, Dimensions
+
+
using namespace ftxui;
+
+
int main() {
+
auto screen = ScreenInteractive::Fullscreen();
+
+
// ---------------------------------------------------------------------------
+
// HTOP
+
// ---------------------------------------------------------------------------
+
int shift = 0;
+
+
auto my_graph = [&shift](int width, int height) {
+
std::vector<int> output(width);
+
for (int i = 0; i < width; ++i) {
+
float v = 0.5f;
+
v += 0.1f * sin((i + shift) * 0.1f);
+
v += 0.2f * sin((i + shift + 10) * 0.15f);
+
v += 0.1f * sin((i + shift) * 0.03f);
+
v *= height;
+
output[i] = (int)v;
+
}
+
return output;
+
};
+
+
auto htop = Renderer([&] {
+
auto frequency = vbox({
+
text("Frequency [Mhz]") | hcenter,
+
hbox({
+
vbox({
+
text("2400 "),
+
filler(),
+
text("1200 "),
+
filler(),
+
text("0 "),
+
}),
+
graph(std::ref(my_graph)) | flex,
+
}) | flex,
+
});
+
+
auto utilization = vbox({
+
text("Utilization [%]") | hcenter,
+
hbox({
+
vbox({
+
text("100 "),
+
filler(),
+
text("50 "),
+
filler(),
+
text("0 "),
+
}),
+
graph(std::ref(my_graph)) | color(Color::RedLight),
+
}) | flex,
+
});
+
+
auto ram = vbox({
+
text("Ram [Mo]") | hcenter,
+
hbox({
+
vbox({
+
text("8192"),
+
filler(),
+
text("4096 "),
+
filler(),
+
text("0 "),
+
}),
+
graph(std::ref(my_graph)) | color(Color::BlueLight),
+
}) | flex,
+
});
+
+
return hbox({
+
vbox({
+
frequency | flex,
+
separator(),
+
utilization | flex,
+
}) | flex,
+
separator(),
+
ram | flex,
+
}) |
+
flex;
+
});
+
+
// ---------------------------------------------------------------------------
+
// Compiler
+
// ---------------------------------------------------------------------------
+
+
const std::vector<std::string> compiler_entries = {
+
"gcc",
+
"clang",
+
"emcc",
+
"game_maker",
+
"Ada compilers",
+
"ALGOL 60 compilers",
+
"ALGOL 68 compilers",
+
"Assemblers (Intel *86)",
+
"Assemblers (Motorola 68*)",
+
"Assemblers (Zilog Z80)",
+
"Assemblers (other)",
+
"BASIC Compilers",
+
"BASIC interpreters",
+
"Batch compilers",
+
"C compilers",
+
"Source-to-source compilers",
+
"C++ compilers",
+
"C# compilers",
+
"COBOL compilers",
+
"Common Lisp compilers",
+
"D compilers",
+
"DIBOL/DBL compilers",
+
"ECMAScript interpreters",
+
"Eiffel compilers",
+
"Fortran compilers",
+
"Go compilers",
+
"Haskell compilers",
+
"Java compilers",
+
"Pascal compilers",
+
"Perl Interpreters",
+
"PHP compilers",
+
"PL/I compilers",
+
"Python compilers",
+
"Scheme compilers and interpreters",
+
"Smalltalk compilers",
+
"Tcl Interpreters",
+
"VMS Interpreters",
+
"Rexx Interpreters",
+
"CLI compilers",
+
};
+
+
int compiler_selected = 0;
+
Component compiler = Radiobox(&compiler_entries, &compiler_selected);
+
+
std::array<std::string, 8> options_label = {
+
"-Wall",
+
"-Werror",
+
"-lpthread",
+
"-O3",
+
"-Wabi-tag",
+
"-Wno-class-conversion",
+
"-Wcomma-subscript",
+
"-Wno-conversion-null",
+
};
+
std::array<bool, 8> options_state = {
+
false, false, false, false, false, false, false, false,
+
};
+
+
std::vector<std::string> input_entries;
+
int input_selected = 0;
+
Component input = Menu(&input_entries, &input_selected);
+
+
auto input_option = InputOption();
+
std::string input_add_content;
+
input_option.on_enter = [&] {
+
input_entries.push_back(input_add_content);
+
input_add_content = "";
+
};
+
Component input_add = Input(&input_add_content, "input files", input_option);
+
+
std::string executable_content_ = "";
+
Component executable_ = Input(&executable_content_, "executable");
+
+
Component flags = Container::Vertical({
+
Checkbox(&options_label[0], &options_state[0]),
+
Checkbox(&options_label[1], &options_state[1]),
+
Checkbox(&options_label[2], &options_state[2]),
+
Checkbox(&options_label[3], &options_state[3]),
+
Checkbox(&options_label[4], &options_state[4]),
+
Checkbox(&options_label[5], &options_state[5]),
+
Checkbox(&options_label[6], &options_state[6]),
+
Checkbox(&options_label[7], &options_state[7]),
+
});
+
+
auto compiler_component = Container::Horizontal({
+
compiler,
+
flags,
+
Container::Vertical({
+
executable_,
+
Container::Horizontal({
+
input_add,
+
input,
+
}),
+
}),
+
});
+
+
auto render_command = [&] {
+
Elements line;
+
// Compiler
+
line.push_back(text(compiler_entries[compiler_selected]) | bold);
+
// flags
+
for (int i = 0; i < 8; ++i) {
+
if (options_state[i]) {
+
line.push_back(text(" "));
+
line.push_back(text(options_label[i]) | dim);
+
}
+
}
+
// Executable
+
if (!executable_content_.empty()) {
+
line.push_back(text(" -o ") | bold);
+
line.push_back(text(executable_content_) | color(Color::BlueLight) |
+
bold);
+
}
+
// Input
+
for (auto& it : input_entries) {
+
line.push_back(text(" " + it) | color(Color::RedLight));
+
}
+
return line;
+
};
+
+
auto compiler_renderer = Renderer(compiler_component, [&] {
+
auto compiler_win = window(text("Compiler"),
+
compiler->Render() | vscroll_indicator | frame);
+
auto flags_win =
+
window(text("Flags"), flags->Render() | vscroll_indicator | frame);
+
auto executable_win = window(text("Executable:"), executable_->Render());
+
auto input_win =
+
window(text("Input"), hbox({
+
vbox({
+
hbox({
+
text("Add: "),
+
input_add->Render(),
+
}) | size(WIDTH, EQUAL, 20) |
+
size(HEIGHT, EQUAL, 1),
+
filler(),
+
}),
+
separator(),
+
input->Render() | vscroll_indicator | frame |
+
size(HEIGHT, EQUAL, 3) | flex,
+
}));
+
return vbox({
+
hbox({
+
compiler_win,
+
flags_win,
+
vbox({
+
executable_win | size(WIDTH, EQUAL, 20),
+
input_win | size(WIDTH, EQUAL, 60),
+
}),
+
filler(),
+
}) | size(HEIGHT, LESS_THAN, 8),
+
hflow(render_command()) | flex_grow,
+
}) |
+
flex_grow;
+
});
+
+
// ---------------------------------------------------------------------------
+
// Spinner
+
// ---------------------------------------------------------------------------
+
auto spinner_tab_renderer = Renderer([&] {
+
Elements entries;
+
for (int i = 0; i < 22; ++i) {
+
entries.push_back(spinner(i, shift / 5) | bold |
+
size(WIDTH, GREATER_THAN, 2) | border);
+
}
+
return hflow(std::move(entries));
+
});
+
+
// ---------------------------------------------------------------------------
+
// Colors
+
// ---------------------------------------------------------------------------
+
auto color_tab_renderer = Renderer([] {
+
auto basic_color_display =
+
vbox({
+
text("16 color palette:"),
+
separator(),
+
hbox({
+
vbox({
+
color(Color::Default, text("Default")),
+
color(Color::Black, text("Black")),
+
color(Color::GrayDark, text("GrayDark")),
+
color(Color::GrayLight, text("GrayLight")),
+
color(Color::White, text("White")),
+
color(Color::Blue, text("Blue")),
+
color(Color::BlueLight, text("BlueLight")),
+
color(Color::Cyan, text("Cyan")),
+
color(Color::CyanLight, text("CyanLight")),
+
color(Color::Green, text("Green")),
+
color(Color::GreenLight, text("GreenLight")),
+
color(Color::Magenta, text("Magenta")),
+
color(Color::MagentaLight, text("MagentaLight")),
+
color(Color::Red, text("Red")),
+
color(Color::RedLight, text("RedLight")),
+
color(Color::Yellow, text("Yellow")),
+
color(Color::YellowLight, text("YellowLight")),
+
}),
+
vbox({
+
bgcolor(Color::Default, text("Default")),
+
bgcolor(Color::Black, text("Black")),
+
bgcolor(Color::GrayDark, text("GrayDark")),
+
bgcolor(Color::GrayLight, text("GrayLight")),
+
bgcolor(Color::White, text("White")),
+
bgcolor(Color::Blue, text("Blue")),
+
bgcolor(Color::BlueLight, text("BlueLight")),
+
bgcolor(Color::Cyan, text("Cyan")),
+
bgcolor(Color::CyanLight, text("CyanLight")),
+
bgcolor(Color::Green, text("Green")),
+
bgcolor(Color::GreenLight, text("GreenLight")),
+
bgcolor(Color::Magenta, text("Magenta")),
+
bgcolor(Color::MagentaLight, text("MagentaLight")),
+
bgcolor(Color::Red, text("Red")),
+
bgcolor(Color::RedLight, text("RedLight")),
+
bgcolor(Color::Yellow, text("Yellow")),
+
bgcolor(Color::YellowLight, text("YellowLight")),
+
}),
+
}),
+
}) |
+
border;
+
+
auto palette_256_color_display = text("256 colors palette:");
+
{
+
std::vector<std::vector<ColorInfo>> info_columns = ColorInfoSorted2D();
+
Elements columns;
+
for (auto& column : info_columns) {
+
Elements column_elements;
+
for (auto& it : column) {
+
column_elements.push_back(
+
text(" ") | bgcolor(Color(Color::Palette256(it.index_256))));
+
}
+
columns.push_back(hbox(std::move(column_elements)));
+
}
+
palette_256_color_display = vbox({
+
palette_256_color_display,
+
separator(),
+
vbox(columns),
+
}) |
+
border;
+
}
+
+
// True color display.
+
auto true_color_display = text("TrueColors: 24bits:");
+
{
+
int saturation = 255;
+
Elements array;
+
for (int value = 0; value < 255; value += 16) {
+
Elements line;
+
for (int hue = 0; hue < 255; hue += 6) {
+
line.push_back(text("▀") //
+
| color(Color::HSV(hue, saturation, value)) //
+
| bgcolor(Color::HSV(hue, saturation, value + 8)));
+
}
+
array.push_back(hbox(std::move(line)));
+
}
+
true_color_display = vbox({
+
true_color_display,
+
separator(),
+
vbox(std::move(array)),
+
}) |
+
border;
+
}
+
+
return flexbox(
+
{
+
basic_color_display,
+
palette_256_color_display,
+
true_color_display,
+
},
+ +
});
+
+
// ---------------------------------------------------------------------------
+
// Gauges
+
// ---------------------------------------------------------------------------
+
auto render_gauge = [&shift](int delta) {
+
float progress = (shift + delta) % 500 / 500.f;
+
return hbox({
+
text(std::to_string(int(progress * 100)) + "% ") |
+
size(WIDTH, EQUAL, 5),
+
gauge(progress),
+
});
+
};
+
+
auto gauge_component = Renderer([render_gauge] {
+
return vbox({
+
render_gauge(0) | color(Color::Black),
+
render_gauge(100) | color(Color::GrayDark),
+
render_gauge(50) | color(Color::GrayLight),
+
render_gauge(6894) | color(Color::White),
+
separator(),
+
render_gauge(6841) | color(Color::Blue),
+
render_gauge(9813) | color(Color::BlueLight),
+
render_gauge(98765) | color(Color::Cyan),
+
render_gauge(98) | color(Color::CyanLight),
+
render_gauge(9846) | color(Color::Green),
+
render_gauge(1122) | color(Color::GreenLight),
+
render_gauge(84) | color(Color::Magenta),
+
render_gauge(645) | color(Color::MagentaLight),
+
render_gauge(568) | color(Color::Red),
+
render_gauge(2222) | color(Color::RedLight),
+
render_gauge(220) | color(Color::Yellow),
+
render_gauge(348) | color(Color::YellowLight),
+
});
+
});
+
+
// ---------------------------------------------------------------------------
+
// Paragraph
+
// ---------------------------------------------------------------------------
+
auto make_box = [](size_t dimx, size_t dimy) {
+
std::string title = std::to_string(dimx) + "x" + std::to_string(dimy);
+
return window(text(title) | hcenter | bold,
+
text("content") | hcenter | dim) |
+
size(WIDTH, EQUAL, dimx) | size(HEIGHT, EQUAL, dimy);
+
};
+
+
auto paragraph_renderer_left = Renderer([&] {
+
std::string str =
+
"Lorem Ipsum is simply dummy text of the printing and typesetting "
+
"industry.\nLorem Ipsum has been the industry's standard dummy text "
+
"ever since the 1500s, when an unknown printer took a galley of type "
+
"and scrambled it to make a type specimen book.";
+
return vbox({
+
window(text("Align left:"), paragraphAlignLeft(str)),
+
window(text("Align center:"), paragraphAlignCenter(str)),
+
window(text("Align right:"), paragraphAlignRight(str)),
+
window(text("Align justify:"), paragraphAlignJustify(str)),
+
window(text("Side by side"), hbox({
+
paragraph(str),
+
separator(),
+
paragraph(str),
+
})),
+
window(text("Elements with different size:"),
+
flexbox({
+
make_box(10, 5),
+
make_box(9, 4),
+
make_box(8, 4),
+
make_box(6, 3),
+
make_box(10, 5),
+
make_box(9, 4),
+
make_box(8, 4),
+
make_box(6, 3),
+
make_box(10, 5),
+
make_box(9, 4),
+
make_box(8, 4),
+
make_box(6, 3),
+
})),
+
}) |
+
vscroll_indicator | yframe | flex;
+
});
+
+
auto paragraph_renderer_right = Renderer([] {
+
return paragraph("<--- This vertical bar is resizable using the mouse") |
+
center;
+
});
+
+
int paragraph_renderer_split_position = Terminal::Size().dimx / 2;
+
auto paragraph_renderer_group =
+
ResizableSplitLeft(paragraph_renderer_left, paragraph_renderer_right,
+
&paragraph_renderer_split_position);
+
auto paragraph_renderer_group_renderer =
+
Renderer(paragraph_renderer_group,
+
[&] { return paragraph_renderer_group->Render(); });
+
+
// ---------------------------------------------------------------------------
+
// Tabs
+
// ---------------------------------------------------------------------------
+
+
int tab_index = 0;
+
std::vector<std::string> tab_entries = {
+
"htop", "color", "spinner", "gauge", "compiler", "paragraph",
+
};
+
auto tab_selection =
+
Menu(&tab_entries, &tab_index, MenuOption::HorizontalAnimated());
+
auto tab_content = Container::Tab(
+
{
+
htop,
+
color_tab_renderer,
+
spinner_tab_renderer,
+
gauge_component,
+
compiler_renderer,
+
paragraph_renderer_group_renderer,
+
},
+
&tab_index);
+
+
auto exit_button =
+
Button("Exit", [&] { screen.Exit(); }, ButtonOption::Animated());
+
+
auto main_container = Container::Vertical({
+
Container::Horizontal({
+
tab_selection,
+
exit_button,
+
}),
+
tab_content,
+
});
+
+
auto main_renderer = Renderer(main_container, [&] {
+
return vbox({
+
text("FTXUI Demo") | bold | hcenter,
+
hbox({
+
tab_selection->Render() | flex,
+
exit_button->Render(),
+
}),
+
tab_content->Render() | flex,
+
});
+
});
+
+
Loop loop(&screen, main_renderer);
+
while (!loop.HasQuitted()) {
+
// Update the state of the application.
+
shift++;
+
+
// Request a new frame to be drawn.
+
screen.RequestAnimationFrame();
+
+
// Execute events, and draw the next frame.
+
loop.RunOnce();
+
+
// Sleep for a short duration to control the frame rate (60 FPS).
+
std::this_thread::sleep_for(std::chrono::milliseconds(1000 / 60));
+
}
+
+
return 0;
+
}
+ + +
std::vector< std::vector< ftxui::ColorInfo > > ColorInfoSorted2D()
+ + + + + + +
Element make_box(int x, int y)
+ +
Loop is a class that manages the event loop for a component.
Definition loop.hpp:56
+
Option for the Input component.
+
FlexboxConfig & SetGap(int gap_x, int gap_y)
Set the flexbox flex direction.
+
FlexboxConfig is a configuration structure that defines the layout properties for a flexbox container...
+ +
Color is a class that represents a color in the terminal user interface.
Definition color.hpp:22
+ +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::vector< Element > Elements
Definition elements.hpp:23
+
std::shared_ptr< ComponentBase > Component
+ + +
+
+ + + + + diff --git a/examples_2component_2input_8cpp-example.html b/examples_2component_2input_8cpp-example.html new file mode 100644 index 000000000..2a947e33a --- /dev/null +++ b/examples_2component_2input_8cpp-example.html @@ -0,0 +1,290 @@ + + + + + + + + +FTXUI: examples/component/input.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/input.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <memory> // for allocator, __shared_ptr_access
+
#include <string> // for char_traits, operator+, string, basic_string
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Input, Renderer, Vertical
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/component_options.hpp" // for InputOption
+
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for text, hbox, separator, Element, operator|, vbox, border
+
#include "ftxui/util/ref.hpp" // for Ref
+
+
int main() {
+
using namespace ftxui;
+
+
// The data:
+
std::string first_name;
+
std::string last_name;
+
std::string password;
+
std::string phoneNumber;
+
+
// The basic input components:
+
Component input_first_name = Input(&first_name, "first name");
+
Component input_last_name = Input(&last_name, "last name");
+
+
// The password input component:
+
InputOption password_option;
+
password_option.password = true;
+
Component input_password = Input(&password, "password", password_option);
+
+
// The phone number input component:
+
// We are using `CatchEvent` to filter out non-digit characters.
+
Component input_phone_number = Input(&phoneNumber, "phone number");
+
input_phone_number |= CatchEvent([&](Event event) {
+
return event.is_character() && !std::isdigit(event.character()[0]);
+
});
+
input_phone_number |= CatchEvent([&](Event event) {
+
return event.is_character() && phoneNumber.size() > 10;
+
});
+
+
// The component tree:
+
auto component = Container::Vertical({
+
input_first_name,
+
input_last_name,
+
input_password,
+
input_phone_number,
+
});
+
+
// Tweak how the component tree is rendered:
+
auto renderer = Renderer(component, [&] {
+
return vbox({
+
hbox(text(" First name : "), input_first_name->Render()),
+
hbox(text(" Last name : "), input_last_name->Render()),
+
hbox(text(" Password : "), input_password->Render()),
+
hbox(text(" Phone num : "), input_phone_number->Render()),
+
separator(),
+
text("Hello " + first_name + " " + last_name),
+
text("Your password is " + password),
+
text("Your phone number is " + phoneNumber),
+
}) |
+
border;
+
});
+
+
auto screen = ScreenInteractive::TerminalOutput();
+
screen.Loop(renderer);
+
}
+ + + + + + +
std::string character() const
Definition event.hpp:107
+
Ref< bool > password
Obscure the input content using '*'.
+
Represent an event. It can be key press event, a terminal resize, or more ...
Definition event.hpp:29
+
Option for the Input component.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< ComponentBase > Component
+ + +
+
+ + + + + diff --git a/examples_2component_2input_8cpp.html b/examples_2component_2input_8cpp.html new file mode 100644 index 000000000..67c784cf7 --- /dev/null +++ b/examples_2component_2input_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: input.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
input.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 15 of file examples/component/input.cpp.

+ +
+
+
+
+ + + + + diff --git a/examples_2component_2input_8cpp.js b/examples_2component_2input_8cpp.js new file mode 100644 index 000000000..7cd112c0e --- /dev/null +++ b/examples_2component_2input_8cpp.js @@ -0,0 +1,4 @@ +var examples_2component_2input_8cpp = +[ + [ "main", "examples_2component_2input_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/examples_2component_2input_8cpp_source.html b/examples_2component_2input_8cpp_source.html new file mode 100644 index 000000000..4e5101604 --- /dev/null +++ b/examples_2component_2input_8cpp_source.html @@ -0,0 +1,293 @@ + + + + + + + + +FTXUI: input.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/input.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <memory> // for allocator, __shared_ptr_access
+
5#include <string> // for char_traits, operator+, string, basic_string
+
6
+
7#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
8#include "ftxui/component/component.hpp" // for Input, Renderer, Vertical
+
9#include "ftxui/component/component_base.hpp" // for ComponentBase
+
10#include "ftxui/component/component_options.hpp" // for InputOption
+
11#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
+
12#include "ftxui/dom/elements.hpp" // for text, hbox, separator, Element, operator|, vbox, border
+
13#include "ftxui/util/ref.hpp" // for Ref
+
14
+
+
15int main() {
+
16 using namespace ftxui;
+
17
+
18 // The data:
+
19 std::string first_name;
+
20 std::string last_name;
+
21 std::string password;
+
22 std::string phoneNumber;
+
23
+
24 // The basic input components:
+
25 Component input_first_name = Input(&first_name, "first name");
+
26 Component input_last_name = Input(&last_name, "last name");
+
27
+
28 // The password input component:
+
29 InputOption password_option;
+
30 password_option.password = true;
+
31 Component input_password = Input(&password, "password", password_option);
+
32
+
33 // The phone number input component:
+
34 // We are using `CatchEvent` to filter out non-digit characters.
+
35 Component input_phone_number = Input(&phoneNumber, "phone number");
+
36 input_phone_number |= CatchEvent([&](Event event) {
+
37 return event.is_character() && !std::isdigit(event.character()[0]);
+
38 });
+
39 input_phone_number |= CatchEvent([&](Event event) {
+
40 return event.is_character() && phoneNumber.size() > 10;
+
41 });
+
42
+
43 // The component tree:
+
44 auto component = Container::Vertical({
+
45 input_first_name,
+
46 input_last_name,
+
47 input_password,
+
48 input_phone_number,
+
49 });
+
50
+
51 // Tweak how the component tree is rendered:
+
52 auto renderer = Renderer(component, [&] {
+
53 return vbox({
+
54 hbox(text(" First name : "), input_first_name->Render()),
+
55 hbox(text(" Last name : "), input_last_name->Render()),
+
56 hbox(text(" Password : "), input_password->Render()),
+
57 hbox(text(" Phone num : "), input_phone_number->Render()),
+
58 separator(),
+
59 text("Hello " + first_name + " " + last_name),
+
60 text("Your password is " + password),
+
61 text("Your phone number is " + phoneNumber),
+
62 }) |
+
63 border;
+
64 });
+
65
+
66 auto screen = ScreenInteractive::TerminalOutput();
+
67 screen.Loop(renderer);
+
68}
+
+ + + + + + +
std::string character() const
Definition event.hpp:107
+
Ref< bool > password
Obscure the input content using '*'.
+
Represent an event. It can be key press event, a terminal resize, or more ...
Definition event.hpp:29
+
Option for the Input component.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< ComponentBase > Component
+ + +
+
+ + + + + diff --git a/examples_2component_2input_in_frame_8cpp-example.html b/examples_2component_2input_in_frame_8cpp-example.html new file mode 100644 index 000000000..8ce8066a5 --- /dev/null +++ b/examples_2component_2input_in_frame_8cpp-example.html @@ -0,0 +1,246 @@ + + + + + + + + +FTXUI: examples/component/input_in_frame.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/input_in_frame.cpp
+
+
+
// Copyright 2021 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <memory> // for allocator, __shared_ptr_access
+
#include <string> // for string, basic_string, operator+, to_string
+
#include <vector> // for vector
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Input, Renderer, Vertical
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, vscroll_indicator, HEIGHT, LESS_THAN
+
+
int main() {
+
using namespace ftxui;
+
+
Component input_list = Container::Vertical({});
+
std::vector<std::string> items(100, "");
+
for (size_t i = 0; i < items.size(); ++i) {
+
input_list->Add(Input(&(items[i]), "placeholder " + std::to_string(i)));
+
}
+
+
auto renderer = Renderer(input_list, [&] {
+
return input_list->Render() | vscroll_indicator | frame | border |
+
size(HEIGHT, LESS_THAN, 10);
+
});
+
+
auto screen = ScreenInteractive::TerminalOutput();
+
screen.Loop(renderer);
+
}
+ + + + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< ComponentBase > Component
+ +
+
+ + + + + diff --git a/examples_2component_2input_style_8cpp-example.html b/examples_2component_2input_style_8cpp-example.html new file mode 100644 index 000000000..6ffb87df8 --- /dev/null +++ b/examples_2component_2input_style_8cpp-example.html @@ -0,0 +1,318 @@ + + + + + + + + +FTXUI: examples/component/input_style.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/input_style.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <ftxui/dom/linear_gradient.hpp> // for LinearGradient
+
#include <ftxui/screen/color.hpp> // for Color, Color::White, Color::Red, Color::Blue, Color::Black, Color::GrayDark, ftxui
+
#include <functional> // for function
+
#include <string> // for allocator, string
+
#include <utility> // for move
+
+
#include "ftxui/component/component.hpp" // for Input, Horizontal, Vertical, operator|
+
#include "ftxui/component/component_base.hpp" // for Component
+
#include "ftxui/component/component_options.hpp" // for InputState, InputOption
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for operator|=, Element, bgcolor, operator|, separatorEmpty, color, borderEmpty, separator, text, center, dim, hbox, vbox, border, borderDouble, borderRounded
+
+
int main() {
+
using namespace ftxui;
+
+
InputOption style_1 = InputOption::Default();
+
+
InputOption style_2 = InputOption::Spacious();
+
+
InputOption style_3 = InputOption::Spacious();
+
style_3.transform = [](InputState state) {
+
state.element |= borderEmpty;
+
+
if (state.is_placeholder) {
+
state.element |= dim;
+
}
+
+
if (state.focused) {
+
state.element |= borderDouble;
+
state.element |= bgcolor(Color::White);
+
state.element |= color(Color::Black);
+
} else if (state.hovered) {
+
state.element |= borderRounded;
+
state.element |= bgcolor(LinearGradient(90, Color::Blue, Color::Red));
+
state.element |= color(Color::White);
+
} else {
+
state.element |= border;
+
state.element |= bgcolor(LinearGradient(0, Color::Blue, Color::Red));
+
state.element |= color(Color::White);
+
}
+
+
return state.element;
+
};
+
+
InputOption style_4 = InputOption::Spacious();
+
style_4.transform = [](InputState state) {
+
state.element = hbox({
+
text("Theorem") | center | borderEmpty | bgcolor(Color::Red),
+
separatorEmpty(),
+
separator() | color(Color::White),
+
separatorEmpty(),
+
std::move(state.element),
+
});
+
+
state.element |= borderEmpty;
+
if (state.is_placeholder) {
+
state.element |= dim;
+
}
+
+
if (state.focused) {
+
state.element |= bgcolor(Color::Black);
+
} else {
+
state.element |= bgcolor(Color::Blue);
+
}
+
+
if (state.hovered) {
+
state.element |= bgcolor(Color::GrayDark);
+
}
+
+
return vbox({state.element, separatorEmpty()});
+
};
+
+
auto generateUiFromStyle = [&](InputOption style) {
+
auto first_name = new std::string(); // Leaked
+
auto middle_name = new std::string(); // Leaked
+
auto last_name = new std::string(); // Leaked
+
return Container::Vertical({
+
Input(first_name, "first name", style),
+
Input(middle_name, "middle name", style),
+
Input(last_name, "last name", style),
+
}) |
+
borderEmpty;
+
};
+
+
auto ui = Container::Horizontal({
+
generateUiFromStyle(style_1),
+
generateUiFromStyle(style_2),
+
generateUiFromStyle(style_3),
+
generateUiFromStyle(style_4),
+
});
+
+
auto screen = ScreenInteractive::TerminalOutput();
+
screen.Loop(ui);
+
}
+ + + + + + +
std::function< Element(InputState)> transform
+
Option for the Input component.
+
A class representing the settings for linear-gradient color effect.
+ +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
Used to define style for the Input component.
+
+
+ + + + + diff --git a/examples_2component_2linear_gradient_gallery_8cpp-example.html b/examples_2component_2linear_gradient_gallery_8cpp-example.html new file mode 100644 index 000000000..c8e737fe1 --- /dev/null +++ b/examples_2component_2linear_gradient_gallery_8cpp-example.html @@ -0,0 +1,274 @@ + + + + + + + + +FTXUI: examples/component/linear_gradient_gallery.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/linear_gradient_gallery.cpp
+
+
+
// Copyright 2023 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <ftxui/component/component_base.hpp> // for ComponentBase, Component
+
#include <ftxui/dom/elements.hpp> // for operator|, Element, flex, bgcolor, text, vbox, center
+
#include <ftxui/dom/linear_gradient.hpp> // for LinearGradient
+
#include <ftxui/screen/color.hpp> // for Color, Color::Blue, Color::Red
+
#include <memory> // for __shared_ptr_access, shared_ptr
+
#include <string> // for allocator, operator+, char_traits, string, to_string
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Slider, Renderer, Vertical
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
+
int main() {
+
using namespace ftxui;
+
auto screen = ScreenInteractive::Fullscreen();
+
+
int angle = 180.f;
+
float start = 0.f;
+
float end = 1.f;
+
+
std::string slider_angle_text;
+
std::string slider_start_text;
+
std::string slider_end_text;
+
+
auto slider_angle = Slider(&slider_angle_text, &angle, 0, 360);
+
auto slider_start = Slider(&slider_start_text, &start, 0.f, 1.f, 0.05f);
+
auto slider_end = Slider(&slider_end_text, &end, 0.f, 1.f, 0.05f);
+
+
auto layout = Container::Vertical({
+
slider_angle,
+
slider_start,
+
slider_end,
+
});
+
+
auto renderer = Renderer(layout, [&] {
+
slider_angle_text = "angle = " + std::to_string(angle) + "°";
+
slider_start_text = "start = " + std::to_string(int(start * 100)) + "%";
+
slider_end_text = "end = " + std::to_string(int(end * 100)) + "%";
+
+
auto background = text("Gradient") | center |
+
bgcolor(LinearGradient()
+
.Angle(angle)
+
.Stop(Color::Blue, start)
+
.Stop(Color::Red, end));
+
return vbox({
+
background | flex,
+
layout->Render(),
+
}) |
+
flex;
+
});
+
+
screen.Loop(renderer);
+
}
+ + + + + + +
A class representing the settings for linear-gradient color effect.
+ +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2component_2maybe_8cpp-example.html b/examples_2component_2maybe_8cpp-example.html new file mode 100644 index 000000000..5fc78cffc --- /dev/null +++ b/examples_2component_2maybe_8cpp-example.html @@ -0,0 +1,257 @@ + + + + + + + + +FTXUI: examples/component/maybe.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/maybe.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <string> // for string, allocator, basic_string
+
#include <vector> // for vector
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for operator|, Maybe, Checkbox, Radiobox, Renderer, Vertical
+
#include "ftxui/component/component_base.hpp" // for Component
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for Element, border, color, operator|, text
+
#include "ftxui/screen/color.hpp" // for Color, Color::Red
+
+
using namespace ftxui;
+
+
int main() {
+
std::vector<std::string> entries = {
+
"entry 1",
+
"entry 2",
+
"entry 3",
+
};
+
int menu_1_selected = 0;
+
int menu_2_selected = 0;
+
+
bool menu_1_show = false;
+
bool menu_2_show = false;
+
+
auto layout = Container::Vertical({
+
Checkbox("Show menu_1", &menu_1_show),
+
Radiobox(&entries, &menu_1_selected) | border | Maybe(&menu_1_show),
+
Checkbox("Show menu_2", &menu_2_show),
+
Radiobox(&entries, &menu_2_selected) | border | Maybe(&menu_2_show),
+
+
Renderer([] {
+
return text("You found the secret combinaison!") | color(Color::Red);
+
}) | Maybe([&] { return menu_1_selected == 1 && menu_2_selected == 2; }),
+
});
+
+
auto screen = ScreenInteractive::TerminalOutput();
+
screen.Loop(layout);
+
}
+ + + + + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/examples_2component_2maybe_8cpp.html b/examples_2component_2maybe_8cpp.html new file mode 100644 index 000000000..92ffa9293 --- /dev/null +++ b/examples_2component_2maybe_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: maybe.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
maybe.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 16 of file examples/component/maybe.cpp.

+ +
+
+
+
+ + + + + diff --git a/examples_2component_2maybe_8cpp.js b/examples_2component_2maybe_8cpp.js new file mode 100644 index 000000000..1c94985cf --- /dev/null +++ b/examples_2component_2maybe_8cpp.js @@ -0,0 +1,4 @@ +var examples_2component_2maybe_8cpp = +[ + [ "main", "examples_2component_2maybe_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/examples_2component_2maybe_8cpp_source.html b/examples_2component_2maybe_8cpp_source.html new file mode 100644 index 000000000..8efe097df --- /dev/null +++ b/examples_2component_2maybe_8cpp_source.html @@ -0,0 +1,269 @@ + + + + + + + + +FTXUI: maybe.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/maybe.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <string> // for string, allocator, basic_string
+
5#include <vector> // for vector
+
6
+
7#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
8#include "ftxui/component/component.hpp" // for operator|, Maybe, Checkbox, Radiobox, Renderer, Vertical
+
9#include "ftxui/component/component_base.hpp" // for Component
+
10#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
11#include "ftxui/dom/elements.hpp" // for Element, border, color, operator|, text
+
12#include "ftxui/screen/color.hpp" // for Color, Color::Red
+
13
+
14using namespace ftxui;
+
15
+
+
16int main() {
+
17 std::vector<std::string> entries = {
+
18 "entry 1",
+
19 "entry 2",
+
20 "entry 3",
+
21 };
+
22 int menu_1_selected = 0;
+
23 int menu_2_selected = 0;
+
24
+
25 bool menu_1_show = false;
+
26 bool menu_2_show = false;
+
27
+
28 auto layout = Container::Vertical({
+
29 Checkbox("Show menu_1", &menu_1_show),
+
30 Radiobox(&entries, &menu_1_selected) | border | Maybe(&menu_1_show),
+
31 Checkbox("Show menu_2", &menu_2_show),
+
32 Radiobox(&entries, &menu_2_selected) | border | Maybe(&menu_2_show),
+
33
+
34 Renderer([] {
+
35 return text("You found the secret combinaison!") | color(Color::Red);
+
36 }) | Maybe([&] { return menu_1_selected == 1 && menu_2_selected == 2; }),
+
37 });
+
38
+ +
40 screen.Loop(layout);
+
41}
+
+ + + + + + +
static ScreenInteractive TerminalOutput()
+
Component Maybe(Component, const bool *show)
Decorate a component |child|. It is shown only when |show| is true.
+
Component Radiobox(RadioboxOption options)
A list of element, where only one can be selected.
+
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
+
Component Vertical(Components children)
A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
+
Component Checkbox(CheckboxOption options)
Draw checkable element.
+
Element text(std::wstring text)
Display a piece of unicode text.
Definition text.cpp:160
+
Decorator color(Color)
Decorate using a foreground color.
+ +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/examples_2component_2menu2_8cpp-example.html b/examples_2component_2menu2_8cpp-example.html new file mode 100644 index 000000000..7d83eade0 --- /dev/null +++ b/examples_2component_2menu2_8cpp-example.html @@ -0,0 +1,297 @@ + + + + + + + + +FTXUI: examples/component/menu2.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/menu2.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <functional> // for function
+
#include <memory> // for allocator, __shared_ptr_access
+
#include <string> // for string, basic_string, operator+, to_string
+
#include <vector> // for vector
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Menu, Horizontal, Renderer
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/component_options.hpp" // for MenuOption
+
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for text, separator, bold, hcenter, vbox, hbox, gauge, Element, operator|, border
+
+
int main() {
+
using namespace ftxui;
+
auto screen = ScreenInteractive::TerminalOutput();
+
+
std::vector<std::string> left_menu_entries = {
+
"0%", "10%", "20%", "30%", "40%", "50%", "60%", "70%", "80%", "90%",
+
};
+
std::vector<std::string> right_menu_entries = {
+
"0%", "1%", "2%", "3%", "4%", "5%", "6%", "7%", "8%", "9%", "10%",
+
};
+
+
auto menu_option = MenuOption();
+
menu_option.on_enter = screen.ExitLoopClosure();
+
+
int left_menu_selected = 0;
+
int right_menu_selected = 0;
+
Component left_menu_ =
+
Menu(&left_menu_entries, &left_menu_selected, menu_option);
+
Component right_menu_ =
+
Menu(&right_menu_entries, &right_menu_selected, menu_option);
+
+
Component container = Container::Horizontal({
+
left_menu_,
+
right_menu_,
+
});
+
+
auto renderer = Renderer(container, [&] {
+
int sum = left_menu_selected * 10 + right_menu_selected;
+
return vbox({
+
// -------- Top panel --------------
+
hbox({
+
// -------- Left Menu --------------
+
vbox({
+
hcenter(bold(text("Percentage by 10%"))),
+
separator(),
+
left_menu_->Render(),
+
}),
+
separator(),
+
// -------- Right Menu --------------
+
vbox({
+
hcenter(bold(text("Percentage by 1%"))),
+
separator(),
+
right_menu_->Render(),
+
}),
+
separator(),
+
}),
+
separator(),
+
// -------- Bottom panel --------------
+
vbox({
+
hbox({
+
text(" gauge : "),
+
gauge(sum / 100.0),
+
}),
+
hbox({
+
text(" text : "),
+
text(std::to_string(sum) + " %"),
+
}),
+
}),
+
}) |
+
border;
+
});
+
+
screen.Loop(renderer);
+
}
+ + + + + + +
Option for the Menu component.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< ComponentBase > Component
+ +
+
+ + + + + diff --git a/examples_2component_2menu_8cpp-example.html b/examples_2component_2menu_8cpp-example.html new file mode 100644 index 000000000..15e47ccc7 --- /dev/null +++ b/examples_2component_2menu_8cpp-example.html @@ -0,0 +1,248 @@ + + + + + + + + +FTXUI: examples/component/menu.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/menu.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <functional> // for function
+
#include <iostream> // for basic_ostream::operator<<, operator<<, endl, basic_ostream, basic_ostream<>::__ostream_type, cout, ostream
+
#include <string> // for string, basic_string, allocator
+
#include <vector> // for vector
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Menu
+
#include "ftxui/component/component_options.hpp" // for MenuOption
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
+
int main() {
+
using namespace ftxui;
+
auto screen = ScreenInteractive::TerminalOutput();
+
+
std::vector<std::string> entries = {
+
"entry 1",
+
"entry 2",
+
"entry 3",
+
};
+
int selected = 0;
+
+
MenuOption option;
+
option.on_enter = screen.ExitLoopClosure();
+
auto menu = Menu(&entries, &selected, option);
+
+
screen.Loop(menu);
+
+
std::cout << "Selected element = " << selected << std::endl;
+
}
+ + + + +
std::function< void()> on_enter
+
Option for the Menu component.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/examples_2component_2menu_8cpp.html b/examples_2component_2menu_8cpp.html new file mode 100644 index 000000000..9b35586ec --- /dev/null +++ b/examples_2component_2menu_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: menu.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
menu.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 14 of file examples/component/menu.cpp.

+ +
+
+
+
+ + + + + diff --git a/examples_2component_2menu_8cpp.js b/examples_2component_2menu_8cpp.js new file mode 100644 index 000000000..dfc9e04da --- /dev/null +++ b/examples_2component_2menu_8cpp.js @@ -0,0 +1,4 @@ +var examples_2component_2menu_8cpp = +[ + [ "main", "examples_2component_2menu_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/examples_2component_2menu_8cpp_source.html b/examples_2component_2menu_8cpp_source.html new file mode 100644 index 000000000..b070abfa9 --- /dev/null +++ b/examples_2component_2menu_8cpp_source.html @@ -0,0 +1,251 @@ + + + + + + + + +FTXUI: menu.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/menu.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <functional> // for function
+
5#include <iostream> // for basic_ostream::operator<<, operator<<, endl, basic_ostream, basic_ostream<>::__ostream_type, cout, ostream
+
6#include <string> // for string, basic_string, allocator
+
7#include <vector> // for vector
+
8
+
9#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
10#include "ftxui/component/component.hpp" // for Menu
+
11#include "ftxui/component/component_options.hpp" // for MenuOption
+
12#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
13
+
+
14int main() {
+
15 using namespace ftxui;
+
16 auto screen = ScreenInteractive::TerminalOutput();
+
17
+
18 std::vector<std::string> entries = {
+
19 "entry 1",
+
20 "entry 2",
+
21 "entry 3",
+
22 };
+
23 int selected = 0;
+
24
+
25 MenuOption option;
+
26 option.on_enter = screen.ExitLoopClosure();
+
27 auto menu = Menu(&entries, &selected, option);
+
28
+
29 screen.Loop(menu);
+
30
+
31 std::cout << "Selected element = " << selected << std::endl;
+
32}
+
+ + + + +
std::function< void()> on_enter
+
Option for the Menu component.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/examples_2component_2menu_entries_8cpp-example.html b/examples_2component_2menu_entries_8cpp-example.html new file mode 100644 index 000000000..3768d3c6e --- /dev/null +++ b/examples_2component_2menu_entries_8cpp-example.html @@ -0,0 +1,306 @@ + + + + + + + + +FTXUI: examples/component/menu_entries.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/menu_entries.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <functional> // for function
+
#include <iostream> // for basic_ostream::operator<<, operator<<, endl, basic_ostream, basic_ostream<>::__ostream_type, cout, ostream
+
#include <memory> // for allocator, shared_ptr, __shared_ptr_access
+
#include <string> // for char_traits, to_string, operator+, string, basic_string
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for MenuEntry, Renderer, Vertical
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/component_options.hpp" // for MenuEntryOption
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for operator|, Element, separator, text, hbox, size, frame, color, vbox, HEIGHT, LESS_THAN, bold, border, inverted
+
#include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Cyan, Color::Green, Color::Red, Color::Yellow
+
+
using namespace ftxui;
+
+
// Define a special style for some menu entry.
+ + +
option.transform = [c](EntryState state) {
+
state.label = (state.active ? "> " : " ") + state.label;
+
Element e = text(state.label) | color(c);
+
if (state.focused) {
+
e = e | inverted;
+
}
+
if (state.active) {
+
e = e | bold;
+
}
+
return e;
+
};
+
return option;
+
}
+
+
int main() {
+
auto screen = ScreenInteractive::TerminalOutput();
+
+
int selected = 0;
+
auto menu = Container::Vertical(
+
{
+
MenuEntry(" 1. improve"),
+
MenuEntry(" 2. tolerant"),
+
MenuEntry(" 3. career"),
+
MenuEntry(" 4. cast"),
+
MenuEntry(" 5. question"),
+
+
Renderer([] { return separator(); }),
+
+
MenuEntry(" 6. rear", Colored(Color::Red)),
+
MenuEntry(" 7. drown", Colored(Color::Yellow)),
+
MenuEntry(" 8. nail", Colored(Color::Green)),
+
MenuEntry(" 9. quit", Colored(Color::Cyan)),
+
MenuEntry("10. decorative", Colored(Color::Blue)),
+
+
Renderer([] { return separator(); }),
+
+
MenuEntry("11. costume"),
+
MenuEntry("12. pick"),
+
MenuEntry("13. oral"),
+
MenuEntry("14. minister"),
+
MenuEntry("15. football"),
+
MenuEntry("16. welcome"),
+
MenuEntry("17. copper"),
+
MenuEntry("18. inhabitant"),
+
MenuEntry("19. fortune"),
+
},
+
&selected);
+
+
// Display together the menu with a border
+
auto renderer = Renderer(menu, [&] {
+
return vbox({
+
hbox(text("selected = "), text(std::to_string(selected))),
+
separator(),
+
menu->Render() | frame | size(HEIGHT, LESS_THAN, 10),
+
}) |
+
border;
+
});
+
+
screen.Loop(renderer);
+
+
std::cout << "Selected element = " << selected << std::endl;
+
}
+ + + + + + + +
std::function< Element(const EntryState &state)> transform
+
Option for the MenuEntry component.
+
Color is a class that represents a color in the terminal user interface.
Definition color.hpp:22
+
MenuEntryOption Colored(ftxui::Color c)
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+ +
arguments for transform from |ButtonOption|, |CheckboxOption|, |RadioboxOption|, |MenuEntryOption|,...
+
+
+ + + + + diff --git a/examples_2component_2menu_entries_animated_8cpp-example.html b/examples_2component_2menu_entries_animated_8cpp-example.html new file mode 100644 index 000000000..0234c7564 --- /dev/null +++ b/examples_2component_2menu_entries_animated_8cpp-example.html @@ -0,0 +1,291 @@ + + + + + + + + +FTXUI: examples/component/menu_entries_animated.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/menu_entries_animated.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <iostream> // for basic_ostream::operator<<, operator<<, endl, basic_ostream, basic_ostream<>::__ostream_type, cout, ostream
+
#include <memory> // for shared_ptr, __shared_ptr_access
+
#include <string> // for to_string, allocator
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for MenuEntryAnimated, Renderer, Vertical
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/component_options.hpp" // for MenuEntryAnimated
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for operator|, separator, Element, Decorator, color, text, hbox, size, bold, frame, inverted, vbox, HEIGHT, LESS_THAN, border
+
#include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Cyan, Color::Green, Color::Red, Color::Yellow
+
+
using namespace ftxui;
+
+
// Define a special style for some menu entry.
+ + + + + +
option.animated_colors.background.inactive = Color::Black;
+
option.animated_colors.foreground.active = Color::White;
+ +
return option;
+
}
+
+
int main() {
+
auto screen = ScreenInteractive::TerminalOutput();
+
+
int selected = 0;
+
auto menu = Container::Vertical(
+
{
+
MenuEntry(" 1. rear", Colored(Color::Red)),
+
MenuEntry(" 2. drown", Colored(Color::Yellow)),
+
MenuEntry(" 3. nail", Colored(Color::Green)),
+
MenuEntry(" 4. quit", Colored(Color::Cyan)),
+
MenuEntry(" 5. decorative", Colored(Color::Blue)),
+
MenuEntry(" 7. costume"),
+
MenuEntry(" 8. pick"),
+
MenuEntry(" 9. oral"),
+
MenuEntry("11. minister"),
+
MenuEntry("12. football"),
+
MenuEntry("13. welcome"),
+
MenuEntry("14. copper"),
+
MenuEntry("15. inhabitant"),
+
},
+
&selected);
+
+
// Display together the menu with a border
+
auto renderer = Renderer(menu, [&] {
+
return vbox({
+
hbox(text("selected = "), text(std::to_string(selected))),
+
separator(),
+
menu->Render() | frame,
+
}) |
+
border | bgcolor(Color::Black);
+
});
+
+
screen.Loop(renderer);
+
+
std::cout << "Selected element = " << selected << std::endl;
+
}
+ + + + + + + + + + +
AnimatedColorsOption animated_colors
+
Option for the MenuEntry component.
+
Color is a class that represents a color in the terminal user interface.
Definition color.hpp:22
+
MenuEntryOption Colored(ftxui::Color c)
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + + +
+
+ + + + + diff --git a/examples_2component_2menu_in_frame_8cpp-example.html b/examples_2component_2menu_in_frame_8cpp-example.html new file mode 100644 index 000000000..814166552 --- /dev/null +++ b/examples_2component_2menu_in_frame_8cpp-example.html @@ -0,0 +1,248 @@ + + + + + + + + +FTXUI: examples/component/menu_in_frame.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/menu_in_frame.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <memory> // for shared_ptr, __shared_ptr_access
+
#include <string> // for string, basic_string, operator+, to_string
+
#include <vector> // for vector
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Radiobox, Renderer
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, HEIGHT, LESS_THAN
+
+
using namespace ftxui;
+
+
int main() {
+
std::vector<std::string> entries;
+
int selected = 0;
+
+
for (int i = 0; i < 30; ++i) {
+
entries.push_back("Entry " + std::to_string(i));
+
}
+
auto radiobox = Menu(&entries, &selected);
+
auto renderer = Renderer(radiobox, [&] {
+
return radiobox->Render() | vscroll_indicator | frame |
+
size(HEIGHT, LESS_THAN, 10) | border;
+
});
+
+
auto screen = ScreenInteractive::FitComponent();
+
screen.Loop(renderer);
+
+
return 0;
+
}
+ + + + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/examples_2component_2menu_in_frame_horizontal_8cpp-example.html b/examples_2component_2menu_in_frame_horizontal_8cpp-example.html new file mode 100644 index 000000000..53cde15f7 --- /dev/null +++ b/examples_2component_2menu_in_frame_horizontal_8cpp-example.html @@ -0,0 +1,246 @@ + + + + + + + + +FTXUI: examples/component/menu_in_frame_horizontal.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/menu_in_frame_horizontal.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <memory> // for shared_ptr, __shared_ptr_access
+
#include <string> // for string, basic_string, operator+, to_string
+
#include <vector> // for vector
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Radiobox, Renderer
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, HEIGHT, LESS_THAN
+
+
using namespace ftxui;
+
+
int main() {
+
std::vector<std::string> entries;
+
int selected = 0;
+
+
for (int i = 0; i < 100; ++i) {
+
entries.push_back(std::to_string(i));
+
}
+
auto radiobox = Menu(&entries, &selected, MenuOption::Horizontal());
+
auto renderer = Renderer(
+
radiobox, [&] { return radiobox->Render() | hscroll_indicator | frame; });
+
+
auto screen = ScreenInteractive::FitComponent();
+
screen.Loop(renderer);
+
+
return 0;
+
}
+ + + + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/examples_2component_2menu_multiple_8cpp-example.html b/examples_2component_2menu_multiple_8cpp-example.html new file mode 100644 index 000000000..7370ab6ff --- /dev/null +++ b/examples_2component_2menu_multiple_8cpp-example.html @@ -0,0 +1,294 @@ + + + + + + + + +FTXUI: examples/component/menu_multiple.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/menu_multiple.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <stdlib.h> // for EXIT_SUCCESS
+
#include <memory> // for allocator, __shared_ptr_access
+
#include <string> // for string, operator+, basic_string, to_string, char_traits
+
#include <vector> // for vector, __alloc_traits<>::value_type
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Menu, Renderer, Horizontal, Vertical
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for text, Element, operator|, window, flex, vbox
+
+
using namespace ftxui;
+
+
Component Window(std::string title, Component component) {
+
return Renderer(component, [component, title] { //
+
return window(text(title), component->Render()) | flex;
+
});
+
}
+
+
int main() {
+
int menu_selected[] = {0, 0, 0};
+
std::vector<std::vector<std::string>> menu_entries = {
+
{
+
"Ananas",
+
"Raspberry",
+
"Citrus",
+
},
+
{
+
"Potatoes",
+
"Weat",
+
"Rise",
+
},
+
{
+
"Carrot",
+
"Lettuce",
+
"Tomato",
+
},
+
};
+
+
int menu_selected_global = 0;
+
auto menu_global = Container::Vertical(
+
{
+
Window("Menu 1", Menu(&menu_entries[0], &menu_selected[0])),
+
Window("Menu 2", Menu(&menu_entries[1], &menu_selected[1])),
+
Window("Menu 3", Menu(&menu_entries[2], &menu_selected[2])),
+
},
+
&menu_selected_global);
+
+
auto info = Renderer([&] {
+
int g = menu_selected_global;
+
std::string value = menu_entries[g][menu_selected[g]];
+
return window(text("Content"), //
+
vbox({
+
text("menu_selected_global = " + std::to_string(g)),
+
text("menu_selected[0] = " +
+
std::to_string(menu_selected[0])),
+
text("menu_selected[1] = " +
+
std::to_string(menu_selected[1])),
+
text("menu_selected[2] = " +
+
std::to_string(menu_selected[2])),
+
text("Value = " + value),
+
})) |
+
flex;
+
});
+
+
auto global = Container::Horizontal({
+
menu_global,
+
info,
+
});
+
+
auto screen = ScreenInteractive::TerminalOutput();
+
screen.Loop(global);
+
return EXIT_SUCCESS;
+
}
+ + + + + +
Component Window(std::string title, Component component)
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< ComponentBase > Component
+ +
+
+ + + + + diff --git a/examples_2component_2menu_style_8cpp-example.html b/examples_2component_2menu_style_8cpp-example.html new file mode 100644 index 000000000..f2d2fccc1 --- /dev/null +++ b/examples_2component_2menu_style_8cpp-example.html @@ -0,0 +1,500 @@ + + + + + + + + +FTXUI: examples/component/menu_style.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/menu_style.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <array> // for array
+
#include <chrono> // for milliseconds
+
#include <functional> // for function
+
#include <memory> // for __shared_ptr_access, shared_ptr, allocator
+
#include <string> // for string, char_traits, operator+, basic_string
+
#include <vector> // for vector
+
+
#include "ftxui/component/animation.hpp" // for ElasticOut, Linear
+
#include "ftxui/component/component.hpp" // for Menu, Horizontal, Renderer, Vertical
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/component_options.hpp" // for MenuOption, EntryState, MenuEntryOption, AnimatedColorOption, AnimatedColorsOption, UnderlineOption
+
#include "ftxui/component/mouse.hpp" // for ftxui
+
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for separator, operator|, Element, text, bgcolor, hbox, bold, color, filler, border, vbox, borderDouble, dim, flex, hcenter
+
#include "ftxui/screen/color.hpp" // for Color, Color::Red, Color::Black, Color::Yellow, Color::Blue, Color::Default, Color::White
+
+
using namespace ftxui;
+
+
Component VMenu1(std::vector<std::string>* entries, int* selected);
+
Component VMenu2(std::vector<std::string>* entries, int* selected);
+
Component VMenu3(std::vector<std::string>* entries, int* selected);
+
Component VMenu4(std::vector<std::string>* entries, int* selected);
+
Component VMenu5(std::vector<std::string>* entries, int* selected);
+
Component VMenu6(std::vector<std::string>* entries, int* selected);
+
Component VMenu7(std::vector<std::string>* entries, int* selected);
+
Component VMenu8(std::vector<std::string>* entries, int* selected);
+
Component HMenu1(std::vector<std::string>* entries, int* selected);
+
Component HMenu2(std::vector<std::string>* entries, int* selected);
+
Component HMenu3(std::vector<std::string>* entries, int* selected);
+
Component HMenu4(std::vector<std::string>* entries, int* selected);
+
Component HMenu5(std::vector<std::string>* entries, int* selected);
+
+
int main() {
+
auto screen = ScreenInteractive::TerminalOutput();
+
+
std::vector<std::string> entries{
+
"Monkey", "Dog", "Cat", "Bird", "Elephant", "Cat",
+
};
+
std::array<int, 12> selected = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+
auto vmenu_1_ = VMenu1(&entries, &selected[0]);
+
auto vmenu_2_ = VMenu2(&entries, &selected[1]);
+
auto vmenu_3_ = VMenu3(&entries, &selected[2]);
+
auto vmenu_4_ = VMenu4(&entries, &selected[3]);
+
auto vmenu_5_ = VMenu5(&entries, &selected[4]);
+
auto vmenu_6_ = VMenu6(&entries, &selected[5]);
+
auto vmenu_7_ = VMenu7(&entries, &selected[6]);
+
auto vmenu_8_ = VMenu8(&entries, &selected[7]);
+
+
auto hmenu_1_ = HMenu1(&entries, &selected[8]);
+
auto hmenu_2_ = HMenu2(&entries, &selected[9]);
+
auto hmenu_3_ = HMenu3(&entries, &selected[10]);
+
auto hmenu_4_ = HMenu4(&entries, &selected[11]);
+
auto hmenu_5_ = HMenu5(&entries, &selected[12]);
+
+
auto container = Container::Vertical({
+
Container::Horizontal({
+
vmenu_1_,
+
vmenu_2_,
+
vmenu_3_,
+
vmenu_4_,
+
vmenu_5_,
+
vmenu_6_,
+
vmenu_7_,
+
vmenu_8_,
+
}),
+
hmenu_1_,
+
hmenu_2_,
+
hmenu_3_,
+
hmenu_4_,
+
hmenu_5_,
+
});
+
+
auto renderer = Renderer(container, [&] {
+
return //
+
hbox({
+
vbox({
+
hbox({
+
vmenu_1_->Render(),
+
separator(),
+
vmenu_2_->Render(),
+
separator(),
+
vmenu_3_->Render(),
+
separator(),
+
vmenu_4_->Render(),
+
separator(),
+
vmenu_5_->Render(),
+
vmenu_6_->Render(),
+
separator(),
+
vmenu_7_->Render(),
+
separator(),
+
vmenu_8_->Render(),
+
}),
+
separator(),
+
hmenu_1_->Render(),
+
separator(),
+
hmenu_2_->Render(),
+
separator(),
+
hmenu_3_->Render(),
+
separator(),
+
hmenu_4_->Render(),
+
hmenu_5_->Render(),
+
}) | border,
+
filler(),
+
});
+
});
+
+
screen.Loop(renderer);
+
}
+
+
Component VMenu1(std::vector<std::string>* entries, int* selected) {
+
auto option = MenuOption::Vertical();
+
option.entries_option.transform = [](EntryState state) {
+
state.label = (state.active ? "> " : " ") + state.label;
+
Element e = text(state.label);
+
if (state.focused) {
+
e = e | bgcolor(Color::Blue);
+
}
+
if (state.active) {
+
e = e | bold;
+
}
+
return e;
+
};
+
return Menu(entries, selected, option);
+
}
+
+
Component VMenu2(std::vector<std::string>* entries, int* selected) {
+
auto option = MenuOption::Vertical();
+
option.entries_option.transform = [](EntryState state) {
+
state.label += (state.active ? " <" : " ");
+
Element e = hbox(filler(), text(state.label));
+
if (state.focused) {
+
e = e | bgcolor(Color::Red);
+
}
+
if (state.active) {
+
e = e | bold;
+
}
+
return e;
+
};
+
return Menu(entries, selected, option);
+
}
+
+
Component VMenu3(std::vector<std::string>* entries, int* selected) {
+
auto option = MenuOption::Vertical();
+
option.entries_option.transform = [](EntryState state) {
+
Element e = state.active ? text("[" + state.label + "]")
+
: text(" " + state.label + " ");
+
if (state.focused) {
+
e = e | bold;
+
}
+
+
if (state.focused) {
+
e = e | color(Color::Blue);
+
}
+
if (state.active) {
+
e = e | bold;
+
}
+
return e;
+
};
+
return Menu(entries, selected, option);
+
}
+
+
Component VMenu4(std::vector<std::string>* entries, int* selected) {
+
auto option = MenuOption::Vertical();
+
option.entries_option.transform = [](EntryState state) {
+
if (state.active && state.focused) {
+
return text(state.label) | color(Color::Yellow) | bgcolor(Color::Black) |
+
bold;
+
}
+
+
if (state.active) {
+
return text(state.label) | color(Color::Yellow) | bgcolor(Color::Black);
+
}
+
if (state.focused) {
+
return text(state.label) | color(Color::Black) | bgcolor(Color::Yellow) |
+
bold;
+
}
+
return text(state.label) | color(Color::Black) | bgcolor(Color::Yellow);
+
};
+
return Menu(entries, selected, option);
+
}
+
+
Component VMenu5(std::vector<std::string>* entries, int* selected) {
+
auto option = MenuOption::Vertical();
+
option.entries_option.transform = [](EntryState state) {
+
auto element = text(state.label);
+
if (state.active && state.focused) {
+
return element | borderDouble;
+
}
+
if (state.active) {
+
return element | border;
+
}
+
if (state.focused) {
+
return element | bold;
+
}
+
return element;
+
};
+
return Menu(entries, selected, option);
+
}
+
+
Component VMenu6(std::vector<std::string>* entries, int* selected) {
+
auto option = MenuOption::VerticalAnimated();
+
option.underline.color_inactive = Color::Default;
+
option.underline.color_active = Color::Red;
+
option.underline.SetAnimationFunction(animation::easing::Linear);
+
return Menu(entries, selected, option);
+
}
+
+
Component VMenu7(std::vector<std::string>* entries, int* selected) {
+
auto option = MenuOption::Vertical();
+
option.entries_option.animated_colors.foreground.enabled = true;
+
option.entries_option.animated_colors.background.enabled = true;
+
option.entries_option.animated_colors.background.active = Color::Red;
+
option.entries_option.animated_colors.background.inactive = Color::Black;
+
option.entries_option.animated_colors.foreground.active = Color::White;
+
option.entries_option.animated_colors.foreground.inactive = Color::Red;
+
return Menu(entries, selected, option);
+
}
+
+
Component VMenu8(std::vector<std::string>* entries, int* selected) {
+
auto option = MenuOption::Vertical();
+
option.entries_option.animated_colors.foreground.Set(
+
Color::Red, Color::White, std::chrono::milliseconds(500));
+
return Menu(entries, selected, option);
+
}
+
+
Component HMenu1(std::vector<std::string>* entries, int* selected) {
+
return Menu(entries, selected, MenuOption::Horizontal());
+
}
+
+
Component HMenu2(std::vector<std::string>* entries, int* selected) {
+
return Menu(entries, selected, MenuOption::Toggle());
+
}
+
+
Component HMenu3(std::vector<std::string>* entries, int* selected) {
+
auto option = MenuOption::Toggle();
+
option.elements_infix = [] { return text(" 🮣🮠 "); };
+
+
return Menu(entries, selected, option);
+
}
+
+
Component HMenu4(std::vector<std::string>* entries, int* selected) {
+
return Menu(entries, selected, MenuOption::HorizontalAnimated());
+
}
+
+
Component HMenu5(std::vector<std::string>* entries, int* selected) {
+
auto option = MenuOption::HorizontalAnimated();
+
option.underline.SetAnimation(std::chrono::milliseconds(1500),
+
animation::easing::ElasticOut);
+
option.entries_option.transform = [](EntryState state) {
+
Element e = text(state.label) | hcenter | flex;
+
if (state.active && state.focused) {
+
e = e | bold;
+
}
+
if (!state.focused && !state.active) {
+
e = e | dim;
+
}
+
return e;
+
};
+
option.underline.color_inactive = Color::Default;
+
option.underline.color_active = Color::Red;
+
return Menu(entries, selected, option);
+
}
+ + + + + + + +
Component HMenu5(std::vector< std::string > *entries, int *selected)
+
Component HMenu4(std::vector< std::string > *entries, int *selected)
+
Component VMenu5(std::vector< std::string > *entries, int *selected)
+
Component HMenu1(std::vector< std::string > *entries, int *selected)
+
Component HMenu2(std::vector< std::string > *entries, int *selected)
+
Component VMenu2(std::vector< std::string > *entries, int *selected)
+
Component HMenu3(std::vector< std::string > *entries, int *selected)
+
Component VMenu1(std::vector< std::string > *entries, int *selected)
+
Component VMenu3(std::vector< std::string > *entries, int *selected)
+
Component VMenu6(std::vector< std::string > *entries, int *selected)
+
Component VMenu7(std::vector< std::string > *entries, int *selected)
+
Component VMenu8(std::vector< std::string > *entries, int *selected)
+
Component VMenu4(std::vector< std::string > *entries, int *selected)
+ +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+
std::shared_ptr< ComponentBase > Component
+ +
arguments for transform from |ButtonOption|, |CheckboxOption|, |RadioboxOption|, |MenuEntryOption|,...
+
+
+ + + + + diff --git a/examples_2component_2menu_underline_animated_gallery_8cpp-example.html b/examples_2component_2menu_underline_animated_gallery_8cpp-example.html new file mode 100644 index 000000000..f91032458 --- /dev/null +++ b/examples_2component_2menu_underline_animated_gallery_8cpp-example.html @@ -0,0 +1,315 @@ + + + + + + + + +FTXUI: examples/component/menu_underline_animated_gallery.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/menu_underline_animated_gallery.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <chrono> // for operator""ms, literals
+
#include <memory> // for allocator, shared_ptr, __shared_ptr_access
+
#include <string> // for string, operator+, to_string, basic_string
+
#include <vector> // for vector
+
+
#include "ftxui/component/animation.hpp" // for BackOut, Duration
+
#include "ftxui/component/component.hpp" // for Menu, Renderer, Vertical
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/component_options.hpp" // for MenuOption, UnderlineOption
+
#include "ftxui/component/mouse.hpp" // for ftxui
+
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for text, Element, operator|, borderEmpty, inverted
+
#include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Red
+
+
using namespace ftxui;
+
+ +
return Renderer([id](bool focused) {
+
auto t = text("component " + std::to_string(id));
+
if (focused) {
+
t = t | inverted;
+
}
+
return t;
+
});
+
}
+
+
Component Text(const std::string& t) {
+
return Renderer([t] { return text(t) | borderEmpty; });
+
}
+
+
int main() {
+
using namespace std::literals;
+
std::vector<std::string> tab_values{
+
"Tab 1", "Tab 2", "Tab 3", "A very very long tab", "탭",
+
};
+
int tab_selected = 0;
+
+
auto container = Container::Vertical({});
+
+
int frame_count = 0;
+
container->Add(Renderer(
+
[&] { return text("Frame count: " + std::to_string(frame_count++)); }));
+
+
{
+
auto option = MenuOption::HorizontalAnimated();
+
container->Add(Text("This demonstrate the Menu component"));
+
container->Add(Menu(&tab_values, &tab_selected, option));
+
}
+
+
{
+
container->Add(Text("Set underline color to blue"));
+
auto option = MenuOption::HorizontalAnimated();
+
option.underline.color_inactive = Color::Blue;
+
container->Add(Menu(&tab_values, &tab_selected, option));
+
}
+
+
{
+
container->Add(Text("Set underline active color to red"));
+
auto option = MenuOption::HorizontalAnimated();
+
option.underline.color_active = Color::Red;
+
container->Add(Menu(&tab_values, &tab_selected, option));
+
}
+
+
{
+
container->Add(Text("Set animation duration to 0ms"));
+
auto option = MenuOption::HorizontalAnimated();
+
option.underline.SetAnimationDuration(0ms);
+
container->Add(Menu(&tab_values, &tab_selected, option));
+
}
+
+
{
+
container->Add(Text("Set animation easing function to back-out"));
+
auto option = MenuOption::HorizontalAnimated();
+
option.underline.SetAnimationFunction(animation::easing::BackOut);
+
option.underline.SetAnimationDuration(350ms);
+
container->Add(Menu(&tab_values, &tab_selected, option));
+
}
+
+
// option.underline_animation_follower_delay = 250ms
+
{
+
container->Add(Text("Add delay to desynchronize animation"));
+
auto option = MenuOption::HorizontalAnimated();
+
option.underline.follower_delay = 250ms;
+
container->Add(Menu(&tab_values, &tab_selected, option));
+
}
+
+
container->SetActiveChild(container->ChildAt(2));
+
+
auto screen = ScreenInteractive::TerminalOutput();
+
screen.Loop(container);
+
}
+ + + + + + + + + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< ComponentBase > Component
+ +
+
+ + + + + diff --git a/examples_2component_2modal_dialog_8cpp-example.html b/examples_2component_2modal_dialog_8cpp-example.html new file mode 100644 index 000000000..4db8f04d9 --- /dev/null +++ b/examples_2component_2modal_dialog_8cpp-example.html @@ -0,0 +1,302 @@ + + + + + + + + +FTXUI: examples/component/modal_dialog.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/modal_dialog.cpp
+
+
+
// Copyright 2022 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <ftxui/component/component_options.hpp> // for ButtonOption
+
#include <ftxui/component/mouse.hpp> // for ftxui
+
#include <functional> // for function
+
#include <memory> // for allocator, shared_ptr
+
+
#include "ftxui/component/component.hpp" // for Button, operator|=, Renderer, Vertical, Modal
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive, Component
+
#include "ftxui/dom/elements.hpp" // for operator|, separator, text, size, Element, vbox, border, GREATER_THAN, WIDTH, center, HEIGHT
+
+
using namespace ftxui;
+
+
auto button_style = ButtonOption::Animated();
+
+
// Definition of the main component. The details are not important.
+
Component MainComponent(std::function<void()> show_modal,
+
std::function<void()> exit) {
+
auto component = Container::Vertical({
+
Button("Show modal", show_modal, button_style),
+
Button("Quit", exit, button_style),
+
});
+
// Polish how the two buttons are rendered:
+
component |= Renderer([&](Element inner) {
+
return vbox({
+
text("Main component"),
+
separator(),
+
inner,
+
}) //
+
| size(WIDTH, GREATER_THAN, 15) //
+
| size(HEIGHT, GREATER_THAN, 15) //
+
| border //
+
| center; //
+
});
+
return component;
+
}
+
+
// Definition of the modal component. The details are not important.
+
Component ModalComponent(std::function<void()> do_nothing,
+
std::function<void()> hide_modal) {
+
auto component = Container::Vertical({
+
Button("Do nothing", do_nothing, button_style),
+
Button("Quit modal", hide_modal, button_style),
+
});
+
// Polish how the two buttons are rendered:
+
component |= Renderer([&](Element inner) {
+
return vbox({
+
text("Modal component "),
+
separator(),
+
inner,
+
}) //
+
| size(WIDTH, GREATER_THAN, 30) //
+
| border; //
+
});
+
return component;
+
}
+
+
int main(int argc, const char* argv[]) {
+
auto screen = ScreenInteractive::TerminalOutput();
+
+
// State of the application:
+
bool modal_shown = false;
+
+
// Some actions modifying the state:
+
auto show_modal = [&] { modal_shown = true; };
+
auto hide_modal = [&] { modal_shown = false; };
+
auto exit = screen.ExitLoopClosure();
+
auto do_nothing = [&] {};
+
+
// Instanciate the main and modal components:
+
auto main_component = MainComponent(show_modal, exit);
+
auto modal_component = ModalComponent(do_nothing, hide_modal);
+
+
// Use the `Modal` function to use together the main component and its modal
+
// window. The |modal_shown| boolean controls whether the modal is shown or
+
// not.
+
main_component |= Modal(modal_component, &modal_shown);
+
+
screen.Loop(main_component);
+
return 0;
+
}
+ + + + +
auto button_style
+
Component ModalComponent(std::function< void()> do_nothing, std::function< void()> hide_modal)
+
Component MainComponent(std::function< void()> show_modal, std::function< void()> exit)
+ +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+
std::shared_ptr< ComponentBase > Component
+ +
+
+ + + + + diff --git a/examples_2component_2modal_dialog_custom_8cpp-example.html b/examples_2component_2modal_dialog_custom_8cpp-example.html new file mode 100644 index 000000000..f3b9c009c --- /dev/null +++ b/examples_2component_2modal_dialog_custom_8cpp-example.html @@ -0,0 +1,309 @@ + + + + + + + + +FTXUI: examples/component/modal_dialog_custom.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/modal_dialog_custom.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <memory> // for allocator, shared_ptr, __shared_ptr_access
+
#include <string> // for string, basic_string, char_traits, operator+
+
#include <vector> // for vector
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Button, Renderer, Horizontal, Tab
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for operator|, Element, filler, text, hbox, separator, center, vbox, bold, border, clear_under, dbox, size, GREATER_THAN, HEIGHT
+
+
int main() {
+
using namespace ftxui;
+
auto screen = ScreenInteractive::TerminalOutput();
+
+
// There are two layers. One at depth = 0 and the modal window at depth = 1;
+
int depth = 0;
+
+
// The current rating of FTXUI.
+
std::string rating = "3/5 stars";
+
+
// At depth=0, two buttons. One for rating FTXUI and one for quitting.
+
auto button_rate_ftxui = Button("Rate FTXUI", [&] { depth = 1; });
+
auto button_quit = Button("Quit", screen.ExitLoopClosure());
+
+
auto depth_0_container = Container::Horizontal({
+
button_rate_ftxui,
+
button_quit,
+
});
+
auto depth_0_renderer = Renderer(depth_0_container, [&] {
+
return vbox({
+
text("Modal dialog example"),
+
separator(),
+
text("☆☆☆ FTXUI:" + rating + " ☆☆☆") | bold,
+
filler(),
+
hbox({
+
button_rate_ftxui->Render(),
+
filler(),
+
button_quit->Render(),
+
}),
+
}) |
+
border | size(HEIGHT, GREATER_THAN, 18) | center;
+
});
+
+
// At depth=1, The "modal" window.
+
std::vector<std::string> rating_labels = {
+
"1/5 stars", "2/5 stars", "3/5 stars", "4/5 stars", "5/5 stars",
+
};
+
auto on_rating = [&](std::string new_rating) {
+
rating = new_rating;
+
depth = 0;
+
};
+
auto depth_1_container = Container::Horizontal({
+
Button(&rating_labels[0], [&] { on_rating(rating_labels[0]); }),
+
Button(&rating_labels[1], [&] { on_rating(rating_labels[1]); }),
+
Button(&rating_labels[2], [&] { on_rating(rating_labels[2]); }),
+
Button(&rating_labels[3], [&] { on_rating(rating_labels[3]); }),
+
Button(&rating_labels[4], [&] { on_rating(rating_labels[4]); }),
+
});
+
+
auto depth_1_renderer = Renderer(depth_1_container, [&] {
+
return vbox({
+
text("Do you like FTXUI?"),
+
separator(),
+
hbox(depth_1_container->Render()),
+
}) |
+
border;
+
});
+
+
auto main_container = Container::Tab(
+
{
+
depth_0_renderer,
+
depth_1_renderer,
+
},
+
&depth);
+
+
auto main_renderer = Renderer(main_container, [&] {
+
Element document = depth_0_renderer->Render();
+
+
if (depth == 1) {
+
document = dbox({
+
document,
+
depth_1_renderer->Render() | clear_under | center,
+
});
+
}
+
return document;
+
});
+
+
screen.Loop(main_renderer);
+
return 0;
+
}
+ + + + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+ +
+
+ + + + + diff --git a/examples_2component_2nested_screen_8cpp-example.html b/examples_2component_2nested_screen_8cpp-example.html new file mode 100644 index 000000000..0ea0c9622 --- /dev/null +++ b/examples_2component_2nested_screen_8cpp-example.html @@ -0,0 +1,266 @@ + + + + + + + + +FTXUI: examples/component/nested_screen.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/nested_screen.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <memory> // for allocator, shared_ptr, __shared_ptr_access
+
#include <string> // for operator+, string, char_traits, basic_string
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Button, Vertical, Renderer
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for separator, text, Element, operator|, vbox, border
+
+
using namespace ftxui;
+
+
void Nested(std::string path) {
+
auto screen = ScreenInteractive::FitComponent();
+
auto back_button = Button("Back", screen.ExitLoopClosure());
+
auto goto_1 = Button("Goto /1", [path] { Nested(path + "/1"); });
+
auto goto_2 = Button("Goto /2", [path] { Nested(path + "/2"); });
+
auto goto_3 = Button("Goto /3", [path] { Nested(path + "/3"); });
+
auto layout = Container::Vertical({
+
back_button,
+
goto_1,
+
goto_2,
+
goto_3,
+
});
+
auto renderer = Renderer(layout, [&] {
+
return vbox({
+
text("path: " + path),
+
separator(),
+
back_button->Render(),
+
goto_1->Render(),
+
goto_2->Render(),
+
goto_3->Render(),
+
}) |
+
border;
+
});
+
screen.Loop(renderer);
+
}
+
+
int main() {
+
auto screen = ScreenInteractive::FitComponent();
+
auto button_quit = Button("Quit", screen.ExitLoopClosure());
+
auto button_nested = Button("Nested", [] { Nested(""); });
+
screen.Loop(Container::Vertical({
+
button_quit,
+
button_nested,
+
}));
+
return 0;
+
}
+ + + + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
void Nested(std::string path)
+ +
+
+ + + + + diff --git a/examples_2component_2print_key_press_8cpp-example.html b/examples_2component_2print_key_press_8cpp-example.html new file mode 100644 index 000000000..ea31a7bb7 --- /dev/null +++ b/examples_2component_2print_key_press_8cpp-example.html @@ -0,0 +1,286 @@ + + + + + + + + +FTXUI: examples/component/print_key_press.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/print_key_press.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
+
#include <stddef.h> // for size_t
+
#include <algorithm> // for max
+
#include <memory> // for allocator, shared_ptr
+
#include <string> // for char_traits, operator+, string, basic_string, to_string
+
#include <utility> // for move
+
#include <vector> // for vector
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for CatchEvent, Renderer
+
#include "ftxui/component/event.hpp" // for Event
+
#include "ftxui/component/mouse.hpp" // for Mouse, Mouse::Left, Mouse::Middle, Mouse::None, Mouse::Pressed, Mouse::Released, Mouse::Right, Mouse::WheelDown, Mouse::WheelUp
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for text, vbox, window, Element, Elements
+
+
using namespace ftxui;
+
+
std::string Code(Event event) {
+
std::string codes;
+
for (auto& it : event.input()) {
+
codes += " " + std::to_string((unsigned int)it);
+
}
+
return codes;
+
}
+
+
int main() {
+
auto screen = ScreenInteractive::TerminalOutput();
+
+
std::vector<Event> keys;
+
+
auto left_column = Renderer([&] {
+
Elements children = {
+
text("Codes"),
+
separator(),
+
};
+
for (size_t i = std::max(0, (int)keys.size() - 20); i < keys.size(); ++i) {
+
children.push_back(text(Code(keys[i])));
+
}
+
return vbox(children);
+
});
+
+
auto right_column = Renderer([&] {
+
Elements children = {
+
text("Event"),
+
separator(),
+
};
+
for (size_t i = std::max(0, (int)keys.size() - 20); i < keys.size(); ++i) {
+
children.push_back(text(keys[i].DebugString()));
+
}
+
return vbox(children);
+
});
+
+
int split_size = 40;
+
auto component = ResizableSplitLeft(left_column, right_column, &split_size);
+
component |= border;
+
+
component |= CatchEvent([&](Event event) {
+
keys.push_back(event);
+
return false;
+
});
+
+
screen.Loop(component);
+
}
+ + + + + +
const std::string & input() const
Definition event.hpp:104
+
Represent an event. It can be key press event, a terminal resize, or more ...
Definition event.hpp:29
+ +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::vector< Element > Elements
Definition elements.hpp:23
+
std::string Code(Event event)
+ +
+
+ + + + + diff --git a/examples_2component_2radiobox_8cpp-example.html b/examples_2component_2radiobox_8cpp-example.html new file mode 100644 index 000000000..af8423b10 --- /dev/null +++ b/examples_2component_2radiobox_8cpp-example.html @@ -0,0 +1,238 @@ + + + + + + + + +FTXUI: examples/component/radiobox.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/radiobox.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <string> // for string, allocator, basic_string
+
#include <vector> // for vector
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Radiobox
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
+
using namespace ftxui;
+
+
int main() {
+
std::vector<std::string> radiobox_list = {
+
"Use gcc",
+
"Use clang",
+
"Use emscripten",
+
"Use tcc",
+
};
+
int selected = 0;
+
+
auto screen = ScreenInteractive::TerminalOutput();
+
screen.Loop(Radiobox(&radiobox_list, &selected));
+
return 0;
+
}
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/examples_2component_2radiobox_8cpp.html b/examples_2component_2radiobox_8cpp.html new file mode 100644 index 000000000..17a2dd2bc --- /dev/null +++ b/examples_2component_2radiobox_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: radiobox.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
radiobox.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 13 of file examples/component/radiobox.cpp.

+ +
+
+
+
+ + + + + diff --git a/examples_2component_2radiobox_8cpp.js b/examples_2component_2radiobox_8cpp.js new file mode 100644 index 000000000..ac6865865 --- /dev/null +++ b/examples_2component_2radiobox_8cpp.js @@ -0,0 +1,4 @@ +var examples_2component_2radiobox_8cpp = +[ + [ "main", "examples_2component_2radiobox_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/examples_2component_2radiobox_8cpp_source.html b/examples_2component_2radiobox_8cpp_source.html new file mode 100644 index 000000000..ab82a7f7c --- /dev/null +++ b/examples_2component_2radiobox_8cpp_source.html @@ -0,0 +1,243 @@ + + + + + + + + +FTXUI: radiobox.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/radiobox.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <string> // for string, allocator, basic_string
+
5#include <vector> // for vector
+
6
+
7#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
8#include "ftxui/component/component.hpp" // for Radiobox
+
9#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
10
+
11using namespace ftxui;
+
12
+
+
13int main() {
+
14 std::vector<std::string> radiobox_list = {
+
15 "Use gcc",
+
16 "Use clang",
+
17 "Use emscripten",
+
18 "Use tcc",
+
19 };
+
20 int selected = 0;
+
21
+ +
23 screen.Loop(Radiobox(&radiobox_list, &selected));
+
24 return 0;
+
25}
+
+ + + +
static ScreenInteractive TerminalOutput()
+
Component Radiobox(RadioboxOption options)
A list of element, where only one can be selected.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/examples_2component_2radiobox_in_frame_8cpp-example.html b/examples_2component_2radiobox_in_frame_8cpp-example.html new file mode 100644 index 000000000..06b5afd2d --- /dev/null +++ b/examples_2component_2radiobox_in_frame_8cpp-example.html @@ -0,0 +1,248 @@ + + + + + + + + +FTXUI: examples/component/radiobox_in_frame.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/radiobox_in_frame.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <memory> // for shared_ptr, __shared_ptr_access
+
#include <string> // for string, basic_string, operator+, to_string
+
#include <vector> // for vector
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Radiobox, Renderer
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, HEIGHT, LESS_THAN
+
+
using namespace ftxui;
+
+
int main() {
+
std::vector<std::string> entries;
+
int selected = 0;
+
+
for (int i = 0; i < 30; ++i) {
+
entries.push_back("RadioBox " + std::to_string(i));
+
}
+
auto radiobox = Radiobox(&entries, &selected);
+
auto renderer = Renderer(radiobox, [&] {
+
return radiobox->Render() | vscroll_indicator | frame |
+
size(HEIGHT, LESS_THAN, 10) | border;
+
});
+
+
auto screen = ScreenInteractive::FitComponent();
+
screen.Loop(renderer);
+
+
return 0;
+
}
+ + + + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/examples_2component_2renderer_8cpp-example.html b/examples_2component_2renderer_8cpp-example.html new file mode 100644 index 000000000..ef91fd13f --- /dev/null +++ b/examples_2component_2renderer_8cpp-example.html @@ -0,0 +1,266 @@ + + + + + + + + +FTXUI: examples/component/renderer.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/renderer.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <memory> // for shared_ptr, allocator, __shared_ptr_access
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Renderer, Button, Vertical
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for operator|, Element, text, bold, border, center, color
+
#include "ftxui/screen/color.hpp" // for Color, Color::Red
+
+
int main() {
+
using namespace ftxui;
+
auto screen = ScreenInteractive::FitComponent();
+
+
// A Renderer() is a component using a lambda function as a parameter to
+
// render itself.
+
+
// 1. Example of focusable renderer:
+
auto renderer_focusable = Renderer([](bool focused) {
+
if (focused) {
+
return text("FOCUSABLE RENDERER()") | center | bold | border;
+
} else {
+
return text(" Focusable renderer() ") | center | border;
+
}
+
});
+
+
// 2. Examples of a non focusable renderer.
+
auto renderer_non_focusable = Renderer([&] {
+
return text("~~~~~ Non Focusable renderer() ~~~~~"); //
+
});
+
+
// 3. Renderer can wrap other components to redefine their Render() function.
+
auto button = Button("Wrapped quit button", screen.ExitLoopClosure());
+
auto renderer_wrap = Renderer(button, [&] {
+
if (button->Focused()) {
+
return button->Render() | bold | color(Color::Red);
+
} else {
+
return button->Render();
+
}
+
});
+
+
// Let's renderer everyone:
+
screen.Loop(Container::Vertical({
+
renderer_focusable,
+
renderer_non_focusable,
+
renderer_wrap,
+
}));
+
}
+ + + + + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/examples_2component_2renderer_8cpp.html b/examples_2component_2renderer_8cpp.html new file mode 100644 index 000000000..29b574872 --- /dev/null +++ b/examples_2component_2renderer_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: renderer.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
renderer.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 13 of file examples/component/renderer.cpp.

+ +
+
+
+
+ + + + + diff --git a/examples_2component_2renderer_8cpp.js b/examples_2component_2renderer_8cpp.js new file mode 100644 index 000000000..cb5dbefe0 --- /dev/null +++ b/examples_2component_2renderer_8cpp.js @@ -0,0 +1,4 @@ +var examples_2component_2renderer_8cpp = +[ + [ "main", "examples_2component_2renderer_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/examples_2component_2renderer_8cpp_source.html b/examples_2component_2renderer_8cpp_source.html new file mode 100644 index 000000000..cf08dff7d --- /dev/null +++ b/examples_2component_2renderer_8cpp_source.html @@ -0,0 +1,269 @@ + + + + + + + + +FTXUI: renderer.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/renderer.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <memory> // for shared_ptr, allocator, __shared_ptr_access
+
5
+
6#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
7#include "ftxui/component/component.hpp" // for Renderer, Button, Vertical
+
8#include "ftxui/component/component_base.hpp" // for ComponentBase
+
9#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
10#include "ftxui/dom/elements.hpp" // for operator|, Element, text, bold, border, center, color
+
11#include "ftxui/screen/color.hpp" // for Color, Color::Red
+
12
+
+
13int main() {
+
14 using namespace ftxui;
+
15 auto screen = ScreenInteractive::FitComponent();
+
16
+
17 // A Renderer() is a component using a lambda function as a parameter to
+
18 // render itself.
+
19
+
20 // 1. Example of focusable renderer:
+
21 auto renderer_focusable = Renderer([](bool focused) {
+
22 if (focused) {
+
23 return text("FOCUSABLE RENDERER()") | center | bold | border;
+
24 } else {
+
25 return text(" Focusable renderer() ") | center | border;
+
26 }
+
27 });
+
28
+
29 // 2. Examples of a non focusable renderer.
+
30 auto renderer_non_focusable = Renderer([&] {
+
31 return text("~~~~~ Non Focusable renderer() ~~~~~"); //
+
32 });
+
33
+
34 // 3. Renderer can wrap other components to redefine their Render() function.
+
35 auto button = Button("Wrapped quit button", screen.ExitLoopClosure());
+
36 auto renderer_wrap = Renderer(button, [&] {
+
37 if (button->Focused()) {
+
38 return button->Render() | bold | color(Color::Red);
+
39 } else {
+
40 return button->Render();
+
41 }
+
42 });
+
43
+
44 // Let's renderer everyone:
+
45 screen.Loop(Container::Vertical({
+
46 renderer_focusable,
+
47 renderer_non_focusable,
+
48 renderer_wrap,
+
49 }));
+
50}
+
+ + + + + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/examples_2component_2resizable__split_8cpp.html b/examples_2component_2resizable__split_8cpp.html new file mode 100644 index 000000000..e03e5b010 --- /dev/null +++ b/examples_2component_2resizable__split_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: resizable_split.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
resizable_split.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 14 of file examples/component/resizable_split.cpp.

+ +
+
+
+
+ + + + + diff --git a/examples_2component_2resizable__split_8cpp.js b/examples_2component_2resizable__split_8cpp.js new file mode 100644 index 000000000..f53ca0512 --- /dev/null +++ b/examples_2component_2resizable__split_8cpp.js @@ -0,0 +1,4 @@ +var examples_2component_2resizable__split_8cpp = +[ + [ "main", "examples_2component_2resizable__split_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/examples_2component_2resizable__split_8cpp_source.html b/examples_2component_2resizable__split_8cpp_source.html new file mode 100644 index 000000000..15a1e0da4 --- /dev/null +++ b/examples_2component_2resizable__split_8cpp_source.html @@ -0,0 +1,268 @@ + + + + + + + + +FTXUI: resizable_split.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/resizable_split.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <memory> // for shared_ptr, allocator, __shared_ptr_access
+
5
+
6#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
7#include "ftxui/component/component.hpp" // for Renderer, ResizableSplitBottom, ResizableSplitLeft, ResizableSplitRight, ResizableSplitTop
+
8#include "ftxui/component/component_base.hpp" // for ComponentBase
+
9#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
10#include "ftxui/dom/elements.hpp" // for Element, operator|, text, center, border
+
11
+
12using namespace ftxui;
+
13
+
+
14int main() {
+
15 auto screen = ScreenInteractive::Fullscreen();
+
16
+
17 auto middle = Renderer([] { return text("middle") | center; });
+
18 auto left = Renderer([] { return text("Left") | center; });
+
19 auto right = Renderer([] { return text("right") | center; });
+
20 auto top = Renderer([] { return text("top") | center; });
+
21 auto bottom = Renderer([] { return text("bottom") | center; });
+
22
+
23 int left_size = 20;
+
24 int right_size = 20;
+
25 int top_size = 10;
+
26 int bottom_size = 10;
+
27
+
28 auto container = middle;
+
29 container = ResizableSplitLeft(left, container, &left_size);
+
30 container = ResizableSplitRight(right, container, &right_size);
+
31 container = ResizableSplitTop(top, container, &top_size);
+
32 container = ResizableSplitBottom(bottom, container, &bottom_size);
+
33
+
34 auto renderer =
+
35 Renderer(container, [&] { return container->Render() | border; });
+
36
+
37 screen.Loop(renderer);
+
38}
+
+ + + + + +
static ScreenInteractive Fullscreen()
+
Component ResizableSplitTop(Component main, Component back, int *main_size)
An vertical split in between two components, configurable using the mouse.
+
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
+
Component ResizableSplitRight(Component main, Component back, int *main_size)
An horizontal split in between two components, configurable using the mouse.
+
Component ResizableSplitBottom(Component main, Component back, int *main_size)
An vertical split in between two components, configurable using the mouse.
+
Component ResizableSplitLeft(Component main, Component back, int *main_size)
An horizontal split in between two components, configurable using the mouse.
+
Element center(Element)
Center an element horizontally and vertically.
+
Element text(std::wstring text)
Display a piece of unicode text.
Definition text.cpp:160
+
Element border(Element)
Draw a border around the element.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::uint8_t top
Definition screen.cpp:131
+
std::uint8_t left
Definition screen.cpp:130
+
std::uint8_t right
Definition screen.cpp:132
+ +
+
+ + + + + diff --git a/examples_2component_2resizable_split_8cpp-example.html b/examples_2component_2resizable_split_8cpp-example.html new file mode 100644 index 000000000..beeb7ec07 --- /dev/null +++ b/examples_2component_2resizable_split_8cpp-example.html @@ -0,0 +1,256 @@ + + + + + + + + +FTXUI: examples/component/resizable_split.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/resizable_split.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <memory> // for shared_ptr, allocator, __shared_ptr_access
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Renderer, ResizableSplitBottom, ResizableSplitLeft, ResizableSplitRight, ResizableSplitTop
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for Element, operator|, text, center, border
+
+
using namespace ftxui;
+
+
int main() {
+
auto screen = ScreenInteractive::Fullscreen();
+
+
auto middle = Renderer([] { return text("middle") | center; });
+
auto left = Renderer([] { return text("Left") | center; });
+
auto right = Renderer([] { return text("right") | center; });
+
auto top = Renderer([] { return text("top") | center; });
+
auto bottom = Renderer([] { return text("bottom") | center; });
+
+
int left_size = 20;
+
int right_size = 20;
+
int top_size = 10;
+
int bottom_size = 10;
+
+
auto container = middle;
+
container = ResizableSplitLeft(left, container, &left_size);
+
container = ResizableSplitRight(right, container, &right_size);
+
container = ResizableSplitTop(top, container, &top_size);
+
container = ResizableSplitBottom(bottom, container, &bottom_size);
+
+
auto renderer =
+
Renderer(container, [&] { return container->Render() | border; });
+
+
screen.Loop(renderer);
+
}
+ + + + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::uint8_t top
Definition screen.cpp:131
+
std::uint8_t left
Definition screen.cpp:130
+
std::uint8_t right
Definition screen.cpp:132
+ +
+
+ + + + + diff --git a/examples_2component_2scrollbar_8cpp-example.html b/examples_2component_2scrollbar_8cpp-example.html new file mode 100644 index 000000000..8dcc7990d --- /dev/null +++ b/examples_2component_2scrollbar_8cpp-example.html @@ -0,0 +1,337 @@ + + + + + + + + +FTXUI: examples/component/scrollbar.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/scrollbar.cpp
+
+
+
// Copyright 2023 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+ + +
#include <string>
+
+
using namespace ftxui;
+
+ +
class Impl : public ComponentBase {
+
private:
+
float scroll_x = 0.1;
+
float scroll_y = 0.1;
+
+
public:
+
Impl() {
+
auto content = Renderer([=] {
+
const std::string lorem =
+
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed "
+
"do eiusmod tempor incididunt ut labore et dolore magna "
+
"aliqua. Ut enim ad minim veniam, quis nostrud exercitation "
+
"ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis "
+
"aute irure dolor in reprehenderit in voluptate velit esse "
+
"cillum dolore eu fugiat nulla pariatur. Excepteur sint "
+
"occaecat cupidatat non proident, sunt in culpa qui officia "
+
"deserunt mollit anim id est laborum.";
+
return vbox({
+
text(lorem.substr(0, -1)), text(lorem.substr(5, -1)), text(""),
+
text(lorem.substr(10, -1)), text(lorem.substr(15, -1)), text(""),
+
text(lorem.substr(20, -1)), text(lorem.substr(25, -1)), text(""),
+
text(lorem.substr(30, -1)), text(lorem.substr(35, -1)), text(""),
+
text(lorem.substr(40, -1)), text(lorem.substr(45, -1)), text(""),
+
text(lorem.substr(50, -1)), text(lorem.substr(55, -1)), text(""),
+
text(lorem.substr(60, -1)), text(lorem.substr(65, -1)), text(""),
+
text(lorem.substr(70, -1)), text(lorem.substr(75, -1)), text(""),
+
text(lorem.substr(80, -1)), text(lorem.substr(85, -1)), text(""),
+
text(lorem.substr(90, -1)), text(lorem.substr(95, -1)), text(""),
+
text(lorem.substr(100, -1)), text(lorem.substr(105, -1)), text(""),
+
text(lorem.substr(110, -1)), text(lorem.substr(115, -1)), text(""),
+
text(lorem.substr(120, -1)), text(lorem.substr(125, -1)), text(""),
+
text(lorem.substr(130, -1)), text(lorem.substr(135, -1)), text(""),
+
text(lorem.substr(140, -1)),
+
});
+
});
+
+
auto scrollable_content = Renderer(content, [&, content] {
+
return content->Render() | focusPositionRelative(scroll_x, scroll_y) |
+
frame | flex;
+
});
+
+ +
option_x.value = &scroll_x;
+
option_x.min = 0.f;
+
option_x.max = 1.f;
+
option_x.increment = 0.1f;
+
option_x.direction = Direction::Right;
+
option_x.color_active = Color::Blue;
+
option_x.color_inactive = Color::BlueLight;
+
auto scrollbar_x = Slider(option_x);
+
+ +
option_y.value = &scroll_y;
+
option_y.min = 0.f;
+
option_y.max = 1.f;
+
option_y.increment = 0.1f;
+
option_y.direction = Direction::Down;
+
option_y.color_active = Color::Yellow;
+
option_y.color_inactive = Color::YellowLight;
+
auto scrollbar_y = Slider(option_y);
+
+
Add(Container::Vertical({
+
Container::Horizontal({
+
scrollable_content,
+
scrollbar_y,
+
}) | flex,
+
Container::Horizontal({
+
scrollbar_x,
+
Renderer([] { return text(L"x"); }),
+
}),
+
}));
+
}
+
};
+
return Make<Impl>();
+
}
+
+
int main() {
+
auto window_1 = Window({
+
.inner = DummyWindowContent(),
+
.title = "First window",
+
.width = 80,
+
.height = 30,
+
});
+
+
auto window_2 = Window({
+
.inner = DummyWindowContent(),
+
.title = "My window",
+
.left = 40,
+
.top = 20,
+
.width = 80,
+
.height = 30,
+
});
+
+
auto window_container = Container::Stacked({
+
window_1,
+
window_2,
+
});
+
+
auto screen = ScreenInteractive::Fullscreen();
+
screen.Loop(window_container);
+
+
return EXIT_SUCCESS;
+
}
+ + +
It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ft...
+
Component Window(std::string title, Component component)
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< ComponentBase > Component
+ +
Component DummyWindowContent()
Definition scrollbar.cpp:10
+ + + + + + + + +
+
+ + + + + diff --git a/examples_2component_2selection_8cpp-example.html b/examples_2component_2selection_8cpp-example.html new file mode 100644 index 000000000..37826de10 --- /dev/null +++ b/examples_2component_2selection_8cpp-example.html @@ -0,0 +1,307 @@ + + + + + + + + +FTXUI: examples/component/selection.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/selection.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <string> // for char_traits, operator+, string, basic_string
+
+
#include "ftxui/component/component.hpp" // for Input, Renderer, Vertical
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/component_options.hpp" // for InputOption
+
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for text, hbox, separator, Element, operator|, vbox, border
+
#include "ftxui/util/ref.hpp" // for Ref
+
+
using namespace ftxui;
+
+ +
return vbox({
+
text("FTXUI: A powerful library for building user interfaces."),
+
text("Enjoy a rich set of components and a declarative style."),
+
text("Create beautiful and responsive UIs with minimal effort."),
+
text("Join the community and experience the power of FTXUI."),
+
});
+
}
+
+
int main() {
+
auto screen = ScreenInteractive::TerminalOutput();
+
+
auto quit =
+
Button("Quit", screen.ExitLoopClosure(), ButtonOption::Animated());
+
+
int selection_change_counter = 0;
+
std::string selection_content = "";
+
screen.SelectionChange([&] {
+
selection_change_counter++;
+
selection_content = screen.GetSelection();
+
});
+
+
// The components:
+
auto renderer = Renderer(quit, [&] {
+
return vbox({
+
text("Select changed: " + std::to_string(selection_change_counter) +
+
" times"),
+
text("Currently selected: "),
+
paragraph(selection_content) | vscroll_indicator | frame | border |
+
size(HEIGHT, EQUAL, 10),
+
window(text("Horizontal split"), hbox({
+ +
separator(),
+ +
separator(),
+ +
})),
+
window(text("Vertical split"), vbox({
+ +
separator(),
+ +
separator(),
+ +
})),
+
window(text("Grid split with different style"),
+
vbox({
+
hbox({
+ +
separator(),
+ +
| selectionBackgroundColor(Color::Yellow) //
+
| selectionColor(Color::Black) //
+
| selectionStyleReset,
+
separator(),
+
LoremIpsum() | selectionColor(Color::Blue),
+
}),
+
separator(),
+
hbox({
+
LoremIpsum() | selectionColor(Color::Red),
+
separator(),
+
LoremIpsum() | selectionStyle([](Pixel& pixel) {
+
pixel.underlined_double = true;
+
}),
+
separator(),
+ +
}),
+
})),
+
quit->Render(),
+
});
+
});
+
+
screen.Loop(renderer);
+
}
+ + + + + +
Element LoremIpsum()
+
bool underlined_double
Definition pixel.hpp:34
+
A Unicode character and its associated style.
Definition pixel.hpp:15
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+ + +
+
+ + + + + diff --git a/examples_2component_2selection_8cpp.html b/examples_2component_2selection_8cpp.html new file mode 100644 index 000000000..89baad829 --- /dev/null +++ b/examples_2component_2selection_8cpp.html @@ -0,0 +1,262 @@ + + + + + + + + +FTXUI: selection.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
selection.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + +

+Functions

Element LoremIpsum ()
 
int main ()
 
+

Function Documentation

+ +

◆ LoremIpsum()

+ +
+
+ + + + + + + +
Element LoremIpsum ()
+
+
Examples
examples/component/selection.cpp.
+
+ +

Definition at line 15 of file examples/component/selection.cpp.

+ +
+
+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 24 of file examples/component/selection.cpp.

+ +
+
+
+
+ + + + + diff --git a/examples_2component_2selection_8cpp.js b/examples_2component_2selection_8cpp.js new file mode 100644 index 000000000..69d33eecc --- /dev/null +++ b/examples_2component_2selection_8cpp.js @@ -0,0 +1,5 @@ +var examples_2component_2selection_8cpp = +[ + [ "LoremIpsum", "examples_2component_2selection_8cpp.html#a693bf20426978b4a6d5114374d8c521d", null ], + [ "main", "examples_2component_2selection_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/examples_2component_2selection_8cpp_source.html b/examples_2component_2selection_8cpp_source.html new file mode 100644 index 000000000..5f8b0fc44 --- /dev/null +++ b/examples_2component_2selection_8cpp_source.html @@ -0,0 +1,334 @@ + + + + + + + + +FTXUI: selection.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/selection.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <string> // for char_traits, operator+, string, basic_string
+
5
+
6#include "ftxui/component/component.hpp" // for Input, Renderer, Vertical
+
7#include "ftxui/component/component_base.hpp" // for ComponentBase
+
8#include "ftxui/component/component_options.hpp" // for InputOption
+
9#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
+
10#include "ftxui/dom/elements.hpp" // for text, hbox, separator, Element, operator|, vbox, border
+
11#include "ftxui/util/ref.hpp" // for Ref
+
12
+
13using namespace ftxui;
+
14
+
+ +
16 return vbox({
+
17 text("FTXUI: A powerful library for building user interfaces."),
+
18 text("Enjoy a rich set of components and a declarative style."),
+
19 text("Create beautiful and responsive UIs with minimal effort."),
+
20 text("Join the community and experience the power of FTXUI."),
+
21 });
+
22}
+
+
23
+
+
24int main() {
+ +
26
+
27 auto quit =
+
28 Button("Quit", screen.ExitLoopClosure(), ButtonOption::Animated());
+
29
+
30 int selection_change_counter = 0;
+
31 std::string selection_content = "";
+
32 screen.SelectionChange([&] {
+
33 selection_change_counter++;
+
34 selection_content = screen.GetSelection();
+
35 });
+
36
+
37 // The components:
+
38 auto renderer = Renderer(quit, [&] {
+
39 return vbox({
+
40 text("Select changed: " + std::to_string(selection_change_counter) +
+
41 " times"),
+
42 text("Currently selected: "),
+
43 paragraph(selection_content) | vscroll_indicator | frame | border |
+
44 size(HEIGHT, EQUAL, 10),
+
45 window(text("Horizontal split"), hbox({
+
46 LoremIpsum(),
+
47 separator(),
+
48 LoremIpsum(),
+
49 separator(),
+
50 LoremIpsum(),
+
51 })),
+
52 window(text("Vertical split"), vbox({
+
53 LoremIpsum(),
+
54 separator(),
+
55 LoremIpsum(),
+
56 separator(),
+
57 LoremIpsum(),
+
58 })),
+
59 window(text("Grid split with different style"),
+
60 vbox({
+
61 hbox({
+
62 LoremIpsum(),
+
63 separator(),
+
64 LoremIpsum() //
+ + + +
68 separator(),
+ +
70 }),
+
71 separator(),
+
72 hbox({
+ +
74 separator(),
+
75 LoremIpsum() | selectionStyle([](Pixel& pixel) {
+
76 pixel.underlined_double = true;
+
77 }),
+
78 separator(),
+
79 LoremIpsum(),
+
80 }),
+
81 })),
+
82 quit->Render(),
+
83 });
+
84 });
+
85
+
86 screen.Loop(renderer);
+
87}
+
+ + + + +
Element LoremIpsum()
+ +
static ButtonOption Animated()
Create a ButtonOption, using animated colors.
+
static ScreenInteractive TerminalOutput()
+
Component Button(ButtonOption options)
Draw a button. Execute a function when clicked.
+
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
+
virtual void Render(Screen &screen)
Display an element on a ftxui::Screen.
Definition node.cpp:59
+
Element window(Element title, Element content, BorderStyle border=ROUNDED)
Draw window with a title and a border around the element.
+
Decorator size(WidthOrHeight, Constraint, int value)
Apply a constraint on the size of an element.
+
Element text(std::wstring text)
Display a piece of unicode text.
Definition text.cpp:160
+
Element separator()
Draw a vertical or horizontal separation in between two other elements.
+
Element vbox(Elements)
A container displaying elements vertically one by one.
Definition vbox.cpp:96
+ + + + +
bool underlined_double
Definition pixel.hpp:34
+
A Unicode character and its associated style.
Definition pixel.hpp:15
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
std::shared_ptr< Node > Element
Definition elements.hpp:22
+
Decorator selectionStyle(std::function< void(Pixel &)> style)
Set the style of an element when selected.
+
Element hbox(Elements)
A container displaying elements horizontally one by one.
Definition hbox.cpp:94
+
Decorator selectionBackgroundColor(Color foreground)
Set the background color of an element when selected. Note that the style is applied on top of the ex...
+
Decorator selectionColor(Color foreground)
Set the color of an element when selected.
+
Element selectionStyleReset(Element)
Reset the selection style of an element.
+
Elements paragraph(std::wstring text)
+ + + +
+
+ + + + + diff --git a/examples_2component_2slider_8cpp-example.html b/examples_2component_2slider_8cpp-example.html new file mode 100644 index 000000000..5c932965b --- /dev/null +++ b/examples_2component_2slider_8cpp-example.html @@ -0,0 +1,229 @@ + + + + + + + + +FTXUI: examples/component/slider.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/slider.cpp
+
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Slider
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
+
using namespace ftxui;
+
+
int main() {
+
auto screen = ScreenInteractive::TerminalOutput();
+
int value = 50;
+
auto slider = Slider("Value:", &value, 0, 100, 1);
+
screen.Loop(slider);
+
}
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/examples_2component_2slider_8cpp.html b/examples_2component_2slider_8cpp.html new file mode 100644 index 000000000..d3ab7a001 --- /dev/null +++ b/examples_2component_2slider_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: slider.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
slider.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 7 of file examples/component/slider.cpp.

+ +
+
+
+
+ + + + + diff --git a/examples_2component_2slider_8cpp.js b/examples_2component_2slider_8cpp.js new file mode 100644 index 000000000..0f0dc37a7 --- /dev/null +++ b/examples_2component_2slider_8cpp.js @@ -0,0 +1,4 @@ +var examples_2component_2slider_8cpp = +[ + [ "main", "examples_2component_2slider_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/examples_2component_2slider_8cpp_source.html b/examples_2component_2slider_8cpp_source.html new file mode 100644 index 000000000..5c9fde565 --- /dev/null +++ b/examples_2component_2slider_8cpp_source.html @@ -0,0 +1,234 @@ + + + + + + + + +FTXUI: slider.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/slider.cpp
+
+
+Go to the documentation of this file.
1#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
2#include "ftxui/component/component.hpp" // for Slider
+
3#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
4
+
5using namespace ftxui;
+
6
+
+
7int main() {
+ +
9 int value = 50;
+
10 auto slider = Slider("Value:", &value, 0, 100, 1);
+
11 screen.Loop(slider);
+
12}
+
+
13
+
14// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
15// Use of this source code is governed by the MIT license that can be found in
+
16// the LICENSE file.
+ + + +
static ScreenInteractive TerminalOutput()
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
Component Slider(SliderOption< T > options)
A slider in any direction.
+ +
+
+ + + + + diff --git a/examples_2component_2slider_direction_8cpp-example.html b/examples_2component_2slider_direction_8cpp-example.html new file mode 100644 index 000000000..eee5f8807 --- /dev/null +++ b/examples_2component_2slider_direction_8cpp-example.html @@ -0,0 +1,272 @@ + + + + + + + + +FTXUI: examples/component/slider_direction.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/slider_direction.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <array> // for array
+
#include <cmath> // for sin
+
#include <ftxui/component/component_base.hpp> // for ComponentBase
+
#include <ftxui/component/component_options.hpp> // for SliderOption
+
#include <ftxui/dom/direction.hpp> // for Direction, Direction::Up
+
#include <ftxui/dom/elements.hpp> // for size, GREATER_THAN, HEIGHT
+
#include <ftxui/util/ref.hpp> // for ConstRef, Ref
+
#include <memory> // for shared_ptr, __shared_ptr_access
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Horizontal, Slider, operator|=
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
+
using namespace ftxui;
+
+
int main() {
+
auto screen = ScreenInteractive::TerminalOutput();
+
std::array<int, 30> values;
+
for (size_t i = 0; i < values.size(); ++i) {
+
values[i] = 50 + 20 * std::sin(i * 0.3);
+
}
+
+
auto layout_horizontal = Container::Horizontal({});
+
for (auto& value : values) {
+
// In C++17:
+ +
option.value = &value;
+
option.max = 100;
+
option.increment = 5;
+
option.direction = Direction::Up;
+
layout_horizontal->Add(Slider<int>(option));
+
+
/* In C++20:
+
layout_horizontal->Add(Slider<int>({
+
.value = &values[i],
+
.max = 100,
+
.increment = 5,
+
.direction = Direction::Up,
+
}));
+
*/
+
}
+
+
layout_horizontal |= size(HEIGHT, GREATER_THAN, 20);
+
+
screen.Loop(layout_horizontal);
+
}
+ + + + + + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + + + + + + +
+
+ + + + + diff --git a/examples_2component_2slider_rgb_8cpp-example.html b/examples_2component_2slider_rgb_8cpp-example.html new file mode 100644 index 000000000..9e472634d --- /dev/null +++ b/examples_2component_2slider_rgb_8cpp-example.html @@ -0,0 +1,280 @@ + + + + + + + + +FTXUI: examples/component/slider_rgb.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/slider_rgb.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <memory> // for allocator, shared_ptr, __shared_ptr_access
+
#include <string> // for char_traits, operator+, to_string
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Slider, Renderer, Vertical
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for separator, operator|, Element, size, text, vbox, xflex, bgcolor, hbox, GREATER_THAN, WIDTH, border, HEIGHT, LESS_THAN
+
#include "ftxui/screen/color.hpp" // for Color
+
+
using namespace ftxui;
+
+
Element ColorTile(int red, int green, int blue) {
+
return text("") | size(WIDTH, GREATER_THAN, 14) |
+
size(HEIGHT, GREATER_THAN, 7) | bgcolor(Color::RGB(red, green, blue));
+
}
+
+
Element ColorString(int red, int green, int blue) {
+
return text("RGB = (" + //
+
std::to_string(red) + "," + //
+
std::to_string(green) + "," + //
+
std::to_string(blue) + ")" //
+
);
+
}
+
+
int main() {
+
int red = 128;
+
int green = 25;
+
int blue = 100;
+
auto slider_red = Slider("Red :", &red, 0, 255, 1);
+
auto slider_green = Slider("Green:", &green, 0, 255, 1);
+
auto slider_blue = Slider("Blue :", &blue, 0, 255, 1);
+
+
auto container = Container::Vertical({
+
slider_red,
+
slider_green,
+
slider_blue,
+
});
+
+
auto renderer = Renderer(container, [&] {
+
return hbox({
+
ColorTile(red, green, blue),
+
separator(),
+
vbox({
+
slider_red->Render(),
+
separator(),
+
slider_green->Render(),
+
separator(),
+
slider_blue->Render(),
+
separator(),
+
ColorString(red, green, blue),
+
}) | xflex,
+
}) |
+
border | size(WIDTH, LESS_THAN, 80);
+
});
+
auto screen = ScreenInteractive::TerminalOutput();
+
screen.Loop(renderer);
+
}
+ + + + + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+ +
Element ColorTile(int red, int green, int blue)
+
Element ColorString(int red, int green, int blue)
+
+
+ + + + + diff --git a/examples_2component_2tab_horizontal_8cpp-example.html b/examples_2component_2tab_horizontal_8cpp-example.html new file mode 100644 index 000000000..6c18d1335 --- /dev/null +++ b/examples_2component_2tab_horizontal_8cpp-example.html @@ -0,0 +1,285 @@ + + + + + + + + +FTXUI: examples/component/tab_horizontal.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/tab_horizontal.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <memory> // for allocator, __shared_ptr_access, shared_ptr
+
#include <string> // for string, basic_string
+
#include <vector> // for vector
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Radiobox, Renderer, Tab, Toggle, Vertical
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for Element, separator, operator|, vbox, border
+
+
using namespace ftxui;
+
+
int main() {
+
std::vector<std::string> tab_values{
+
"tab_1",
+
"tab_2",
+
"tab_3",
+
};
+
int tab_selected = 0;
+
auto tab_toggle = Toggle(&tab_values, &tab_selected);
+
+
std::vector<std::string> tab_1_entries{
+
"Forest",
+
"Water",
+
"I don't know",
+
};
+
int tab_1_selected = 0;
+
+
std::vector<std::string> tab_2_entries{
+
"Hello",
+
"Hi",
+
"Hay",
+
};
+
int tab_2_selected = 0;
+
+
std::vector<std::string> tab_3_entries{
+
"Table",
+
"Nothing",
+
"Is",
+
"Empty",
+
};
+
int tab_3_selected = 0;
+
auto tab_container = Container::Tab(
+
{
+
Radiobox(&tab_1_entries, &tab_1_selected),
+
Radiobox(&tab_2_entries, &tab_2_selected),
+
Radiobox(&tab_3_entries, &tab_3_selected),
+
},
+
&tab_selected);
+
+
auto container = Container::Vertical({
+
tab_toggle,
+
tab_container,
+
});
+
+
auto renderer = Renderer(container, [&] {
+
return vbox({
+
tab_toggle->Render(),
+
separator(),
+
tab_container->Render(),
+
}) |
+
border;
+
});
+
+
auto screen = ScreenInteractive::TerminalOutput();
+
screen.Loop(renderer);
+
}
+ + + + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/examples_2component_2tab_vertical_8cpp-example.html b/examples_2component_2tab_vertical_8cpp-example.html new file mode 100644 index 000000000..58eb6e091 --- /dev/null +++ b/examples_2component_2tab_vertical_8cpp-example.html @@ -0,0 +1,285 @@ + + + + + + + + +FTXUI: examples/component/tab_vertical.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/tab_vertical.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <memory> // for allocator, __shared_ptr_access, shared_ptr
+
#include <string> // for string, basic_string
+
#include <vector> // for vector
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Radiobox, Horizontal, Menu, Renderer, Tab
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for Element, separator, hbox, operator|, border
+
+
using namespace ftxui;
+
+
int main() {
+
std::vector<std::string> tab_values{
+
"tab_1",
+
"tab_2",
+
"tab_3",
+
};
+
int tab_selected = 0;
+
auto tab_menu = Menu(&tab_values, &tab_selected);
+
+
std::vector<std::string> tab_1_entries{
+
"Forest",
+
"Water",
+
"I don't know",
+
};
+
int tab_1_selected = 0;
+
+
std::vector<std::string> tab_2_entries{
+
"Hello",
+
"Hi",
+
"Hay",
+
};
+
int tab_2_selected = 0;
+
+
std::vector<std::string> tab_3_entries{
+
"Table",
+
"Nothing",
+
"Is",
+
"Empty",
+
};
+
int tab_3_selected = 0;
+
auto tab_container = Container::Tab(
+
{
+
Radiobox(&tab_1_entries, &tab_1_selected),
+
Radiobox(&tab_2_entries, &tab_2_selected),
+
Radiobox(&tab_3_entries, &tab_3_selected),
+
},
+
&tab_selected);
+
+
auto container = Container::Horizontal({
+
tab_menu,
+
tab_container,
+
});
+
+
auto renderer = Renderer(container, [&] {
+
return hbox({
+
tab_menu->Render(),
+
separator(),
+
tab_container->Render(),
+
}) |
+
border;
+
});
+
+
auto screen = ScreenInteractive::TerminalOutput();
+
screen.Loop(renderer);
+
}
+ + + + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/examples_2component_2textarea_8cpp-example.html b/examples_2component_2textarea_8cpp-example.html new file mode 100644 index 000000000..27cb880df --- /dev/null +++ b/examples_2component_2textarea_8cpp-example.html @@ -0,0 +1,249 @@ + + + + + + + + +FTXUI: examples/component/textarea.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/textarea.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <memory> // for allocator, __shared_ptr_access, shared_ptr
+
#include <string> // for string
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Input, Renderer, ResizableSplitLeft
+
#include "ftxui/component/component_base.hpp" // for ComponentBase, Component
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for operator|, separator, text, Element, flex, vbox, border
+
+
int main() {
+
using namespace ftxui;
+
+
std::string content_1;
+
std::string content_2;
+
auto textarea_1 = Input(&content_1);
+
auto textarea_2 = Input(&content_2);
+
int size = 50;
+
auto layout = ResizableSplitLeft(textarea_1, textarea_2, &size);
+
+
auto component = Renderer(layout, [&] {
+
return vbox({
+
text("Input:"),
+
separator(),
+
layout->Render() | flex,
+
}) |
+
border;
+
});
+
+
auto screen = ScreenInteractive::Fullscreen();
+
screen.Loop(component);
+
}
+ + + + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/examples_2component_2toggle_8cpp-example.html b/examples_2component_2toggle_8cpp-example.html new file mode 100644 index 000000000..4aa23f846 --- /dev/null +++ b/examples_2component_2toggle_8cpp-example.html @@ -0,0 +1,280 @@ + + + + + + + + +FTXUI: examples/component/toggle.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/toggle.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <memory> // for allocator, __shared_ptr_access
+
#include <string> // for string, basic_string
+
#include <vector> // for vector
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Toggle, Renderer, Vertical
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for text, hbox, vbox, Element
+
+
using namespace ftxui;
+
+
int main() {
+
std::vector<std::string> toggle_1_entries = {
+
"On",
+
"Off",
+
};
+
std::vector<std::string> toggle_2_entries = {
+
"Enabled",
+
"Disabled",
+
};
+
std::vector<std::string> toggle_3_entries = {
+
"10€",
+
"0€",
+
};
+
std::vector<std::string> toggle_4_entries = {
+
"Nothing",
+
"One element",
+
"Several elements",
+
};
+
+
int toggle_1_selected = 0;
+
int toggle_2_selected = 0;
+
int toggle_3_selected = 0;
+
int toggle_4_selected = 0;
+
Component toggle_1 = Toggle(&toggle_1_entries, &toggle_1_selected);
+
Component toggle_2 = Toggle(&toggle_2_entries, &toggle_2_selected);
+
Component toggle_3 = Toggle(&toggle_3_entries, &toggle_3_selected);
+
Component toggle_4 = Toggle(&toggle_4_entries, &toggle_4_selected);
+
+
auto container = Container::Vertical({
+
toggle_1,
+
toggle_2,
+
toggle_3,
+
toggle_4,
+
});
+
+
auto renderer = Renderer(container, [&] {
+
return vbox({
+
text("Choose your options:"),
+
text(""),
+
hbox(text(" * Poweroff on startup : "), toggle_1->Render()),
+
hbox(text(" * Out of process : "), toggle_2->Render()),
+
hbox(text(" * Price of the information : "), toggle_3->Render()),
+
hbox(text(" * Number of elements : "), toggle_4->Render()),
+
});
+
});
+
+
auto screen = ScreenInteractive::TerminalOutput();
+
screen.Loop(renderer);
+
}
+ + + + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< ComponentBase > Component
+ +
+
+ + + + + diff --git a/examples_2component_2window_8cpp-example.html b/examples_2component_2window_8cpp-example.html new file mode 100644 index 000000000..642699bf1 --- /dev/null +++ b/examples_2component_2window_8cpp-example.html @@ -0,0 +1,305 @@ + + + + + + + + +FTXUI: examples/component/window.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/window.cpp
+
+
+
// Copyright 2023 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+ + +
#include <string>
+
+
using namespace ftxui;
+
+ +
class Impl : public ComponentBase {
+
private:
+
bool checked[3] = {false, false, false};
+
float slider = 50;
+
+
public:
+
Impl() {
+
Add(Container::Vertical({
+
Checkbox("Check me", &checked[0]),
+
Checkbox("Check me", &checked[1]),
+
Checkbox("Check me", &checked[2]),
+
Slider("Slider", &slider, 0.f, 100.f),
+
}));
+
}
+
};
+
return Make<Impl>();
+
}
+
+
int main() {
+
int window_1_left = 20;
+
int window_1_top = 10;
+
int window_1_width = 40;
+
int window_1_height = 20;
+
+
auto window_1 = Window({
+
.inner = DummyWindowContent(),
+
.title = "First window",
+
.left = &window_1_left,
+
.top = &window_1_top,
+
.width = &window_1_width,
+
.height = &window_1_height,
+
});
+
+
auto window_2 = Window({
+
.inner = DummyWindowContent(),
+
.title = "My window",
+
.left = 40,
+
.top = 20,
+
});
+
+
auto window_3 = Window({
+
.inner = DummyWindowContent(),
+
.title = "My window",
+
.left = 60,
+
.top = 30,
+
});
+
+
auto window_4 = Window({
+
.inner = DummyWindowContent(),
+
});
+
+
auto window_5 = Window({});
+
+
auto window_container = Container::Stacked({
+
window_1,
+
window_2,
+
window_3,
+
window_4,
+
window_5,
+
});
+
+
auto display_win_1 = Renderer([&] {
+
return text("window_1: " + //
+
std::to_string(window_1_width) + "x" +
+
std::to_string(window_1_height) + " + " +
+
std::to_string(window_1_left) + "," +
+
std::to_string(window_1_top));
+
});
+
+
auto layout = Container::Vertical({
+
display_win_1,
+
window_container,
+
});
+
+
auto screen = ScreenInteractive::Fullscreen();
+
screen.Loop(layout);
+
+
return EXIT_SUCCESS;
+
}
+ + +
It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ft...
+
Component Window(std::string title, Component component)
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< ComponentBase > Component
+ +
Component DummyWindowContent()
Definition scrollbar.cpp:10
+
+
+ + + + + diff --git a/examples_2component_2window_8cpp.html b/examples_2component_2window_8cpp.html new file mode 100644 index 000000000..8bd523e2a --- /dev/null +++ b/examples_2component_2window_8cpp.html @@ -0,0 +1,260 @@ + + + + + + + + +FTXUI: window.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
window.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + +

+Functions

Component DummyWindowContent ()
 
int main ()
 
+

Function Documentation

+ +

◆ DummyWindowContent()

+ +
+
+ + + + + + + +
Component DummyWindowContent ()
+
+ +

Definition at line 10 of file examples/component/window.cpp.

+ +
+
+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 29 of file examples/component/window.cpp.

+ +
+
+
+
+ + + + + diff --git a/examples_2component_2window_8cpp.js b/examples_2component_2window_8cpp.js new file mode 100644 index 000000000..a2cd78d9d --- /dev/null +++ b/examples_2component_2window_8cpp.js @@ -0,0 +1,5 @@ +var examples_2component_2window_8cpp = +[ + [ "DummyWindowContent", "examples_2component_2window_8cpp.html#a83db372d294b69185f7a26148935cfc3", null ], + [ "main", "examples_2component_2window_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/examples_2component_2window_8cpp_source.html b/examples_2component_2window_8cpp_source.html new file mode 100644 index 000000000..8b74f0938 --- /dev/null +++ b/examples_2component_2window_8cpp_source.html @@ -0,0 +1,319 @@ + + + + + + + + +FTXUI: window.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/window.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2023 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+ + +
6#include <string>
+
7
+
8using namespace ftxui;
+
9
+
+ +
11 class Impl : public ComponentBase {
+
12 private:
+
13 bool checked[3] = {false, false, false};
+
14 float slider = 50;
+
15
+
16 public:
+
17 Impl() {
+
18 Add(Container::Vertical({
+
19 Checkbox("Check me", &checked[0]),
+
20 Checkbox("Check me", &checked[1]),
+
21 Checkbox("Check me", &checked[2]),
+
22 Slider("Slider", &slider, 0.f, 100.f),
+
23 }));
+
24 }
+
25 };
+
26 return Make<Impl>();
+
27}
+
+
28
+
+
29int main() {
+
30 int window_1_left = 20;
+
31 int window_1_top = 10;
+
32 int window_1_width = 40;
+
33 int window_1_height = 20;
+
34
+
35 auto window_1 = Window({
+
36 .inner = DummyWindowContent(),
+
37 .title = "First window",
+
38 .left = &window_1_left,
+
39 .top = &window_1_top,
+
40 .width = &window_1_width,
+
41 .height = &window_1_height,
+
42 });
+
43
+
44 auto window_2 = Window({
+
45 .inner = DummyWindowContent(),
+
46 .title = "My window",
+
47 .left = 40,
+
48 .top = 20,
+
49 });
+
50
+
51 auto window_3 = Window({
+
52 .inner = DummyWindowContent(),
+
53 .title = "My window",
+
54 .left = 60,
+
55 .top = 30,
+
56 });
+
57
+
58 auto window_4 = Window({
+
59 .inner = DummyWindowContent(),
+
60 });
+
61
+
62 auto window_5 = Window({});
+
63
+
64 auto window_container = Container::Stacked({
+
65 window_1,
+
66 window_2,
+
67 window_3,
+
68 window_4,
+
69 window_5,
+
70 });
+
71
+
72 auto display_win_1 = Renderer([&] {
+
73 return text("window_1: " + //
+
74 std::to_string(window_1_width) + "x" +
+
75 std::to_string(window_1_height) + " + " +
+
76 std::to_string(window_1_left) + "," +
+
77 std::to_string(window_1_top));
+
78 });
+
79
+
80 auto layout = Container::Vertical({
+
81 display_win_1,
+
82 window_container,
+
83 });
+
84
+
85 auto screen = ScreenInteractive::Fullscreen();
+
86 screen.Loop(layout);
+
87
+
88 return EXIT_SUCCESS;
+
89}
+
+ +
Component DummyWindowContent()
+ +
void Add(Component children)
Add a child. @param child The child to be attached.
Definition component.cpp:70
+
static ScreenInteractive Fullscreen()
+
It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ft...
+
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
+
Component Window(WindowOptions option)
A draggeable / resizeable window. To use multiple of them, they must be stacked using Container::Stac...
+
Component Vertical(Components children)
A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
+
Component Stacked(Components children)
A list of components to be stacked on top of each other. Events are propagated to the first component...
+
Component Checkbox(CheckboxOption options)
Draw checkable element.
+
Element text(std::wstring text)
Display a piece of unicode text.
Definition text.cpp:160
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< T > Make(Args &&... args)
Definition component.hpp:27
+
Component Slider(SliderOption< T > options)
A slider in any direction.
+
std::shared_ptr< ComponentBase > Component
+ +
+
+ + + + + diff --git a/examples_2component_2with_restored_io_8cpp-example.html b/examples_2component_2with_restored_io_8cpp-example.html new file mode 100644 index 000000000..106a5cbbc --- /dev/null +++ b/examples_2component_2with_restored_io_8cpp-example.html @@ -0,0 +1,275 @@ + + + + + + + + +FTXUI: examples/component/with_restored_io.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/component/with_restored_io.cpp
+
+
+
// Copyright 2022 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <cstdlib> // for system, EXIT_SUCCESS
+
#include <iostream> // for operator<<, basic_ostream, basic_ostream::operator<<, cout, endl, flush, ostream, basic_ostream<>::__ostream_type, cin
+
#include <memory> // for shared_ptr, __shared_ptr_access, allocator
+
#include <string> // for getline, string
+
+
#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
#include "ftxui/component/component.hpp" // for Button, Horizontal, Renderer
+
#include "ftxui/component/component_base.hpp" // for ComponentBase
+
#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
#include "ftxui/dom/elements.hpp" // for operator|, filler, Element, borderEmpty, hbox, size, paragraph, vbox, LESS_THAN, border, center, HEIGHT, WIDTH
+
+
int main() {
+
using namespace ftxui;
+
+
auto screen = ScreenInteractive::Fullscreen();
+
+
// When pressing this button, "screen.WithRestoredIO" will execute the
+
// temporarily uninstall the terminal hook and execute the provided callback
+
// function. This allow running the application in a non-interactive mode.
+
auto btn_run = Button("Execute with restored IO", screen.WithRestoredIO([] {
+
std::cout << "This is a child program using stdin/stdout." << std::endl;
+
for (int i = 0; i < 10; ++i) {
+
std::cout << "Please enter 10 strings (" << i << "/10)" << std::flush;
+
std::string input;
+
std::getline(std::cin, input);
+
}
+
}));
+
+
auto btn_quit = Button("Quit", screen.ExitLoopClosure());
+
+
auto layout = Container::Horizontal({
+
btn_run,
+
btn_quit,
+
});
+
+
auto renderer = Renderer(layout, [&] {
+
auto explanation = paragraph(
+
"After clicking this button, the ScreenInteractive will be "
+
"suspended and access to stdin/stdout will temporarilly be "
+
"restore for running a function.");
+
auto element = vbox({
+
explanation | borderEmpty,
+
hbox({
+
btn_run->Render(),
+
filler(),
+
btn_quit->Render(),
+
}),
+
});
+
+
element = element | borderEmpty | border | size(WIDTH, LESS_THAN, 80) |
+
size(HEIGHT, LESS_THAN, 20) | center;
+
return element;
+
});
+
+
screen.Loop(renderer);
+
return EXIT_SUCCESS;
+
}
+ + + + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/examples_2dom_2border_8cpp-example.html b/examples_2dom_2border_8cpp-example.html new file mode 100644 index 000000000..bdc9ee229 --- /dev/null +++ b/examples_2dom_2border_8cpp-example.html @@ -0,0 +1,252 @@ + + + + + + + + +FTXUI: examples/dom/border.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/border.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <stdlib.h> // for EXIT_SUCCESS
+
#include <ftxui/dom/elements.hpp> // for text, operator|, vbox, border, Element, Fit, hbox
+
#include <ftxui/screen/screen.hpp> // for Full, Screen
+
#include <memory> // for allocator
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for ftxui
+
+
int main() {
+
using namespace ftxui;
+
auto document = //
+
hbox({
+
vbox({
+
text("Line 1"),
+
text("Line 2"),
+
text("Line 3"),
+
}) | border,
+
+
vbox({
+
text("Line 4"),
+
text("Line 5"),
+
text("Line 6"),
+
}) | border,
+
+
vbox({
+
text("Line 7"),
+
text("Line 8"),
+
text("Line 9"),
+
}) | border,
+
});
+
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
Render(screen, document);
+
screen.Print();
+
return EXIT_SUCCESS;
+
}
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2border_8cpp.html b/examples_2dom_2border_8cpp.html new file mode 100644 index 000000000..9db805075 --- /dev/null +++ b/examples_2dom_2border_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: border.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
border.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 12 of file examples/dom/border.cpp.

+ +
+
+
+
+ + + + + diff --git a/examples_2dom_2border_8cpp.js b/examples_2dom_2border_8cpp.js new file mode 100644 index 000000000..8ed410df6 --- /dev/null +++ b/examples_2dom_2border_8cpp.js @@ -0,0 +1,4 @@ +var examples_2dom_2border_8cpp = +[ + [ "main", "examples_2dom_2border_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/examples_2dom_2border_8cpp_source.html b/examples_2dom_2border_8cpp_source.html new file mode 100644 index 000000000..053b196ae --- /dev/null +++ b/examples_2dom_2border_8cpp_source.html @@ -0,0 +1,255 @@ + + + + + + + + +FTXUI: border.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/border.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <stdlib.h> // for EXIT_SUCCESS
+
5#include <ftxui/dom/elements.hpp> // for text, operator|, vbox, border, Element, Fit, hbox
+
6#include <ftxui/screen/screen.hpp> // for Full, Screen
+
7#include <memory> // for allocator
+
8
+
9#include "ftxui/dom/node.hpp" // for Render
+
10#include "ftxui/screen/color.hpp" // for ftxui
+
11
+
+
12int main() {
+
13 using namespace ftxui;
+
14 auto document = //
+
15 hbox({
+
16 vbox({
+
17 text("Line 1"),
+
18 text("Line 2"),
+
19 text("Line 3"),
+
20 }) | border,
+
21
+
22 vbox({
+
23 text("Line 4"),
+
24 text("Line 5"),
+
25 text("Line 6"),
+
26 }) | border,
+
27
+
28 vbox({
+
29 text("Line 7"),
+
30 text("Line 8"),
+
31 text("Line 9"),
+
32 }) | border,
+
33 });
+
34 auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
35 Render(screen, document);
+
36 screen.Print();
+
37 return EXIT_SUCCESS;
+
38}
+
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2border_colored_8cpp-example.html b/examples_2dom_2border_colored_8cpp-example.html new file mode 100644 index 000000000..3adecdb5d --- /dev/null +++ b/examples_2dom_2border_colored_8cpp-example.html @@ -0,0 +1,253 @@ + + + + + + + + +FTXUI: examples/dom/border_colored.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/border_colored.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <ftxui/dom/elements.hpp> // for operator|, text, Element, Fit, borderDouble, borderHeavy, borderLight, borderRounded, vbox
+
#include <ftxui/screen/screen.hpp> // for Screen
+
#include <iostream> // for endl, cout, ostream
+
#include <memory> // for allocator
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for ftxui
+
+
int main() {
+
using namespace ftxui;
+
+
auto make_boxed = [] {
+
return vbox({
+
text("borderLight") | borderStyled(LIGHT, Color::Red),
+
text("borderDashed") | borderStyled(DASHED, Color::Green),
+
text("borderHeavy") | borderStyled(HEAVY, Color::Blue),
+
text("borderDouble") | borderStyled(DOUBLE, Color::Yellow),
+
text("borderRounded") | borderStyled(ROUNDED, Color::Cyan),
+
});
+
};
+
+
auto document = hbox({
+
make_boxed(),
+
separator() | color(Color::Red),
+
make_boxed(),
+
separator() | color(Color::Red),
+
make_boxed(),
+
}) |
+
borderStyled(ROUNDED, Color::Red);
+
+
auto screen =
+
Screen::Create(Dimension::Fit(document), Dimension::Fit(document));
+
Render(screen, document);
+
screen.Print();
+
std::cout << std::endl;
+
}
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2border_style_8cpp-example.html b/examples_2dom_2border_style_8cpp-example.html new file mode 100644 index 000000000..de2add1cf --- /dev/null +++ b/examples_2dom_2border_style_8cpp-example.html @@ -0,0 +1,242 @@ + + + + + + + + +FTXUI: examples/dom/border_style.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/border_style.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <ftxui/dom/elements.hpp> // for operator|, text, Element, Fit, borderDouble, borderHeavy, borderLight, borderRounded, vbox
+
#include <ftxui/screen/screen.hpp> // for Screen
+
#include <iostream> // for endl, cout, ostream
+
#include <memory> // for allocator
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for ftxui
+
+
int main() {
+
using namespace ftxui;
+
+
auto document = vbox({
+
text("borderLight") | borderLight,
+
text("borderDashed") | borderDashed,
+
text("borderHeavy") | borderHeavy,
+
text("borderDouble") | borderDouble,
+
text("borderRounded") | borderRounded,
+
});
+
+
auto screen =
+
Screen::Create(Dimension::Fit(document), Dimension::Fit(document));
+
Render(screen, document);
+
screen.Print();
+
std::cout << std::endl;
+
}
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2canvas_8cpp-example.html b/examples_2dom_2canvas_8cpp-example.html new file mode 100644 index 000000000..369144072 --- /dev/null +++ b/examples_2dom_2canvas_8cpp-example.html @@ -0,0 +1,269 @@ + + + + + + + + +FTXUI: examples/dom/canvas.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/canvas.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <stdio.h> // for getchar
+
#include <cmath> // for cos
+
#include <ftxui/dom/elements.hpp> // for Fit, canvas, operator|, border, Element
+
#include <ftxui/screen/screen.hpp> // for Pixel, Screen
+
#include <vector> // for vector, allocator
+
+
#include "ftxui/dom/canvas.hpp" // for Canvas
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for Color, Color::Red, Color::Blue, Color::Green, ftxui
+
+
int main() {
+
using namespace ftxui;
+
+
auto c = Canvas(100, 100);
+
+
c.DrawText(0, 0, "This is a canvas", [](Pixel& p) {
+
p.foreground_color = Color::Red;
+
p.underlined = true;
+
});
+
+
// Triangle:
+
c.DrawPointLine(10, 10, 80, 10, Color::Red);
+
c.DrawPointLine(80, 10, 80, 40, Color::Blue);
+
c.DrawPointLine(80, 40, 10, 10, Color::Green);
+
+
// Circle, not filled and filled:
+
c.DrawPointCircle(30, 50, 20);
+
c.DrawPointCircleFilled(40, 40, 10);
+
+
// Plot a function:
+
std::vector<int> ys(100);
+
for (int x = 0; x < 100; x++) {
+
ys[x] = int(80 + 20 * cos(x * 0.2));
+
}
+
for (int x = 0; x < 99; x++) {
+
c.DrawPointLine(x, ys[x], x + 1, ys[x + 1], Color::Red);
+
}
+
+
auto document = canvas(&c) | border;
+
+
auto screen = Screen::Create(Dimension::Fit(document));
+
Render(screen, document);
+
screen.Print();
+
getchar();
+
+
return 0;
+
}
+ + + + +
Canvas is a drawable buffer associated with drawing operations.
Definition canvas.hpp:38
+
Color foreground_color
Definition pixel.hpp:49
+
bool underlined
Definition pixel.hpp:33
+
A Unicode character and its associated style.
Definition pixel.hpp:15
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2canvas_8cpp.html b/examples_2dom_2canvas_8cpp.html new file mode 100644 index 000000000..c3c64fbdc --- /dev/null +++ b/examples_2dom_2canvas_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: canvas.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
canvas.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 14 of file examples/dom/canvas.cpp.

+ +
+
+
+
+ + + + + diff --git a/examples_2dom_2canvas_8cpp.js b/examples_2dom_2canvas_8cpp.js new file mode 100644 index 000000000..dcfb8222e --- /dev/null +++ b/examples_2dom_2canvas_8cpp.js @@ -0,0 +1,4 @@ +var examples_2dom_2canvas_8cpp = +[ + [ "main", "examples_2dom_2canvas_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/examples_2dom_2canvas_8cpp_source.html b/examples_2dom_2canvas_8cpp_source.html new file mode 100644 index 000000000..a5b963ba2 --- /dev/null +++ b/examples_2dom_2canvas_8cpp_source.html @@ -0,0 +1,272 @@ + + + + + + + + +FTXUI: canvas.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/canvas.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <stdio.h> // for getchar
+
5#include <cmath> // for cos
+
6#include <ftxui/dom/elements.hpp> // for Fit, canvas, operator|, border, Element
+
7#include <ftxui/screen/screen.hpp> // for Pixel, Screen
+
8#include <vector> // for vector, allocator
+
9
+
10#include "ftxui/dom/canvas.hpp" // for Canvas
+
11#include "ftxui/dom/node.hpp" // for Render
+
12#include "ftxui/screen/color.hpp" // for Color, Color::Red, Color::Blue, Color::Green, ftxui
+
13
+
+
14int main() {
+
15 using namespace ftxui;
+
16
+
17 auto c = Canvas(100, 100);
+
18
+
19 c.DrawText(0, 0, "This is a canvas", [](Pixel& p) {
+
20 p.foreground_color = Color::Red;
+
21 p.underlined = true;
+
22 });
+
23
+
24 // Triangle:
+
25 c.DrawPointLine(10, 10, 80, 10, Color::Red);
+
26 c.DrawPointLine(80, 10, 80, 40, Color::Blue);
+
27 c.DrawPointLine(80, 40, 10, 10, Color::Green);
+
28
+
29 // Circle, not filled and filled:
+
30 c.DrawPointCircle(30, 50, 20);
+
31 c.DrawPointCircleFilled(40, 40, 10);
+
32
+
33 // Plot a function:
+
34 std::vector<int> ys(100);
+
35 for (int x = 0; x < 100; x++) {
+
36 ys[x] = int(80 + 20 * cos(x * 0.2));
+
37 }
+
38 for (int x = 0; x < 99; x++) {
+
39 c.DrawPointLine(x, ys[x], x + 1, ys[x + 1], Color::Red);
+
40 }
+
41
+
42 auto document = canvas(&c) | border;
+
43
+
44 auto screen = Screen::Create(Dimension::Fit(document));
+
45 Render(screen, document);
+
46 screen.Print();
+
47 getchar();
+
48
+
49 return 0;
+
50}
+
+ + + + +
Canvas is a drawable buffer associated with drawing operations.
Definition canvas.hpp:38
+
Color foreground_color
Definition pixel.hpp:49
+
bool underlined
Definition pixel.hpp:33
+
A Unicode character and its associated style.
Definition pixel.hpp:15
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2color_gallery_8cpp-example.html b/examples_2dom_2color_gallery_8cpp-example.html new file mode 100644 index 000000000..ccb875049 --- /dev/null +++ b/examples_2dom_2color_gallery_8cpp-example.html @@ -0,0 +1,362 @@ + + + + + + + + +FTXUI: examples/dom/color_gallery.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/color_gallery.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <ftxui/screen/color_info.hpp> // for ColorInfo
+
#include <ftxui/screen/screen.hpp> // for Full, Screen
+
#include <ftxui/screen/terminal.hpp> // for ColorSupport, Color, Palette16, Palette256, TrueColor
+
#include <memory> // for allocator, shared_ptr
+
#include <utility> // for move
+
#include <vector> // for vector
+
+
#include "ftxui/dom/elements.hpp" // for text, bgcolor, color, vbox, hbox, separator, operator|, Elements, Element, Fit, border
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for Color, Color::Black, Color::Blue, Color::BlueLight, Color::Cyan, Color::CyanLight, Color::Default, Color::GrayDark, Color::GrayLight, Color::Green, Color::GreenLight, Color::Magenta, Color::MagentaLight, Color::Red, Color::RedLight, Color::White, Color::Yellow, Color::YellowLight, Color::Palette256, ftxui
+
+
using namespace ftxui;
+
#include "./color_info_sorted_2d.ipp" // for ColorInfoSorted2D
+
+
int main() {
+
// clang-format off
+
auto basic_color_display =
+
vbox(
+
text("16 color palette:"),
+
separator(),
+
hbox(
+
vbox(
+
color(Color::Default, text("Default")),
+
color(Color::Black, text("Black")),
+
color(Color::GrayDark, text("GrayDark")),
+
color(Color::GrayLight, text("GrayLight")),
+
color(Color::White, text("White")),
+
color(Color::Blue, text("Blue")),
+
color(Color::BlueLight, text("BlueLight")),
+
color(Color::Cyan, text("Cyan")),
+
color(Color::CyanLight, text("CyanLight")),
+
color(Color::Green, text("Green")),
+
color(Color::GreenLight, text("GreenLight")),
+
color(Color::Magenta, text("Magenta")),
+
color(Color::MagentaLight, text("MagentaLight")),
+
color(Color::Red, text("Red")),
+
color(Color::RedLight, text("RedLight")),
+
color(Color::Yellow, text("Yellow")),
+
color(Color::YellowLight, text("YellowLight"))
+
),
+
vbox(
+
bgcolor(Color::Default, text("Default")),
+
bgcolor(Color::Black, text("Black")),
+
bgcolor(Color::GrayDark, text("GrayDark")),
+
bgcolor(Color::GrayLight, text("GrayLight")),
+
bgcolor(Color::White, text("White")),
+
bgcolor(Color::Blue, text("Blue")),
+
bgcolor(Color::BlueLight, text("BlueLight")),
+
bgcolor(Color::Cyan, text("Cyan")),
+
bgcolor(Color::CyanLight, text("CyanLight")),
+
bgcolor(Color::Green, text("Green")),
+
bgcolor(Color::GreenLight, text("GreenLight")),
+
bgcolor(Color::Magenta, text("Magenta")),
+
bgcolor(Color::MagentaLight, text("MagentaLight")),
+
bgcolor(Color::Red, text("Red")),
+
bgcolor(Color::RedLight, text("RedLight")),
+
bgcolor(Color::Yellow, text("Yellow")),
+
bgcolor(Color::YellowLight, text("YellowLight"))
+
)
+
)
+
);
+
+
// clang-format on
+
auto palette_256_color_display = text("256 colors palette:");
+
{
+
std::vector<std::vector<ColorInfo>> info_columns = ColorInfoSorted2D();
+
Elements columns;
+
for (auto& column : info_columns) {
+
Elements column_elements;
+
for (auto& it : column) {
+
column_elements.push_back(
+
text(" ") | bgcolor(Color(Color::Palette256(it.index_256))));
+
}
+
columns.push_back(hbox(std::move(column_elements)));
+
}
+
palette_256_color_display = vbox({
+
palette_256_color_display,
+
separator(),
+
vbox(columns),
+
});
+
}
+
+
// True color display.
+
auto true_color_display = text("TrueColors: 24bits:");
+
{
+
const int max_value = 255;
+
const int value_increment = 8;
+
const int hue_increment = 6;
+
int saturation = max_value;
+
Elements array;
+
for (int value = 0; value < max_value; value += 2 * value_increment) {
+
Elements line;
+
for (int hue = 0; hue < max_value; hue += hue_increment) {
+
line.push_back(
+
text("▀") //
+
| color(Color::HSV(hue, saturation, value)) //
+
| bgcolor(Color::HSV(hue, saturation, value + value_increment)));
+
}
+
array.push_back(hbox(std::move(line)));
+
}
+
true_color_display = vbox({
+
true_color_display,
+
separator(),
+
vbox(std::move(array)),
+
});
+
}
+
+
auto terminal_info =
+
vbox({
+
Terminal::ColorSupport() >= Terminal::Color::Palette16
+
? text(" 16 color palette support : Yes")
+
: text(" 16 color palette support : No"),
+
Terminal::ColorSupport() >= Terminal::Color::Palette256
+
? text("256 color palette support : Yes")
+
: text("256 color palette support : No"),
+
Terminal::ColorSupport() >= Terminal::Color::TrueColor
+
? text(" True color support : Yes")
+
: text(" True color support : No"),
+
}) |
+
border;
+
+
auto document = vbox({hbox({
+
basic_color_display,
+
text(" "),
+
palette_256_color_display,
+
text(" "),
+
true_color_display,
+
}),
+
terminal_info});
+
// clang-format on
+
+
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
Render(screen, document);
+
+
screen.Print();
+
+
return 0;
+
}
+ + + +
std::vector< std::vector< ftxui::ColorInfo > > ColorInfoSorted2D()
+ + + +
Color is a class that represents a color in the terminal user interface.
Definition color.hpp:22
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::vector< Element > Elements
Definition elements.hpp:23
+ + + +
+
+ + + + + diff --git a/examples_2dom_2color_info_palette256_8cpp-example.html b/examples_2dom_2color_info_palette256_8cpp-example.html new file mode 100644 index 000000000..99ca8dd1f --- /dev/null +++ b/examples_2dom_2color_info_palette256_8cpp-example.html @@ -0,0 +1,259 @@ + + + + + + + + +FTXUI: examples/dom/color_info_palette256.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/color_info_palette256.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <ftxui/dom/elements.hpp> // for text, bgcolor, hbox, operator|, Elements, Fit, vbox, Element
+
#include <ftxui/screen/color_info.hpp> // for ColorInfo
+
#include <ftxui/screen/screen.hpp> // for Full, Screen
+
#include <utility> // for move
+
#include <vector> // for vector, allocator
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for Color, Color::Palette256, ftxui
+
+
using namespace ftxui;
+
#include "./color_info_sorted_2d.ipp" // for ColorInfoSorted2D
+
+
int main() {
+
std::vector<std::vector<ColorInfo>> info_columns = ColorInfoSorted2D();
+
+
// Draw every columns
+
Elements columns_elements;
+
for (auto& column : info_columns) {
+
Elements column_elements;
+
for (auto& it : column) {
+
column_elements.push_back(hbox({
+
text(" ") | bgcolor(Color(Color::Palette256(it.index_256))),
+
text(it.name),
+
}));
+
}
+
columns_elements.push_back(vbox(std::move(column_elements)));
+
}
+
auto document = hbox(std::move(columns_elements));
+
+
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
Render(screen, document);
+
+
screen.Print();
+
+
return 0;
+
}
+ + + +
std::vector< std::vector< ftxui::ColorInfo > > ColorInfoSorted2D()
+ + + +
Color is a class that represents a color in the terminal user interface.
Definition color.hpp:22
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::vector< Element > Elements
Definition elements.hpp:23
+ + +
+
+ + + + + diff --git a/examples_2dom_2color_truecolor_HSV_8cpp-example.html b/examples_2dom_2color_truecolor_HSV_8cpp-example.html new file mode 100644 index 000000000..1ae185e7f --- /dev/null +++ b/examples_2dom_2color_truecolor_HSV_8cpp-example.html @@ -0,0 +1,250 @@ + + + + + + + + +FTXUI: examples/dom/color_truecolor_HSV.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/color_truecolor_HSV.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <ftxui/dom/elements.hpp> // for operator|, Elements, Fit, bgcolor, color, hbox, text, vbox, Element
+
#include <ftxui/screen/screen.hpp> // for Full, Screen
+
#include <memory> // for allocator
+
#include <utility> // for move
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for Color, ftxui
+
+
int main() {
+
using namespace ftxui;
+
+
int saturation = 255;
+
Elements array;
+
for (int value = 0; value < 255; value += 20) {
+
Elements line;
+
for (int hue = 0; hue < 255; hue += 2) {
+
line.push_back(text("▀") //
+
| color(Color::HSV(hue, saturation, value)) //
+
| bgcolor(Color::HSV(hue, saturation, value + 10)));
+
}
+
array.push_back(hbox(std::move(line)));
+
}
+
+
auto document = vbox(std::move(array));
+
+
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
Render(screen, document);
+
+
screen.Print();
+
+
return 0;
+
}
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::vector< Element > Elements
Definition elements.hpp:23
+ + +
+
+ + + + + diff --git a/examples_2dom_2color_truecolor_RGB_8cpp-example.html b/examples_2dom_2color_truecolor_RGB_8cpp-example.html new file mode 100644 index 000000000..a21601828 --- /dev/null +++ b/examples_2dom_2color_truecolor_RGB_8cpp-example.html @@ -0,0 +1,268 @@ + + + + + + + + +FTXUI: examples/dom/color_truecolor_RGB.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/color_truecolor_RGB.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <ftxui/dom/elements.hpp> // for hbox, text, bgcolor, operator|, vbox, Elements, window, Element, Fit
+
#include <ftxui/screen/screen.hpp> // for Full, Screen
+
#include <memory> // for allocator
+
#include <utility> // for move
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for Color, ftxui
+
+
int main() {
+
using namespace ftxui;
+
+
Elements red_line;
+
Elements green_line;
+
Elements blue_line;
+
Elements cyan_line;
+
Elements magenta_line;
+
Elements yellow_line;
+
+
for (int value = 0; value < 255; value += 3) {
+
int v = value * value / 255;
+
red_line.push_back(text(" ") | bgcolor(Color::RGB(v, 0, 0)));
+
green_line.push_back(text(" ") | bgcolor(Color::RGB(0, v, 0)));
+
blue_line.push_back(text(" ") | bgcolor(Color::RGB(0, 0, v)));
+
cyan_line.push_back(text(" ") | bgcolor(Color::RGB(0, v, v)));
+
magenta_line.push_back(text(" ") | bgcolor(Color::RGB(v, 0, v)));
+
yellow_line.push_back(text(" ") | bgcolor(Color::RGB(v, v, 0)));
+
}
+
+
auto document = vbox({
+
window(text("Primary colors"),
+
vbox({
+
hbox({text("Red line :"), hbox(std::move(red_line))}),
+
hbox({text("Green line :"), hbox(std::move(green_line))}),
+
hbox({text("Blue line :"), hbox(std::move(blue_line))}),
+
})),
+
window(text("Secondary colors"),
+
vbox({
+
hbox({text("cyan line :"), hbox(std::move(cyan_line))}),
+
hbox({text("magenta line:"), hbox(std::move(magenta_line))}),
+
hbox({text("Yellow line :"), hbox(std::move(yellow_line))}),
+
})),
+
});
+
+
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
Render(screen, document);
+
+
screen.Print();
+
+
return 0;
+
}
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::vector< Element > Elements
Definition elements.hpp:23
+ + +
+
+ + + + + diff --git a/examples_2dom_2dbox_8cpp-example.html b/examples_2dom_2dbox_8cpp-example.html new file mode 100644 index 000000000..d13973e96 --- /dev/null +++ b/examples_2dom_2dbox_8cpp-example.html @@ -0,0 +1,243 @@ + + + + + + + + +FTXUI: examples/dom/dbox.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/dbox.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <ftxui/dom/elements.hpp> // for text, operator|, border, Element, vbox, center, Fit, dbox
+
#include <ftxui/screen/screen.hpp> // for Full, Screen
+
#include <memory> // for allocator
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for ftxui
+
+
int main() {
+
using namespace ftxui;
+
auto document = dbox({
+
vbox({
+
text("line_1"),
+
text("line_2"),
+
text("line_3"),
+
text("line_4"),
+
text("line_5"),
+
}) | border,
+
text("overlay") | border | center,
+
});
+
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
Render(screen, document);
+
+
screen.Print();
+
+
return 0;
+
}
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2dbox_8cpp.html b/examples_2dom_2dbox_8cpp.html new file mode 100644 index 000000000..eb6fd60e1 --- /dev/null +++ b/examples_2dom_2dbox_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: dbox.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
dbox.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 11 of file examples/dom/dbox.cpp.

+ +
+
+
+
+ + + + + diff --git a/examples_2dom_2dbox_8cpp.js b/examples_2dom_2dbox_8cpp.js new file mode 100644 index 000000000..78e9a3593 --- /dev/null +++ b/examples_2dom_2dbox_8cpp.js @@ -0,0 +1,4 @@ +var examples_2dom_2dbox_8cpp = +[ + [ "main", "examples_2dom_2dbox_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/examples_2dom_2dbox_8cpp_source.html b/examples_2dom_2dbox_8cpp_source.html new file mode 100644 index 000000000..b98dc4523 --- /dev/null +++ b/examples_2dom_2dbox_8cpp_source.html @@ -0,0 +1,246 @@ + + + + + + + + +FTXUI: dbox.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/dbox.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <ftxui/dom/elements.hpp> // for text, operator|, border, Element, vbox, center, Fit, dbox
+
5#include <ftxui/screen/screen.hpp> // for Full, Screen
+
6#include <memory> // for allocator
+
7
+
8#include "ftxui/dom/node.hpp" // for Render
+
9#include "ftxui/screen/color.hpp" // for ftxui
+
10
+
+
11int main() {
+
12 using namespace ftxui;
+
13 auto document = dbox({
+
14 vbox({
+
15 text("line_1"),
+
16 text("line_2"),
+
17 text("line_3"),
+
18 text("line_4"),
+
19 text("line_5"),
+
20 }) | border,
+
21 text("overlay") | border | center,
+
22 });
+
23 auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
24 Render(screen, document);
+
25
+
26 screen.Print();
+
27
+
28 return 0;
+
29}
+
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2gauge_8cpp-example.html b/examples_2dom_2gauge_8cpp-example.html new file mode 100644 index 000000000..7371eb3f7 --- /dev/null +++ b/examples_2dom_2gauge_8cpp-example.html @@ -0,0 +1,251 @@ + + + + + + + + +FTXUI: examples/dom/gauge.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/gauge.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <chrono> // for operator""s, chrono_literals
+
#include <ftxui/dom/elements.hpp> // for text, gauge, operator|, flex, hbox, Element
+
#include <ftxui/screen/screen.hpp> // for Screen
+
#include <iostream> // for cout, endl, ostream
+
#include <string> // for allocator, char_traits, operator+, operator<<, string, to_string, basic_string
+
#include <thread> // for sleep_for
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for ftxui
+
+
int main() {
+
using namespace ftxui;
+
using namespace std::chrono_literals;
+
+
std::string reset_position;
+
for (float percentage = 0.0f; percentage <= 1.0f; percentage += 0.002f) {
+
std::string data_downloaded =
+
std::to_string(int(percentage * 5000)) + "/5000";
+
auto document = hbox({
+
text("downloading:"),
+
gauge(percentage) | flex,
+
text(" " + data_downloaded),
+
});
+
auto screen = Screen(100, 1);
+
Render(screen, document);
+
std::cout << reset_position;
+
screen.Print();
+
reset_position = screen.ResetPosition();
+
+
std::this_thread::sleep_for(0.01s);
+
}
+
std::cout << std::endl;
+
}
+ + + +
A rectangular grid of Pixel.
Definition screen.hpp:26
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2gauge_8cpp.html b/examples_2dom_2gauge_8cpp.html new file mode 100644 index 000000000..f7220309c --- /dev/null +++ b/examples_2dom_2gauge_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: gauge.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
gauge.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 14 of file examples/dom/gauge.cpp.

+ +
+
+
+
+ + + + + diff --git a/examples_2dom_2gauge_8cpp.js b/examples_2dom_2gauge_8cpp.js new file mode 100644 index 000000000..ae6e44cf3 --- /dev/null +++ b/examples_2dom_2gauge_8cpp.js @@ -0,0 +1,4 @@ +var examples_2dom_2gauge_8cpp = +[ + [ "main", "examples_2dom_2gauge_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/examples_2dom_2gauge_8cpp_source.html b/examples_2dom_2gauge_8cpp_source.html new file mode 100644 index 000000000..7c88a7f48 --- /dev/null +++ b/examples_2dom_2gauge_8cpp_source.html @@ -0,0 +1,254 @@ + + + + + + + + +FTXUI: gauge.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/gauge.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <chrono> // for operator""s, chrono_literals
+
5#include <ftxui/dom/elements.hpp> // for text, gauge, operator|, flex, hbox, Element
+
6#include <ftxui/screen/screen.hpp> // for Screen
+
7#include <iostream> // for cout, endl, ostream
+
8#include <string> // for allocator, char_traits, operator+, operator<<, string, to_string, basic_string
+
9#include <thread> // for sleep_for
+
10
+
11#include "ftxui/dom/node.hpp" // for Render
+
12#include "ftxui/screen/color.hpp" // for ftxui
+
13
+
+
14int main() {
+
15 using namespace ftxui;
+
16 using namespace std::chrono_literals;
+
17
+
18 std::string reset_position;
+
19 for (float percentage = 0.0f; percentage <= 1.0f; percentage += 0.002f) {
+
20 std::string data_downloaded =
+
21 std::to_string(int(percentage * 5000)) + "/5000";
+
22 auto document = hbox({
+
23 text("downloading:"),
+
24 gauge(percentage) | flex,
+
25 text(" " + data_downloaded),
+
26 });
+
27 auto screen = Screen(100, 1);
+
28 Render(screen, document);
+
29 std::cout << reset_position;
+
30 screen.Print();
+
31 reset_position = screen.ResetPosition();
+
32
+
33 std::this_thread::sleep_for(0.01s);
+
34 }
+
35 std::cout << std::endl;
+
36}
+
+ + + +
A rectangular grid of Pixel.
Definition screen.hpp:26
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2gauge_direction_8cpp-example.html b/examples_2dom_2gauge_direction_8cpp-example.html new file mode 100644 index 000000000..4dd4885b2 --- /dev/null +++ b/examples_2dom_2gauge_direction_8cpp-example.html @@ -0,0 +1,293 @@ + + + + + + + + +FTXUI: examples/dom/gauge_direction.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/gauge_direction.cpp
+
+
+
// Copyright 2022 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <chrono> // for operator""s, chrono_literals
+
#include <ftxui/dom/elements.hpp> // for filler, operator|, separator, text, border, Element, vbox, vtext, hbox, center, gaugeDown, gaugeLeft, gaugeRight, gaugeUp
+
#include <ftxui/screen/screen.hpp> // for Screen
+
#include <iostream> // for cout, endl, ostream
+
#include <string> // for allocator, operator+, operator<<, string, to_string
+
#include <thread> // for sleep_for
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for ftxui
+
+
int main() {
+
using namespace ftxui;
+
using namespace std::chrono_literals;
+
+
std::string reset_position;
+
for (float percentage = 0.0f; percentage <= 1.0f; percentage += 0.002f) {
+
std::string data_downloaded =
+
std::to_string(int(percentage * 5000)) + "/5000";
+
+
auto gauge_up = //
+
hbox({
+
vtext("gauge vertical"),
+
separator(),
+
gaugeUp(percentage),
+
}) |
+
border;
+
+
auto gauge_down = //
+
hbox({
+
vtext("gauge vertical"),
+
separator(),
+
gaugeDown(percentage),
+
}) |
+
border;
+
+
auto gauge_right = //
+
vbox({
+
text("gauge horizontal"),
+
separator(),
+
gaugeRight(percentage),
+
}) |
+
border;
+
+
auto gauge_left = //
+
vbox({
+
text("gauge horizontal"),
+
separator(),
+
gaugeLeft(percentage),
+
}) |
+
border;
+
+
auto document = hbox({
+
gauge_up,
+
filler(),
+
vbox({
+
gauge_right,
+
filler(),
+
text(data_downloaded) | border | center,
+
filler(),
+
gauge_left,
+
}),
+
filler(),
+
gauge_down,
+
});
+
+
auto screen = Screen(32, 16);
+
Render(screen, document);
+
std::cout << reset_position;
+
screen.Print();
+
reset_position = screen.ResetPosition();
+
+
std::this_thread::sleep_for(0.01s);
+
}
+
std::cout << std::endl;
+
}
+ + + +
A rectangular grid of Pixel.
Definition screen.hpp:26
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2graph_8cpp-example.html b/examples_2dom_2graph_8cpp-example.html new file mode 100644 index 000000000..c1a448f20 --- /dev/null +++ b/examples_2dom_2graph_8cpp-example.html @@ -0,0 +1,302 @@ + + + + + + + + +FTXUI: examples/dom/graph.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/graph.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <chrono> // for operator""s, chrono_literals
+
#include <cmath> // for sin
+
#include <ftxui/dom/elements.hpp> // for graph, operator|, separator, color, Element, vbox, flex, inverted, operator|=, Fit, hbox, size, border, GREATER_THAN, HEIGHT
+
#include <ftxui/screen/screen.hpp> // for Full, Screen
+
#include <functional> // for ref, reference_wrapper
+
#include <iostream> // for cout, ostream
+
#include <memory> // for shared_ptr
+
#include <string> // for operator<<, string
+
#include <thread> // for sleep_for
+
#include <utility> // for ignore
+
#include <vector> // for vector
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for Color, Color::BlueLight, Color::RedLight, Color::YellowLight, ftxui
+
+
class Graph {
+
public:
+
std::vector<int> operator()(int width, int height) const {
+
std::vector<int> output(width);
+
for (int i = 0; i < width; ++i) {
+
float v = 0;
+
v += 0.1f * sin((i + shift) * 0.1f); // NOLINT
+
v += 0.2f * sin((i + shift + 10) * 0.15f); // NOLINT
+
v += 0.1f * sin((i + shift) * 0.03f); // NOLINT
+
v *= height; // NOLINT
+
v += 0.5f * height; // NOLINT
+
output[i] = static_cast<int>(v);
+
}
+
return output;
+
}
+
int shift = 0;
+
};
+
+
std::vector<int> triangle(int width, int height) {
+
std::vector<int> output(width);
+
for (int i = 0; i < width; ++i) {
+
output[i] = i % (height - 4) + 2;
+
}
+
return output;
+
}
+
+
int main() {
+
using namespace ftxui;
+
using namespace std::chrono_literals;
+
+
Graph my_graph;
+
+
std::string reset_position;
+
for (int i = 0;; ++i) {
+
std::ignore = i;
+
auto document = hbox({
+
vbox({
+
graph(std::ref(my_graph)),
+
separator(),
+
graph(triangle) | inverted,
+
}) | flex,
+
separator(),
+
vbox({
+
graph(std::ref(my_graph)) | color(Color::BlueLight),
+
separator(),
+
graph(std::ref(my_graph)) | color(Color::RedLight),
+
separator(),
+
graph(std::ref(my_graph)) | color(Color::YellowLight),
+
}) | flex,
+
});
+
+
document |= border;
+
+
const int min_width = 40;
+
document |= size(HEIGHT, GREATER_THAN, min_width);
+
+
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
Render(screen, document);
+
std::cout << reset_position;
+
screen.Print();
+
reset_position = screen.ResetPosition();
+
+
const auto sleep_time = 0.03s;
+
std::this_thread::sleep_for(sleep_time);
+
my_graph.shift++;
+
}
+
+
return 0;
+
}
+ + + +
std::vector< int > triangle(int width, int height)
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2graph_8cpp.html b/examples_2dom_2graph_8cpp.html new file mode 100644 index 000000000..16662a508 --- /dev/null +++ b/examples_2dom_2graph_8cpp.html @@ -0,0 +1,266 @@ + + + + + + + + +FTXUI: graph.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
graph.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + +

+Functions

std::vector< int > triangle (int width, int height)
 
int main ()
 
+

Function Documentation

+ +

◆ triangle()

+ +
+
+ + + + + + + + + + + +
std::vector< int > triangle (int width,
int height )
+
+
Examples
examples/dom/graph.cpp.
+
+ +

Definition at line 37 of file examples/dom/graph.cpp.

+ +
+
+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 45 of file examples/dom/graph.cpp.

+ +
+
+
+
+ + + + + diff --git a/examples_2dom_2graph_8cpp.js b/examples_2dom_2graph_8cpp.js new file mode 100644 index 000000000..1b5449d68 --- /dev/null +++ b/examples_2dom_2graph_8cpp.js @@ -0,0 +1,5 @@ +var examples_2dom_2graph_8cpp = +[ + [ "triangle", "examples_2dom_2graph_8cpp.html#a5ab45e2cb218468666c7dc7b2b957396", null ], + [ "main", "examples_2dom_2graph_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/examples_2dom_2graph_8cpp_source.html b/examples_2dom_2graph_8cpp_source.html new file mode 100644 index 000000000..c473dd554 --- /dev/null +++ b/examples_2dom_2graph_8cpp_source.html @@ -0,0 +1,307 @@ + + + + + + + + +FTXUI: graph.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/graph.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <chrono> // for operator""s, chrono_literals
+
5#include <cmath> // for sin
+
6#include <ftxui/dom/elements.hpp> // for graph, operator|, separator, color, Element, vbox, flex, inverted, operator|=, Fit, hbox, size, border, GREATER_THAN, HEIGHT
+
7#include <ftxui/screen/screen.hpp> // for Full, Screen
+
8#include <functional> // for ref, reference_wrapper
+
9#include <iostream> // for cout, ostream
+
10#include <memory> // for shared_ptr
+
11#include <string> // for operator<<, string
+
12#include <thread> // for sleep_for
+
13#include <utility> // for ignore
+
14#include <vector> // for vector
+
15
+
16#include "ftxui/dom/node.hpp" // for Render
+
17#include "ftxui/screen/color.hpp" // for Color, Color::BlueLight, Color::RedLight, Color::YellowLight, ftxui
+
18
+
19class Graph {
+
20 public:
+
21 std::vector<int> operator()(int width, int height) const {
+
22 std::vector<int> output(width);
+
23 for (int i = 0; i < width; ++i) {
+
24 float v = 0;
+
25 v += 0.1f * sin((i + shift) * 0.1f); // NOLINT
+
26 v += 0.2f * sin((i + shift + 10) * 0.15f); // NOLINT
+
27 v += 0.1f * sin((i + shift) * 0.03f); // NOLINT
+
28 v *= height; // NOLINT
+
29 v += 0.5f * height; // NOLINT
+
30 output[i] = static_cast<int>(v);
+
31 }
+
32 return output;
+
33 }
+
34 int shift = 0;
+
35};
+
36
+
+
37std::vector<int> triangle(int width, int height) {
+
38 std::vector<int> output(width);
+
39 for (int i = 0; i < width; ++i) {
+
40 output[i] = i % (height - 4) + 2;
+
41 }
+
42 return output;
+
43}
+
+
44
+
+
45int main() {
+
46 using namespace ftxui;
+
47 using namespace std::chrono_literals;
+
48
+
49 Graph my_graph;
+
50
+
51 std::string reset_position;
+
52 for (int i = 0;; ++i) {
+
53 std::ignore = i;
+
54 auto document = hbox({
+
55 vbox({
+
56 graph(std::ref(my_graph)),
+
57 separator(),
+
58 graph(triangle) | inverted,
+
59 }) | flex,
+
60 separator(),
+
61 vbox({
+
62 graph(std::ref(my_graph)) | color(Color::BlueLight),
+
63 separator(),
+
64 graph(std::ref(my_graph)) | color(Color::RedLight),
+
65 separator(),
+
66 graph(std::ref(my_graph)) | color(Color::YellowLight),
+
67 }) | flex,
+
68 });
+
69
+
70 document |= border;
+
71
+
72 const int min_width = 40;
+
73 document |= size(HEIGHT, GREATER_THAN, min_width);
+
74
+
75 auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
76 Render(screen, document);
+
77 std::cout << reset_position;
+
78 screen.Print();
+
79 reset_position = screen.ResetPosition();
+
80
+
81 const auto sleep_time = 0.03s;
+
82 std::this_thread::sleep_for(sleep_time);
+
83 my_graph.shift++;
+
84 }
+
85
+
86 return 0;
+
87}
+
+ + + +
std::vector< int > triangle(int width, int height)
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2gridbox_8cpp-example.html b/examples_2dom_2gridbox_8cpp-example.html new file mode 100644 index 000000000..9e4d99849 --- /dev/null +++ b/examples_2dom_2gridbox_8cpp-example.html @@ -0,0 +1,262 @@ + + + + + + + + +FTXUI: examples/dom/gridbox.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/gridbox.cpp
+
+
+
// Copyright 2021 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <stdio.h> // for getchar
+
#include <ftxui/dom/elements.hpp> // for Elements, gridbox, Fit, operator|, text, border, Element
+
#include <ftxui/screen/screen.hpp> // for Screen
+
#include <memory> // for allocator, shared_ptr
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for ftxui
+
+
int main() {
+
using namespace ftxui;
+
auto cell = [](const char* t) { return text(t) | border; };
+
auto document = //
+
gridbox({
+
{
+
cell("north-west"),
+
cell("north"),
+
cell("north-east"),
+
},
+
{
+
cell("center-west"),
+
gridbox({
+
{
+
cell("center-north-west"),
+
cell("center-north-east"),
+
},
+
{
+
cell("center-south-west"),
+
cell("center-south-east"),
+
},
+
}),
+
cell("center-east"),
+
},
+
{
+
cell("south-west"),
+
cell("south"),
+
cell("south-east"),
+
},
+
});
+
auto screen = Screen::Create(Dimension::Fit(document));
+
Render(screen, document);
+
screen.Print();
+
getchar();
+
+
return 0;
+
}
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2gridbox_8cpp.html b/examples_2dom_2gridbox_8cpp.html new file mode 100644 index 000000000..ca447e1c0 --- /dev/null +++ b/examples_2dom_2gridbox_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: gridbox.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
gridbox.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 12 of file examples/dom/gridbox.cpp.

+ +
+
+
+
+ + + + + diff --git a/examples_2dom_2gridbox_8cpp.js b/examples_2dom_2gridbox_8cpp.js new file mode 100644 index 000000000..5235441fe --- /dev/null +++ b/examples_2dom_2gridbox_8cpp.js @@ -0,0 +1,4 @@ +var examples_2dom_2gridbox_8cpp = +[ + [ "main", "examples_2dom_2gridbox_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/examples_2dom_2gridbox_8cpp_source.html b/examples_2dom_2gridbox_8cpp_source.html new file mode 100644 index 000000000..4dd0d2b52 --- /dev/null +++ b/examples_2dom_2gridbox_8cpp_source.html @@ -0,0 +1,265 @@ + + + + + + + + +FTXUI: gridbox.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/gridbox.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2021 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <stdio.h> // for getchar
+
5#include <ftxui/dom/elements.hpp> // for Elements, gridbox, Fit, operator|, text, border, Element
+
6#include <ftxui/screen/screen.hpp> // for Screen
+
7#include <memory> // for allocator, shared_ptr
+
8
+
9#include "ftxui/dom/node.hpp" // for Render
+
10#include "ftxui/screen/color.hpp" // for ftxui
+
11
+
+
12int main() {
+
13 using namespace ftxui;
+
14 auto cell = [](const char* t) { return text(t) | border; };
+
15 auto document = //
+
16 gridbox({
+
17 {
+
18 cell("north-west"),
+
19 cell("north"),
+
20 cell("north-east"),
+
21 },
+
22 {
+
23 cell("center-west"),
+
24 gridbox({
+
25 {
+
26 cell("center-north-west"),
+
27 cell("center-north-east"),
+
28 },
+
29 {
+
30 cell("center-south-west"),
+
31 cell("center-south-east"),
+
32 },
+
33 }),
+
34 cell("center-east"),
+
35 },
+
36 {
+
37 cell("south-west"),
+
38 cell("south"),
+
39 cell("south-east"),
+
40 },
+
41 });
+
42 auto screen = Screen::Create(Dimension::Fit(document));
+
43 Render(screen, document);
+
44 screen.Print();
+
45 getchar();
+
46
+
47 return 0;
+
48}
+
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2hflow_8cpp-example.html b/examples_2dom_2hflow_8cpp-example.html new file mode 100644 index 000000000..e12d4fcf3 --- /dev/null +++ b/examples_2dom_2hflow_8cpp-example.html @@ -0,0 +1,267 @@ + + + + + + + + +FTXUI: examples/dom/hflow.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/hflow.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <stdio.h> // for getchar
+
#include <ftxui/dom/elements.hpp> // for operator|, size, Element, text, hcenter, Decorator, Fit, WIDTH, hflow, window, EQUAL, GREATER_THAN, HEIGHT, bold, border, dim, LESS_THAN
+
#include <ftxui/screen/screen.hpp> // for Full, Screen
+
#include <string> // for allocator, char_traits, operator+, to_string, string
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for ftxui
+
+
int main() {
+
using namespace ftxui;
+
auto make_box = [](int dimx, int dimy) {
+
std::string title = std::to_string(dimx) + "x" + std::to_string(dimy);
+
return window(text(title) | hcenter | bold,
+
text("content") | hcenter | dim) |
+
size(WIDTH, EQUAL, dimx) | size(HEIGHT, EQUAL, dimy);
+
};
+
+
auto style = size(WIDTH, GREATER_THAN, 20) | border |
+
size(HEIGHT, GREATER_THAN, 30) | size(WIDTH, LESS_THAN, 50);
+
+
auto document = hflow({
+
make_box(7, 7),
+
make_box(7, 5),
+
make_box(5, 7),
+
make_box(10, 4),
+
make_box(10, 4),
+
make_box(10, 4),
+
make_box(10, 4),
+
make_box(11, 4),
+
make_box(11, 4),
+
make_box(11, 4),
+
make_box(11, 4),
+
make_box(12, 4),
+
make_box(12, 5),
+
make_box(12, 4),
+
make_box(13, 4),
+
make_box(13, 3),
+
make_box(13, 3),
+
make_box(10, 3),
+
}) |
+
style;
+
+
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
Render(screen, document);
+
screen.Print();
+
getchar();
+
+
return 0;
+
}
+ + + +
Element make_box(int x, int y)
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2html_like_8cpp-example.html b/examples_2dom_2html_like_8cpp-example.html new file mode 100644 index 000000000..ac6f7ad78 --- /dev/null +++ b/examples_2dom_2html_like_8cpp-example.html @@ -0,0 +1,274 @@ + + + + + + + + +FTXUI: examples/dom/html_like.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/html_like.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <chrono> // for operator""s, chrono_literals
+
#include <ftxui/screen/screen.hpp> // for Screen
+
#include <iostream> // for cout, ostream
+
#include <string> // for allocator, operator<<, string
+
#include <thread> // for sleep_for
+
+
#include "ftxui/dom/elements.hpp" // for paragraph, text, operator|, Element, border, Fit, color, hflow, spinner, vbox, bold, dim, underlined
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/box.hpp" // for ftxui
+
#include "ftxui/screen/color.hpp" // for Color, Color::Red
+
+
int main() {
+
using namespace ftxui;
+
using namespace std::chrono_literals;
+
+
auto img1 = []() { return text("img") | border; };
+
auto img2 = []() { return vbox({text("big"), text("image")}) | border; };
+
+
std::string reset_position;
+
for (int i = 0;; ++i) {
+
auto document = //
+
hflow(
+
paragraph("Hello world! Here is an image:"), img1(),
+
paragraph(" Here is a text "), text("underlined ") | underlined,
+
paragraph(" Here is a text "), text("bold ") | bold,
+
paragraph("Hello world! Here is an image:"), img2(),
+
paragraph(
+
"Le Lorem Ipsum est simplement du faux texte employé dans la "
+
"composition et la mise en page avant impression. Le Lorem "
+
"Ipsum est le faux texte standard de l'imprimerie depuis les "
+
"années 1500, quand un imprimeur anonyme assembla ensemble "
+
"des morceaux de texte pour réaliser un livre spécimen de "
+
"polices de texte. Il n'a pas fait que survivre cinq siècles, "
+
"mais s'est aussi adapté à la bureautique informatique, sans "
+
"que son contenu n'en soit modifié. Il a été popularisé dans "
+
"les années 1960 grâce à la vente de feuilles Letraset "
+
"contenant des passages du Lorem Ipsum, et, plus récemment, "
+
"par son inclusion dans des applications de mise en page de "
+
"texte, comme Aldus PageMaker."),
+
paragraph(" Here is a text "), text("dim ") | dim,
+
paragraph("Hello world! Here is an image:"), img1(),
+
paragraph(" Here is a text "), text("red ") | color(Color::Red),
+
paragraph(" A spinner "), spinner(6, i / 10)) |
+
border;
+
+
auto screen = Screen::Create(Dimension::Fit(document));
+
Render(screen, document);
+
std::cout << reset_position;
+
screen.Print();
+
reset_position = screen.ResetPosition();
+
+
std::this_thread::sleep_for(0.01s);
+
}
+
+
return 0;
+
}
+ + + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2linear__gradient_8cpp.html b/examples_2dom_2linear__gradient_8cpp.html new file mode 100644 index 000000000..133c37c3c --- /dev/null +++ b/examples_2dom_2linear__gradient_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: linear_gradient.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
linear_gradient.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 12 of file examples/dom/linear_gradient.cpp.

+ +
+
+
+
+ + + + + diff --git a/examples_2dom_2linear__gradient_8cpp.js b/examples_2dom_2linear__gradient_8cpp.js new file mode 100644 index 000000000..7ac9ecb3d --- /dev/null +++ b/examples_2dom_2linear__gradient_8cpp.js @@ -0,0 +1,4 @@ +var examples_2dom_2linear__gradient_8cpp = +[ + [ "main", "examples_2dom_2linear__gradient_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/examples_2dom_2linear__gradient_8cpp_source.html b/examples_2dom_2linear__gradient_8cpp_source.html new file mode 100644 index 000000000..ac397daa0 --- /dev/null +++ b/examples_2dom_2linear__gradient_8cpp_source.html @@ -0,0 +1,244 @@ + + + + + + + + +FTXUI: linear_gradient.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/linear_gradient.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2023 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <ftxui/dom/elements.hpp> // for bgcolor, operator|, operator|=, text, center, Element
+
5#include <ftxui/dom/linear_gradient.hpp> // for LinearGradient::Stop, LinearGradient
+
6#include <ftxui/screen/screen.hpp> // for Full, Screen
+
7#include <memory> // for allocator, shared_ptr
+
8
+
9#include "ftxui/dom/node.hpp" // for Render
+
10#include "ftxui/screen/color.hpp" // for Color, Color::DeepPink1, Color::DeepSkyBlue1, Color::Yellow, ftxui
+
11
+
+
12int main() {
+
13 using namespace ftxui;
+
14 auto document = text("gradient") | center;
+
15
+
16 document |= bgcolor(LinearGradient()
+
17 .Angle(45)
+
18 .Stop(Color::DeepPink1)
+
19 .Stop(Color::DeepSkyBlue1));
+
20 auto screen = Screen::Create(Dimension::Full(), Dimension::Full());
+
21 Render(screen, document);
+
22 screen.Print();
+
23
+
24 return 0;
+
25}
+
+ + + +
A class representing the settings for linear-gradient color effect.
+ +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2linear_gradient_8cpp-example.html b/examples_2dom_2linear_gradient_8cpp-example.html new file mode 100644 index 000000000..ab314be08 --- /dev/null +++ b/examples_2dom_2linear_gradient_8cpp-example.html @@ -0,0 +1,241 @@ + + + + + + + + +FTXUI: examples/dom/linear_gradient.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/linear_gradient.cpp
+
+
+
// Copyright 2023 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <ftxui/dom/elements.hpp> // for bgcolor, operator|, operator|=, text, center, Element
+
#include <ftxui/dom/linear_gradient.hpp> // for LinearGradient::Stop, LinearGradient
+
#include <ftxui/screen/screen.hpp> // for Full, Screen
+
#include <memory> // for allocator, shared_ptr
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for Color, Color::DeepPink1, Color::DeepSkyBlue1, Color::Yellow, ftxui
+
+
int main() {
+
using namespace ftxui;
+
auto document = text("gradient") | center;
+
+
document |= bgcolor(LinearGradient()
+
.Angle(45)
+
.Stop(Color::DeepPink1)
+
.Stop(Color::DeepSkyBlue1));
+
auto screen = Screen::Create(Dimension::Full(), Dimension::Full());
+
Render(screen, document);
+
screen.Print();
+
+
return 0;
+
}
+ + + +
A class representing the settings for linear-gradient color effect.
+ +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2package_manager_8cpp-example.html b/examples_2dom_2package_manager_8cpp-example.html new file mode 100644 index 000000000..e072df573 --- /dev/null +++ b/examples_2dom_2package_manager_8cpp-example.html @@ -0,0 +1,365 @@ + + + + + + + + +FTXUI: examples/dom/package_manager.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/package_manager.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <chrono> // for operator""s, chrono_literals
+
#include <ftxui/dom/elements.hpp> // for operator|, text, Element, hbox, bold, color, filler, separator, vbox, window, gauge, Fit, size, dim, EQUAL, WIDTH
+
#include <ftxui/screen/screen.hpp> // for Full, Screen
+
#include <iostream> // for cout, endl, ostream
+
#include <list> // for list, operator==, _List_iterator, _List_iterator<>::_Self
+
#include <memory> // for allocator, shared_ptr, allocator_traits<>::value_type
+
#include <string> // for string, operator<<, to_string
+
#include <thread> // for sleep_for
+
#include <utility> // for move
+
#include <vector> // for vector
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for Color, Color::Green, Color::Red, Color::RedLight, ftxui
+
+
int main() {
+
using namespace ftxui;
+
+
struct Task {
+
std::string name;
+
int number_of_threads;
+
int downloaded;
+
int size;
+
};
+
+
std::list<Task> remaining_tasks = {
+
{"contact server ", 10, 0, 6 * 25},
+
{"download index.html ", 10, 0, 9 * 25},
+
{"download script.js ", 1, 0, 3 * 25},
+
{"download style.js ", 1, 0, 4 * 25},
+
{"download image.png ", 1, 0, 5 * 25},
+
{"download big_1.png ", 1, 0, 30 * 25},
+
{"download icon_1.png ", 1, 0, 7 * 25},
+
{"download icon_2.png ", 1, 0, 8 * 25},
+
{"download big_2.png ", 1, 0, 30 * 25},
+
{"download small_1.png ", 1, 0, 10 * 25},
+
{"download small_2.png ", 1, 0, 11 * 25},
+
{"download small_3.png ", 1, 0, 12 * 25},
+
};
+
+
std::list<Task> displayed_task;
+
+
int remaining_threads = 12;
+
+
int nb_queued = (int)remaining_tasks.size();
+
int nb_active = 0;
+
int nb_done = 0;
+
+
auto to_text = [](int number) {
+
return text(std::to_string(number)) | size(WIDTH, EQUAL, 3);
+
};
+
+
auto renderTask = [&](const Task& task) {
+
auto style = (task.downloaded == task.size) ? dim : bold;
+
return hbox({
+
text(task.name) | style,
+
separator(),
+
to_text(task.downloaded),
+
text("/"),
+
to_text(task.size),
+
separator(),
+
gauge(task.downloaded / float(task.size)),
+
});
+
};
+
+
auto renderSummary = [&]() {
+
auto summary = vbox({
+
hbox({
+
text("- done: "),
+
to_text(nb_done) | bold,
+
}) | color(Color::Green),
+
hbox({
+
text("- active: "),
+
to_text(nb_active) | bold,
+
}) | color(Color::RedLight),
+
hbox({
+
text("- queue: "),
+
to_text(nb_queued) | bold,
+
}) | color(Color::Red),
+
});
+
+
return window(text(" Summary "), summary);
+
};
+
+
auto render = [&]() {
+
std::vector<Element> entries;
+
for (auto& task : displayed_task) {
+
entries.push_back(renderTask(task));
+
}
+
+
return vbox({
+
// List of tasks.
+
window(text(" Task "), vbox(std::move(entries))),
+
+
// Summary.
+
hbox({
+
renderSummary(),
+
filler(),
+
}),
+
});
+
};
+
+
auto updateModel = [&]() {
+
for (auto& task : displayed_task) {
+
if (task.downloaded != task.size) {
+
task.downloaded++;
+
} else if (task.number_of_threads) {
+
remaining_threads += task.number_of_threads;
+
task.number_of_threads = 0;
+
nb_active--;
+
nb_done++;
+
}
+
}
+
+
if (remaining_tasks.size() &&
+
remaining_tasks.front().number_of_threads <= remaining_threads) {
+
remaining_threads -= remaining_tasks.front().number_of_threads;
+
displayed_task.push_back(remaining_tasks.front());
+
remaining_tasks.pop_front();
+
nb_queued--;
+
nb_active++;
+
}
+
};
+
+
std::string reset_position;
+
for (;;) {
+
// Draw.
+
auto document = render();
+
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
Render(screen, document);
+
std::cout << reset_position;
+
screen.Print();
+
reset_position = screen.ResetPosition();
+
+
// Simulate time.
+
using namespace std::chrono_literals;
+
std::this_thread::sleep_for(0.01s);
+
+
// Exit
+
if (nb_active + nb_queued == 0) {
+
break;
+
}
+
+
// Update the model for the next frame.
+
updateModel();
+
}
+
std::cout << std::endl;
+
}
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::variant< Event, Closure, AnimationTask > Task
Definition task.hpp:14
+ + +
+
+ + + + + diff --git a/examples_2dom_2paragraph_8cpp-example.html b/examples_2dom_2paragraph_8cpp-example.html new file mode 100644 index 000000000..f62eb6a39 --- /dev/null +++ b/examples_2dom_2paragraph_8cpp-example.html @@ -0,0 +1,267 @@ + + + + + + + + +FTXUI: examples/dom/paragraph.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/paragraph.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <chrono> // for operator""s, chrono_literals
+
#include <ftxui/screen/screen.hpp> // for Full, Screen
+
#include <iostream> // for cout, ostream
+
#include <memory> // for allocator, shared_ptr
+
#include <string> // for string, operator<<
+
#include <thread> // for sleep_for
+
+
#include "ftxui/dom/elements.hpp" // for hflow, paragraph, separator, hbox, vbox, filler, operator|, border, Element
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/box.hpp" // for ftxui
+
+
using namespace std::chrono_literals;
+
int main() {
+
using namespace ftxui;
+
std::string p =
+
R"(In probability theory and statistics, Bayes' theorem (alternatively Bayes' law or Bayes' rule) describes the probability of an event, based on prior knowledge of conditions that might be related to the event. For example, if cancer is related to age, then, using Bayes' theorem, a person's age can be used to more accurately assess the probability that they have cancer, compared to the assessment of the probability of cancer made without knowledge of the person's age. One of the many applications of Bayes' theorem is Bayesian inference, a particular approach to statistical inference. When applied, the probabilities involved in Bayes' theorem may have different probability interpretations. With the Bayesian probability interpretation the theorem expresses how a subjective degree of belief should rationally change to account for availability of related evidence. Bayesian inference is fundamental to Bayesian statistics.)";
+
+
std::string reset_position;
+
while (true) {
+
auto document = vbox({
+
hflow(paragraph(p)),
+
separator(),
+
hflow(paragraph(p)),
+
separator(),
+
hbox({
+
hflow(paragraph(p)),
+
separator(),
+
hflow(paragraph(p)),
+
}),
+
}) |
+
border;
+
+
document = vbox(filler(), document);
+
+
// auto screen = Screen::Create(Dimension::Fit(document));
+
// Render(screen, document);
+
// screen.Print();
+
// getchar();
+
+
auto screen = Screen::Create(Dimension::Full());
+
Render(screen, document);
+
std::cout << reset_position;
+
screen.Print();
+
reset_position = screen.ResetPosition();
+
+
std::this_thread::sleep_for(0.01s);
+
}
+
+
return 0;
+
}
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2paragraph_8cpp.html b/examples_2dom_2paragraph_8cpp.html new file mode 100644 index 000000000..eb9b6928c --- /dev/null +++ b/examples_2dom_2paragraph_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: paragraph.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
paragraph.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 16 of file examples/dom/paragraph.cpp.

+ +
+
+
+
+ + + + + diff --git a/examples_2dom_2paragraph_8cpp.js b/examples_2dom_2paragraph_8cpp.js new file mode 100644 index 000000000..c25d2ffba --- /dev/null +++ b/examples_2dom_2paragraph_8cpp.js @@ -0,0 +1,4 @@ +var examples_2dom_2paragraph_8cpp = +[ + [ "main", "examples_2dom_2paragraph_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/examples_2dom_2paragraph_8cpp_source.html b/examples_2dom_2paragraph_8cpp_source.html new file mode 100644 index 000000000..fe850f2d5 --- /dev/null +++ b/examples_2dom_2paragraph_8cpp_source.html @@ -0,0 +1,270 @@ + + + + + + + + +FTXUI: paragraph.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/paragraph.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <chrono> // for operator""s, chrono_literals
+
5#include <ftxui/screen/screen.hpp> // for Full, Screen
+
6#include <iostream> // for cout, ostream
+
7#include <memory> // for allocator, shared_ptr
+
8#include <string> // for string, operator<<
+
9#include <thread> // for sleep_for
+
10
+
11#include "ftxui/dom/elements.hpp" // for hflow, paragraph, separator, hbox, vbox, filler, operator|, border, Element
+
12#include "ftxui/dom/node.hpp" // for Render
+
13#include "ftxui/screen/box.hpp" // for ftxui
+
14
+
15using namespace std::chrono_literals;
+
+
16int main() {
+
17 using namespace ftxui;
+
18 std::string p =
+
19 R"(In probability theory and statistics, Bayes' theorem (alternatively Bayes' law or Bayes' rule) describes the probability of an event, based on prior knowledge of conditions that might be related to the event. For example, if cancer is related to age, then, using Bayes' theorem, a person's age can be used to more accurately assess the probability that they have cancer, compared to the assessment of the probability of cancer made without knowledge of the person's age. One of the many applications of Bayes' theorem is Bayesian inference, a particular approach to statistical inference. When applied, the probabilities involved in Bayes' theorem may have different probability interpretations. With the Bayesian probability interpretation the theorem expresses how a subjective degree of belief should rationally change to account for availability of related evidence. Bayesian inference is fundamental to Bayesian statistics.)";
+
20
+
21 std::string reset_position;
+
22 while (true) {
+
23 auto document = vbox({
+
24 hflow(paragraph(p)),
+
25 separator(),
+
26 hflow(paragraph(p)),
+
27 separator(),
+
28 hbox({
+
29 hflow(paragraph(p)),
+
30 separator(),
+
31 hflow(paragraph(p)),
+
32 }),
+
33 }) |
+
34 border;
+
35
+
36 document = vbox(filler(), document);
+
37
+
38 // auto screen = Screen::Create(Dimension::Fit(document));
+
39 // Render(screen, document);
+
40 // screen.Print();
+
41 // getchar();
+
42
+
43 auto screen = Screen::Create(Dimension::Full());
+
44 Render(screen, document);
+
45 std::cout << reset_position;
+
46 screen.Print();
+
47 reset_position = screen.ResetPosition();
+
48
+
49 std::this_thread::sleep_for(0.01s);
+
50 }
+
51
+
52 return 0;
+
53}
+
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2separator_8cpp-example.html b/examples_2dom_2separator_8cpp-example.html new file mode 100644 index 000000000..2ca3ff323 --- /dev/null +++ b/examples_2dom_2separator_8cpp-example.html @@ -0,0 +1,244 @@ + + + + + + + + +FTXUI: examples/dom/separator.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/separator.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <ftxui/dom/elements.hpp> // for text, center, separator, operator|, flex, Element, vbox, Fit, hbox, border
+
#include <ftxui/screen/screen.hpp> // for Full, Screen
+
#include <memory> // for allocator
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for ftxui
+
+
int main() {
+
using namespace ftxui;
+
auto document = hbox({
+
text("left-column"),
+
separator(),
+
vbox({
+
center(text("top")) | flex,
+
separator(),
+
center(text("bottom")),
+
}) | flex,
+
separator(),
+
text("right-column"),
+
}) |
+
border;
+
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
Render(screen, document);
+
screen.Print();
+
+
return 0;
+
}
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2separator_8cpp.html b/examples_2dom_2separator_8cpp.html new file mode 100644 index 000000000..3d5da5b6f --- /dev/null +++ b/examples_2dom_2separator_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: separator.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
separator.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 11 of file examples/dom/separator.cpp.

+ +
+
+
+
+ + + + + diff --git a/examples_2dom_2separator_8cpp.js b/examples_2dom_2separator_8cpp.js new file mode 100644 index 000000000..9d1377a6b --- /dev/null +++ b/examples_2dom_2separator_8cpp.js @@ -0,0 +1,4 @@ +var examples_2dom_2separator_8cpp = +[ + [ "main", "examples_2dom_2separator_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/examples_2dom_2separator_8cpp_source.html b/examples_2dom_2separator_8cpp_source.html new file mode 100644 index 000000000..d1138826a --- /dev/null +++ b/examples_2dom_2separator_8cpp_source.html @@ -0,0 +1,247 @@ + + + + + + + + +FTXUI: separator.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/separator.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <ftxui/dom/elements.hpp> // for text, center, separator, operator|, flex, Element, vbox, Fit, hbox, border
+
5#include <ftxui/screen/screen.hpp> // for Full, Screen
+
6#include <memory> // for allocator
+
7
+
8#include "ftxui/dom/node.hpp" // for Render
+
9#include "ftxui/screen/color.hpp" // for ftxui
+
10
+
+
11int main() {
+
12 using namespace ftxui;
+
13 auto document = hbox({
+
14 text("left-column"),
+
15 separator(),
+
16 vbox({
+
17 center(text("top")) | flex,
+
18 separator(),
+
19 center(text("bottom")),
+
20 }) | flex,
+
21 separator(),
+
22 text("right-column"),
+
23 }) |
+
24 border;
+
25 auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
26 Render(screen, document);
+
27 screen.Print();
+
28
+
29 return 0;
+
30}
+
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2separator_style_8cpp-example.html b/examples_2dom_2separator_style_8cpp-example.html new file mode 100644 index 000000000..67f41efce --- /dev/null +++ b/examples_2dom_2separator_style_8cpp-example.html @@ -0,0 +1,260 @@ + + + + + + + + +FTXUI: examples/dom/separator_style.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/separator_style.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <ftxui/screen/screen.hpp> // for Screen
+
#include <iostream> // for endl, cout, ostream
+
#include <memory> // for allocator
+
+
#include "ftxui/dom/elements.hpp" // for text, hbox, separatorDouble, separatorHeavy, separatorLight, vbox, operator|, Element, Fit, borderDouble, borderHeavy, borderLight
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/box.hpp" // for ftxui
+
+
int main() {
+
using namespace ftxui;
+
+
auto document = vbox({
+
vbox({
+
text("separatorLight"),
+
separatorLight(),
+
hbox(text("left"), separatorLight(), text("right")),
+
}) | borderLight,
+
+
vbox({
+
text("separatorDashed"),
+
separatorDashed(),
+
hbox(text("left"), separatorDashed(), text("right")),
+
}) | borderDashed,
+
+
vbox({
+
text("separatorHeavy"),
+
separatorHeavy(),
+
hbox(text("left"), separatorHeavy(), text("right")),
+
}) | borderHeavy,
+
+
vbox({
+
text("separatorDouble"),
+
separatorDouble(),
+
hbox(text("left"), separatorDouble(), text("right")),
+
}) | borderDouble,
+
});
+
+
auto screen =
+
Screen::Create(Dimension::Fit(document), Dimension::Fit(document));
+
Render(screen, document);
+
screen.Print();
+
std::cout << std::endl;
+
}
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2size_8cpp-example.html b/examples_2dom_2size_8cpp-example.html new file mode 100644 index 000000000..1df30ff93 --- /dev/null +++ b/examples_2dom_2size_8cpp-example.html @@ -0,0 +1,247 @@ + + + + + + + + +FTXUI: examples/dom/size.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/size.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <ftxui/dom/elements.hpp> // for operator|, text, Element, hcenter, Fit, hbox, size, window, Elements, bold, dim, EQUAL, WIDTH
+
#include <ftxui/screen/screen.hpp> // for Screen
+
#include <memory> // for allocator, shared_ptr
+
#include <string> // for string, to_string
+
#include <utility> // for move
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for ftxui
+
+
int main() {
+
using namespace ftxui;
+
auto make_box = [](const std::string& title) {
+
return window(text(title) | hcenter | bold,
+
text("content") | hcenter | dim);
+
};
+
+
Elements content;
+
for (int x = 3; x < 30; ++x) {
+
content.push_back(make_box(std::to_string(x)) | size(WIDTH, EQUAL, x));
+
}
+
+
auto document = hbox(std::move(content));
+
auto screen = Screen::Create(Dimension::Fit(document));
+
Render(screen, document);
+
screen.Print();
+
+
return 0;
+
}
+ + + +
Element make_box(int x, int y)
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::vector< Element > Elements
Definition elements.hpp:23
+ + +
+
+ + + + + diff --git a/examples_2dom_2size_8cpp.html b/examples_2dom_2size_8cpp.html new file mode 100644 index 000000000..d8a6ea78c --- /dev/null +++ b/examples_2dom_2size_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: size.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
size.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 13 of file examples/dom/size.cpp.

+ +
+
+
+
+ + + + + diff --git a/examples_2dom_2size_8cpp.js b/examples_2dom_2size_8cpp.js new file mode 100644 index 000000000..98b5bbfaf --- /dev/null +++ b/examples_2dom_2size_8cpp.js @@ -0,0 +1,4 @@ +var examples_2dom_2size_8cpp = +[ + [ "main", "examples_2dom_2size_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/examples_2dom_2size_8cpp_source.html b/examples_2dom_2size_8cpp_source.html new file mode 100644 index 000000000..37d2a5a0e --- /dev/null +++ b/examples_2dom_2size_8cpp_source.html @@ -0,0 +1,250 @@ + + + + + + + + +FTXUI: size.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/size.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <ftxui/dom/elements.hpp> // for operator|, text, Element, hcenter, Fit, hbox, size, window, Elements, bold, dim, EQUAL, WIDTH
+
5#include <ftxui/screen/screen.hpp> // for Screen
+
6#include <memory> // for allocator, shared_ptr
+
7#include <string> // for string, to_string
+
8#include <utility> // for move
+
9
+
10#include "ftxui/dom/node.hpp" // for Render
+
11#include "ftxui/screen/color.hpp" // for ftxui
+
12
+
+
13int main() {
+
14 using namespace ftxui;
+
15 auto make_box = [](const std::string& title) {
+
16 return window(text(title) | hcenter | bold,
+
17 text("content") | hcenter | dim);
+
18 };
+
19
+
20 Elements content;
+
21 for (int x = 3; x < 30; ++x) {
+
22 content.push_back(make_box(std::to_string(x)) | size(WIDTH, EQUAL, x));
+
23 }
+
24
+
25 auto document = hbox(std::move(content));
+
26 auto screen = Screen::Create(Dimension::Fit(document));
+
27 Render(screen, document);
+
28 screen.Print();
+
29
+
30 return 0;
+
31}
+
+ + + +
Element make_box(int x, int y)
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::vector< Element > Elements
Definition elements.hpp:23
+ + +
+
+ + + + + diff --git a/examples_2dom_2spinner_8cpp-example.html b/examples_2dom_2spinner_8cpp-example.html new file mode 100644 index 000000000..c3c211bbc --- /dev/null +++ b/examples_2dom_2spinner_8cpp-example.html @@ -0,0 +1,261 @@ + + + + + + + + +FTXUI: examples/dom/spinner.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/spinner.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <chrono> // for operator""s, chrono_literals
+
#include <ftxui/dom/elements.hpp> // for Element, operator|, separator, filler, hbox, size, spinner, text, vbox, bold, border, Fit, EQUAL, WIDTH
+
#include <ftxui/screen/screen.hpp> // for Full, Screen
+
#include <iostream> // for cout, endl, ostream
+
#include <string> // for to_string, operator<<, string
+
#include <thread> // for sleep_for
+
#include <utility> // for move
+
#include <vector> // for vector
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for ftxui
+
+
int main() {
+
using namespace ftxui;
+
using namespace std::chrono_literals;
+
+
std::string reset_position;
+
for (int index = 0; index < 200; ++index) {
+
std::vector<Element> entries;
+
for (int i = 0; i < 23; ++i) {
+
if (i != 0) {
+
entries.push_back(separator());
+
}
+
entries.push_back( //
+
hbox({
+
text(std::to_string(i)) | size(WIDTH, EQUAL, 2),
+
separator(),
+
spinner(i, index) | bold,
+
}));
+
}
+
auto document = hbox({
+
vbox(std::move(entries)) | border,
+
filler(),
+
});
+
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
Render(screen, document);
+
std::cout << reset_position;
+
screen.Print();
+
reset_position = screen.ResetPosition();
+
+
std::this_thread::sleep_for(0.1s);
+
}
+
std::cout << std::endl;
+
}
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2spinner_8cpp.html b/examples_2dom_2spinner_8cpp.html new file mode 100644 index 000000000..be965d193 --- /dev/null +++ b/examples_2dom_2spinner_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: spinner.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
spinner.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 16 of file examples/dom/spinner.cpp.

+ +
+
+
+
+ + + + + diff --git a/examples_2dom_2spinner_8cpp.js b/examples_2dom_2spinner_8cpp.js new file mode 100644 index 000000000..421393780 --- /dev/null +++ b/examples_2dom_2spinner_8cpp.js @@ -0,0 +1,4 @@ +var examples_2dom_2spinner_8cpp = +[ + [ "main", "examples_2dom_2spinner_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/examples_2dom_2spinner_8cpp_source.html b/examples_2dom_2spinner_8cpp_source.html new file mode 100644 index 000000000..e4feac369 --- /dev/null +++ b/examples_2dom_2spinner_8cpp_source.html @@ -0,0 +1,264 @@ + + + + + + + + +FTXUI: spinner.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/spinner.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <chrono> // for operator""s, chrono_literals
+
5#include <ftxui/dom/elements.hpp> // for Element, operator|, separator, filler, hbox, size, spinner, text, vbox, bold, border, Fit, EQUAL, WIDTH
+
6#include <ftxui/screen/screen.hpp> // for Full, Screen
+
7#include <iostream> // for cout, endl, ostream
+
8#include <string> // for to_string, operator<<, string
+
9#include <thread> // for sleep_for
+
10#include <utility> // for move
+
11#include <vector> // for vector
+
12
+
13#include "ftxui/dom/node.hpp" // for Render
+
14#include "ftxui/screen/color.hpp" // for ftxui
+
15
+
+
16int main() {
+
17 using namespace ftxui;
+
18 using namespace std::chrono_literals;
+
19
+
20 std::string reset_position;
+
21 for (int index = 0; index < 200; ++index) {
+
22 std::vector<Element> entries;
+
23 for (int i = 0; i < 23; ++i) {
+
24 if (i != 0) {
+
25 entries.push_back(separator());
+
26 }
+
27 entries.push_back( //
+
28 hbox({
+
29 text(std::to_string(i)) | size(WIDTH, EQUAL, 2),
+
30 separator(),
+
31 spinner(i, index) | bold,
+
32 }));
+
33 }
+
34 auto document = hbox({
+
35 vbox(std::move(entries)) | border,
+
36 filler(),
+
37 });
+
38 auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
39 Render(screen, document);
+
40 std::cout << reset_position;
+
41 screen.Print();
+
42 reset_position = screen.ResetPosition();
+
43
+
44 std::this_thread::sleep_for(0.1s);
+
45 }
+
46 std::cout << std::endl;
+
47}
+
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2style_blink_8cpp-example.html b/examples_2dom_2style_blink_8cpp-example.html new file mode 100644 index 000000000..657f2b67b --- /dev/null +++ b/examples_2dom_2style_blink_8cpp-example.html @@ -0,0 +1,238 @@ + + + + + + + + +FTXUI: examples/dom/style_blink.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/style_blink.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <ftxui/dom/elements.hpp> // for text, operator|, blink, Fit, hbox, Element
+
#include <ftxui/screen/screen.hpp> // for Full, Screen
+
#include <memory> // for allocator
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for ftxui
+
+
int main() {
+
using namespace ftxui;
+
auto document = //
+
hbox({
+
text("This text is "),
+
text("blink") | blink,
+
text(". Do you like it?"),
+
});
+
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
Render(screen, document);
+
screen.Print();
+
+
return 0;
+
}
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2style_bold_8cpp-example.html b/examples_2dom_2style_bold_8cpp-example.html new file mode 100644 index 000000000..6c8d1b8c1 --- /dev/null +++ b/examples_2dom_2style_bold_8cpp-example.html @@ -0,0 +1,238 @@ + + + + + + + + +FTXUI: examples/dom/style_bold.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/style_bold.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <ftxui/dom/elements.hpp> // for text, operator|, bold, Fit, hbox, Element
+
#include <ftxui/screen/screen.hpp> // for Full, Screen
+
#include <memory> // for allocator
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for ftxui
+
+
int main() {
+
using namespace ftxui;
+
auto document = //
+
hbox({
+
text("This text is "),
+
text("bold") | bold,
+
text(". Do you like it?"),
+
});
+
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
Render(screen, document);
+
screen.Print();
+
+
return 0;
+
}
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2style_color_8cpp-example.html b/examples_2dom_2style_color_8cpp-example.html new file mode 100644 index 000000000..8f50c5731 --- /dev/null +++ b/examples_2dom_2style_color_8cpp-example.html @@ -0,0 +1,283 @@ + + + + + + + + +FTXUI: examples/dom/style_color.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/style_color.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <ftxui/dom/linear_gradient.hpp> // for LinearGradient
+
#include <ftxui/screen/screen.hpp> // for Full, Screen
+
#include <memory> // for allocator
+
+
#include "ftxui/dom/elements.hpp" // for text, bgcolor, color, vbox, filler, Fit, hbox
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for Color, operator""_rgb, Color::Black, Color::Blue, Color::BlueLight, Color::Cyan, Color::CyanLight, Color::DeepSkyBlue4, Color::Default, Color::GrayDark, Color::GrayLight, Color::Green, Color::GreenLight, Color::Magenta, Color::MagentaLight, Color::Red, Color::RedLight, Color::SkyBlue1, Color::White, Color::Yellow, Color::YellowLight, ftxui
+
+
int main() {
+
using namespace ftxui;
+
auto document = hbox({
+
vbox({
+
color(Color::Default, text("Default")),
+
color(Color::Black, text("Black")),
+
color(Color::GrayDark, text("GrayDark")),
+
color(Color::GrayLight, text("GrayLight")),
+
color(Color::White, text("White")),
+
color(Color::Blue, text("Blue")),
+
color(Color::BlueLight, text("BlueLight")),
+
color(Color::Cyan, text("Cyan")),
+
color(Color::CyanLight, text("CyanLight")),
+
color(Color::Green, text("Green")),
+
color(Color::GreenLight, text("GreenLight")),
+
color(Color::Magenta, text("Magenta")),
+
color(Color::MagentaLight, text("MagentaLight")),
+
color(Color::Red, text("Red")),
+
color(Color::RedLight, text("RedLight")),
+
color(Color::Yellow, text("Yellow")),
+
color(Color::YellowLight, text("YellowLight")),
+
color(0x66ff66_rgb, text("Phosphor")),
+
color(LinearGradient(Color::SkyBlue1, Color::DeepSkyBlue4),
+
text("Skyblue to DeepSkyBlue")),
+
}),
+
vbox({
+
bgcolor(Color::Default, text("Default")),
+
bgcolor(Color::Black, text("Black")),
+
bgcolor(Color::GrayDark, text("GrayDark")),
+
bgcolor(Color::GrayLight, text("GrayLight")),
+
bgcolor(Color::White, text("White")),
+
bgcolor(Color::Blue, text("Blue")),
+
bgcolor(Color::BlueLight, text("BlueLight")),
+
bgcolor(Color::Cyan, text("Cyan")),
+
bgcolor(Color::CyanLight, text("CyanLight")),
+
bgcolor(Color::Green, text("Green")),
+
bgcolor(Color::GreenLight, text("GreenLight")),
+
bgcolor(Color::Magenta, text("Magenta")),
+
bgcolor(Color::MagentaLight, text("MagentaLight")),
+
bgcolor(Color::Red, text("Red")),
+
bgcolor(Color::RedLight, text("RedLight")),
+
bgcolor(Color::Yellow, text("Yellow")),
+
bgcolor(Color::YellowLight, text("YellowLight")),
+
bgcolor(0x66ff66_rgb, text("Phosphor")),
+
bgcolor(LinearGradient(Color::SkyBlue1, Color::DeepSkyBlue4),
+
text("Skyblue to DeepSkyBlue")),
+
}),
+
filler(),
+
});
+
+
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
Render(screen, document);
+
screen.Print();
+
+
return 0;
+
}
+ + + +
A class representing the settings for linear-gradient color effect.
+ +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2style_dim_8cpp-example.html b/examples_2dom_2style_dim_8cpp-example.html new file mode 100644 index 000000000..c74bb676d --- /dev/null +++ b/examples_2dom_2style_dim_8cpp-example.html @@ -0,0 +1,238 @@ + + + + + + + + +FTXUI: examples/dom/style_dim.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/style_dim.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <ftxui/dom/elements.hpp> // for text, operator|, dim, Fit, hbox, Element
+
#include <ftxui/screen/screen.hpp> // for Full, Screen
+
#include <memory> // for allocator
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for ftxui
+
+
int main() {
+
using namespace ftxui;
+
auto document = //
+
hbox({
+
text("This text is "),
+
text("dim") | dim,
+
text(". Do you like it?"),
+
});
+
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
Render(screen, document);
+
screen.Print();
+
+
return 0;
+
}
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2style_gallery_8cpp-example.html b/examples_2dom_2style_gallery_8cpp-example.html new file mode 100644 index 000000000..40e48f991 --- /dev/null +++ b/examples_2dom_2style_gallery_8cpp-example.html @@ -0,0 +1,249 @@ + + + + + + + + +FTXUI: examples/dom/style_gallery.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/style_gallery.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <ftxui/dom/elements.hpp> // for text, operator|, Element, bgcolor, color, blink, bold, dim, inverted, underlined, Fit, hbox
+
#include <ftxui/screen/screen.hpp> // for Full, Screen
+
#include <memory> // for allocator
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for Color, Color::Blue, ftxui
+
+
int main() {
+
using namespace ftxui;
+
// clang-format off
+
auto document =
+
hbox({
+
text("normal") , text(" ") ,
+
text("bold") | bold , text(" ") ,
+
text("italic") | italic , text(" ") ,
+
text("dim") | dim , text(" ") ,
+
text("inverted") | inverted , text(" ") ,
+
text("underlined") | underlined , text(" ") ,
+
text("underlinedDouble") | underlinedDouble , text(" ") ,
+
text("blink") | blink , text(" ") ,
+
text("strikethrough") | strikethrough , text(" ") ,
+
text("color") | color(Color::Blue) , text(" ") ,
+
text("bgcolor") | bgcolor(Color::Blue) , text(" ") ,
+
text("hyperlink") | hyperlink("https://github.com/ArthurSonzogni/FTXUI"),
+
});
+
// clang-format on
+
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
Render(screen, document);
+
screen.Print();
+
+
return 0;
+
}
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2style_hyperlink_8cpp-example.html b/examples_2dom_2style_hyperlink_8cpp-example.html new file mode 100644 index 000000000..0aa700846 --- /dev/null +++ b/examples_2dom_2style_hyperlink_8cpp-example.html @@ -0,0 +1,238 @@ + + + + + + + + +FTXUI: examples/dom/style_hyperlink.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/style_hyperlink.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <ftxui/dom/elements.hpp> // for text, operator|, bold, Fit, hbox, Element
+
#include <ftxui/screen/screen.hpp> // for Full, Screen
+
#include <memory> // for allocator
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for ftxui
+
+
int main() {
+
using namespace ftxui;
+
auto document = //
+
hbox({
+
text("This text is an "),
+
text("hyperlink") | hyperlink("https://www.google.com"),
+
text(". Do you like it?"),
+
});
+
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
Render(screen, document);
+
screen.Print();
+
+
return 0;
+
}
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2style_inverted_8cpp-example.html b/examples_2dom_2style_inverted_8cpp-example.html new file mode 100644 index 000000000..ef8429134 --- /dev/null +++ b/examples_2dom_2style_inverted_8cpp-example.html @@ -0,0 +1,237 @@ + + + + + + + + +FTXUI: examples/dom/style_inverted.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/style_inverted.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <ftxui/dom/elements.hpp> // for text, operator|, inverted, Fit, hbox, Element
+
#include <ftxui/screen/screen.hpp> // for Full, Screen
+
#include <memory> // for allocator
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for ftxui
+
+
int main() {
+
using namespace ftxui;
+
auto document = hbox({
+
text("This text is "),
+
text("inverted") | inverted,
+
text(". Do you like it?"),
+
});
+
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
Render(screen, document);
+
screen.Print();
+
+
return 0;
+
}
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2style_italic_8cpp-example.html b/examples_2dom_2style_italic_8cpp-example.html new file mode 100644 index 000000000..bb7706f0c --- /dev/null +++ b/examples_2dom_2style_italic_8cpp-example.html @@ -0,0 +1,237 @@ + + + + + + + + +FTXUI: examples/dom/style_italic.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/style_italic.cpp
+
+
+
// Copyright 2025 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <ftxui/dom/elements.hpp> // for text, operator|, inverted, Fit, hbox, Element
+
#include <ftxui/screen/screen.hpp> // for Full, Screen
+
#include <memory> // for allocator
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for ftxui
+
+
int main() {
+
using namespace ftxui;
+
auto document = hbox({
+
text("This text is "),
+
text("italic") | italic,
+
text(". Do you like it?"),
+
});
+
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
Render(screen, document);
+
screen.Print();
+
+
return 0;
+
}
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2style_strikethrough_8cpp-example.html b/examples_2dom_2style_strikethrough_8cpp-example.html new file mode 100644 index 000000000..99b365a89 --- /dev/null +++ b/examples_2dom_2style_strikethrough_8cpp-example.html @@ -0,0 +1,238 @@ + + + + + + + + +FTXUI: examples/dom/style_strikethrough.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/style_strikethrough.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <ftxui/dom/elements.hpp> // for text, operator|, strikethrough, Fit, hbox, Element
+
#include <ftxui/screen/screen.hpp> // for Full, Screen
+
#include <memory> // for allocator
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for ftxui
+
+
int main() {
+
using namespace ftxui;
+
auto document = //
+
hbox({
+
text("This text is "),
+
text("strikethrough") | strikethrough,
+
text(". Do you like it?"),
+
});
+
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
Render(screen, document);
+
screen.Print();
+
+
return 0;
+
}
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2style_underlined_8cpp-example.html b/examples_2dom_2style_underlined_8cpp-example.html new file mode 100644 index 000000000..42d2f60bc --- /dev/null +++ b/examples_2dom_2style_underlined_8cpp-example.html @@ -0,0 +1,238 @@ + + + + + + + + +FTXUI: examples/dom/style_underlined.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/style_underlined.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <ftxui/dom/elements.hpp> // for text, operator|, underlined, Fit, hbox, Element
+
#include <ftxui/screen/screen.hpp> // for Full, Screen
+
#include <memory> // for allocator
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for ftxui
+
+
int main() {
+
using namespace ftxui;
+
auto document = //
+
hbox({
+
text("This text is "),
+
text("underlined") | underlined,
+
text(". Do you like it?"),
+
});
+
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
Render(screen, document);
+
screen.Print();
+
+
return 0;
+
}
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2style_underlined_double_8cpp-example.html b/examples_2dom_2style_underlined_double_8cpp-example.html new file mode 100644 index 000000000..ff536f261 --- /dev/null +++ b/examples_2dom_2style_underlined_double_8cpp-example.html @@ -0,0 +1,238 @@ + + + + + + + + +FTXUI: examples/dom/style_underlined_double.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/style_underlined_double.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <ftxui/dom/elements.hpp> // for text, operator|, underlinedDouble, Fit, hbox, Element
+
#include <ftxui/screen/screen.hpp> // for Full, Screen
+
#include <memory> // for allocator
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for ftxui
+
+
int main() {
+
using namespace ftxui;
+
auto document = //
+
hbox({
+
text("This text is "),
+
text("underlinedDouble") | underlinedDouble,
+
text(". Do you like it?"),
+
});
+
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
Render(screen, document);
+
screen.Print();
+
+
return 0;
+
}
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2table_8cpp-example.html b/examples_2dom_2table_8cpp-example.html new file mode 100644 index 000000000..7acbaed34 --- /dev/null +++ b/examples_2dom_2table_8cpp-example.html @@ -0,0 +1,283 @@ + + + + + + + + +FTXUI: examples/dom/table.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/table.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <ftxui/dom/elements.hpp> // for color, Fit, LIGHT, align_right, bold, DOUBLE
+
#include <ftxui/dom/table.hpp> // for Table, TableSelection
+
#include <ftxui/screen/screen.hpp> // for Screen
+
#include <iostream> // for endl, cout, ostream
+
#include <string> // for basic_string, allocator, string
+
#include <vector> // for vector
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Cyan, Color::White, ftxui
+
+
int main() {
+
using namespace ftxui;
+
+
auto table = Table({
+
{"Version", "Marketing name", "Release date", "API level", "Runtime"},
+
{"2.3", "Gingerbread", "February 9 2011", "10", "Dalvik 1.4.0"},
+
{"4.0", "Ice Cream Sandwich", "October 19 2011", "15", "Dalvik"},
+
{"4.1", "Jelly Bean", "July 9 2012", "16", "Dalvik"},
+
{"4.2", "Jelly Bean", "November 13 2012", "17", "Dalvik"},
+
{"4.3", "Jelly Bean", "July 24 2013", "18", "Dalvik"},
+
{"4.4", "KitKat", "October 31 2013", "19", "Dalvik and ART"},
+
{"5.0", "Lollipop", "November 3 2014", "21", "ART"},
+
{"5.1", "Lollipop", "March 9 2015", "22", "ART"},
+
{"6.0", "Marshmallow", "October 5 2015", "23", "ART"},
+
{"7.0", "Nougat", "August 22 2016", "24", "ART"},
+
{"7.1", "Nougat", "October 4 2016", "25", "ART"},
+
{"8.0", "Oreo", "August 21 2017", "26", "ART"},
+
{"8.1", "Oreo", "December 5 2017", "27", "ART"},
+
{"9", "Pie", "August 6 2018", "28", "ART"},
+
{"10", "10", "September 3 2019", "29", "ART"},
+
{"11", "11", "September 8 2020", "30", "ART"},
+
});
+
+
table.SelectAll().Border(LIGHT);
+
+
// Add border around the first column.
+
table.SelectColumn(0).Border(LIGHT);
+
+
// Make first row bold with a double border.
+
table.SelectRow(0).Decorate(bold);
+
table.SelectRow(0).SeparatorVertical(LIGHT);
+
table.SelectRow(0).Border(DOUBLE);
+
+
// Align right the "Release date" column.
+
table.SelectColumn(2).DecorateCells(align_right);
+
+
// Select row from the second to the last.
+
auto content = table.SelectRows(1, -1);
+
// Alternate in between 3 colors.
+
content.DecorateCellsAlternateRow(color(Color::Blue), 3, 0);
+
content.DecorateCellsAlternateRow(color(Color::Cyan), 3, 1);
+
content.DecorateCellsAlternateRow(color(Color::White), 3, 2);
+
+
auto document = table.Render();
+
auto screen =
+
Screen::Create(Dimension::Fit(document, /*extend_beyond_screen=*/true));
+
Render(screen, document);
+
screen.Print();
+
std::cout << std::endl;
+
+
return 0;
+
}
+
void Border(BorderStyle border=LIGHT)
Apply a border around the selection.
+ + + +
TableSelection SelectAll()
Select all the table.
+
Table is a utility to draw tables.
Definition table.hpp:36
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + + +
+
+ + + + + diff --git a/examples_2dom_2table_8cpp.html b/examples_2dom_2table_8cpp.html new file mode 100644 index 000000000..adebe3df4 --- /dev/null +++ b/examples_2dom_2table_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: table.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
table.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 14 of file examples/dom/table.cpp.

+ +
+
+
+
+ + + + + diff --git a/examples_2dom_2table_8cpp.js b/examples_2dom_2table_8cpp.js new file mode 100644 index 000000000..eb38b8c1f --- /dev/null +++ b/examples_2dom_2table_8cpp.js @@ -0,0 +1,4 @@ +var examples_2dom_2table_8cpp = +[ + [ "main", "examples_2dom_2table_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/examples_2dom_2table_8cpp_source.html b/examples_2dom_2table_8cpp_source.html new file mode 100644 index 000000000..1040326f4 --- /dev/null +++ b/examples_2dom_2table_8cpp_source.html @@ -0,0 +1,286 @@ + + + + + + + + +FTXUI: table.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/table.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <ftxui/dom/elements.hpp> // for color, Fit, LIGHT, align_right, bold, DOUBLE
+
5#include <ftxui/dom/table.hpp> // for Table, TableSelection
+
6#include <ftxui/screen/screen.hpp> // for Screen
+
7#include <iostream> // for endl, cout, ostream
+
8#include <string> // for basic_string, allocator, string
+
9#include <vector> // for vector
+
10
+
11#include "ftxui/dom/node.hpp" // for Render
+
12#include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Cyan, Color::White, ftxui
+
13
+
+
14int main() {
+
15 using namespace ftxui;
+
16
+
17 auto table = Table({
+
18 {"Version", "Marketing name", "Release date", "API level", "Runtime"},
+
19 {"2.3", "Gingerbread", "February 9 2011", "10", "Dalvik 1.4.0"},
+
20 {"4.0", "Ice Cream Sandwich", "October 19 2011", "15", "Dalvik"},
+
21 {"4.1", "Jelly Bean", "July 9 2012", "16", "Dalvik"},
+
22 {"4.2", "Jelly Bean", "November 13 2012", "17", "Dalvik"},
+
23 {"4.3", "Jelly Bean", "July 24 2013", "18", "Dalvik"},
+
24 {"4.4", "KitKat", "October 31 2013", "19", "Dalvik and ART"},
+
25 {"5.0", "Lollipop", "November 3 2014", "21", "ART"},
+
26 {"5.1", "Lollipop", "March 9 2015", "22", "ART"},
+
27 {"6.0", "Marshmallow", "October 5 2015", "23", "ART"},
+
28 {"7.0", "Nougat", "August 22 2016", "24", "ART"},
+
29 {"7.1", "Nougat", "October 4 2016", "25", "ART"},
+
30 {"8.0", "Oreo", "August 21 2017", "26", "ART"},
+
31 {"8.1", "Oreo", "December 5 2017", "27", "ART"},
+
32 {"9", "Pie", "August 6 2018", "28", "ART"},
+
33 {"10", "10", "September 3 2019", "29", "ART"},
+
34 {"11", "11", "September 8 2020", "30", "ART"},
+
35 });
+
36
+
37 table.SelectAll().Border(LIGHT);
+
38
+
39 // Add border around the first column.
+
40 table.SelectColumn(0).Border(LIGHT);
+
41
+
42 // Make first row bold with a double border.
+
43 table.SelectRow(0).Decorate(bold);
+
44 table.SelectRow(0).SeparatorVertical(LIGHT);
+
45 table.SelectRow(0).Border(DOUBLE);
+
46
+
47 // Align right the "Release date" column.
+
48 table.SelectColumn(2).DecorateCells(align_right);
+
49
+
50 // Select row from the second to the last.
+
51 auto content = table.SelectRows(1, -1);
+
52 // Alternate in between 3 colors.
+
53 content.DecorateCellsAlternateRow(color(Color::Blue), 3, 0);
+
54 content.DecorateCellsAlternateRow(color(Color::Cyan), 3, 1);
+
55 content.DecorateCellsAlternateRow(color(Color::White), 3, 2);
+
56
+
57 auto document = table.Render();
+
58 auto screen =
+
59 Screen::Create(Dimension::Fit(document, /*extend_beyond_screen=*/true));
+
60 Render(screen, document);
+
61 screen.Print();
+
62 std::cout << std::endl;
+
63
+
64 return 0;
+
65}
+
+
void Border(BorderStyle border=LIGHT)
Apply a border around the selection.
+ + + +
TableSelection SelectAll()
Select all the table.
+
Table is a utility to draw tables.
Definition table.hpp:36
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + + +
+
+ + + + + diff --git a/examples_2dom_2vbox_hbox_8cpp-example.html b/examples_2dom_2vbox_hbox_8cpp-example.html new file mode 100644 index 000000000..f04983a2b --- /dev/null +++ b/examples_2dom_2vbox_hbox_8cpp-example.html @@ -0,0 +1,254 @@ + + + + + + + + +FTXUI: examples/dom/vbox_hbox.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/vbox_hbox.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <stdio.h> // for getchar
+
#include <ftxui/dom/elements.hpp> // for filler, text, hbox, vbox
+
#include <ftxui/screen/screen.hpp> // for Full, Screen
+
#include <memory> // for allocator
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for ftxui
+
+
int main() {
+
using namespace ftxui;
+
auto document = //
+
vbox({
+
hbox({
+
text("north-west"),
+
filler(),
+
text("north-east"),
+
}),
+
filler(),
+
hbox({
+
filler(),
+
text("center"),
+
filler(),
+
}),
+
filler(),
+
hbox({
+
text("south-west"),
+
filler(),
+
text("south-east"),
+
}),
+
});
+
auto screen = Screen::Create(Dimension::Full());
+
Render(screen, document);
+
screen.Print();
+
getchar();
+
+
return 0;
+
}
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/examples_2dom_2vflow_8cpp-example.html b/examples_2dom_2vflow_8cpp-example.html new file mode 100644 index 000000000..c7e6b6432 --- /dev/null +++ b/examples_2dom_2vflow_8cpp-example.html @@ -0,0 +1,264 @@ + + + + + + + + +FTXUI: examples/dom/vflow.cpp + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
examples/dom/vflow.cpp
+
+
+
// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
// Use of this source code is governed by the MIT license that can be found in
+
// the LICENSE file.
+
#include <stdio.h> // for getchar
+
#include <ftxui/dom/elements.hpp> // for operator|, Element, size, text, hcenter, Fit, vflow, window, EQUAL, bold, border, dim, HEIGHT, WIDTH
+
#include <ftxui/screen/screen.hpp> // for Full, Screen
+
#include <string> // for allocator, char_traits, operator+, to_string, string
+
+
#include "ftxui/dom/node.hpp" // for Render
+
#include "ftxui/screen/color.hpp" // for ftxui
+
+
int main() {
+
using namespace ftxui;
+
auto make_box = [](int dimx, int dimy) {
+
std::string title = std::to_string(dimx) + "x" + std::to_string(dimy);
+
return window(text(title) | hcenter | bold,
+
text("content") | hcenter | dim) |
+
size(WIDTH, EQUAL, dimx) | size(HEIGHT, EQUAL, dimy);
+
};
+
+
auto document = vflow({
+
make_box(7, 7),
+
make_box(7, 5),
+
make_box(5, 7),
+
make_box(10, 4),
+
make_box(10, 4),
+
make_box(10, 4),
+
make_box(10, 4),
+
make_box(11, 4),
+
make_box(11, 4),
+
make_box(11, 4),
+
make_box(11, 4),
+
make_box(12, 4),
+
make_box(12, 5),
+
make_box(12, 4),
+
make_box(13, 4),
+
make_box(13, 3),
+
make_box(13, 3),
+
make_box(10, 3),
+
}) |
+
border;
+
+
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
Render(screen, document);
+
screen.Print();
+
getchar();
+
+
return 0;
+
}
+ + + +
Element make_box(int x, int y)
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/files.html b/files.html new file mode 100644 index 000000000..b67ca873f --- /dev/null +++ b/files.html @@ -0,0 +1,473 @@ + + + + + + + + +FTXUI: File List + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
File List
+
+
+
Here is a list of all files with brief descriptions:
+
[detail level 1234]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 doc
 doc
  examples
  component
 button.cpp
 button_animated.cpp
 button_in_frame.cpp
 button_style.cpp
 canvas_animated.cpp
 checkbox.cpp
 checkbox_in_frame.cpp
 collapsible.cpp
 composition.cpp
 custom_loop.cpp
 dropdown.cpp
 dropdown_custom.cpp
 flexbox_gallery.cpp
 focus.cpp
 focus_cursor.cpp
 gallery.cpp
 homescreen.cpp
 input.cpp
 input_in_frame.cpp
 input_style.cpp
 linear_gradient_gallery.cpp
 maybe.cpp
 menu.cpp
 menu2.cpp
 menu_entries.cpp
 menu_entries_animated.cpp
 menu_in_frame.cpp
 menu_in_frame_horizontal.cpp
 menu_multiple.cpp
 menu_style.cpp
 menu_underline_animated_gallery.cpp
 modal_dialog.cpp
 modal_dialog_custom.cpp
 nested_screen.cpp
 print_key_press.cpp
 radiobox.cpp
 radiobox_in_frame.cpp
 renderer.cpp
 resizable_split.cpp
 scrollbar.cpp
 selection.cpp
 slider.cpp
 slider_direction.cpp
 slider_rgb.cpp
 tab_horizontal.cpp
 tab_vertical.cpp
 textarea.cpp
 toggle.cpp
 window.cpp
 with_restored_io.cpp
  dom
 border.cpp
 border_colored.cpp
 border_style.cpp
 canvas.cpp
 color_gallery.cpp
 color_info_palette256.cpp
 color_info_sorted_2d.ipp
 color_truecolor_HSV.cpp
 color_truecolor_RGB.cpp
 dbox.cpp
 gauge.cpp
 gauge_direction.cpp
 graph.cpp
 gridbox.cpp
 hflow.cpp
 html_like.cpp
 linear_gradient.cpp
 package_manager.cpp
 paragraph.cpp
 separator.cpp
 separator_style.cpp
 size.cpp
 spinner.cpp
 style_blink.cpp
 style_bold.cpp
 style_color.cpp
 style_dim.cpp
 style_gallery.cpp
 style_hyperlink.cpp
 style_inverted.cpp
 style_italic.cpp
 style_strikethrough.cpp
 style_underlined.cpp
 style_underlined_double.cpp
 table.cpp
 vbox_hbox.cpp
 vflow.cpp
  include
  ftxui
  component
  dom
  screen
  util
  src
  ftxui
  component
  dom
  screen
  util
 component.cppm
 dom.cppm
 ftxui.cppm
 screen.cppm
 util.cppm
+
+
+
+ + + + + diff --git a/files_dup.js b/files_dup.js new file mode 100644 index 000000000..48f034d94 --- /dev/null +++ b/files_dup.js @@ -0,0 +1,8 @@ +var files_dup = +[ + [ "doc", "dir_6c89d1ed406002b4e6ebce07fb51a507.html", null ], + [ "doc", "dir_e68e8157741866f444e17edd764ebbae.html", null ], + [ "examples", "dir_d28a4824dc47e487b107a5db32ef43c4.html", "dir_d28a4824dc47e487b107a5db32ef43c4" ], + [ "include", "dir_d44c64559bbebec7f509842c48db8b23.html", "dir_d44c64559bbebec7f509842c48db8b23" ], + [ "src", "dir_68267d1309a1af8e8297ef4c3efbcdba.html", "dir_68267d1309a1af8e8297ef4c3efbcdba" ] +]; \ No newline at end of file diff --git a/flex_8cpp.html b/flex_8cpp.html new file mode 100644 index 000000000..e4232cd66 --- /dev/null +++ b/flex_8cpp.html @@ -0,0 +1,274 @@ + + + + + + + + +FTXUI: flex.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
flex.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

Element filler ()
 An element that will take expand proportionally to the space left in a container.
 
Element flex (Element child)
 Make a child element to expand proportionally to the space left in a container.
 
Element xflex (Element child)
 Expand/Minimize if possible/needed on the X axis.
 
Element yflex (Element child)
 Expand/Minimize if possible/needed on the Y axis.
 
Element flex_grow (Element child)
 Expand if possible.
 
Element xflex_grow (Element child)
 Expand if possible on the X axis.
 
Element yflex_grow (Element child)
 Expand if possible on the Y axis.
 
Element flex_shrink (Element child)
 Minimize if needed.
 
Element xflex_shrink (Element child)
 Minimize if needed on the X axis.
 
Element yflex_shrink (Element child)
 Minimize if needed on the Y axis.
 
Element notflex (Element child)
 Make the element not flexible.
 
+

Variable Documentation

+ +

◆ f_

+ +
+
+ + + + +
FlexFunction f_
+
+ +

Definition at line 90 of file flex.cpp.

+ +
+
+
+
+ + + + + diff --git a/flex_8cpp.js b/flex_8cpp.js new file mode 100644 index 000000000..221292742 --- /dev/null +++ b/flex_8cpp.js @@ -0,0 +1,15 @@ +var flex_8cpp = +[ + [ "filler", "flex_8cpp.html#gac2a9ed2d22ec3c8811b61f4a901ed367", null ], + [ "flex", "flex_8cpp.html#ga257acd2bd47bab7db879cca2c0e67e23", null ], + [ "xflex", "flex_8cpp.html#ga0dbba98e14f63f1dd5163cbdc4f42da8", null ], + [ "yflex", "flex_8cpp.html#ga42c7a33df6d890de30fc1ebb2d1b3ca6", null ], + [ "flex_grow", "flex_8cpp.html#ga81ed6b31f512e849247f13d249f6f20e", null ], + [ "xflex_grow", "flex_8cpp.html#ga1618cb15307f29eb3d531e7b44c280d3", null ], + [ "yflex_grow", "flex_8cpp.html#ga7eac3f709e905af8f583aed52093b7ce", null ], + [ "flex_shrink", "flex_8cpp.html#ga4629196b5ffc280054d35f2a9977e829", null ], + [ "xflex_shrink", "flex_8cpp.html#ga95275a9271934cf76e970c6650cc224d", null ], + [ "yflex_shrink", "flex_8cpp.html#gaf7d0757f5965aa579bccc125ff909256", null ], + [ "notflex", "flex_8cpp.html#ga845b0ea50d51024aa4e050447b46e1dd", null ], + [ "f_", "flex_8cpp.html#a51920d6139d68e1a860381e730c217c3", null ] +]; \ No newline at end of file diff --git a/flex_8cpp_source.html b/flex_8cpp_source.html new file mode 100644 index 000000000..b2837d473 --- /dev/null +++ b/flex_8cpp_source.html @@ -0,0 +1,431 @@ + + + + + + + + +FTXUI: flex.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flex.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <memory> // for make_shared, __shared_ptr_access
+
5#include <utility> // for move
+
6
+
7#include "ftxui/dom/elements.hpp" // for Element, unpack, filler, flex, flex_grow, flex_shrink, notflex, xflex, xflex_grow, xflex_shrink, yflex, yflex_grow, yflex_shrink
+
8#include "ftxui/dom/node.hpp" // for Elements, Node
+
9#include "ftxui/dom/requirement.hpp" // for Requirement
+
10#include "ftxui/screen/box.hpp" // for Box
+
11
+
12namespace ftxui {
+
13
+
14namespace {
+
15
+
16using FlexFunction = void (*)(Requirement&);
+
17
+
18void function_flex_grow(Requirement& r) {
+
19 r.flex_grow_x = 1;
+
20 r.flex_grow_y = 1;
+
21}
+
22
+
23void function_xflex_grow(Requirement& r) {
+
24 r.flex_grow_x = 1;
+
25}
+
26
+
27void function_yflex_grow(Requirement& r) {
+
28 r.flex_grow_y = 1;
+
29}
+
30
+
31void function_flex_shrink(Requirement& r) {
+
32 r.flex_shrink_x = 1;
+
33 r.flex_shrink_y = 1;
+
34}
+
35
+
36void function_xflex_shrink(Requirement& r) {
+
37 r.flex_shrink_x = 1;
+
38}
+
39
+
40void function_yflex_shrink(Requirement& r) {
+
41 r.flex_shrink_y = 1;
+
42}
+
43
+
44void function_flex(Requirement& r) {
+
45 r.flex_grow_x = 1;
+
46 r.flex_grow_y = 1;
+
47 r.flex_shrink_x = 1;
+
48 r.flex_shrink_y = 1;
+
49}
+
50
+
51void function_xflex(Requirement& r) {
+
52 r.flex_grow_x = 1;
+
53 r.flex_shrink_x = 1;
+
54}
+
55
+
56void function_yflex(Requirement& r) {
+
57 r.flex_grow_y = 1;
+
58 r.flex_shrink_y = 1;
+
59}
+
60
+
61void function_not_flex(Requirement& r) {
+
62 r.flex_grow_x = 0;
+
63 r.flex_grow_y = 0;
+
64 r.flex_shrink_x = 0;
+
65 r.flex_shrink_y = 0;
+
66}
+
67
+
68class Flex : public Node {
+
69 public:
+
70 explicit Flex(FlexFunction f) : f_(f) {}
+
71 Flex(FlexFunction f, Element child) : Node(unpack(std::move(child))), f_(f) {}
+
72 void ComputeRequirement() override {
+
73 requirement_.min_x = 0;
+
74 requirement_.min_y = 0;
+
75 if (!children_.empty()) {
+
76 children_[0]->ComputeRequirement();
+
77 requirement_ = children_[0]->requirement();
+
78 }
+
79 f_(requirement_);
+
80 }
+
81
+
82 void SetBox(Box box) override {
+
83 Node::SetBox(box);
+
84 if (children_.empty()) {
+
85 return;
+
86 }
+
87 children_[0]->SetBox(box);
+
88 }
+
89
+
90 FlexFunction f_;
+
91};
+
92
+
93} // namespace
+
94
+
95/// @brief An element that will take expand proportionally to the space left in
+
96/// a container.
+
97/// @ingroup dom
+
+ +
99 return std::make_shared<Flex>(function_flex);
+
100}
+
+
101
+
102/// @brief Make a child element to expand proportionally to the space left in a
+
103/// container.
+
104/// @ingroup dom
+
105///
+
106/// #### Examples:
+
107///
+
108/// ~~~cpp
+
109/// hbox({
+
110/// text("left") | border ,
+
111/// text("middle") | border | flex,
+
112/// text("right") | border,
+
113/// });
+
114/// ~~~
+
115///
+
116/// #### Output:
+
117///
+
118/// ~~~bash
+
119/// ┌────┐┌─────────────────────────────────────────────────────────┐┌─────┐
+
120/// │left││middle ││right│
+
121/// └────┘└─────────────────────────────────────────────────────────┘└─────┘
+
122/// ~~~
+
+ +
124 return std::make_shared<Flex>(function_flex, std::move(child));
+
125}
+
+
126
+
127/// @brief Expand/Minimize if possible/needed on the X axis.
+
128/// @ingroup dom
+
+ +
130 return std::make_shared<Flex>(function_xflex, std::move(child));
+
131}
+
+
132
+
133/// @brief Expand/Minimize if possible/needed on the Y axis.
+
134/// @ingroup dom
+
+ +
136 return std::make_shared<Flex>(function_yflex, std::move(child));
+
137}
+
+
138
+
139/// @brief Expand if possible.
+
140/// @ingroup dom
+
+ +
142 return std::make_shared<Flex>(function_flex_grow, std::move(child));
+
143}
+
+
144
+
145/// @brief Expand if possible on the X axis.
+
146/// @ingroup dom
+
+ +
148 return std::make_shared<Flex>(function_xflex_grow, std::move(child));
+
149}
+
+
150
+
151/// @brief Expand if possible on the Y axis.
+
152/// @ingroup dom
+
+ +
154 return std::make_shared<Flex>(function_yflex_grow, std::move(child));
+
155}
+
+
156
+
157/// @brief Minimize if needed.
+
158/// @ingroup dom
+
+ +
160 return std::make_shared<Flex>(function_flex_shrink, std::move(child));
+
161}
+
+
162
+
163/// @brief Minimize if needed on the X axis.
+
164/// @ingroup dom
+
+ +
166 return std::make_shared<Flex>(function_xflex_shrink, std::move(child));
+
167}
+
+
168
+
169/// @brief Minimize if needed on the Y axis.
+
170/// @ingroup dom
+
+ +
172 return std::make_shared<Flex>(function_yflex_shrink, std::move(child));
+
173}
+
+
174
+
175/// @brief Make the element not flexible.
+
176/// @ingroup dom
+
+ +
178 return std::make_shared<Flex>(function_not_flex, std::move(child));
+
179}
+
+
180
+
181} // namespace ftxui
+ + +
FlexFunction f_
Definition flex.cpp:90
+
virtual void SetBox(Box box)
Assign a position and a dimension to an element for drawing.
Definition node.cpp:41
+
Element xflex(Element)
Expand/Minimize if possible/needed on the X axis.
Definition flex.cpp:129
+
Element xflex_grow(Element)
Expand if possible on the X axis.
Definition flex.cpp:147
+
Element flex(Element)
Make a child element to expand proportionally to the space left in a container.
Definition flex.cpp:123
+
Element yflex(Element)
Expand/Minimize if possible/needed on the Y axis.
Definition flex.cpp:135
+
Element flex_shrink(Element)
Minimize if needed.
Definition flex.cpp:159
+
Element yflex_grow(Element)
Expand if possible on the Y axis.
Definition flex.cpp:153
+
Element flex_grow(Element)
Expand if possible.
Definition flex.cpp:141
+
Element notflex(Element)
Make the element not flexible.
Definition flex.cpp:177
+
Element xflex_shrink(Element)
Minimize if needed on the X axis.
Definition flex.cpp:165
+
Element filler()
An element that will take expand proportionally to the space left in a container.
Definition flex.cpp:98
+
Element yflex_shrink(Element)
Minimize if needed on the Y axis.
Definition flex.cpp:171
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+ + +
+
+ + + + + diff --git a/flexbox_8cpp.html b/flexbox_8cpp.html new file mode 100644 index 000000000..9e8a5edae --- /dev/null +++ b/flexbox_8cpp.html @@ -0,0 +1,314 @@ + + + + + + + + +FTXUI: flexbox.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
flexbox.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+ + + + + + + + + + +

+Functions

Element flexbox (Elements children, FlexboxConfig config)
 A container displaying elements on row/columns and capable of wrapping on the next column/row when full.
 
Element hflow (Elements children)
 A container displaying elements in rows from left to right. When filled, it starts on a new row below.
 
Element vflow (Elements children)
 A container displaying elements in rows from top to bottom. When filled, it starts on a new columns on the right. filled, it starts on a new row. is full, it starts a new row.
 
+

Variable Documentation

+ +

◆ asked_

+ +
+
+ + + + +
int asked_ = 6000
+
+ +

Definition at line 222 of file flexbox.cpp.

+ +
+
+ +

◆ need_iteration_

+ +
+
+ + + + +
bool need_iteration_ = true
+
+ +

Definition at line 223 of file flexbox.cpp.

+ +
+
+ +

◆ config_

+ +
+
+ + + + +
const FlexboxConfig config_
+
+ +

Definition at line 224 of file flexbox.cpp.

+ +
+
+ +

◆ config_normalized_

+ +
+
+ + + + +
const FlexboxConfig config_normalized_
+
+ +

Definition at line 225 of file flexbox.cpp.

+ +
+
+ +

◆ global_

+ +
+
+ + + + +
flexbox_helper::Global global_
+
+ +

Definition at line 226 of file flexbox.cpp.

+ +
+
+
+
+ + + + + diff --git a/flexbox_8cpp.js b/flexbox_8cpp.js new file mode 100644 index 000000000..0bae4fd5a --- /dev/null +++ b/flexbox_8cpp.js @@ -0,0 +1,11 @@ +var flexbox_8cpp = +[ + [ "flexbox", "flexbox_8cpp.html#a168a235aa438b6c72df5861322154be3", null ], + [ "hflow", "flexbox_8cpp.html#a345b31919048562675615d5af78e6322", null ], + [ "vflow", "flexbox_8cpp.html#ae0da51b614e95a0687727644b5898a23", null ], + [ "asked_", "flexbox_8cpp.html#a020ee158f0c398a7ffd442a82bb878d0", null ], + [ "need_iteration_", "flexbox_8cpp.html#a82e273363997977449a51ea1b7dce6f0", null ], + [ "config_", "flexbox_8cpp.html#a85d583fe20f57cb4f383cba6eae3d073", null ], + [ "config_normalized_", "flexbox_8cpp.html#a8a92e22645479418ed4d290ebf4b51c3", null ], + [ "global_", "flexbox_8cpp.html#ac8e8d5f863ecfaf27c5cf94ab6c9c9ca", null ] +]; \ No newline at end of file diff --git a/flexbox_8cpp_source.html b/flexbox_8cpp_source.html new file mode 100644 index 000000000..565f64ca6 --- /dev/null +++ b/flexbox_8cpp_source.html @@ -0,0 +1,542 @@ + + + + + + + + +FTXUI: flexbox.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flexbox.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <algorithm> // for min, max
+
5#include <cstddef> // for size_t
+
6#include <memory> // for __shared_ptr_access, shared_ptr, allocator_traits<>::value_type, make_shared
+
7#include <tuple> // for ignore
+
8#include <utility> // for move, swap
+
9#include <vector> // for vector
+
10
+
11#include "ftxui/dom/elements.hpp" // for Element, Elements, flexbox, hflow, vflow
+
12#include "ftxui/dom/flexbox_config.hpp" // for FlexboxConfig, FlexboxConfig::Direction, FlexboxConfig::Direction::Column, FlexboxConfig::AlignContent, FlexboxConfig::Direction::ColumnInversed, FlexboxConfig::Direction::Row, FlexboxConfig::JustifyContent, FlexboxConfig::Wrap, FlexboxConfig::AlignContent::FlexStart, FlexboxConfig::Direction::RowInversed, FlexboxConfig::JustifyContent::FlexStart, FlexboxConfig::Wrap::Wrap
+
13#include "ftxui/dom/flexbox_helper.hpp" // for Block, Global, Compute
+
14#include "ftxui/dom/node.hpp" // for Node, Elements, Node::Status
+
15#include "ftxui/dom/requirement.hpp" // for Requirement
+
16#include "ftxui/dom/selection.hpp" // for Selection
+
17#include "ftxui/screen/box.hpp" // for Box
+
18
+
19namespace ftxui {
+
20
+
21namespace {
+
22void Normalize(FlexboxConfig::Direction& direction) {
+
23 switch (direction) {
+ + + +
27 } break;
+ + + +
31 } break;
+
32 }
+
33}
+
34
+
35void Normalize(FlexboxConfig::AlignContent& align_content) {
+ +
37}
+
38
+
39void Normalize(FlexboxConfig::JustifyContent& justify_content) {
+ +
41}
+
42
+
43void Normalize(FlexboxConfig::Wrap& wrap) {
+ +
45}
+
46
+
47FlexboxConfig Normalize(FlexboxConfig config) {
+
48 Normalize(config.direction);
+
49 Normalize(config.wrap);
+
50 Normalize(config.justify_content);
+
51 Normalize(config.align_content);
+
52 return config;
+
53}
+
54
+
55class Flexbox : public Node {
+
56 public:
+
57 Flexbox(Elements children, FlexboxConfig config)
+
58 : Node(std::move(children)),
+
59 config_(config),
+
60 config_normalized_(Normalize(config)) {
+
61 requirement_.flex_grow_x = 1;
+
62 requirement_.flex_grow_y = 0;
+
63
+
64 if (IsColumnOriented()) {
+
65 std::swap(requirement_.flex_grow_x, requirement_.flex_grow_y);
+
66 }
+
67 }
+
68
+
69 bool IsColumnOriented() const {
+
70 return config_.direction == FlexboxConfig::Direction::Column ||
+ +
72 }
+
73
+
74 void Layout(flexbox_helper::Global& global,
+
75 bool compute_requirement = false) {
+
76 global.blocks.reserve(children_.size());
+
77 for (auto& child : children_) {
+
78 flexbox_helper::Block block;
+
79 block.min_size_x = child->requirement().min_x;
+
80 block.min_size_y = child->requirement().min_y;
+
81 if (!compute_requirement) {
+
82 block.flex_grow_x = child->requirement().flex_grow_x;
+
83 block.flex_grow_y = child->requirement().flex_grow_y;
+
84 block.flex_shrink_x = child->requirement().flex_shrink_x;
+
85 block.flex_shrink_y = child->requirement().flex_shrink_y;
+
86 }
+
87 global.blocks.push_back(block);
+
88 }
+
89
+ +
91 }
+
92
+
93 void ComputeRequirement() override {
+
94 requirement_ = Requirement{};
+
95 for (auto& child : children_) {
+
96 child->ComputeRequirement();
+
97 }
+
98 global_ = flexbox_helper::Global();
+ +
100 if (IsColumnOriented()) {
+
101 global_.size_x = 100000; // NOLINT
+
102 global_.size_y = asked_;
+
103 } else {
+
104 global_.size_x = asked_;
+
105 global_.size_y = 100000; // NOLINT
+
106 }
+
107 Layout(global_, true);
+
108
+
109 if (global_.blocks.empty()) {
+
110 return;
+
111 }
+
112
+
113 // Compute the union of all the blocks:
+
114 Box box;
+
115 box.x_min = global_.blocks[0].x;
+
116 box.y_min = global_.blocks[0].y;
+
117 box.x_max = global_.blocks[0].x + global_.blocks[0].dim_x;
+
118 box.y_max = global_.blocks[0].y + global_.blocks[0].dim_y;
+
119 for (auto& b : global_.blocks) {
+
120 box.x_min = std::min(box.x_min, b.x);
+
121 box.y_min = std::min(box.y_min, b.y);
+
122 box.x_max = std::max(box.x_max, b.x + b.dim_x);
+
123 box.y_max = std::max(box.y_max, b.y + b.dim_y);
+
124 }
+
125 requirement_.min_x = box.x_max - box.x_min;
+
126 requirement_.min_y = box.y_max - box.y_min;
+
127
+
128 // Find the selection:
+
129 for (size_t i = 0; i < children_.size(); ++i) {
+
130 if (requirement_.focused.Prefer(children_[i]->requirement().focused)) {
+
131 requirement_.focused = children_[i]->requirement().focused;
+
132 // Shift |focused.box| according to its position inside this component:
+
133 auto& b = global_.blocks[i];
+
134 requirement_.focused.box.Shift(b.x, b.y);
+
135 requirement_.focused.box =
+
136 Box::Intersection(requirement_.focused.box, box);
+
137 }
+
138 }
+
139 }
+
140
+
141 void SetBox(Box box) override {
+
142 Node::SetBox(box);
+
143
+
144 const int asked_previous = asked_;
+
145 asked_ = std::min(asked_, IsColumnOriented() ? box.y_max - box.y_min + 1
+
146 : box.x_max - box.x_min + 1);
+
147 need_iteration_ = (asked_ != asked_previous);
+
148
+
149 flexbox_helper::Global global;
+
150 global.config = config_;
+
151 global.size_x = box.x_max - box.x_min + 1;
+
152 global.size_y = box.y_max - box.y_min + 1;
+
153 Layout(global);
+
154
+
155 for (size_t i = 0; i < children_.size(); ++i) {
+
156 auto& child = children_[i];
+
157 auto& b = global.blocks[i];
+
158
+
159 Box children_box;
+
160 children_box.x_min = box.x_min + b.x;
+
161 children_box.y_min = box.y_min + b.y;
+
162 children_box.x_max = box.x_min + b.x + b.dim_x - 1;
+
163 children_box.y_max = box.y_min + b.y + b.dim_y - 1;
+
164
+
165 const Box intersection = Box::Intersection(children_box, box);
+
166 child->SetBox(intersection);
+
167
+
168 need_iteration_ |= (intersection != children_box);
+
169 }
+
170 }
+
171
+
172 void Select(Selection& selection) override {
+
173 // If this Node box_ doesn't intersect with the selection, then no
+
174 // selection.
+
175 if (Box::Intersection(selection.GetBox(), box_).IsEmpty()) {
+
176 return;
+
177 }
+
178
+
179 Selection selection_lines = IsColumnOriented()
+
180 ? selection.SaturateVertical(box_)
+
181 : selection.SaturateHorizontal(box_);
+
182
+
183 size_t i = 0;
+
184 for (auto& line : global_.lines) {
+
185 Box box;
+
186 box.x_min = box_.x_min + line.x;
+
187 box.x_max = box_.x_min + line.x + line.dim_x - 1;
+
188 box.y_min = box_.y_min + line.y;
+
189 box.y_max = box_.y_min + line.y + line.dim_y - 1;
+
190
+
191 // If the line box doesn't intersect with the selection, then no
+
192 // selection.
+
193 if (Box::Intersection(selection.GetBox(), box).IsEmpty()) {
+
194 continue;
+
195 }
+
196
+
197 Selection selection_line = IsColumnOriented()
+
198 ? selection_lines.SaturateHorizontal(box)
+
199 : selection_lines.SaturateVertical(box);
+
200
+
201 for (auto& block : line.blocks) {
+
202 std::ignore = block;
+
203 children_[i]->Select(selection_line);
+
204 i++;
+
205 }
+
206 }
+
207 }
+
208
+
209 void Check(Status* status) override {
+
210 for (auto& child : children_) {
+
211 child->Check(status);
+
212 }
+
213
+
214 if (status->iteration == 0) {
+
215 asked_ = 6000; // NOLINT
+
216 need_iteration_ = true;
+
217 }
+
218
+
219 status->need_iteration |= need_iteration_;
+
220 }
+
221
+
222 int asked_ = 6000; // NOLINT
+
223 bool need_iteration_ = true;
+
224 const FlexboxConfig config_;
+
225 const FlexboxConfig config_normalized_;
+
226 flexbox_helper::Global global_;
+
227};
+
228
+
229} // namespace
+
230
+
231/// @brief A container displaying elements on row/columns and capable of
+
232/// wrapping on the next column/row when full.
+
233/// @param children The elements in the container
+
234/// @param config The option
+
235/// @return The container.
+
236///
+
237/// #### Example
+
238///
+
239/// ```cpp
+
240/// flexbox({
+
241/// text("element 1"),
+
242/// text("element 2"),
+
243/// text("element 3"),
+
244/// }, FlexboxConfig()
+
245/// .Set(FlexboxConfig::Direction::Column)
+
246/// .Set(FlexboxConfig::Wrap::WrapInversed)
+
247/// .SetGapMainAxis(1)
+
248/// .SetGapCrossAxis(1)
+
249/// )
+
250/// ```
+
+ +
252 return std::make_shared<Flexbox>(std::move(children), config);
+
253}
+
+
254
+
255/// @brief A container displaying elements in rows from left to right. When
+
256/// filled, it starts on a new row below.
+
257/// @param children The elements in the container
+
258/// @return The container.
+
259///
+
260/// #### Example
+
261///
+
262/// ```cpp
+
263/// hflow({
+
264/// text("element 1"),
+
265/// text("element 2"),
+
266/// text("element 3"),
+
267/// });
+
268/// ```
+
+ +
270 return flexbox(std::move(children), FlexboxConfig());
+
271}
+
+
272
+
273/// @brief A container displaying elements in rows from top to bottom. When
+
274/// filled, it starts on a new columns on the right.
+
275/// filled, it starts on a new row.
+
276/// is full, it starts a new row.
+
277/// @param children The elements in the container
+
278/// @return The container.
+
279///
+
280/// #### Example
+
281///
+
282/// ```cpp
+
283/// vflow({
+
284/// text("element 1"),
+
285/// text("element 2"),
+
286/// text("element 3"),
+
287/// });
+
288/// ```
+
+ +
290 return flexbox(std::move(children),
+ +
292}
+
+
293
+
294} // namespace ftxui
+ + +
int asked_
Definition flexbox.cpp:222
+
bool need_iteration_
Definition flexbox.cpp:223
+
const FlexboxConfig config_
Definition flexbox.cpp:224
+
const FlexboxConfig config_normalized_
Definition flexbox.cpp:225
+
flexbox_helper::Global global_
Definition flexbox.cpp:226
+ + + +
@ FlexStart
items are placed at the start of the cross axis.
+ +
@ Column
Flex items are laid out in a column.
+ +
@ Row
Flex items are laid out in a row.
+
@ RowInversed
Flex items are laid out in a row, but in reverse order.
+
virtual void SetBox(Box box)
Assign a position and a dimension to an element for drawing.
Definition node.cpp:41
+ +
@ Wrap
Flex items will wrap onto multiple lines.
+ +
@ FlexStart
Items are aligned to the start of flexbox's direction.
+
FlexboxConfig is a configuration structure that defines the layout properties for a flexbox container...
+
static auto Intersection(Box a, Box b) -> Box
Definition box.cpp:11
+
void Compute(Global &global)
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
Element flexbox(Elements, FlexboxConfig config=FlexboxConfig())
A container displaying elements on row/columns and capable of wrapping on the next column/row when fu...
Definition flexbox.cpp:251
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+
Element hflow(Elements)
A container displaying elements in rows from left to right. When filled, it starts on a new row below...
Definition flexbox.cpp:269
+
std::vector< Element > Elements
Definition elements.hpp:23
+
Element vflow(Elements)
A container displaying elements in rows from top to bottom. When filled, it starts on a new columns o...
Definition flexbox.cpp:289
+ + + +
+
+ + + + + diff --git a/flexbox__config_8cpp.html b/flexbox__config_8cpp.html new file mode 100644 index 000000000..b649cb445 --- /dev/null +++ b/flexbox__config_8cpp.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: flexbox_config.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
flexbox_config.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+
+
+ + + + + diff --git a/flexbox__config_8cpp_source.html b/flexbox__config_8cpp_source.html new file mode 100644 index 000000000..d25a4e414 --- /dev/null +++ b/flexbox__config_8cpp_source.html @@ -0,0 +1,283 @@ + + + + + + + + +FTXUI: flexbox_config.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flexbox_config.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+ +
5
+
6namespace ftxui {
+
7
+
8/// @brief Set the flexbox direction.
+
+ +
10 this->direction = d;
+
11 return *this;
+
12}
+
+
13
+
14/// @brief Set the flexbox wrap.
+
+ +
16 this->wrap = w;
+
17 return *this;
+
18}
+
+
19
+
20/// @brief Set the flexbox justify content.
+
+ +
22 this->justify_content = j;
+
23 return *this;
+
24}
+
+
25
+
26/// @brief Set the flexbox align items.
+
+ +
28 this->align_items = a;
+
29 return *this;
+
30}
+
+
31
+
32/// @brief Set the flexbox align content.
+
+ +
34 this->align_content = a;
+
35 return *this;
+
36}
+
+
37
+
38/// @brief Set the flexbox flex direction.
+
+ +
40 this->gap_x = x;
+
41 this->gap_y = y;
+
42 return *this;
+
43}
+
+
44
+
45} // namespace ftxui
+ + + + + + + + + + +
FlexboxConfig & SetGap(int gap_x, int gap_y)
Set the flexbox flex direction.
+ +
JustifyContent justify_content
+ +
FlexboxConfig & Set(FlexboxConfig::Direction)
Set the flexbox direction.
+
FlexboxConfig is a configuration structure that defines the layout properties for a flexbox container...
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
+
+ + + + + diff --git a/flexbox__config_8cppm.html b/flexbox__config_8cppm.html new file mode 100644 index 000000000..049a7037e --- /dev/null +++ b/flexbox__config_8cppm.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: flexbox_config.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
flexbox_config.cppm File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+
+
+ + + + + diff --git a/flexbox__config_8cppm_source.html b/flexbox__config_8cppm_source.html new file mode 100644 index 000000000..4b488b991 --- /dev/null +++ b/flexbox__config_8cppm_source.html @@ -0,0 +1,229 @@ + + + + + + + + +FTXUI: flexbox_config.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flexbox_config.cppm
+
+
+Go to the documentation of this file.
1/// @module ftxui.dom.flexbox_config
+
2/// @brief Module file for the FlexboxConfig struct of the Dom module
+
3
+
4module;
+
5
+ +
7
+
8export module ftxui.dom.flexbox_config;
+
9
+
10/**
+
11 * @namespace ftxui
+
12 * @brief The FTXUI ftxui:: namespace
+
13 */
+
14export namespace ftxui {
+ +
16}
+ +
FlexboxConfig is a configuration structure that defines the layout properties for a flexbox container...
+
Module file for the FlexboxConfig struct of the Dom module.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
+
+ + + + + diff --git a/flexbox__config_8hpp.html b/flexbox__config_8hpp.html new file mode 100644 index 000000000..476d7a8ef --- /dev/null +++ b/flexbox__config_8hpp.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: flexbox_config.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
flexbox_config.hpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Classes

struct  FlexboxConfig
 FlexboxConfig is a configuration structure that defines the layout properties for a flexbox container. More...
 
+ + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+
+
+ + + + + diff --git a/flexbox__config_8hpp_source.html b/flexbox__config_8hpp_source.html new file mode 100644 index 000000000..ef5b64f9e --- /dev/null +++ b/flexbox__config_8hpp_source.html @@ -0,0 +1,379 @@ + + + + + + + + +FTXUI: flexbox_config.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flexbox_config.hpp
+
+
+Go to the documentation of this file.
1// Copyright 2021 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#ifndef FTXUI_DOM_FLEXBOX_CONFIG_HPP
+
5#define FTXUI_DOM_FLEXBOX_CONFIG_HPP
+
6
+
7/*
+
8 This replicate the CSS flexbox model.
+
9 See guide for documentation:
+
10 https://css-tricks.com/snippets/css/a-guide-to-flexbox/
+
11*/
+
12
+
13namespace ftxui {
+
14
+
15/// @brief FlexboxConfig is a configuration structure that defines the layout
+
16/// properties for a flexbox container.
+
17//
+
18/// It allows you to specify the direction of the flex items, whether they
+
19/// should wrap, how they should be justified along the main axis, and how
+
20/// they should be aligned along the cross axis.
+
21/// It also includes properties for gaps between flex items in both the
+
22/// main and cross axes.
+
23/// This structure is used to configure the layout behavior of flexbox
+
24/// containers in a terminal user interface.
+
25///
+
26/// @ingroup dom
+
+ +
28 /// This establishes the main-axis, thus defining the direction flex items are
+
29 /// placed in the flex container. Flexbox is (aside wrapping) single-direction
+
30 /// layout concept. Think of flex items as primarily laying out either in
+
31 /// horizontal rows or vertical columns.
+
+
32 enum class Direction {
+
33 Row, ///< Flex items are laid out in a row.
+
34 RowInversed, ///< Flex items are laid out in a row, but in reverse order.
+
35 Column, ///< Flex items are laid out in a column.
+
36 ColumnInversed ///< Flex items are laid out in a column, but in reverse
+
37 ///< order.
+
38 };
+
+ +
40
+
41 /// By default, flex items will all try to fit onto one line. You can change
+
42 /// that and allow the items to wrap as needed with this property.
+
+
43 enum class Wrap {
+
44 NoWrap, ///< Flex items will all try to fit onto one line.
+
45 Wrap, ///< Flex items will wrap onto multiple lines.
+
46 WrapInversed, ///< Flex items will wrap onto multiple lines, but in reverse
+
47 ///< order.
+
48 };
+
+ +
50
+
51 /// This defines the alignment along the main axis. It helps distribute extra
+
52 /// free space leftover when either all the flex items on a line are
+
53 /// inflexible, or are flexible but have reached their maximum size. It also
+
54 /// exerts some control over the alignment of items when they overflow the
+
55 /// line.
+
+
56 enum class JustifyContent {
+
57 /// Items are aligned to the start of flexbox's direction.
+ +
59 /// Items are aligned to the end of flexbox's direction.
+
60 FlexEnd,
+
61 /// Items are centered along the line.
+
62 Center,
+
63 /// Items are stretched to fill the line.
+
64 Stretch,
+
65 /// Items are evenly distributed in the line; first item is on the start
+
66 // line, last item on the end line
+ +
68 /// Items are evenly distributed in the line with equal space around them.
+
69 /// Note that visually the spaces aren’t equal, since all the items have
+
70 /// equal space on both sides. The first item will have one unit of space
+
71 /// against the container edge, but two units of space between the next item
+
72 /// because that next item has its own spacing that applies.
+ +
74 /// Items are distributed so that the spacing between any two items (and the
+
75 /// space to the edges) is equal.
+ +
77 };
+
+ +
79
+
80 /// This defines the default behavior for how flex items are laid out along
+
81 /// the cross axis on the current line. Think of it as the justify-content
+
82 /// version for the cross-axis (perpendicular to the main-axis).
+
+
83 enum class AlignItems {
+
84 FlexStart, ///< items are placed at the start of the cross axis.
+
85 FlexEnd, ///< items are placed at the end of the cross axis.
+
86 Center, ///< items are centered along the cross axis.
+
87 Stretch, ///< items are stretched to fill the cross axis.
+
88 };
+
+ +
90
+
91 // This aligns a flex container’s lines within when there is extra space in
+
92 // the cross-axis, similar to how justify-content aligns individual items
+
93 // within the main-axis.
+
+
94 enum class AlignContent {
+
95 FlexStart, ///< items are placed at the start of the cross axis.
+
96 FlexEnd, ///< items are placed at the end of the cross axis.
+
97 Center, ///< items are centered along the cross axis.
+
98 Stretch, ///< items are stretched to fill the cross axis.
+
99 SpaceBetween, ///< items are evenly distributed in the cross axis.
+
100 SpaceAround, ///< tems evenly distributed with equal space around each
+
101 ///< line.
+
102 SpaceEvenly, ///< items are evenly distributed in the cross axis with equal
+
103 ///< space around them.
+
104 };
+
+ +
106
+
107 int gap_x = 0;
+
108 int gap_y = 0;
+
109
+
110 // Constructor pattern. For chained use like:
+
111 // ```
+
112 // FlexboxConfig()
+
113 // .Set(FlexboxConfig::Direction::Row)
+
114 // .Set(FlexboxConfig::Wrap::Wrap);
+
115 // ```
+ + + + + +
121 FlexboxConfig& SetGap(int gap_x, int gap_y);
+
122};
+
+
123
+
124} // namespace ftxui
+
125
+
126#endif // FTXUI_DOM_FLEXBOX_CONFIG_HPP
+ + + + +
@ FlexStart
items are placed at the start of the cross axis.
+ +
@ Column
Flex items are laid out in a column.
+ +
@ Row
Flex items are laid out in a row.
+
@ RowInversed
Flex items are laid out in a row, but in reverse order.
+ + + +
@ NoWrap
Flex items will all try to fit onto one line.
+
@ Wrap
Flex items will wrap onto multiple lines.
+ + +
@ FlexStart
items are placed at the start of the cross axis.
+
FlexboxConfig & SetGap(int gap_x, int gap_y)
Set the flexbox flex direction.
+ +
JustifyContent justify_content
+ + +
@ Center
Items are centered along the line.
+
@ FlexStart
Items are aligned to the start of flexbox's direction.
+
@ FlexEnd
Items are aligned to the end of flexbox's direction.
+ +
@ SpaceBetween
Items are evenly distributed in the line; first item is on the start.
+
@ Stretch
Items are stretched to fill the line.
+
FlexboxConfig & Set(FlexboxConfig::Direction)
Set the flexbox direction.
+
FlexboxConfig is a configuration structure that defines the layout properties for a flexbox container...
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
+
+ + + + + diff --git a/flexbox__gallery_8cpp.html b/flexbox__gallery_8cpp.html new file mode 100644 index 000000000..72ad37cce --- /dev/null +++ b/flexbox__gallery_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: flexbox_gallery.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
flexbox_gallery.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 19 of file flexbox_gallery.cpp.

+ +
+
+
+
+ + + + + diff --git a/flexbox__gallery_8cpp.js b/flexbox__gallery_8cpp.js new file mode 100644 index 000000000..fc23a60f6 --- /dev/null +++ b/flexbox__gallery_8cpp.js @@ -0,0 +1,4 @@ +var flexbox__gallery_8cpp = +[ + [ "main", "flexbox__gallery_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/flexbox__gallery_8cpp_source.html b/flexbox__gallery_8cpp_source.html new file mode 100644 index 000000000..7ce03f3c9 --- /dev/null +++ b/flexbox__gallery_8cpp_source.html @@ -0,0 +1,459 @@ + + + + + + + + +FTXUI: flexbox_gallery.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flexbox_gallery.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <stddef.h> // for size_t
+
5#include <memory> // for shared_ptr, __shared_ptr_access, allocator
+
6#include <string> // for string, basic_string, to_string, operator+, char_traits
+
7#include <vector> // for vector
+
8
+
9#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
10#include "ftxui/component/component.hpp" // for Radiobox, Vertical, Checkbox, Horizontal, Renderer, ResizableSplitBottom, ResizableSplitRight
+
11#include "ftxui/component/component_base.hpp" // for ComponentBase
+
12#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
13#include "ftxui/dom/elements.hpp" // for text, window, operator|, vbox, hbox, Element, flexbox, bgcolor, filler, flex, size, border, hcenter, color, EQUAL, bold, dim, notflex, xflex_grow, yflex_grow, HEIGHT, WIDTH
+
14#include "ftxui/dom/flexbox_config.hpp" // for FlexboxConfig, FlexboxConfig::AlignContent, FlexboxConfig::JustifyContent, FlexboxConfig::AlignContent::Center, FlexboxConfig::AlignItems, FlexboxConfig::Direction, FlexboxConfig::JustifyContent::Center, FlexboxConfig::Wrap
+
15#include "ftxui/screen/color.hpp" // for Color, Color::Black
+
16
+
17using namespace ftxui;
+
18
+
+
19int main() {
+
20 auto screen = ScreenInteractive::Fullscreen();
+
21
+
22 int direction_index = 0;
+
23 int wrap_index = 0;
+
24 int justify_content_index = 0;
+
25 int align_items_index = 0;
+
26 int align_content_index = 0;
+
27
+
28 std::vector<std::string> directions = {
+
29 "Row",
+
30 "RowInversed",
+
31 "Column",
+
32 "ColumnInversed",
+
33 };
+
34
+
35 std::vector<std::string> wraps = {
+
36 "NoWrap",
+
37 "Wrap",
+
38 "WrapInversed",
+
39 };
+
40
+
41 std::vector<std::string> justify_content = {
+
42 "FlexStart", "FlexEnd", "Center", "Stretch",
+
43 "SpaceBetween", "SpaceAround", "SpaceEvenly",
+
44 };
+
45
+
46 std::vector<std::string> align_items = {
+
47 "FlexStart",
+
48 "FlexEnd",
+
49 "Center",
+
50 "Stretch",
+
51 };
+
52
+
53 std::vector<std::string> align_content = {
+
54 "FlexStart", "FlexEnd", "Center", "Stretch",
+
55 "SpaceBetween", "SpaceAround", "SpaceEvenly",
+
56 };
+
57
+
58 auto radiobox_direction = Radiobox(&directions, &direction_index);
+
59 auto radiobox_wrap = Radiobox(&wraps, &wrap_index);
+
60 auto radiobox_justify_content =
+
61 Radiobox(&justify_content, &justify_content_index);
+
62 auto radiobox_align_items = Radiobox(&align_items, &align_items_index);
+
63 auto radiobox_align_content = Radiobox(&align_content, &align_content_index);
+
64
+
65 bool element_xflex_grow = false;
+
66 bool element_yflex_grow = false;
+
67 bool group_xflex_grow = true;
+
68 bool group_yflex_grow = true;
+
69 auto checkbox_element_xflex_grow =
+
70 Checkbox("element |= xflex_grow", &element_xflex_grow);
+
71 auto checkbox_element_yflex_grow =
+
72 Checkbox("element |= yflex_grow", &element_yflex_grow);
+
73 auto checkbox_group_xflex_grow =
+
74 Checkbox("group |= xflex_grow", &group_xflex_grow);
+
75 auto checkbox_group_yflex_grow =
+
76 Checkbox("group |= yflex_grow", &group_yflex_grow);
+
77
+
78 auto make_box = [&](size_t dimx, size_t dimy, size_t index) {
+
79 std::string title = std::to_string(dimx) + "x" + std::to_string(dimy);
+
80 auto element = window(text(title) | hcenter | bold,
+
81 text(std::to_string(index)) | hcenter | dim) |
+
82 size(WIDTH, EQUAL, dimx) | size(HEIGHT, EQUAL, dimy) |
+
83 bgcolor(Color::HSV(index * 25, 255, 255)) |
+ +
85 if (element_xflex_grow) {
+
86 element = element | xflex_grow;
+
87 }
+
88 if (element_yflex_grow) {
+
89 element = element | yflex_grow;
+
90 }
+
91 return element;
+
92 };
+
93
+
94 auto content_renderer = Renderer([&] {
+
95 FlexboxConfig config;
+
96 config.direction = static_cast<FlexboxConfig::Direction>(direction_index);
+
97 config.wrap = static_cast<FlexboxConfig::Wrap>(wrap_index);
+
98 config.justify_content =
+
99 static_cast<FlexboxConfig::JustifyContent>(justify_content_index);
+
100 config.align_items =
+
101 static_cast<FlexboxConfig::AlignItems>(align_items_index);
+
102 config.align_content =
+
103 static_cast<FlexboxConfig::AlignContent>(align_content_index);
+
104
+
105 auto group = flexbox(
+
106 {
+
107 make_box(8, 4, 0),
+
108 make_box(9, 6, 1),
+
109 make_box(11, 6, 2),
+
110 make_box(10, 4, 3),
+
111 make_box(13, 7, 4),
+
112 make_box(12, 4, 5),
+
113 make_box(12, 5, 6),
+
114 make_box(10, 4, 7),
+
115 make_box(12, 4, 8),
+
116 make_box(10, 5, 9),
+
117 },
+
118 config);
+
119
+
120 group = group | bgcolor(Color::Black);
+
121
+
122 group = group | notflex;
+
123
+
124 if (!group_xflex_grow) {
+
125 group = hbox(group, filler());
+
126 }
+
127 if (!group_yflex_grow) {
+
128 group = vbox(group, filler());
+
129 }
+
130
+
131 group = group | flex;
+
132 return group;
+
133 });
+
134
+
135 auto center = FlexboxConfig()
+ + +
138 int space_right = 10;
+
139 int space_bottom = 1;
+
140 content_renderer = ResizableSplitRight(
+
141 Renderer([&] { return flexbox({text("resizable")}, center); }),
+
142 content_renderer, &space_right);
+
143 content_renderer = ResizableSplitBottom(
+
144 Renderer([&] { return flexbox({text("resizable")}, center); }),
+
145 content_renderer, &space_bottom);
+
146
+
147 auto main_container = Container::Vertical({
+ +
149 radiobox_direction,
+
150 radiobox_wrap,
+ +
152 checkbox_element_xflex_grow,
+
153 checkbox_element_yflex_grow,
+
154 checkbox_group_xflex_grow,
+
155 checkbox_group_yflex_grow,
+
156 }),
+
157 }),
+
158 Container::Horizontal({
+
159 radiobox_justify_content,
+
160 radiobox_align_items,
+
161 radiobox_align_content,
+
162 }),
+
163 content_renderer,
+
164 });
+
165
+
166 auto main_renderer = Renderer(main_container, [&] {
+
167 return vbox({
+
168 vbox({hbox({
+
169 window(text("FlexboxConfig::Direction"),
+
170 radiobox_direction->Render()),
+
171 window(text("FlexboxConfig::Wrap"), radiobox_wrap->Render()),
+
172 window(text("Misc:"),
+
173 vbox({
+
174 checkbox_element_xflex_grow->Render(),
+
175 checkbox_element_yflex_grow->Render(),
+
176 checkbox_group_xflex_grow->Render(),
+
177 checkbox_group_yflex_grow->Render(),
+
178 })),
+
179 }),
+
180 hbox({
+
181 window(text("FlexboxConfig::JustifyContent"),
+
182 radiobox_justify_content->Render()),
+
183 window(text("FlexboxConfig::AlignItems"),
+
184 radiobox_align_items->Render()),
+
185 window(text("FlexboxConfig::AlignContent"),
+
186 radiobox_align_content->Render()),
+
187 })}),
+
188 content_renderer->Render() | flex | border,
+
189 });
+
190 });
+
191
+
192 screen.Loop(main_renderer);
+
193
+
194 return 0;
+
195}
+
+ + + + + +
Element make_box(int x, int y)
+ + +
static ScreenInteractive Fullscreen()
+
Component Horizontal(Components children)
A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow...
+
Component Radiobox(RadioboxOption options)
A list of element, where only one can be selected.
+
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
+
Component Vertical(Components children)
A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
+
Component ResizableSplitRight(Component main, Component back, int *main_size)
An horizontal split in between two components, configurable using the mouse.
+
Component ResizableSplitBottom(Component main, Component back, int *main_size)
An vertical split in between two components, configurable using the mouse.
+
Component Checkbox(CheckboxOption options)
Draw checkable element.
+ + + +
@ Center
items are centered along the cross axis.
+ + + + +
virtual void Render(Screen &screen)
Display an element on a ftxui::Screen.
Definition node.cpp:59
+ +
JustifyContent justify_content
+ +
@ Center
Items are centered along the line.
+
FlexboxConfig & Set(FlexboxConfig::Direction)
Set the flexbox direction.
+
Decorator bgcolor(Color)
Decorate using a background color.
+
Element window(Element title, Element content, BorderStyle border=ROUNDED)
Draw window with a title and a border around the element.
+
Element xflex_grow(Element)
Expand if possible on the X axis.
Definition flex.cpp:147
+
Decorator size(WidthOrHeight, Constraint, int value)
Apply a constraint on the size of an element.
+
Element flex(Element)
Make a child element to expand proportionally to the space left in a container.
Definition flex.cpp:123
+
Element center(Element)
Center an element horizontally and vertically.
+
Element text(std::wstring text)
Display a piece of unicode text.
Definition text.cpp:160
+
Element yflex_grow(Element)
Expand if possible on the Y axis.
Definition flex.cpp:153
+
Element notflex(Element)
Make the element not flexible.
Definition flex.cpp:177
+
Element filler()
An element that will take expand proportionally to the space left in a container.
Definition flex.cpp:98
+
Element border(Element)
Draw a border around the element.
+
Decorator color(Color)
Decorate using a foreground color.
+
Element vbox(Elements)
A container displaying elements vertically one by one.
Definition vbox.cpp:96
+
FlexboxConfig is a configuration structure that defines the layout properties for a flexbox container...
+
static Color HSV(uint8_t hue, uint8_t saturation, uint8_t value)
Build a Color from its HSV representation. https://en.wikipedia.org/wiki/HSL_and_HSV.
+ +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
Element flexbox(Elements, FlexboxConfig config=FlexboxConfig())
A container displaying elements on row/columns and capable of wrapping on the next column/row when fu...
Definition flexbox.cpp:251
+
Element hbox(Elements)
A container displaying elements horizontally one by one.
Definition hbox.cpp:94
+ + +
+
+ + + + + diff --git a/flexbox__helper_8cpp.html b/flexbox__helper_8cpp.html new file mode 100644 index 000000000..a930bac15 --- /dev/null +++ b/flexbox__helper_8cpp.html @@ -0,0 +1,228 @@ + + + + + + + + +FTXUI: flexbox_helper.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
flexbox_helper.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
namespace  ftxui::flexbox_helper
 
+ + + +

+Functions

void Compute (Global &global)
 
+
+
+ + + + + diff --git a/flexbox__helper_8cpp.js b/flexbox__helper_8cpp.js new file mode 100644 index 000000000..ec6715a21 --- /dev/null +++ b/flexbox__helper_8cpp.js @@ -0,0 +1,4 @@ +var flexbox__helper_8cpp = +[ + [ "Compute", "flexbox__helper_8cpp.html#aaf9df834cf83e439dd0e74cb1999c83d", null ] +]; \ No newline at end of file diff --git a/flexbox__helper_8cpp_source.html b/flexbox__helper_8cpp_source.html new file mode 100644 index 000000000..e21f06154 --- /dev/null +++ b/flexbox__helper_8cpp_source.html @@ -0,0 +1,648 @@ + + + + + + + + +FTXUI: flexbox_helper.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flexbox_helper.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2021 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+ +
5
+
6#include <algorithm> // for max, min
+
7#include <cstddef> // for size_t
+
8#include <ftxui/dom/flexbox_config.hpp> // for FlexboxConfig, FlexboxConfig::Direction, FlexboxConfig::AlignContent, FlexboxConfig::JustifyContent, FlexboxConfig::Wrap, FlexboxConfig::Direction::RowInversed, FlexboxConfig::AlignItems, FlexboxConfig::Direction::Row, FlexboxConfig::Direction::Column, FlexboxConfig::Direction::ColumnInversed, FlexboxConfig::Wrap::WrapInversed, FlexboxConfig::AlignContent::Stretch, FlexboxConfig::JustifyContent::Stretch, FlexboxConfig::Wrap::Wrap, FlexboxConfig::AlignContent::Center, FlexboxConfig::AlignContent::FlexEnd, FlexboxConfig::AlignContent::FlexStart, FlexboxConfig::AlignContent::SpaceAround, FlexboxConfig::AlignContent::SpaceBetween, FlexboxConfig::AlignContent::SpaceEvenly, FlexboxConfig::AlignItems::Center, FlexboxConfig::AlignItems::FlexEnd, FlexboxConfig::AlignItems::FlexStart, FlexboxConfig::AlignItems::Stretch, FlexboxConfig::JustifyContent::Center, FlexboxConfig::JustifyContent::FlexEnd, FlexboxConfig::JustifyContent::FlexStart, FlexboxConfig::JustifyContent::SpaceAround, FlexboxConfig::JustifyContent::SpaceBetween, FlexboxConfig::JustifyContent::SpaceEvenly, FlexboxConfig::Wrap::NoWrap
+
9#include <utility> // for swap, move
+
10#include <vector>
+
11
+
12#include "ftxui/dom/box_helper.hpp" // for Element, Compute
+
13
+
+ +
15
+
16namespace {
+
17void SymmetryXY(FlexboxConfig& c) {
+
18 std::swap(c.gap_x, c.gap_y);
+
19 switch (c.direction) {
+ + +
22 break;
+ + +
25 break;
+ + +
28 break;
+ + +
31 break;
+
32 }
+
33}
+
34
+
35void SymmetryX(FlexboxConfig& c) {
+
36 switch (c.direction) {
+ + +
39 break;
+ + +
42 break;
+
43 default:
+
44 break;
+
45 }
+
46}
+
47
+
48void SymmetryY(FlexboxConfig& c) {
+
49 switch (c.wrap) {
+ +
51 break;
+ + +
54 break;
+ + +
57 break;
+
58 }
+
59}
+
60
+
61void SymmetryXY(Global& g) {
+
62 SymmetryXY(g.config);
+
63 std::swap(g.size_x, g.size_y);
+
64 for (auto& b : g.blocks) {
+
65 std::swap(b.min_size_x, b.min_size_y);
+
66 std::swap(b.flex_grow_x, b.flex_grow_y);
+
67 std::swap(b.flex_shrink_x, b.flex_shrink_y);
+
68 std::swap(b.x, b.y);
+
69 std::swap(b.dim_x, b.dim_y);
+
70 }
+
71 for (auto& l : g.lines) {
+
72 std::swap(l.x, l.y);
+
73 std::swap(l.dim_x, l.dim_y);
+
74 }
+
75}
+
76
+
77void SymmetryX(Global& g) {
+
78 SymmetryX(g.config);
+
79 for (auto& b : g.blocks) {
+
80 b.x = g.size_x - b.x - b.dim_x;
+
81 }
+
82 for (auto& l : g.lines) {
+
83 l.x = g.size_x - l.x - l.dim_x;
+
84 }
+
85}
+
86
+
87void SymmetryY(Global& g) {
+
88 SymmetryY(g.config);
+
89 for (auto& b : g.blocks) {
+
90 b.y = g.size_y - b.y - b.dim_y;
+
91 }
+
92 for (auto& l : g.lines) {
+
93 l.y = g.size_y - l.y - l.dim_y;
+
94 }
+
95}
+
96
+
97void SetX(Global& global) {
+
98 for (auto& line : global.lines) {
+
99 std::vector<box_helper::Element> elements;
+
100 elements.reserve(line.blocks.size());
+
101 for (auto* block : line.blocks) {
+
102 box_helper::Element element;
+
103 element.min_size = block->min_size_x;
+
104 element.flex_grow =
+
105 block->flex_grow_x != 0 || global.config.justify_content ==
+ +
107 ? 1
+
108 : 0;
+
109 element.flex_shrink = block->flex_shrink_x;
+
110 elements.push_back(element);
+
111 }
+
112
+ +
114 &elements,
+
115 global.size_x - global.config.gap_x * (int(line.blocks.size()) - 1));
+
116
+
117 int x = 0;
+
118 for (size_t i = 0; i < line.blocks.size(); ++i) {
+
119 line.blocks[i]->x = x;
+
120 line.blocks[i]->dim_x = elements[i].size;
+
121 x += elements[i].size;
+
122 x += global.config.gap_x;
+
123 }
+
124 }
+
125
+
126 for (auto& line : global.lines) {
+
127 line.x = 0;
+
128 line.dim_x = global.size_x;
+
129 }
+
130}
+
131
+
132// NOLINTNEXTLINE(readability-function-cognitive-complexity)
+
133void SetY(Global& g) {
+
134 std::vector<box_helper::Element> elements;
+
135 elements.reserve(g.lines.size());
+
136 for (auto& line : g.lines) {
+
137 box_helper::Element element;
+
138 element.flex_shrink = line.blocks.front()->flex_shrink_y;
+
139 element.flex_grow = line.blocks.front()->flex_grow_y;
+
140 for (auto* block : line.blocks) {
+
141 element.min_size = std::max(element.min_size, block->min_size_y);
+
142 element.flex_shrink = std::min(element.flex_shrink, block->flex_shrink_y);
+
143 element.flex_grow = std::min(element.flex_grow, block->flex_grow_y);
+
144 }
+
145 elements.push_back(element);
+
146 }
+
147
+
148 // box_helper::Compute(&elements, g.size_y);
+
149 box_helper::Compute(&elements, 10000); // NOLINT
+
150
+
151 // [Align-content]
+
152 std::vector<int> ys(elements.size());
+
153 int y = 0;
+
154 for (size_t i = 0; i < elements.size(); ++i) {
+
155 ys[i] = y;
+
156 y += elements[i].size;
+
157 y += g.config.gap_y;
+
158 }
+
159 int remaining_space = std::max(0, g.size_y - y);
+
160 switch (g.config.align_content) {
+ +
162 break;
+
163 }
+
164
+ +
166 for (size_t i = 0; i < ys.size(); ++i) { // NOLINT
+
167 ys[i] += remaining_space;
+
168 }
+
169 break;
+
170 }
+
171
+ +
173 for (size_t i = 0; i < ys.size(); ++i) { // NOLINT
+
174 ys[i] += remaining_space / 2;
+
175 }
+
176 break;
+
177 }
+
178
+ +
180 for (int i = static_cast<int>(ys.size()) - 1; i >= 0; --i) { // NOLINT
+
181 const int shifted = remaining_space * (i + 0) / (i + 1);
+
182 ys[i] += shifted;
+
183 const int consumed = remaining_space - shifted;
+
184 elements[i].size += consumed;
+
185 remaining_space -= consumed;
+
186 }
+
187 break;
+
188 }
+
189
+ +
191 for (int i = static_cast<int>(ys.size()) - 1; i >= 1; --i) { // NOLINT
+
192 ys[i] += remaining_space;
+
193 remaining_space = remaining_space * (i - 1) / i;
+
194 }
+
195 break;
+
196 }
+
197
+ +
199 for (int i = static_cast<int>(ys.size()) - 1; i >= 0; --i) { // NOLINT
+
200 ys[i] += remaining_space * (2 * i + 1) / (2 * i + 2);
+
201 remaining_space = remaining_space * (2 * i) / (2 * i + 2);
+
202 }
+
203 break;
+
204 }
+
205
+ +
207 for (int i = static_cast<int>(ys.size()) - 1; i >= 0; --i) { // NOLINT
+
208 ys[i] += remaining_space * (i + 1) / (i + 2);
+
209 remaining_space = remaining_space * (i + 1) / (i + 2);
+
210 }
+
211 break;
+
212 }
+
213 }
+
214
+
215 // [Align items]
+
216 for (size_t i = 0; i < g.lines.size(); ++i) {
+
217 auto& element = elements[i];
+
218 for (auto* block : g.lines[i].blocks) {
+
219 const bool stretch =
+
220 block->flex_grow_y != 0 ||
+ +
222 const int size =
+
223 stretch ? element.size : std::min(element.size, block->min_size_y);
+
224 switch (g.config.align_items) {
+ +
226 block->y = ys[i];
+
227 block->dim_y = size;
+
228 break;
+
229 }
+
230
+ +
232 block->y = ys[i] + (element.size - size) / 2;
+
233 block->dim_y = size;
+
234 break;
+
235 }
+
236
+ +
238 block->y = ys[i] + element.size - size;
+
239 block->dim_y = size;
+
240 break;
+
241 }
+
242
+ +
244 block->y = ys[i];
+
245 block->dim_y = element.size;
+
246 break;
+
247 }
+
248 }
+
249 }
+
250 }
+
251
+
252 ys.push_back(g.size_y);
+
253 for (size_t i = 0; i < g.lines.size(); ++i) {
+
254 g.lines[i].y = ys[i];
+
255 g.lines[i].dim_y = ys[i + 1] - ys[i];
+
256 }
+
257}
+
258
+
259void JustifyContent(Global& g) {
+
260 for (auto& line : g.lines) {
+
261 Block* last = line.blocks.back();
+
262 int remaining_space = g.size_x - last->x - last->dim_x;
+
263 switch (g.config.justify_content) {
+ + +
266 break;
+
267
+ +
269 for (auto* block : line.blocks) {
+
270 block->x += remaining_space;
+
271 }
+
272 break;
+
273 }
+
274
+ +
276 for (auto* block : line.blocks) {
+
277 block->x += remaining_space / 2;
+
278 }
+
279 break;
+
280 }
+
281
+ +
283 for (int i = (int)line.blocks.size() - 1; i >= 1; --i) {
+
284 line.blocks[i]->x += remaining_space;
+
285 remaining_space = remaining_space * (i - 1) / i;
+
286 }
+
287 break;
+
288 }
+
289
+ +
291 for (int i = (int)line.blocks.size() - 1; i >= 0; --i) {
+
292 line.blocks[i]->x += remaining_space * (2 * i + 1) / (2 * i + 2);
+
293 remaining_space = remaining_space * (2 * i) / (2 * i + 2);
+
294 }
+
295 break;
+
296 }
+
297
+ +
299 for (int i = (int)line.blocks.size() - 1; i >= 0; --i) {
+
300 line.blocks[i]->x += remaining_space * (i + 1) / (i + 2);
+
301 remaining_space = remaining_space * (i + 1) / (i + 2);
+
302 }
+
303 break;
+
304 }
+
305 }
+
306 }
+
307}
+
308
+
309void Compute1(Global& global);
+
310void Compute2(Global& global);
+
311void Compute3(Global& global);
+
312
+
313void Compute1(Global& global) {
+ +
315 SymmetryX(global);
+
316 Compute2(global);
+
317 SymmetryX(global);
+
318 return;
+
319 }
+
320 Compute2(global);
+
321}
+
322
+
323void Compute2(Global& global) {
+ +
325 SymmetryY(global);
+
326 Compute3(global);
+
327 SymmetryY(global);
+
328 return;
+
329 }
+
330 Compute3(global);
+
331}
+
332
+
333void Compute3(Global& global) {
+
334 // Step 1: Lay out every elements into rows:
+
335 {
+
336 Line line;
+
337 int x = 0;
+
338 for (auto& block : global.blocks) {
+
339 // Does it fit the end of the row?
+
340 // No? Then we need to start a new one:
+
341 if (x + block.min_size_x > global.size_x) {
+
342 x = 0;
+
343 if (!line.blocks.empty()) {
+
344 global.lines.push_back(std::move(line));
+
345 }
+
346 line = Line();
+
347 }
+
348
+
349 block.line = static_cast<int>(global.lines.size());
+
350 block.line_position = static_cast<int>(line.blocks.size());
+
351 line.blocks.push_back(&block);
+
352 x += block.min_size_x + global.config.gap_x;
+
353 }
+
354 if (!line.blocks.empty()) {
+
355 global.lines.push_back(std::move(line));
+
356 }
+
357 }
+
358
+
359 // Step 2: Set positions on the X axis.
+
360 SetX(global);
+
361 JustifyContent(global); // Distribute remaining space.
+
362
+
363 // Step 3: Set positions on the Y axis.
+
364 SetY(global);
+
365}
+
366
+
367} // namespace
+
368
+
+
369void Compute(Global& global) {
+ + +
372 SymmetryXY(global);
+
373 Compute1(global);
+
374 SymmetryXY(global);
+
375 return;
+
376 }
+
377 Compute1(global);
+
378}
+
+
379
+
380} // namespace ftxui::flexbox_helper
+
+ + + + + + + +
@ Center
items are centered along the cross axis.
+
@ FlexStart
items are placed at the start of the cross axis.
+
@ FlexEnd
items are placed at the end of the cross axis.
+ +
@ SpaceBetween
items are evenly distributed in the cross axis.
+
@ Stretch
items are stretched to fill the cross axis.
+
@ Column
Flex items are laid out in a column.
+ +
@ Row
Flex items are laid out in a row.
+
@ RowInversed
Flex items are laid out in a row, but in reverse order.
+ + +
@ NoWrap
Flex items will all try to fit onto one line.
+
@ Wrap
Flex items will wrap onto multiple lines.
+ +
@ Center
items are centered along the cross axis.
+
@ FlexStart
items are placed at the start of the cross axis.
+
@ FlexEnd
items are placed at the end of the cross axis.
+
@ Stretch
items are stretched to fill the cross axis.
+ +
JustifyContent justify_content
+ +
@ Center
Items are centered along the line.
+
@ FlexStart
Items are aligned to the start of flexbox's direction.
+
@ FlexEnd
Items are aligned to the end of flexbox's direction.
+ +
@ SpaceBetween
Items are evenly distributed in the line; first item is on the start.
+
@ Stretch
Items are stretched to fill the line.
+
Decorator size(WidthOrHeight, Constraint, int value)
Apply a constraint on the size of an element.
+
FlexboxConfig is a configuration structure that defines the layout properties for a flexbox container...
+
void Compute(std::vector< Element > *elements, int target_size)
+ +
void Compute(Global &global)
+ + + + + + + + + + + + + + +
std::vector< Block * > blocks
+
+
+ + + + + diff --git a/flexbox__helper_8hpp.html b/flexbox__helper_8hpp.html new file mode 100644 index 000000000..11b1ff345 --- /dev/null +++ b/flexbox__helper_8hpp.html @@ -0,0 +1,238 @@ + + + + + + + + +FTXUI: flexbox_helper.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
flexbox_helper.hpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + + + +

+Classes

struct  Block
 
struct  Line
 
struct  Global
 
+ + + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
namespace  ftxui::flexbox_helper
 
+ + + +

+Functions

void Compute (Global &global)
 
+
+
+ + + + + diff --git a/flexbox__helper_8hpp.js b/flexbox__helper_8hpp.js new file mode 100644 index 000000000..71641b2d5 --- /dev/null +++ b/flexbox__helper_8hpp.js @@ -0,0 +1,7 @@ +var flexbox__helper_8hpp = +[ + [ "Block", "structftxui_1_1flexbox__helper_1_1Block.html", "structftxui_1_1flexbox__helper_1_1Block" ], + [ "Line", "structftxui_1_1flexbox__helper_1_1Line.html", "structftxui_1_1flexbox__helper_1_1Line" ], + [ "Global", "structftxui_1_1flexbox__helper_1_1Global.html", "structftxui_1_1flexbox__helper_1_1Global" ], + [ "Compute", "flexbox__helper_8hpp.html#aaf9df834cf83e439dd0e74cb1999c83d", null ] +]; \ No newline at end of file diff --git a/flexbox__helper_8hpp_source.html b/flexbox__helper_8hpp_source.html new file mode 100644 index 000000000..7c04cfb5f --- /dev/null +++ b/flexbox__helper_8hpp_source.html @@ -0,0 +1,298 @@ + + + + + + + + +FTXUI: flexbox_helper.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
flexbox_helper.hpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#ifndef FTXUI_DOM_FLEXBOX_HELPER_HPP
+
5#define FTXUI_DOM_FLEXBOX_HELPER_HPP
+
6
+
7#include <vector>
+ +
9
+
10namespace ftxui::flexbox_helper {
+
11
+
12// A block is a rectangle in the flexbox.
+
+
13struct Block {
+
14 // Input:
+
15 int min_size_x = 0;
+
16 int min_size_y = 0;
+
17 int flex_grow_x = 0;
+
18 int flex_grow_y = 0;
+ + +
21
+
22 // Output:
+
23 int line{};
+ +
25 int x = 0;
+
26 int y = 0;
+
27 int dim_x = 0;
+
28 int dim_y = 0;
+
29 bool overflow = false;
+
30};
+
+
31
+
32// A line is a row of blocks.
+
+
33struct Line {
+
34 std::vector<Block*> blocks;
+
35 int x = 0;
+
36 int y = 0;
+
37 int dim_x = 0;
+
38 int dim_y = 0;
+
39};
+
+
40
+
+
41struct Global {
+
42 std::vector<Block> blocks;
+
43 std::vector<Line> lines;
+ +
45 int size_x;
+
46 int size_y;
+
47};
+
+
48
+
49void Compute(Global& global);
+
50
+
51} // namespace ftxui::flexbox_helper
+
52
+
53#endif /* end of include guard: FTXUI_DOM_FLEXBOX_HELPER_HPP*/
+ +
FlexboxConfig is a configuration structure that defines the layout properties for a flexbox container...
+ +
void Compute(Global &global)
+ + + + + + + + + + + + + + + + + + + + + + + + +
std::vector< Block * > blocks
+ +
+
+ + + + + diff --git a/focus__cursor_8cpp.html b/focus__cursor_8cpp.html new file mode 100644 index 000000000..e9533c444 --- /dev/null +++ b/focus__cursor_8cpp.html @@ -0,0 +1,266 @@ + + + + + + + + +FTXUI: focus_cursor.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
focus_cursor.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + +

+Functions

Component Instance (std::string label, Decorator focusCursor)
 
int main ()
 
+

Function Documentation

+ +

◆ Instance()

+ +
+
+ + + + + + + + + + + +
Component Instance (std::string label,
Decorator focusCursor )
+
+
Examples
examples/component/focus_cursor.cpp.
+
+ +

Definition at line 13 of file focus_cursor.cpp.

+ +
+
+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 25 of file focus_cursor.cpp.

+ +
+
+
+
+ + + + + diff --git a/focus__cursor_8cpp.js b/focus__cursor_8cpp.js new file mode 100644 index 000000000..7c22c3f63 --- /dev/null +++ b/focus__cursor_8cpp.js @@ -0,0 +1,5 @@ +var focus__cursor_8cpp = +[ + [ "Instance", "focus__cursor_8cpp.html#a96da73e7fb75cca8a91e59559ce1dba2", null ], + [ "main", "focus__cursor_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/focus__cursor_8cpp_source.html b/focus__cursor_8cpp_source.html new file mode 100644 index 000000000..c2255c38c --- /dev/null +++ b/focus__cursor_8cpp_source.html @@ -0,0 +1,263 @@ + + + + + + + + +FTXUI: focus_cursor.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
focus_cursor.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <ftxui/component/captured_mouse.hpp> // for ftxui
+
5#include <string> // for allocator, operator+, char_traits, string
+
6
+
7#include "ftxui/component/component.hpp" // for Renderer, Vertical
+
8#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive, Component
+
9#include "ftxui/dom/elements.hpp" // for text, Decorator, focus, focusCursorBar, focusCursorBarBlinking, focusCursorBlock, focusCursorBlockBlinking, focusCursorUnderline, focusCursorUnderlineBlinking, hbox, Element
+
10
+
11using namespace ftxui;
+
12
+
+
13Component Instance(std::string label, Decorator focusCursor) {
+
14 return Renderer([=](bool focused) {
+
15 if (focused) {
+
16 return hbox({
+
17 text("> " + label + " "),
+
18 focusCursor(text(" ")),
+
19 });
+
20 }
+
21 return text(" " + label + " ");
+
22 });
+
23};
+
+
24
+
+
25int main() {
+
26 auto screen = ScreenInteractive::Fullscreen();
+
27 screen.Loop(Container::Vertical({
+
28 Instance("focus", focus),
+
29 Instance("focusCursorBlock", focusCursorBlock),
+
30 Instance("focusCursorBlockBlinking", focusCursorBlockBlinking),
+
31 Instance("focusCursorBar", focusCursorBar),
+
32 Instance("focusCursorBarBlinking", focusCursorBarBlinking),
+
33 Instance("focusCursorUnderline", focusCursorUnderline),
+
34 Instance("focusCursorUnderlineBlinking", focusCursorUnderlineBlinking),
+
35 }));
+
36 return 0;
+
37}
+
+ + + +
Component Instance(std::string label, Decorator focusCursor)
+
int main()
+
static ScreenInteractive Fullscreen()
+
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
+
Element text(std::wstring text)
Display a piece of unicode text.
Definition text.cpp:160
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::function< Element(Element)> Decorator
Definition elements.hpp:24
+
Element hbox(Elements)
A container displaying elements horizontally one by one.
Definition hbox.cpp:94
+
std::shared_ptr< ComponentBase > Component
+ +
+
+ + + + + diff --git a/folderclosed.svg b/folderclosed.svg new file mode 100644 index 000000000..8de6910ee --- /dev/null +++ b/folderclosed.svg @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/folderclosedd.svg b/folderclosedd.svg new file mode 100644 index 000000000..7690e5701 --- /dev/null +++ b/folderclosedd.svg @@ -0,0 +1,11 @@ + + + + + + + + + + diff --git a/folderopen.svg b/folderopen.svg new file mode 100644 index 000000000..b45daf8df --- /dev/null +++ b/folderopen.svg @@ -0,0 +1,17 @@ + + + + + + + + + + diff --git a/folderopend.svg b/folderopend.svg new file mode 100644 index 000000000..4f13873dc --- /dev/null +++ b/folderopend.svg @@ -0,0 +1,12 @@ + + + + + + + + + + + diff --git a/frame_8cpp.html b/frame_8cpp.html new file mode 100644 index 000000000..9a95d049a --- /dev/null +++ b/frame_8cpp.html @@ -0,0 +1,257 @@ + + + + + + + + +FTXUI: frame.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
frame.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

Element focus (Element child)
 Set the child to be the one focused among its siblings.
 
Element select (Element child)
 Set the child to be the one focused among its siblings.
 
Element frame (Element child)
 Allow an element to be displayed inside a 'virtual' area. It size can be larger than its container. In this case only a smaller portion is displayed. The view is scrollable to make the focused element visible.
 
Element xframe (Element child)
 Same as frame, but only on the x-axis.
 
Element yframe (Element child)
 Same as frame, but only on the y-axis.
 
Element focusCursorBlock (Element child)
 Same as focus, but set the cursor shape to be a still block.
 
Element focusCursorBlockBlinking (Element child)
 Same as focus, but set the cursor shape to be a blinking block.
 
Element focusCursorBar (Element child)
 Same as focus, but set the cursor shape to be a still block.
 
Element focusCursorBarBlinking (Element child)
 Same as focus, but set the cursor shape to be a blinking bar.
 
Element focusCursorUnderline (Element child)
 Same as focus, but set the cursor shape to be a still underline.
 
Element focusCursorUnderlineBlinking (Element child)
 Same as focus, but set the cursor shape to be a blinking underline.
 
+
+
+ + + + + diff --git a/frame_8cpp.js b/frame_8cpp.js new file mode 100644 index 000000000..c69606d7f --- /dev/null +++ b/frame_8cpp.js @@ -0,0 +1,14 @@ +var frame_8cpp = +[ + [ "focus", "frame_8cpp.html#gaa2d7d671f184f85e0f396f2610fa6c2e", null ], + [ "select", "frame_8cpp.html#a9e3e2988ed61a129d82d634ad66f7eb1", null ], + [ "frame", "frame_8cpp.html#ad0d6a96f6e1fb6d67d9fa6323062a737", null ], + [ "xframe", "frame_8cpp.html#a2d0617c0912b732f059cf360ac951c49", null ], + [ "yframe", "frame_8cpp.html#a7ea9d3ceb2a977955125c6e4a6072325", null ], + [ "focusCursorBlock", "frame_8cpp.html#ga509ef7e7f8913ea3de7efd45e3301ea1", null ], + [ "focusCursorBlockBlinking", "frame_8cpp.html#gadda589914ba8fe863c905b6566557768", null ], + [ "focusCursorBar", "frame_8cpp.html#ga4f89e72e7001064e3eb8189c8317e95b", null ], + [ "focusCursorBarBlinking", "frame_8cpp.html#ga085a7c997e7364c5a54e73c7b84145db", null ], + [ "focusCursorUnderline", "frame_8cpp.html#ga61e1fe02a18c2b18e31ccc9cd3943823", null ], + [ "focusCursorUnderlineBlinking", "frame_8cpp.html#ga33637d59d1e52aa06dd2a94162adbfe9", null ] +]; \ No newline at end of file diff --git a/frame_8cpp_source.html b/frame_8cpp_source.html new file mode 100644 index 000000000..1a9d6cb60 --- /dev/null +++ b/frame_8cpp_source.html @@ -0,0 +1,484 @@ + + + + + + + + +FTXUI: frame.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
frame.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <algorithm> // for max, min
+
5#include <memory> // for make_shared, __shared_ptr_access
+
6#include <utility> // for move
+
7
+
8#include "ftxui/dom/elements.hpp" // for Element, unpack, Elements, focus, frame, select, xframe, yframe
+
9#include "ftxui/dom/node.hpp" // for Node, Elements
+
10#include "ftxui/dom/requirement.hpp" // for Requirement
+
11#include "ftxui/screen/box.hpp" // for Box
+
12#include "ftxui/screen/screen.hpp" // for Screen, Screen::Cursor
+
13#include "ftxui/util/autoreset.hpp" // for AutoReset
+
14
+
15namespace ftxui {
+
16
+
17namespace {
+
18class Focus : public Node {
+
19 public:
+
20 explicit Focus(Elements children) : Node(std::move(children)) {}
+
21
+
22 void ComputeRequirement() override {
+ +
24 requirement_ = children_[0]->requirement();
+
25 requirement_.focused.enabled = true;
+
26 requirement_.focused.node = this;
+
27 requirement_.focused.box.x_min = 0;
+
28 requirement_.focused.box.y_min = 0;
+
29 requirement_.focused.box.x_max = requirement_.min_x - 1;
+
30 requirement_.focused.box.y_max = requirement_.min_y - 1;
+
31 }
+
32
+
33 void SetBox(Box box) override {
+
34 Node::SetBox(box);
+
35 children_[0]->SetBox(box);
+
36 }
+
37};
+
38
+
39class Frame : public Node {
+
40 public:
+
41 Frame(Elements children, bool x_frame, bool y_frame)
+
42 : Node(std::move(children)), x_frame_(x_frame), y_frame_(y_frame) {}
+
43
+
44 void SetBox(Box box) override {
+
45 Node::SetBox(box);
+
46 auto& focused_box = requirement_.focused.box;
+
47 Box children_box = box;
+
48
+
49 if (x_frame_) {
+
50 const int external_dimx = box.x_max - box.x_min;
+
51 const int internal_dimx = std::max(requirement_.min_x, external_dimx);
+
52 const int focused_dimx = focused_box.x_max - focused_box.x_min;
+
53 int dx = focused_box.x_min - external_dimx / 2 + focused_dimx / 2;
+
54 dx = std::max(0, std::min(internal_dimx - external_dimx - 1, dx));
+
55 children_box.x_min = box.x_min - dx;
+
56 children_box.x_max = box.x_min + internal_dimx - dx;
+
57 }
+
58
+
59 if (y_frame_) {
+
60 const int external_dimy = box.y_max - box.y_min;
+
61 const int internal_dimy = std::max(requirement_.min_y, external_dimy);
+
62 const int focused_dimy = focused_box.y_max - focused_box.y_min;
+
63 int dy = focused_box.y_min - external_dimy / 2 + focused_dimy / 2;
+
64 dy = std::max(0, std::min(internal_dimy - external_dimy - 1, dy));
+
65 children_box.y_min = box.y_min - dy;
+
66 children_box.y_max = box.y_min + internal_dimy - dy;
+
67 }
+
68
+
69 children_[0]->SetBox(children_box);
+
70 }
+
71
+
72 void Render(Screen& screen) override {
+
73 const AutoReset<Box> stencil(&screen.stencil,
+
74 Box::Intersection(box_, screen.stencil));
+
75 children_[0]->Render(screen);
+
76 }
+
77
+
78 private:
+
79 bool x_frame_;
+
80 bool y_frame_;
+
81};
+
82
+
83class FocusCursor : public Focus {
+
84 public:
+
85 FocusCursor(Elements children, Screen::Cursor::Shape shape)
+
86 : Focus(std::move(children)), shape_(shape) {}
+
87
+
88 private:
+
89 void ComputeRequirement() override {
+
90 Focus::ComputeRequirement(); // NOLINT
+
91 requirement_.focused.cursor_shape = shape_;
+
92 }
+ +
94};
+
95
+
96} // namespace
+
97
+
98/// @brief Set the `child` to be the one focused among its siblings.
+
99/// @param child The element to be focused.
+
100/// @ingroup dom
+
+ +
102 return std::make_shared<Focus>(unpack(std::move(child)));
+
103}
+
+
104
+
105/// This is deprecated. Use `focus` instead.
+
106/// @brief Set the `child` to be the one focused among its siblings.
+
107/// @param child The element to be focused.
+
+ +
109 return focus(std::move(child));
+
110}
+
+
111
+
112/// @brief Allow an element to be displayed inside a 'virtual' area. It size can
+
113/// be larger than its container. In this case only a smaller portion is
+
114/// displayed. The view is scrollable to make the focused element visible.
+
115/// @see frame
+
116/// @see xframe
+
117/// @see yframe
+
+ +
119 return std::make_shared<Frame>(unpack(std::move(child)), true, true);
+
120}
+
+
121
+
122/// @brief Same as `frame`, but only on the x-axis.
+
123/// @see frame
+
124/// @see xframe
+
125/// @see yframe
+
+ +
127 return std::make_shared<Frame>(unpack(std::move(child)), true, false);
+
128}
+
+
129
+
130/// @brief Same as `frame`, but only on the y-axis.
+
131/// @see frame
+
132/// @see xframe
+
133/// @see yframe
+
+ +
135 return std::make_shared<Frame>(unpack(std::move(child)), false, true);
+
136}
+
+
137
+
138/// @brief Same as `focus`, but set the cursor shape to be a still block.
+
139/// @see focus
+
140/// @see focusCursorBlock
+
141/// @see focusCursorBlockBlinking
+
142/// @see focusCursorBar
+
143/// @see focusCursorBarBlinking
+
144/// @see focusCursorUnderline
+
145/// @see focusCursorUnderlineBlinking
+
146/// @ingroup dom
+
+ +
148 return std::make_shared<FocusCursor>(unpack(std::move(child)),
+ +
150}
+
+
151
+
152/// @brief Same as `focus`, but set the cursor shape to be a blinking block.
+
153/// @see focus
+
154/// @see focusCursorBlock
+
155/// @see focusCursorBlockBlinking
+
156/// @see focusCursorBar
+
157/// @see focusCursorBarBlinking
+
158/// @see focusCursorUnderline
+
159/// @see focusCursorUnderlineBlinking
+
160/// @ingroup dom
+
+ +
162 return std::make_shared<FocusCursor>(unpack(std::move(child)),
+ +
164}
+
+
165
+
166/// @brief Same as `focus`, but set the cursor shape to be a still block.
+
167/// @see focus
+
168/// @see focusCursorBlock
+
169/// @see focusCursorBlockBlinking
+
170/// @see focusCursorBar
+
171/// @see focusCursorBarBlinking
+
172/// @see focusCursorUnderline
+
173/// @see focusCursorUnderlineBlinking
+
174/// @ingroup dom
+
+ +
176 return std::make_shared<FocusCursor>(unpack(std::move(child)),
+ +
178}
+
+
179
+
180/// @brief Same as `focus`, but set the cursor shape to be a blinking bar.
+
181/// @see focus
+
182/// @see focusCursorBlock
+
183/// @see focusCursorBlockBlinking
+
184/// @see focusCursorBar
+
185/// @see focusCursorBarBlinking
+
186/// @see focusCursorUnderline
+
187/// @see focusCursorUnderlineBlinking
+
188/// @ingroup dom
+
+ +
190 return std::make_shared<FocusCursor>(unpack(std::move(child)),
+ +
192}
+
+
193
+
194/// @brief Same as `focus`, but set the cursor shape to be a still underline.
+
195/// @see focus
+
196/// @see focusCursorBlock
+
197/// @see focusCursorBlockBlinking
+
198/// @see focusCursorBar
+
199/// @see focusCursorBarBlinking
+
200/// @see focusCursorUnderline
+
201/// @see focusCursorUnderlineBlinking
+
202/// @ingroup dom
+
+ +
204 return std::make_shared<FocusCursor>(unpack(std::move(child)),
+ +
206}
+
+
207
+
208/// @brief Same as `focus`, but set the cursor shape to be a blinking underline.
+
209/// @see focus
+
210/// @see focusCursorBlock
+
211/// @see focusCursorBlockBlinking
+
212/// @see focusCursorBar
+
213/// @see focusCursorBarBlinking
+
214/// @see focusCursorUnderline
+
215/// @see focusCursorUnderlineBlinking
+
216/// @ingroup dom
+
+ +
218 return std::make_shared<FocusCursor>(unpack(std::move(child)),
+ +
220}
+
+
221
+
222} // namespace ftxui
+ + + +
virtual void SetBox(Box box)
Assign a position and a dimension to an element for drawing.
Definition node.cpp:41
+
virtual void ComputeRequirement()
Compute how much space an element needs.
Definition node.cpp:20
+
Element focusCursorBarBlinking(Element)
Same as focus, but set the cursor shape to be a blinking bar.
Definition frame.cpp:189
+
Element focusCursorUnderlineBlinking(Element)
Same as focus, but set the cursor shape to be a blinking underline.
Definition frame.cpp:217
+
Element focusCursorBar(Element)
Same as focus, but set the cursor shape to be a still block.
Definition frame.cpp:175
+
Element focusCursorBlock(Element)
Same as focus, but set the cursor shape to be a still block.
Definition frame.cpp:147
+
Element focusCursorUnderline(Element)
Same as focus, but set the cursor shape to be a still underline.
Definition frame.cpp:203
+
Element focus(Element)
Set the child to be the one focused among its siblings.
Definition frame.cpp:101
+
void Render(Screen &screen, const Element &element)
Display an element on a ftxui::Screen.
Definition node.cpp:84
+
Element focusCursorBlockBlinking(Element)
Same as focus, but set the cursor shape to be a blinking block.
Definition frame.cpp:161
+
static auto Intersection(Box a, Box b) -> Box
Definition box.cpp:11
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+
Element xframe(Element)
Same as frame, but only on the x-axis.
Definition frame.cpp:126
+
std::vector< Element > Elements
Definition elements.hpp:23
+
Element yframe(Element)
Same as frame, but only on the y-axis.
Definition frame.cpp:134
+
Element select(Element e)
Set the child to be the one focused among its siblings.
Definition frame.cpp:108
+
Element frame(Element)
Allow an element to be displayed inside a 'virtual' area. It size can be larger than its container....
Definition frame.cpp:118
+ + + + + + + + + + +
+
+ + + + + diff --git a/ftxui.html b/ftxui.html new file mode 100644 index 000000000..b8f44dc78 --- /dev/null +++ b/ftxui.html @@ -0,0 +1,267 @@ + + + + + + + + +FTXUI: ftxui + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
ftxui
+
+
+

+

title-img

+

FTXUI is organized into three modules, each building upon the previous:

+
    +
  1. ftxui/screen - Low-level rendering
  2. +
  3. ftxui/dom - Layout and composition
  4. +
  5. ftxui/component - User interaction
  6. +
+
+

+ftxui/screen

+

Defines:

+ +

Use for direct terminal drawing and styling.

+
+ + + + +
Next
Documentation
+

+

+ftxui/dom

+

Provides:

+
    +
  • ftxui::Element: a tree structure for layout and UI.
  • +
  • Composable and responsive elements.
  • +
  • Render() to draw onto a Screen.
  • +
+

Ideal for structured, styled UIs.

+
+ + + + +
Next
Documentation
+

+

+ftxui/component

+

Adds:

+
    +
  • ftxui::Component: stateful, interactive widgets.
  • +
  • Built-ins: Checkbox, Input, Menu, Button.
  • +
  • Supports keyboard/cursor input and composition.
  • +
+

Use for interactive apps.

+
+ + + + +
Next
Documentation
+

+

Modules can be used independently, or together: screen → dom → component.

+
+
+
+ + + + + diff --git a/ftxui_8cppm.html b/ftxui_8cppm.html new file mode 100644 index 000000000..bcc37f329 --- /dev/null +++ b/ftxui_8cppm.html @@ -0,0 +1,211 @@ + + + + + + + + +FTXUI: ftxui.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
ftxui.cppm File Reference
module ftxui
+
+ +
+ + + + + diff --git a/ftxui_8cppm_source.html b/ftxui_8cppm_source.html new file mode 100644 index 000000000..291933a3d --- /dev/null +++ b/ftxui_8cppm_source.html @@ -0,0 +1,223 @@ + + + + + + + + +FTXUI: ftxui.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
ftxui.cppm
+
+
+Go to the documentation of this file.
1/// @module ftxui
+
2/// @brief Module file re-exporting all FTXUI submodules.
+
3
+
4export module ftxui;
+
5
+
6export import ftxui.component;
+
7export import ftxui.dom;
+
8export import ftxui.screen;
+
9export import ftxui.util;
+
Module file for FTXUI component operations.
+
Module file for FTXUI main operations.
+
Module file for FTXUI screen operations.
+
Module file for FTXUI utility operations.
+
Module file re-exporting all FTXUI submodules.
+
+
+ + + + + diff --git a/functions.html b/functions.html new file mode 100644 index 000000000..56d001e51 --- /dev/null +++ b/functions.html @@ -0,0 +1,268 @@ + + + + + + + + +FTXUI: Class Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- a -

+
+
+ + + + + diff --git a/functions_b.html b/functions_b.html new file mode 100644 index 000000000..874904a61 --- /dev/null +++ b/functions_b.html @@ -0,0 +1,240 @@ + + + + + + + + +FTXUI: Class Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- b -

+
+
+ + + + + diff --git a/functions_c.html b/functions_c.html new file mode 100644 index 000000000..18aaae404 --- /dev/null +++ b/functions_c.html @@ -0,0 +1,316 @@ + + + + + + + + +FTXUI: Class Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- c -

+
+
+ + + + + diff --git a/functions_d.html b/functions_d.html new file mode 100644 index 000000000..620bd9a91 --- /dev/null +++ b/functions_d.html @@ -0,0 +1,305 @@ + + + + + + + + +FTXUI: Class Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- d -

+
+
+ + + + + diff --git a/functions_dup.js b/functions_dup.js new file mode 100644 index 000000000..dce297a95 --- /dev/null +++ b/functions_dup.js @@ -0,0 +1,30 @@ +var functions_dup = +[ + [ "a", "functions.html", null ], + [ "b", "functions_b.html", null ], + [ "c", "functions_c.html", null ], + [ "d", "functions_d.html", null ], + [ "e", "functions_e.html", null ], + [ "f", "functions_f.html", null ], + [ "g", "functions_g.html", null ], + [ "h", "functions_h.html", null ], + [ "i", "functions_i.html", null ], + [ "j", "functions_j.html", null ], + [ "k", "functions_k.html", null ], + [ "l", "functions_l.html", null ], + [ "m", "functions_m.html", null ], + [ "n", "functions_n.html", null ], + [ "o", "functions_o.html", null ], + [ "p", "functions_p.html", null ], + [ "q", "functions_q.html", null ], + [ "r", "functions_r.html", null ], + [ "s", "functions_s.html", null ], + [ "t", "functions_t.html", null ], + [ "u", "functions_u.html", null ], + [ "v", "functions_v.html", null ], + [ "w", "functions_w.html", null ], + [ "x", "functions_x.html", null ], + [ "y", "functions_y.html", null ], + [ "z", "functions_z.html", null ], + [ "~", "functions_~.html", null ] +]; \ No newline at end of file diff --git a/functions_e.html b/functions_e.html new file mode 100644 index 000000000..267614415 --- /dev/null +++ b/functions_e.html @@ -0,0 +1,223 @@ + + + + + + + + +FTXUI: Class Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- e -

+
+
+ + + + + diff --git a/functions_enum.html b/functions_enum.html new file mode 100644 index 000000000..7aea0c52e --- /dev/null +++ b/functions_enum.html @@ -0,0 +1,218 @@ + + + + + + + + +FTXUI: Class Members - Enumerations + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all enums with links to the classes they belong to:
+
+
+ + + + + diff --git a/functions_eval.html b/functions_eval.html new file mode 100644 index 000000000..4e9765697 --- /dev/null +++ b/functions_eval.html @@ -0,0 +1,212 @@ + + + + + + + + +FTXUI: Class Members - Enumerator + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all enum values with links to the classes they belong to:
+ +

- a -

+
+
+ + + + + diff --git a/functions_eval.js b/functions_eval.js new file mode 100644 index 000000000..0a0baa99c --- /dev/null +++ b/functions_eval.js @@ -0,0 +1,23 @@ +var functions_eval = +[ + [ "a", "functions_eval.html", null ], + [ "b", "functions_eval_b.html", null ], + [ "c", "functions_eval_c.html", null ], + [ "d", "functions_eval_d.html", null ], + [ "g", "functions_eval_g.html", null ], + [ "h", "functions_eval_h.html", null ], + [ "i", "functions_eval_i.html", null ], + [ "k", "functions_eval_k.html", null ], + [ "l", "functions_eval_l.html", null ], + [ "m", "functions_eval_m.html", null ], + [ "n", "functions_eval_n.html", null ], + [ "o", "functions_eval_o.html", null ], + [ "p", "functions_eval_p.html", null ], + [ "r", "functions_eval_r.html", null ], + [ "s", "functions_eval_s.html", null ], + [ "t", "functions_eval_t.html", null ], + [ "u", "functions_eval_u.html", null ], + [ "v", "functions_eval_v.html", null ], + [ "w", "functions_eval_w.html", null ], + [ "y", "functions_eval_y.html", null ] +]; \ No newline at end of file diff --git a/functions_eval_b.html b/functions_eval_b.html new file mode 100644 index 000000000..d92d0116b --- /dev/null +++ b/functions_eval_b.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: Class Members - Enumerator + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all enum values with links to the classes they belong to:
+ +

- b -

+
+
+ + + + + diff --git a/functions_eval_c.html b/functions_eval_c.html new file mode 100644 index 000000000..6a9e40d3e --- /dev/null +++ b/functions_eval_c.html @@ -0,0 +1,224 @@ + + + + + + + + +FTXUI: Class Members - Enumerator + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all enum values with links to the classes they belong to:
+ +

- c -

+
+
+ + + + + diff --git a/functions_eval_d.html b/functions_eval_d.html new file mode 100644 index 000000000..45272a468 --- /dev/null +++ b/functions_eval_d.html @@ -0,0 +1,261 @@ + + + + + + + + +FTXUI: Class Members - Enumerator + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all enum values with links to the classes they belong to:
+ +

- d -

+
+
+ + + + + diff --git a/functions_eval_g.html b/functions_eval_g.html new file mode 100644 index 000000000..023dec60b --- /dev/null +++ b/functions_eval_g.html @@ -0,0 +1,252 @@ + + + + + + + + +FTXUI: Class Members - Enumerator + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all enum values with links to the classes they belong to:
+ +

- g -

+
+
+ + + + + diff --git a/functions_eval_h.html b/functions_eval_h.html new file mode 100644 index 000000000..9266f86a0 --- /dev/null +++ b/functions_eval_h.html @@ -0,0 +1,216 @@ + + + + + + + + +FTXUI: Class Members - Enumerator + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all enum values with links to the classes they belong to:
+ +

- h -

+
+
+ + + + + diff --git a/functions_eval_i.html b/functions_eval_i.html new file mode 100644 index 000000000..d97d62098 --- /dev/null +++ b/functions_eval_i.html @@ -0,0 +1,213 @@ + + + + + + + + +FTXUI: Class Members - Enumerator + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all enum values with links to the classes they belong to:
+ +

- i -

+
+
+ + + + + diff --git a/functions_eval_k.html b/functions_eval_k.html new file mode 100644 index 000000000..394dec9d3 --- /dev/null +++ b/functions_eval_k.html @@ -0,0 +1,211 @@ + + + + + + + + +FTXUI: Class Members - Enumerator + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all enum values with links to the classes they belong to:
+ +

- k -

+
+
+ + + + + diff --git a/functions_eval_l.html b/functions_eval_l.html new file mode 100644 index 000000000..0283d6e95 --- /dev/null +++ b/functions_eval_l.html @@ -0,0 +1,236 @@ + + + + + + + + +FTXUI: Class Members - Enumerator + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all enum values with links to the classes they belong to:
+ +

- l -

    +
  • Left : Mouse
  • +
  • LightCoral : Color
  • +
  • LightCyan1Bis : Color
  • +
  • LightCyan3 : Color
  • +
  • LightGoldenrod1 : Color
  • +
  • LightGoldenrod2 : Color
  • +
  • LightGoldenrod2Bis : Color
  • +
  • LightGoldenrod2Ter : Color
  • +
  • LightGoldenrod3 : Color
  • +
  • LightGreen : Color
  • +
  • LightGreenBis : Color
  • +
  • LightPink1 : Color
  • +
  • LightPink3 : Color
  • +
  • LightPink4 : Color
  • +
  • LightSalmon1 : Color
  • +
  • LightSalmon3 : Color
  • +
  • LightSalmon3Bis : Color
  • +
  • LightSeaGreen : Color
  • +
  • LightSkyBlue1 : Color
  • +
  • LightSkyBlue3 : Color
  • +
  • LightSkyBlue3Bis : Color
  • +
  • LightSlateBlue : Color
  • +
  • LightSlateGrey : Color
  • +
  • LightSteelBlue : Color
  • +
  • LightSteelBlue1 : Color
  • +
  • LightSteelBlue3 : Color
  • +
  • LightYellow3 : Color
  • +
+
+
+ + + + + diff --git a/functions_eval_m.html b/functions_eval_m.html new file mode 100644 index 000000000..99724c763 --- /dev/null +++ b/functions_eval_m.html @@ -0,0 +1,235 @@ + + + + + + + + +FTXUI: Class Members - Enumerator + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all enum values with links to the classes they belong to:
+ +

- m -

+
+
+ + + + + diff --git a/functions_eval_n.html b/functions_eval_n.html new file mode 100644 index 000000000..50502864d --- /dev/null +++ b/functions_eval_n.html @@ -0,0 +1,213 @@ + + + + + + + + +FTXUI: Class Members - Enumerator + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all enum values with links to the classes they belong to:
+ +

- n -

+
+
+ + + + + diff --git a/functions_eval_o.html b/functions_eval_o.html new file mode 100644 index 000000000..be994a26a --- /dev/null +++ b/functions_eval_o.html @@ -0,0 +1,217 @@ + + + + + + + + +FTXUI: Class Members - Enumerator + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all enum values with links to the classes they belong to:
+ +

- o -

+
+
+ + + + + diff --git a/functions_eval_p.html b/functions_eval_p.html new file mode 100644 index 000000000..672382d88 --- /dev/null +++ b/functions_eval_p.html @@ -0,0 +1,228 @@ + + + + + + + + +FTXUI: Class Members - Enumerator + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all enum values with links to the classes they belong to:
+ +

- p -

+
+
+ + + + + diff --git a/functions_eval_r.html b/functions_eval_r.html new file mode 100644 index 000000000..69155a955 --- /dev/null +++ b/functions_eval_r.html @@ -0,0 +1,218 @@ + + + + + + + + +FTXUI: Class Members - Enumerator + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all enum values with links to the classes they belong to:
+ +

- r -

+
+
+ + + + + diff --git a/functions_eval_s.html b/functions_eval_s.html new file mode 100644 index 000000000..038323fb9 --- /dev/null +++ b/functions_eval_s.html @@ -0,0 +1,231 @@ + + + + + + + + +FTXUI: Class Members - Enumerator + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all enum values with links to the classes they belong to:
+ +

- s -

+
+
+ + + + + diff --git a/functions_eval_t.html b/functions_eval_t.html new file mode 100644 index 000000000..c695105bc --- /dev/null +++ b/functions_eval_t.html @@ -0,0 +1,214 @@ + + + + + + + + +FTXUI: Class Members - Enumerator + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all enum values with links to the classes they belong to:
+ +

- t -

+
+
+ + + + + diff --git a/functions_eval_u.html b/functions_eval_u.html new file mode 100644 index 000000000..16b79e104 --- /dev/null +++ b/functions_eval_u.html @@ -0,0 +1,211 @@ + + + + + + + + +FTXUI: Class Members - Enumerator + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all enum values with links to the classes they belong to:
+ +

- u -

+
+
+ + + + + diff --git a/functions_eval_v.html b/functions_eval_v.html new file mode 100644 index 000000000..b37b58701 --- /dev/null +++ b/functions_eval_v.html @@ -0,0 +1,210 @@ + + + + + + + + +FTXUI: Class Members - Enumerator + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all enum values with links to the classes they belong to:
+ +

- v -

+
+
+ + + + + diff --git a/functions_eval_w.html b/functions_eval_w.html new file mode 100644 index 000000000..4537961cd --- /dev/null +++ b/functions_eval_w.html @@ -0,0 +1,216 @@ + + + + + + + + +FTXUI: Class Members - Enumerator + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all enum values with links to the classes they belong to:
+ +

- w -

+
+
+ + + + + diff --git a/functions_eval_y.html b/functions_eval_y.html new file mode 100644 index 000000000..2d1f425af --- /dev/null +++ b/functions_eval_y.html @@ -0,0 +1,217 @@ + + + + + + + + +FTXUI: Class Members - Enumerator + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all enum values with links to the classes they belong to:
+ +

- y -

+
+
+ + + + + diff --git a/functions_f.html b/functions_f.html new file mode 100644 index 000000000..15d65631a --- /dev/null +++ b/functions_f.html @@ -0,0 +1,246 @@ + + + + + + + + +FTXUI: Class Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- f -

+
+
+ + + + + diff --git a/functions_func.html b/functions_func.html new file mode 100644 index 000000000..4fd4e0ad9 --- /dev/null +++ b/functions_func.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: Class Members - Functions + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all functions with links to the classes they belong to:
+ +

- a -

+
+
+ + + + + diff --git a/functions_func.js b/functions_func.js new file mode 100644 index 000000000..58f8dc287 --- /dev/null +++ b/functions_func.js @@ -0,0 +1,24 @@ +var functions_func = +[ + [ "a", "functions_func.html", null ], + [ "b", "functions_func_b.html", null ], + [ "c", "functions_func_c.html", null ], + [ "d", "functions_func_d.html", null ], + [ "e", "functions_func_e.html", null ], + [ "f", "functions_func_f.html", null ], + [ "g", "functions_func_g.html", null ], + [ "h", "functions_func_h.html", null ], + [ "i", "functions_func_i.html", null ], + [ "l", "functions_func_l.html", null ], + [ "m", "functions_func_m.html", null ], + [ "n", "functions_func_n.html", null ], + [ "o", "functions_func_o.html", null ], + [ "p", "functions_func_p.html", null ], + [ "r", "functions_func_r.html", null ], + [ "s", "functions_func_s.html", null ], + [ "t", "functions_func_t.html", null ], + [ "u", "functions_func_u.html", null ], + [ "v", "functions_func_v.html", null ], + [ "w", "functions_func_w.html", null ], + [ "~", "functions_func_~.html", null ] +]; \ No newline at end of file diff --git a/functions_func_b.html b/functions_func_b.html new file mode 100644 index 000000000..9de746af3 --- /dev/null +++ b/functions_func_b.html @@ -0,0 +1,215 @@ + + + + + + + + +FTXUI: Class Members - Functions + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all functions with links to the classes they belong to:
+ +

- b -

+
+
+ + + + + diff --git a/functions_func_c.html b/functions_func_c.html new file mode 100644 index 000000000..665bcae1d --- /dev/null +++ b/functions_func_c.html @@ -0,0 +1,234 @@ + + + + + + + + +FTXUI: Class Members - Functions + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all functions with links to the classes they belong to:
+ +

- c -

+
+
+ + + + + diff --git a/functions_func_d.html b/functions_func_d.html new file mode 100644 index 000000000..9b6d47afc --- /dev/null +++ b/functions_func_d.html @@ -0,0 +1,243 @@ + + + + + + + + +FTXUI: Class Members - Functions + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all functions with links to the classes they belong to:
+ +

- d -

+
+
+ + + + + diff --git a/functions_func_e.html b/functions_func_e.html new file mode 100644 index 000000000..b3f6f6f3d --- /dev/null +++ b/functions_func_e.html @@ -0,0 +1,212 @@ + + + + + + + + +FTXUI: Class Members - Functions + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all functions with links to the classes they belong to:
+ +

- e -

+
+
+ + + + + diff --git a/functions_func_f.html b/functions_func_f.html new file mode 100644 index 000000000..ccfe829e3 --- /dev/null +++ b/functions_func_f.html @@ -0,0 +1,218 @@ + + + + + + + + +FTXUI: Class Members - Functions + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all functions with links to the classes they belong to:
+ +

- f -

+
+
+ + + + + diff --git a/functions_func_g.html b/functions_func_g.html new file mode 100644 index 000000000..5d550dfc0 --- /dev/null +++ b/functions_func_g.html @@ -0,0 +1,216 @@ + + + + + + + + +FTXUI: Class Members - Functions + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all functions with links to the classes they belong to:
+ +

- g -

+
+
+ + + + + diff --git a/functions_func_h.html b/functions_func_h.html new file mode 100644 index 000000000..36c7d876d --- /dev/null +++ b/functions_func_h.html @@ -0,0 +1,218 @@ + + + + + + + + +FTXUI: Class Members - Functions + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all functions with links to the classes they belong to:
+ +

- h -

+
+
+ + + + + diff --git a/functions_func_i.html b/functions_func_i.html new file mode 100644 index 000000000..d140f4794 --- /dev/null +++ b/functions_func_i.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: Class Members - Functions + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all functions with links to the classes they belong to:
+ +

- i -

+
+
+ + + + + diff --git a/functions_func_l.html b/functions_func_l.html new file mode 100644 index 000000000..6e0b561fc --- /dev/null +++ b/functions_func_l.html @@ -0,0 +1,211 @@ + + + + + + + + +FTXUI: Class Members - Functions + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all functions with links to the classes they belong to:
+ +

- l -

+
+
+ + + + + diff --git a/functions_func_m.html b/functions_func_m.html new file mode 100644 index 000000000..5c00351b8 --- /dev/null +++ b/functions_func_m.html @@ -0,0 +1,212 @@ + + + + + + + + +FTXUI: Class Members - Functions + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all functions with links to the classes they belong to:
+ +

- m -

+
+
+ + + + + diff --git a/functions_func_n.html b/functions_func_n.html new file mode 100644 index 000000000..ff05eac8f --- /dev/null +++ b/functions_func_n.html @@ -0,0 +1,211 @@ + + + + + + + + +FTXUI: Class Members - Functions + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all functions with links to the classes they belong to:
+ +

- n -

+
+
+ + + + + diff --git a/functions_func_o.html b/functions_func_o.html new file mode 100644 index 000000000..d8263cb2e --- /dev/null +++ b/functions_func_o.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: Class Members - Functions + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all functions with links to the classes they belong to:
+ +

- o -

+
+
+ + + + + diff --git a/functions_func_p.html b/functions_func_p.html new file mode 100644 index 000000000..75f7e92e4 --- /dev/null +++ b/functions_func_p.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: Class Members - Functions + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all functions with links to the classes they belong to:
+ +

- p -

+
+
+ + + + + diff --git a/functions_func_r.html b/functions_func_r.html new file mode 100644 index 000000000..416667192 --- /dev/null +++ b/functions_func_r.html @@ -0,0 +1,224 @@ + + + + + + + + +FTXUI: Class Members - Functions + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all functions with links to the classes they belong to:
+ +

- r -

+
+
+ + + + + diff --git a/functions_func_s.html b/functions_func_s.html new file mode 100644 index 000000000..cec508c50 --- /dev/null +++ b/functions_func_s.html @@ -0,0 +1,245 @@ + + + + + + + + +FTXUI: Class Members - Functions + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all functions with links to the classes they belong to:
+ +

- s -

+
+
+ + + + + diff --git a/functions_func_t.html b/functions_func_t.html new file mode 100644 index 000000000..3cc12e597 --- /dev/null +++ b/functions_func_t.html @@ -0,0 +1,219 @@ + + + + + + + + +FTXUI: Class Members - Functions + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all functions with links to the classes they belong to:
+ +

- t -

+
+
+ + + + + diff --git a/functions_func_u.html b/functions_func_u.html new file mode 100644 index 000000000..9e21e1214 --- /dev/null +++ b/functions_func_u.html @@ -0,0 +1,210 @@ + + + + + + + + +FTXUI: Class Members - Functions + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all functions with links to the classes they belong to:
+ +

- u -

    +
  • Union() : Box
  • +
+
+
+ + + + + diff --git a/functions_func_v.html b/functions_func_v.html new file mode 100644 index 000000000..a82fc1330 --- /dev/null +++ b/functions_func_v.html @@ -0,0 +1,211 @@ + + + + + + + + +FTXUI: Class Members - Functions + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all functions with links to the classes they belong to:
+ +

- v -

+
+
+ + + + + diff --git a/functions_func_w.html b/functions_func_w.html new file mode 100644 index 000000000..f0584503a --- /dev/null +++ b/functions_func_w.html @@ -0,0 +1,211 @@ + + + + + + + + +FTXUI: Class Members - Functions + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all functions with links to the classes they belong to:
+ +

- w -

+
+
+ + + + + diff --git a/functions_func_~.html b/functions_func_~.html new file mode 100644 index 000000000..536d94874 --- /dev/null +++ b/functions_func_~.html @@ -0,0 +1,223 @@ + + + + + + + + +FTXUI: Class Members - Functions + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all functions with links to the classes they belong to:
+ +

- ~ -

+
+
+ + + + + diff --git a/functions_g.html b/functions_g.html new file mode 100644 index 000000000..70023d728 --- /dev/null +++ b/functions_g.html @@ -0,0 +1,264 @@ + + + + + + + + +FTXUI: Class Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- g -

+
+
+ + + + + diff --git a/functions_h.html b/functions_h.html new file mode 100644 index 000000000..46cc82702 --- /dev/null +++ b/functions_h.html @@ -0,0 +1,236 @@ + + + + + + + + +FTXUI: Class Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- h -

+
+
+ + + + + diff --git a/functions_i.html b/functions_i.html new file mode 100644 index 000000000..248137fc7 --- /dev/null +++ b/functions_i.html @@ -0,0 +1,238 @@ + + + + + + + + +FTXUI: Class Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- i -

+
+
+ + + + + diff --git a/functions_j.html b/functions_j.html new file mode 100644 index 000000000..50866170a --- /dev/null +++ b/functions_j.html @@ -0,0 +1,213 @@ + + + + + + + + +FTXUI: Class Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- j -

+
+
+ + + + + diff --git a/functions_k.html b/functions_k.html new file mode 100644 index 000000000..2b669dd75 --- /dev/null +++ b/functions_k.html @@ -0,0 +1,213 @@ + + + + + + + + +FTXUI: Class Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- k -

+
+
+ + + + + diff --git a/functions_l.html b/functions_l.html new file mode 100644 index 000000000..36bb3abe1 --- /dev/null +++ b/functions_l.html @@ -0,0 +1,248 @@ + + + + + + + + +FTXUI: Class Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- l -

+
+
+ + + + + diff --git a/functions_m.html b/functions_m.html new file mode 100644 index 000000000..906593218 --- /dev/null +++ b/functions_m.html @@ -0,0 +1,254 @@ + + + + + + + + +FTXUI: Class Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- m -

+
+
+ + + + + diff --git a/functions_n.html b/functions_n.html new file mode 100644 index 000000000..3a7dbdab0 --- /dev/null +++ b/functions_n.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: Class Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- n -

+
+
+ + + + + diff --git a/functions_o.html b/functions_o.html new file mode 100644 index 000000000..9b077369a --- /dev/null +++ b/functions_o.html @@ -0,0 +1,235 @@ + + + + + + + + +FTXUI: Class Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- o -

+
+
+ + + + + diff --git a/functions_p.html b/functions_p.html new file mode 100644 index 000000000..06f59c359 --- /dev/null +++ b/functions_p.html @@ -0,0 +1,251 @@ + + + + + + + + +FTXUI: Class Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- p -

+
+
+ + + + + diff --git a/functions_q.html b/functions_q.html new file mode 100644 index 000000000..72b413062 --- /dev/null +++ b/functions_q.html @@ -0,0 +1,211 @@ + + + + + + + + +FTXUI: Class Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- q -

+
+
+ + + + + diff --git a/functions_r.html b/functions_r.html new file mode 100644 index 000000000..ab1bf9044 --- /dev/null +++ b/functions_r.html @@ -0,0 +1,245 @@ + + + + + + + + +FTXUI: Class Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- r -

+
+
+ + + + + diff --git a/functions_rela.html b/functions_rela.html new file mode 100644 index 000000000..df9e49be7 --- /dev/null +++ b/functions_rela.html @@ -0,0 +1,208 @@ + + + + + + + + +FTXUI: Class Members - Related Symbols + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all related symbols with links to the classes they belong to:
+
+
+ + + + + diff --git a/functions_s.html b/functions_s.html new file mode 100644 index 000000000..6a1c7d53b --- /dev/null +++ b/functions_s.html @@ -0,0 +1,285 @@ + + + + + + + + +FTXUI: Class Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- s -

+
+
+ + + + + diff --git a/functions_t.html b/functions_t.html new file mode 100644 index 000000000..cf5a2a357 --- /dev/null +++ b/functions_t.html @@ -0,0 +1,233 @@ + + + + + + + + +FTXUI: Class Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- t -

+
+
+ + + + + diff --git a/functions_type.html b/functions_type.html new file mode 100644 index 000000000..228cbff6d --- /dev/null +++ b/functions_type.html @@ -0,0 +1,211 @@ + + + + + + + + +FTXUI: Class Members - Typedefs + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all typedefs with links to the classes they belong to:
+
+
+ + + + + diff --git a/functions_u.html b/functions_u.html new file mode 100644 index 000000000..2e17ea4ce --- /dev/null +++ b/functions_u.html @@ -0,0 +1,217 @@ + + + + + + + + +FTXUI: Class Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- u -

+
+
+ + + + + diff --git a/functions_v.html b/functions_v.html new file mode 100644 index 000000000..6bbc8876c --- /dev/null +++ b/functions_v.html @@ -0,0 +1,216 @@ + + + + + + + + +FTXUI: Class Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- v -

+
+
+ + + + + diff --git a/functions_vars.html b/functions_vars.html new file mode 100644 index 000000000..a00f49740 --- /dev/null +++ b/functions_vars.html @@ -0,0 +1,251 @@ + + + + + + + + +FTXUI: Class Members - Variables + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the classes they belong to:
+ +

- a -

+
+
+ + + + + diff --git a/functions_vars.js b/functions_vars.js new file mode 100644 index 000000000..f7307cc5f --- /dev/null +++ b/functions_vars.js @@ -0,0 +1,29 @@ +var functions_vars = +[ + [ "a", "functions_vars.html", null ], + [ "b", "functions_vars_b.html", null ], + [ "c", "functions_vars_c.html", null ], + [ "d", "functions_vars_d.html", null ], + [ "e", "functions_vars_e.html", null ], + [ "f", "functions_vars_f.html", null ], + [ "g", "functions_vars_g.html", null ], + [ "h", "functions_vars_h.html", null ], + [ "i", "functions_vars_i.html", null ], + [ "j", "functions_vars_j.html", null ], + [ "k", "functions_vars_k.html", null ], + [ "l", "functions_vars_l.html", null ], + [ "m", "functions_vars_m.html", null ], + [ "n", "functions_vars_n.html", null ], + [ "o", "functions_vars_o.html", null ], + [ "p", "functions_vars_p.html", null ], + [ "q", "functions_vars_q.html", null ], + [ "r", "functions_vars_r.html", null ], + [ "s", "functions_vars_s.html", null ], + [ "t", "functions_vars_t.html", null ], + [ "u", "functions_vars_u.html", null ], + [ "v", "functions_vars_v.html", null ], + [ "w", "functions_vars_w.html", null ], + [ "x", "functions_vars_x.html", null ], + [ "y", "functions_vars_y.html", null ], + [ "z", "functions_vars_z.html", null ] +]; \ No newline at end of file diff --git a/functions_vars_b.html b/functions_vars_b.html new file mode 100644 index 000000000..34ac6743c --- /dev/null +++ b/functions_vars_b.html @@ -0,0 +1,222 @@ + + + + + + + + +FTXUI: Class Members - Variables + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the classes they belong to:
+ +

- b -

+
+
+ + + + + diff --git a/functions_vars_c.html b/functions_vars_c.html new file mode 100644 index 000000000..787ca1101 --- /dev/null +++ b/functions_vars_c.html @@ -0,0 +1,279 @@ + + + + + + + + +FTXUI: Class Members - Variables + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the classes they belong to:
+ +

- c -

+
+
+ + + + + diff --git a/functions_vars_d.html b/functions_vars_d.html new file mode 100644 index 000000000..66ee67200 --- /dev/null +++ b/functions_vars_d.html @@ -0,0 +1,222 @@ + + + + + + + + +FTXUI: Class Members - Variables + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the classes they belong to:
+ +

- d -

+
+
+ + + + + diff --git a/functions_vars_e.html b/functions_vars_e.html new file mode 100644 index 000000000..acb35ccb1 --- /dev/null +++ b/functions_vars_e.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: Class Members - Variables + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the classes they belong to:
+ +

- e -

+
+
+ + + + + diff --git a/functions_vars_f.html b/functions_vars_f.html new file mode 100644 index 000000000..63e17c267 --- /dev/null +++ b/functions_vars_f.html @@ -0,0 +1,237 @@ + + + + + + + + +FTXUI: Class Members - Variables + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the classes they belong to:
+ +

- f -

+
+
+ + + + + diff --git a/functions_vars_g.html b/functions_vars_g.html new file mode 100644 index 000000000..e0208d5dc --- /dev/null +++ b/functions_vars_g.html @@ -0,0 +1,214 @@ + + + + + + + + +FTXUI: Class Members - Variables + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the classes they belong to:
+ +

- g -

+
+
+ + + + + diff --git a/functions_vars_h.html b/functions_vars_h.html new file mode 100644 index 000000000..60a19d42c --- /dev/null +++ b/functions_vars_h.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: Class Members - Variables + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the classes they belong to:
+ +

- h -

+
+
+ + + + + diff --git a/functions_vars_i.html b/functions_vars_i.html new file mode 100644 index 000000000..82c642a9d --- /dev/null +++ b/functions_vars_i.html @@ -0,0 +1,223 @@ + + + + + + + + +FTXUI: Class Members - Variables + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the classes they belong to:
+ +

- i -

+
+
+ + + + + diff --git a/functions_vars_j.html b/functions_vars_j.html new file mode 100644 index 000000000..225d1db43 --- /dev/null +++ b/functions_vars_j.html @@ -0,0 +1,212 @@ + + + + + + + + +FTXUI: Class Members - Variables + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the classes they belong to:
+ +

- j -

+
+
+ + + + + diff --git a/functions_vars_k.html b/functions_vars_k.html new file mode 100644 index 000000000..34591a148 --- /dev/null +++ b/functions_vars_k.html @@ -0,0 +1,211 @@ + + + + + + + + +FTXUI: Class Members - Variables + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the classes they belong to:
+ +

- k -

+
+
+ + + + + diff --git a/functions_vars_l.html b/functions_vars_l.html new file mode 100644 index 000000000..3d4c012f1 --- /dev/null +++ b/functions_vars_l.html @@ -0,0 +1,219 @@ + + + + + + + + +FTXUI: Class Members - Variables + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the classes they belong to:
+ +

- l -

+
+
+ + + + + diff --git a/functions_vars_m.html b/functions_vars_m.html new file mode 100644 index 000000000..c0ac0c101 --- /dev/null +++ b/functions_vars_m.html @@ -0,0 +1,224 @@ + + + + + + + + +FTXUI: Class Members - Variables + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the classes they belong to:
+ +

- m -

+
+
+ + + + + diff --git a/functions_vars_n.html b/functions_vars_n.html new file mode 100644 index 000000000..c71321f82 --- /dev/null +++ b/functions_vars_n.html @@ -0,0 +1,214 @@ + + + + + + + + +FTXUI: Class Members - Variables + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the classes they belong to:
+ +

- n -

+
+
+ + + + + diff --git a/functions_vars_o.html b/functions_vars_o.html new file mode 100644 index 000000000..a910743c9 --- /dev/null +++ b/functions_vars_o.html @@ -0,0 +1,216 @@ + + + + + + + + +FTXUI: Class Members - Variables + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the classes they belong to:
+ +

- o -

+
+
+ + + + + diff --git a/functions_vars_p.html b/functions_vars_p.html new file mode 100644 index 000000000..8ee8b2689 --- /dev/null +++ b/functions_vars_p.html @@ -0,0 +1,218 @@ + + + + + + + + +FTXUI: Class Members - Variables + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the classes they belong to:
+ +

- p -

+
+
+ + + + + diff --git a/functions_vars_q.html b/functions_vars_q.html new file mode 100644 index 000000000..039b13c07 --- /dev/null +++ b/functions_vars_q.html @@ -0,0 +1,211 @@ + + + + + + + + +FTXUI: Class Members - Variables + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the classes they belong to:
+ +

- q -

+
+
+ + + + + diff --git a/functions_vars_r.html b/functions_vars_r.html new file mode 100644 index 000000000..255200905 --- /dev/null +++ b/functions_vars_r.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: Class Members - Variables + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the classes they belong to:
+ +

- r -

+
+
+ + + + + diff --git a/functions_vars_s.html b/functions_vars_s.html new file mode 100644 index 000000000..854843929 --- /dev/null +++ b/functions_vars_s.html @@ -0,0 +1,225 @@ + + + + + + + + +FTXUI: Class Members - Variables + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the classes they belong to:
+ +

- s -

+
+
+ + + + + diff --git a/functions_vars_t.html b/functions_vars_t.html new file mode 100644 index 000000000..4b8c7d1cb --- /dev/null +++ b/functions_vars_t.html @@ -0,0 +1,218 @@ + + + + + + + + +FTXUI: Class Members - Variables + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the classes they belong to:
+ +

- t -

+
+
+ + + + + diff --git a/functions_vars_u.html b/functions_vars_u.html new file mode 100644 index 000000000..2c189be67 --- /dev/null +++ b/functions_vars_u.html @@ -0,0 +1,214 @@ + + + + + + + + +FTXUI: Class Members - Variables + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the classes they belong to:
+ +

- u -

+
+
+ + + + + diff --git a/functions_vars_v.html b/functions_vars_v.html new file mode 100644 index 000000000..f2d08da79 --- /dev/null +++ b/functions_vars_v.html @@ -0,0 +1,212 @@ + + + + + + + + +FTXUI: Class Members - Variables + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the classes they belong to:
+ +

- v -

+
+
+ + + + + diff --git a/functions_vars_w.html b/functions_vars_w.html new file mode 100644 index 000000000..71f9d86a9 --- /dev/null +++ b/functions_vars_w.html @@ -0,0 +1,213 @@ + + + + + + + + +FTXUI: Class Members - Variables + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the classes they belong to:
+ +

- w -

+
+
+ + + + + diff --git a/functions_vars_x.html b/functions_vars_x.html new file mode 100644 index 000000000..301bdf8fb --- /dev/null +++ b/functions_vars_x.html @@ -0,0 +1,213 @@ + + + + + + + + +FTXUI: Class Members - Variables + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the classes they belong to:
+ +

- x -

+
+
+ + + + + diff --git a/functions_vars_y.html b/functions_vars_y.html new file mode 100644 index 000000000..1db2b5615 --- /dev/null +++ b/functions_vars_y.html @@ -0,0 +1,213 @@ + + + + + + + + +FTXUI: Class Members - Variables + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the classes they belong to:
+ +

- y -

+
+
+ + + + + diff --git a/functions_vars_z.html b/functions_vars_z.html new file mode 100644 index 000000000..f83216b7f --- /dev/null +++ b/functions_vars_z.html @@ -0,0 +1,211 @@ + + + + + + + + +FTXUI: Class Members - Variables + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the classes they belong to:
+ +

- z -

+
+
+ + + + + diff --git a/functions_w.html b/functions_w.html new file mode 100644 index 000000000..0546b3a28 --- /dev/null +++ b/functions_w.html @@ -0,0 +1,222 @@ + + + + + + + + +FTXUI: Class Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- w -

+
+
+ + + + + diff --git a/functions_x.html b/functions_x.html new file mode 100644 index 000000000..04bd60326 --- /dev/null +++ b/functions_x.html @@ -0,0 +1,213 @@ + + + + + + + + +FTXUI: Class Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- x -

+
+
+ + + + + diff --git a/functions_y.html b/functions_y.html new file mode 100644 index 000000000..cbd9b260b --- /dev/null +++ b/functions_y.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: Class Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- y -

+
+
+ + + + + diff --git a/functions_z.html b/functions_z.html new file mode 100644 index 000000000..b40864d10 --- /dev/null +++ b/functions_z.html @@ -0,0 +1,211 @@ + + + + + + + + +FTXUI: Class Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- z -

+
+
+ + + + + diff --git a/functions_~.html b/functions_~.html new file mode 100644 index 000000000..9a36af5ad --- /dev/null +++ b/functions_~.html @@ -0,0 +1,223 @@ + + + + + + + + +FTXUI: Class Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all class members with links to the classes they belong to:
+ +

- ~ -

+
+
+ + + + + diff --git a/gallery_8cpp.html b/gallery_8cpp.html new file mode 100644 index 000000000..d11ef9ea9 --- /dev/null +++ b/gallery_8cpp.html @@ -0,0 +1,266 @@ + + + + + + + + +FTXUI: gallery.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
gallery.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + +

+Functions

Component Wrap (std::string name, Component component)
 
int main ()
 
+

Function Documentation

+ +

◆ Wrap()

+ +
+
+ + + + + + + + + + + +
Component Wrap (std::string name,
Component component )
+
+
Examples
examples/component/gallery.cpp.
+
+ +

Definition at line 18 of file gallery.cpp.

+ +
+
+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 29 of file gallery.cpp.

+ +
+
+
+
+ + + + + diff --git a/gallery_8cpp.js b/gallery_8cpp.js new file mode 100644 index 000000000..072faa9bd --- /dev/null +++ b/gallery_8cpp.js @@ -0,0 +1,5 @@ +var gallery_8cpp = +[ + [ "Wrap", "gallery_8cpp.html#a0a320000c5a485508c57030f605b800a", null ], + [ "main", "gallery_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/gallery_8cpp_source.html b/gallery_8cpp_source.html new file mode 100644 index 000000000..2605f9f27 --- /dev/null +++ b/gallery_8cpp_source.html @@ -0,0 +1,398 @@ + + + + + + + + +FTXUI: gallery.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
gallery.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <functional> // for function
+
5#include <memory> // for shared_ptr, allocator, __shared_ptr_access
+
6#include <string> // for string, basic_string
+
7#include <vector> // for vector
+
8
+
9#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
10#include "ftxui/component/component.hpp" // for Slider, Checkbox, Vertical, Renderer, Button, Input, Menu, Radiobox, Toggle
+
11#include "ftxui/component/component_base.hpp" // for ComponentBase
+
12#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
+
13#include "ftxui/dom/elements.hpp" // for separator, operator|, Element, size, xflex, text, WIDTH, hbox, vbox, EQUAL, border, GREATER_THAN
+
14
+
15using namespace ftxui;
+
16
+
17// Display a component nicely with a title on the left.
+
+
18Component Wrap(std::string name, Component component) {
+
19 return Renderer(component, [name, component] {
+
20 return hbox({
+
21 text(name) | size(WIDTH, EQUAL, 8),
+
22 separator(),
+
23 component->Render() | xflex,
+
24 }) |
+
25 xflex;
+
26 });
+
27}
+
+
28
+
+
29int main() {
+
30 auto screen = ScreenInteractive::FitComponent();
+
31
+
32 // -- Menu
+
33 // ----------------------------------------------------------------------
+
34 const std::vector<std::string> menu_entries = {
+
35 "Menu 1",
+
36 "Menu 2",
+
37 "Menu 3",
+
38 "Menu 4",
+
39 };
+
40 int menu_selected = 0;
+
41 auto menu = Menu(&menu_entries, &menu_selected);
+
42 menu = Wrap("Menu", menu);
+
43
+
44 // -- Toggle------------------------------------------------------------------
+
45 int toggle_selected = 0;
+
46 std::vector<std::string> toggle_entries = {
+
47 "Toggle_1",
+
48 "Toggle_2",
+
49 };
+
50 auto toggle = Toggle(&toggle_entries, &toggle_selected);
+
51 toggle = Wrap("Toggle", toggle);
+
52
+
53 // -- Checkbox ---------------------------------------------------------------
+
54 bool checkbox_1_selected = false;
+
55 bool checkbox_2_selected = false;
+
56 bool checkbox_3_selected = false;
+
57 bool checkbox_4_selected = false;
+
58
+
59 auto checkboxes = Container::Vertical({
+
60 Checkbox("checkbox1", &checkbox_1_selected),
+
61 Checkbox("checkbox2", &checkbox_2_selected),
+
62 Checkbox("checkbox3", &checkbox_3_selected),
+
63 Checkbox("checkbox4", &checkbox_4_selected),
+
64 });
+
65 checkboxes = Wrap("Checkbox", checkboxes);
+
66
+
67 // -- Radiobox ---------------------------------------------------------------
+
68 int radiobox_selected = 0;
+
69 std::vector<std::string> radiobox_entries = {
+
70 "Radiobox 1",
+
71 "Radiobox 2",
+
72 "Radiobox 3",
+
73 "Radiobox 4",
+
74 };
+
75 auto radiobox = Radiobox(&radiobox_entries, &radiobox_selected);
+
76 radiobox = Wrap("Radiobox", radiobox);
+
77
+
78 // -- Input ------------------------------------------------------------------
+
79 std::string input_label;
+
80 auto input = Input(&input_label, "placeholder");
+
81 input = Wrap("Input", input);
+
82
+
83 // -- Button -----------------------------------------------------------------
+
84 std::string button_label = "Quit";
+
85 std::function<void()> on_button_clicked_;
+
86 auto button = Button(&button_label, screen.ExitLoopClosure());
+
87 button = Wrap("Button", button);
+
88
+
89 // -- Slider -----------------------------------------------------------------
+
90 int slider_value_1 = 12;
+
91 int slider_value_2 = 56;
+
92 int slider_value_3 = 128;
+
93 auto sliders = Container::Vertical({
+
94 Slider("R:", &slider_value_1, 0, 256, 1),
+
95 Slider("G:", &slider_value_2, 0, 256, 1),
+
96 Slider("B:", &slider_value_3, 0, 256, 1),
+
97 });
+
98 sliders = Wrap("Slider", sliders);
+
99
+
100 // A large text:
+
101 auto lorel_ipsum = Renderer([] {
+
102 return vbox({
+
103 text("Lorem ipsum dolor sit amet, consectetur adipiscing elit. "),
+
104 text("Sed do eiusmod tempor incididunt ut labore et dolore magna "
+
105 "aliqua. "),
+
106 text("Ut enim ad minim veniam, quis nostrud exercitation ullamco "
+
107 "laboris nisi ut aliquip ex ea commodo consequat. "),
+
108 text("Duis aute irure dolor in reprehenderit in voluptate velit esse "
+
109 "cillum dolore eu fugiat nulla pariatur. "),
+
110 text("Excepteur sint occaecat cupidatat non proident, sunt in culpa "
+
111 "qui officia deserunt mollit anim id est laborum. "),
+
112
+
113 });
+
114 });
+
115 lorel_ipsum = Wrap("Lorel Ipsum", lorel_ipsum);
+
116
+
117 // -- Layout
+
118 // -----------------------------------------------------------------
+
119 auto layout = Container::Vertical({
+
120 menu,
+
121 toggle,
+
122 checkboxes,
+
123 radiobox,
+
124 input,
+
125 sliders,
+
126 button,
+
127 lorel_ipsum,
+
128 });
+
129
+
130 auto component = Renderer(layout, [&] {
+
131 return vbox({
+
132 menu->Render(),
+
133 separator(),
+
134 toggle->Render(),
+
135 separator(),
+
136 checkboxes->Render(),
+
137 separator(),
+
138 radiobox->Render(),
+
139 separator(),
+
140 input->Render(),
+
141 separator(),
+
142 sliders->Render(),
+
143 separator(),
+
144 button->Render(),
+
145 separator(),
+
146 lorel_ipsum->Render(),
+
147 }) |
+
148 xflex | size(WIDTH, GREATER_THAN, 40) | border;
+
149 });
+
150
+
151 screen.Loop(component);
+
152
+
153 return 0;
+
154}
+
+ + + + +
Component Wrap(std::string name, Component component)
Definition gallery.cpp:18
+
int main()
Definition gallery.cpp:29
+
Element Render()
Draw the component. Build a ftxui::Element to be drawn on the ftxui::Screen representing this ftxui::...
+
static ScreenInteractive FitComponent()
+
Component Menu(MenuOption options)
A list of text. The focused element is selected.
+
Component Toggle(ConstStringListRef entries, int *selected)
An horizontal list of elements. The user can navigate through them.
+
Component Radiobox(RadioboxOption options)
A list of element, where only one can be selected.
+
Component Button(ButtonOption options)
Draw a button. Execute a function when clicked.
+
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
+
Component Vertical(Components children)
A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
+
Component Input(InputOption options={})
An input box for editing text.
+
Component Checkbox(CheckboxOption options)
Draw checkable element.
+
virtual void Render(Screen &screen)
Display an element on a ftxui::Screen.
Definition node.cpp:59
+
Element xflex(Element)
Expand/Minimize if possible/needed on the X axis.
Definition flex.cpp:129
+
Decorator size(WidthOrHeight, Constraint, int value)
Apply a constraint on the size of an element.
+
Element text(std::wstring text)
Display a piece of unicode text.
Definition text.cpp:160
+
Element separator()
Draw a vertical or horizontal separation in between two other elements.
+
Element border(Element)
Draw a border around the element.
+
Element vbox(Elements)
A container displaying elements vertically one by one.
Definition vbox.cpp:96
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
Element hbox(Elements)
A container displaying elements horizontally one by one.
Definition hbox.cpp:94
+
Component Slider(SliderOption< T > options)
A slider in any direction.
+ +
@ GREATER_THAN
Definition elements.hpp:162
+
std::shared_ptr< ComponentBase > Component
+ +
+
+ + + + + diff --git a/gauge__direction_8cpp.html b/gauge__direction_8cpp.html new file mode 100644 index 000000000..56785add7 --- /dev/null +++ b/gauge__direction_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: gauge_direction.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
gauge_direction.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 14 of file gauge_direction.cpp.

+ +
+
+
+
+ + + + + diff --git a/gauge__direction_8cpp.js b/gauge__direction_8cpp.js new file mode 100644 index 000000000..9b2057523 --- /dev/null +++ b/gauge__direction_8cpp.js @@ -0,0 +1,4 @@ +var gauge__direction_8cpp = +[ + [ "main", "gauge__direction_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/gauge__direction_8cpp_source.html b/gauge__direction_8cpp_source.html new file mode 100644 index 000000000..862b1d35d --- /dev/null +++ b/gauge__direction_8cpp_source.html @@ -0,0 +1,296 @@ + + + + + + + + +FTXUI: gauge_direction.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
gauge_direction.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2022 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <chrono> // for operator""s, chrono_literals
+
5#include <ftxui/dom/elements.hpp> // for filler, operator|, separator, text, border, Element, vbox, vtext, hbox, center, gaugeDown, gaugeLeft, gaugeRight, gaugeUp
+
6#include <ftxui/screen/screen.hpp> // for Screen
+
7#include <iostream> // for cout, endl, ostream
+
8#include <string> // for allocator, operator+, operator<<, string, to_string
+
9#include <thread> // for sleep_for
+
10
+
11#include "ftxui/dom/node.hpp" // for Render
+
12#include "ftxui/screen/color.hpp" // for ftxui
+
13
+
+
14int main() {
+
15 using namespace ftxui;
+
16 using namespace std::chrono_literals;
+
17
+
18 std::string reset_position;
+
19 for (float percentage = 0.0f; percentage <= 1.0f; percentage += 0.002f) {
+
20 std::string data_downloaded =
+
21 std::to_string(int(percentage * 5000)) + "/5000";
+
22
+
23 auto gauge_up = //
+
24 hbox({
+
25 vtext("gauge vertical"),
+
26 separator(),
+
27 gaugeUp(percentage),
+
28 }) |
+
29 border;
+
30
+
31 auto gauge_down = //
+
32 hbox({
+
33 vtext("gauge vertical"),
+
34 separator(),
+
35 gaugeDown(percentage),
+
36 }) |
+
37 border;
+
38
+
39 auto gauge_right = //
+
40 vbox({
+
41 text("gauge horizontal"),
+
42 separator(),
+
43 gaugeRight(percentage),
+
44 }) |
+
45 border;
+
46
+
47 auto gauge_left = //
+
48 vbox({
+
49 text("gauge horizontal"),
+
50 separator(),
+
51 gaugeLeft(percentage),
+
52 }) |
+
53 border;
+
54
+
55 auto document = hbox({
+
56 gauge_up,
+
57 filler(),
+
58 vbox({
+
59 gauge_right,
+
60 filler(),
+
61 text(data_downloaded) | border | center,
+
62 filler(),
+
63 gauge_left,
+
64 }),
+
65 filler(),
+
66 gauge_down,
+
67 });
+
68
+
69 auto screen = Screen(32, 16);
+
70 Render(screen, document);
+
71 std::cout << reset_position;
+
72 screen.Print();
+
73 reset_position = screen.ResetPosition();
+
74
+
75 std::this_thread::sleep_for(0.01s);
+
76 }
+
77 std::cout << std::endl;
+
78}
+
+ + +
int main()
+
A rectangular grid of Pixel.
Definition screen.hpp:26
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/getting-started.html b/getting-started.html new file mode 100644 index 000000000..1eefc5cba --- /dev/null +++ b/getting-started.html @@ -0,0 +1,268 @@ + + + + + + + + +FTXUI: Getting Started + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Getting Started
+
+
+

Table of Contents

+ +
+

title-img

+

+Install FTXUI

+

To set up FTXUI in your project, follow the installation guide, which provides instructions for multiple build systems and package managers.

+

+Minimal Example

+

Save the following code as main.cpp:

+
+ +
#include <iostream>
+
+
int main() {
+
using namespace ftxui;
+
+
Element document = hbox({
+
text("left") | border,
+
text("middle") | border | flex,
+
text("right") | border,
+
});
+
+
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
Render(screen, document);
+
screen.Print();
+
}
+ + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+ +

Build and run it using your preferred build system.
+ If unsure, start with one of the methods described in the installation page.

+

Expected output:

+
┌────┐┌────────────────────────────────────┐┌─────┐
+
│left││middle ││right│
+
└────┘└────────────────────────────────────┘└─────┘
+

+Starter Template

+

For a complete working project, clone the official starter repository:

+
git clone https://github.com/ArthurSonzogni/ftxui-starter
+

Follow the build instructions in the README.md of that repository.

+
+ + + + +
Previous Next
Introduction Modules
+
+
+
+ + + + + diff --git a/getting-started_8md.html b/getting-started_8md.html new file mode 100644 index 000000000..8b82a28d2 --- /dev/null +++ b/getting-started_8md.html @@ -0,0 +1,209 @@ + + + + + + + + +FTXUI: getting-started.md File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
getting-started.md File Reference
+
+
+
+
+ + + + + diff --git a/globals.html b/globals.html new file mode 100644 index 000000000..c310d8df6 --- /dev/null +++ b/globals.html @@ -0,0 +1,352 @@ + + + + + + + + +FTXUI: File Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all file members with links to the files they belong to:
+ +

- a -

+ + +

- b -

+ + +

- c -

+ + +

- d -

+ + +

- e -

+ + +

- f -

+ + +

- g -

+ + +

- h -

+ + +

- i -

+ + +

- l -

+ + +

- m -

+ + +

- n -

+ + +

- p -

+ + +

- r -

+ + +

- s -

+ + +

- t -

+ + +

- v -

+ + +

- w -

+ + +

- x -

+ + +

- y -

+
+
+ + + + + diff --git a/globals_defs.html b/globals_defs.html new file mode 100644 index 000000000..0a3253726 --- /dev/null +++ b/globals_defs.html @@ -0,0 +1,210 @@ + + + + + + + + +FTXUI: File Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all macros with links to the files they belong to:
+
+
+ + + + + diff --git a/globals_func.html b/globals_func.html new file mode 100644 index 000000000..669267a1a --- /dev/null +++ b/globals_func.html @@ -0,0 +1,289 @@ + + + + + + + + +FTXUI: File Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all functions with links to the files they belong to:
+ +

- c -

+ + +

- d -

+ + +

- e -

+ + +

- h -

+ + +

- i -

+ + +

- l -

+ + +

- m -

+ + +

- n -

+ + +

- s -

+ + +

- t -

+ + +

- v -

+ + +

- w -

+
+
+ + + + + diff --git a/globals_vars.html b/globals_vars.html new file mode 100644 index 000000000..97b1d1b57 --- /dev/null +++ b/globals_vars.html @@ -0,0 +1,235 @@ + + + + + + + + +FTXUI: File Members + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Here is a list of all variables with links to the files they belong to:
+
+
+ + + + + diff --git a/graph_legend.html b/graph_legend.html new file mode 100644 index 000000000..f80595a5a --- /dev/null +++ b/graph_legend.html @@ -0,0 +1,268 @@ + + + + + + + + +FTXUI: Graph Legend + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Graph Legend
+
+
+

This page explains how to interpret the graphs that are generated by doxygen.

+

Consider the following example:

/*! Invisible class because of truncation */
+
class Invisible { };
+
+
/*! Truncated class, inheritance relation is hidden */
+
class Truncated : public Invisible { };
+
+
/* Class not documented with doxygen comments */
+
class Undocumented { };
+
+
/*! Class that is inherited using public inheritance */
+
class PublicBase : public Truncated { };
+
+
/*! A template class */
+
template<class T> class Templ { };
+
+
/*! Class that is inherited using protected inheritance */
+
class ProtectedBase { };
+
+
/*! Class that is inherited using private inheritance */
+
class PrivateBase { };
+
+
/*! Class that is used by the Inherited class */
+
class Used { };
+
+
/*! Super class that inherits a number of other classes */
+
class Inherited : public PublicBase,
+
protected ProtectedBase,
+
private PrivateBase,
+
public Undocumented,
+
public Templ<int>
+
{
+
private:
+
Used *m_usedClass;
+
};
+

This will result in the following graph:

+

The boxes in the above graph have the following meaning:

+
    +
  • +A filled gray box represents the struct or class for which the graph is generated.
  • +
  • +A box with a black border denotes a documented struct or class.
  • +
  • +A box with a gray border denotes an undocumented struct or class.
  • +
  • +A box with a red border denotes a documented struct or class forwhich not all inheritance/containment relations are shown. A graph is truncated if it does not fit within the specified boundaries.
  • +
+

The arrows have the following meaning:

+
    +
  • +A blue arrow is used to visualize a public inheritance relation between two classes.
  • +
  • +A dark green arrow is used for protected inheritance.
  • +
  • +A dark red arrow is used for private inheritance.
  • +
  • +A purple dashed arrow is used if a class is contained or used by another class. The arrow is labelled with the variable(s) through which the pointed class or struct is accessible.
  • +
  • +A yellow dashed arrow denotes a relation between a template instance and the template class it was instantiated from. The arrow is labelled with the template parameters of the instance.
  • +
+
+
+ + + + + diff --git a/graph_legend.md5 b/graph_legend.md5 new file mode 100644 index 000000000..34a71d615 --- /dev/null +++ b/graph_legend.md5 @@ -0,0 +1 @@ +238bc3d95adc1929b3259d0c39010ed6 \ No newline at end of file diff --git a/graph_legend.png b/graph_legend.png new file mode 100644 index 000000000..15bf62a2f Binary files /dev/null and b/graph_legend.png differ diff --git a/group__component.html b/group__component.html new file mode 100644 index 000000000..6da4df611 --- /dev/null +++ b/group__component.html @@ -0,0 +1,12355 @@ + + + + + + + + +FTXUI: ftxui/component + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
ftxui/component
+
+
+

Detailed Description

+

Please check the tutorial of the ftxui/component module.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Classes

class  ComponentBase
 It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ftxui::Event. More...
 
struct  UnderlineOption
 Option for the underline effect. More...
 
struct  AnimatedColorOption
 Option about a potentially animated color. More...
 
struct  MenuEntryOption
 Option for the MenuEntry component. More...
 
struct  MenuOption
 Option for the Menu component. More...
 
struct  ButtonOption
 Option for the AnimatedButton component. More...
 
struct  CheckboxOption
 Option for the Checkbox component. More...
 
struct  InputOption
 Option for the Input component. More...
 
struct  RadioboxOption
 Option for the Radiobox component. More...
 
struct  WindowRenderState
 State passed to the Window component's render function. More...
 
struct  DropdownOption
 Option for the Dropdown component.A dropdown menu is a checkbox opening/closing a radiobox. More...
 
struct  Event
 Represent an event. It can be key press event, a terminal resize, or more ... More...
 
class  Loop
 Loop is a class that manages the event loop for a component. More...
 
struct  Mouse
 A mouse event. It contains the coordinate of the mouse, the button pressed and the modifier (shift, ctrl, meta). More...
 
class  ScreenInteractive
 ScreenInteractive is a Screen that can handle events, run a main loop, and manage components. More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

void RequestAnimationFrame ()
 RequestAnimationFrame is a function that requests a new frame to be drawn in the next animation cycle.
 
Component Button (ButtonOption option)
 Draw a button. Execute a function when clicked.
 
Component Button (ConstStringRef label, std::function< void()> on_click, ButtonOption option)
 Draw a button. Execute a function when clicked.
 
Component CatchEvent (Component child, std::function< bool(Event event)> on_event)
 Return a component, using |on_event| to catch events. This function must returns true when the event has been handled, false otherwise.
 
ComponentDecorator CatchEvent (std::function< bool(Event)> on_event)
 Decorate a component, using |on_event| to catch events. This function must returns true when the event has been handled, false otherwise.
 
Component Checkbox (CheckboxOption option)
 Draw checkable element.
 
Component Checkbox (ConstStringRef label, bool *checked, CheckboxOption option)
 Draw checkable element.
 
Component Vertical (Components children)
 A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or 'j'/'k' keys.
 
Component Vertical (Components children, int *selector)
 A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or 'j'/'k' keys. This is useful for implementing a Menu for instance.
 
Component Horizontal (Components children)
 A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow key or 'h'/'l' keys.
 
Component Horizontal (Components children, int *selector)
 A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow key or 'h'/'l' keys.
 
Component Tab (Components children, int *selector)
 A list of components, where only one is drawn and interacted with at a time. The |selector| gives the index of the selected component. This is useful to implement tabs.
 
Component Stacked (Components children)
 A list of components to be stacked on top of each other. Events are propagated to the first component, then the second if not handled, etc. The components are drawn in the reverse order they are given. When a component take focus, it is put at the front, without changing the relative order of the other elements.
 
Component Dropdown (ConstStringListRef entries, int *selected)
 A dropdown menu.
 
Component Dropdown (DropdownOption option)
 A dropdown menu.
 
Component Hoverable (Component component, bool *hover)
 Wrap a component. Gives the ability to know if it is hovered by the mouse.
 
Component Hoverable (Component component, std::function< void()> on_enter, std::function< void()> on_leave)
 Wrap a component. Uses callbacks.
 
ComponentDecorator Hoverable (bool *hover)
 Wrap a component. Gives the ability to know if it is hovered by the mouse.
 
ComponentDecorator Hoverable (std::function< void()> on_enter, std::function< void()> on_leave)
 Wrap a component. Gives the ability to know if it is hovered by the mouse.
 
Component Hoverable (Component component, std::function< void(bool)> on_change)
 Wrap a component. Gives the ability to know if it is hovered by the mouse.
 
ComponentDecorator Hoverable (std::function< void(bool)> on_change)
 Wrap a component. Gives the ability to know if it is hovered by the mouse.
 
Component Input (InputOption option)
 An input box for editing text.
 
Component Input (StringRef content, InputOption option)
 An input box for editing text.
 
Component Input (StringRef content, StringRef placeholder, InputOption option)
 An input box for editing text.
 
Component Maybe (Component child, std::function< bool()> show)
 Decorate a component |child|. It is shown only when |show| returns true.
 
ComponentDecorator Maybe (std::function< bool()> show)
 Decorate a component. It is shown only when the |show| function returns true.
 
Component Maybe (Component child, const bool *show)
 Decorate a component |child|. It is shown only when |show| is true.
 
ComponentDecorator Maybe (const bool *show)
 Decorate a component. It is shown only when |show| is true.
 
Component Menu (MenuOption option)
 A list of text. The focused element is selected.
 
Component Menu (ConstStringListRef entries, int *selected, MenuOption option)
 A list of text. The focused element is selected.
 
Component Toggle (ConstStringListRef entries, int *selected)
 An horizontal list of elements. The user can navigate through them.
 
Component MenuEntry (ConstStringRef label, MenuEntryOption option)
 A specific menu entry. They can be put into a Container::Vertical to form a menu.
 
Component MenuEntry (MenuEntryOption option)
 A specific menu entry. They can be put into a Container::Vertical to form a menu.
 
Component Modal (Component main, Component modal, const bool *show_modal)
 
ComponentDecorator Modal (Component modal, const bool *show_modal)
 
Component Radiobox (RadioboxOption option)
 A list of element, where only one can be selected.
 
Component Radiobox (ConstStringListRef entries, int *selected, RadioboxOption option)
 A list of element, where only one can be selected.
 
Component Renderer (std::function< Element()> render)
 Return a component, using |render| to render its interface.
 
Component Renderer (Component child, std::function< Element()> render)
 Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
 
Component Renderer (std::function< Element(bool)> render)
 Return a focusable component, using |render| to render its interface.
 
ComponentDecorator Renderer (ElementDecorator decorator)
 Decorate a component, by decorating what it renders.
 
Component ResizableSplitLeft (Component main, Component back, int *main_size)
 An horizontal split in between two components, configurable using the mouse.
 
Component ResizableSplitRight (Component main, Component back, int *main_size)
 An horizontal split in between two components, configurable using the mouse.
 
Component ResizableSplitTop (Component main, Component back, int *main_size)
 An vertical split in between two components, configurable using the mouse.
 
Component ResizableSplitBottom (Component main, Component back, int *main_size)
 An vertical split in between two components, configurable using the mouse.
 
Component Slider (ConstStringRef label, Ref< int > value, ConstRef< int > min, ConstRef< int > max, ConstRef< int > increment)
 An horizontal slider.
 
Component Window (WindowOptions option)
 A draggeable / resizeable window. To use multiple of them, they must be stacked using Container::Stacked({...}) component;.
 
+

Class Documentation

+ +

◆ ftxui::ComponentBase

+ +
+
+ + + + +
class ftxui::ComponentBase
+
+

It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ftxui::Event.

+
Examples
examples/component/scrollbar.cpp, and examples/component/window.cpp.
+
+ +

Definition at line 30 of file component_base.hpp.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

 ComponentBase (Components children)
 
virtual ~ComponentBase ()
 
 ComponentBase ()=default
 
 ComponentBase (const ComponentBase &)=delete
 
 ComponentBase (ComponentBase &&)=delete
 
ComponentBaseoperator= (const ComponentBase &)=delete
 
ComponentBaseoperator= (ComponentBase &&)=delete
 
ComponentBaseParent () const
 Return the parent ComponentBase, or nul if any.
 
ComponentChildAt (size_t i)
 Access the child at index i.
 
size_t ChildCount () const
 Returns the number of children.
 
int Index () const
 Return index of the component in its parent. -1 if no parent.
 
void Add (Component children)
 Add a child. @param child The child to be attached.
 
void Detach ()
 Detach this child from its parent.
 
void DetachAllChildren ()
 Remove all children.
 
Element Render ()
 Draw the component. Build a ftxui::Element to be drawn on the ftxui::Screen representing this ftxui::ComponentBase. Please override OnRender() to modify the rendering.
 
virtual Element OnRender ()
 Draw the component. Build a ftxui::Element to be drawn on the ftxi::Screen representing this ftxui::ComponentBase. This function is means to be overridden.
 
virtual bool OnEvent (Event)
 Called in response to an event.
 
virtual void OnAnimation (animation::Params &params)
 Called in response to an animation event.
 
virtual Component ActiveChild ()
 Return the currently Active child.
 
virtual bool Focusable () const
 Return true when the component contains focusable elements. The non focusable Components will be skipped when navigating using the keyboard.
 
bool Active () const
 Returns if the element if the currently active child of its parent.
 
bool Focused () const
 Returns if the elements if focused by the user. True when the ComponentBase is focused by the user. An element is Focused when it is with all its ancestors the ActiveChild() of their parents, and it Focusable().
 
virtual void SetActiveChild (ComponentBase *child)
 Make the |child| to be the "active" one.
 
void SetActiveChild (Component child)
 Make the |child| to be the "active" one.
 
void TakeFocus ()
 Configure all the ancestors to give focus to this component.
 

Protected Member Functions

CapturedMouse CaptureMouse (const Event &event)
 Take the CapturedMouse if available. There is only one component of them. It represents a component taking priority over others.
 

Protected Attributes

Components children_
 
+

Constructor & Destructor Documentation

+ +

◆ ComponentBase() [1/4]

+ +
+
+ + + + + +
+ + + + + + + +
ComponentBase (Components children)
+
+inlineexplicit
+
+ +

Definition at line 32 of file component_base.hpp.

+ +
+
+ +

◆ ~ComponentBase()

+ +
+
+ + + + + +
+ + + + + + + +
~ComponentBase ()
+
+virtual
+
+ +

Definition at line 31 of file component.cpp.

+ +
+
+ +

◆ ComponentBase() [2/4]

+ +
+
+ + + + + +
+ + + + + + + +
ComponentBase ()
+
+default
+
+ +
+
+ +

◆ ComponentBase() [3/4]

+ +
+
+ + + + + +
+ + + + + + + +
ComponentBase (const ComponentBase & )
+
+delete
+
+ +
+
+ +

◆ ComponentBase() [4/4]

+ +
+
+ + + + + +
+ + + + + + + +
ComponentBase (ComponentBase && )
+
+delete
+
+ +
+
+

Member Function Documentation

+ +

◆ operator=() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
ComponentBase & operator= (const ComponentBase & )
+
+delete
+
+ +
+
+ +

◆ operator=() [2/2]

+ +
+
+ + + + + +
+ + + + + + + +
ComponentBase & operator= (ComponentBase && )
+
+delete
+
+ +
+
+ +

◆ Parent()

+ +
+
+ + + + + + + +
ComponentBase * Parent () const
+
+ +

Return the parent ComponentBase, or nul if any.

+
See also
Detach
+
+Parent
+ +

Definition at line 38 of file component.cpp.

+ +
+
+ +

◆ ChildAt()

+ +
+
+ + + + + + + +
Component & ChildAt (size_t i)
+
+ +

Access the child at index i.

+ +

Definition at line 43 of file component.cpp.

+ +
+
+ +

◆ ChildCount()

+ +
+
+ + + + + + + +
size_t ChildCount () const
+
+ +

Returns the number of children.

+ +

Definition at line 49 of file component.cpp.

+ +
+
+ +

◆ Index()

+ +
+
+ + + + + + + +
int Index () const
+
+ +

Return index of the component in its parent. -1 if no parent.

+ +

Definition at line 54 of file component.cpp.

+ +
+
+ +

◆ Add()

+ +
+
+ + + + + + + +
void Add (Component children)
+
+ +

Add a child. @param child The child to be attached.

+ +

Definition at line 70 of file component.cpp.

+ +
+
+ +

◆ Detach()

+ +
+
+ + + + + + + +
void Detach ()
+
+ +

Detach this child from its parent.

+
See also
Detach
+
+Parent
+ +

Definition at line 79 of file component.cpp.

+ +
+
+ +

◆ DetachAllChildren()

+ +
+
+ + + + + + + +
void DetachAllChildren ()
+
+ +

Remove all children.

+ +

Definition at line 94 of file component.cpp.

+ +
+
+ +

◆ Render()

+ +
+
+ + + + + + + +
Element Render ()
+
+ +

Draw the component. Build a ftxui::Element to be drawn on the ftxui::Screen representing this ftxui::ComponentBase. Please override OnRender() to modify the rendering.

+ +

Definition at line 103 of file component.cpp.

+ +
+
+ +

◆ OnRender()

+ +
+
+ + + + + +
+ + + + + + + +
Element OnRender ()
+
+virtual
+
+ +

Draw the component. Build a ftxui::Element to be drawn on the ftxi::Screen representing this ftxui::ComponentBase. This function is means to be overridden.

+ +

Definition at line 138 of file component.cpp.

+ +
+
+ +

◆ OnEvent()

+ +
+
+ + + + + +
+ + + + + + + +
bool OnEvent (Event event)
+
+virtual
+
+ +

Called in response to an event.

+
Parameters
+ + +
eventThe event.
+
+
+
Returns
True when the event has been handled. The default implementation called OnEvent on every child until one return true. If none returns true, return false.
+ +

Definition at line 151 of file component.cpp.

+ +
+
+ +

◆ OnAnimation()

+ +
+
+ + + + + +
+ + + + + + + +
void OnAnimation (animation::Params & params)
+
+virtual
+
+ +

Called in response to an animation event.

+
Parameters
+ + +
paramsthe parameters of the animation The default implementation dispatch the event to every child.
+
+
+ +

Definition at line 163 of file component.cpp.

+ +
+
+ +

◆ ActiveChild()

+ +
+
+ + + + + +
+ + + + + + + +
Component ActiveChild ()
+
+virtual
+
+ +

Return the currently Active child.

+
Returns
the currently Active child.
+ +

Definition at line 171 of file component.cpp.

+ +
+
+ +

◆ Focusable()

+ +
+
+ + + + + +
+ + + + + + + +
bool Focusable () const
+
+virtual
+
+ +

Return true when the component contains focusable elements. The non focusable Components will be skipped when navigating using the keyboard.

+ +

Definition at line 183 of file component.cpp.

+ +
+
+ +

◆ Active()

+ +
+
+ + + + + + + +
bool Active () const
+
+ +

Returns if the element if the currently active child of its parent.

+ +

Definition at line 193 of file component.cpp.

+ +
+
+ +

◆ Focused()

+ +
+
+ + + + + + + +
bool Focused () const
+
+ +

Returns if the elements if focused by the user. True when the ComponentBase is focused by the user. An element is Focused when it is with all its ancestors the ActiveChild() of their parents, and it Focusable().

+ +

Definition at line 201 of file component.cpp.

+ +
+
+ +

◆ SetActiveChild() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
void SetActiveChild (ComponentBase * child)
+
+virtual
+
+ +

Make the |child| to be the "active" one.

+
Parameters
+ + +
childthe child to become active.
+
+
+ +

Definition at line 211 of file component.cpp.

+ +
+
+ +

◆ SetActiveChild() [2/2]

+ +
+
+ + + + + + + +
void SetActiveChild (Component child)
+
+ +

Make the |child| to be the "active" one.

+
Parameters
+ + +
childthe child to become active.
+
+
+ +

Definition at line 215 of file component.cpp.

+ +
+
+ +

◆ TakeFocus()

+ +
+
+ + + + + + + +
void TakeFocus ()
+
+ +

Configure all the ancestors to give focus to this component.

+ +

Definition at line 220 of file component.cpp.

+ +
+
+ +

◆ CaptureMouse()

+ +
+
+ + + + + +
+ + + + + + + +
CapturedMouse CaptureMouse (const Event & event)
+
+protected
+
+ +

Take the CapturedMouse if available. There is only one component of them. It represents a component taking priority over others.

+
Parameters
+ + +
eventThe event
+
+
+ +

Definition at line 231 of file component.cpp.

+ +
+
+

Member Data Documentation

+ +

◆ children_

+ +
+
+ + + + + +
+ + + + +
Components children_
+
+protected
+
+ +

Definition at line 96 of file component_base.hpp.

+ +
+
+ +
+
+ +

◆ ftxui::UnderlineOption

+ +
+
+ + + + +
struct ftxui::UnderlineOption
+
+

Option for the underline effect.

+ +

Definition at line 33 of file component_options.hpp.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

void SetAnimation (animation::Duration d, animation::easing::Function f)
 Set how the underline should animate.
 
void SetAnimationDuration (animation::Duration d)
 Set how the underline should animate.
 
void SetAnimationFunction (animation::easing::Function f)
 Set how the underline should animate.
 
void SetAnimationFunction (animation::easing::Function f_leader, animation::easing::Function f_follower)
 Set how the underline should animate. This is useful to desynchronize the animation of the leader and the follower.
 

Public Attributes

bool enabled = false
 
Color color_active = Color::White
 
Color color_inactive = Color::GrayDark
 
animation::easing::Function leader_function
 
animation::easing::Function follower_function
 
animation::Duration leader_duration = std::chrono::milliseconds(250)
 
animation::Duration leader_delay = std::chrono::milliseconds(0)
 
animation::Duration follower_duration = std::chrono::milliseconds(250)
 
animation::Duration follower_delay = std::chrono::milliseconds(0)
 
+

Member Function Documentation

+ +

◆ SetAnimation()

+ +
+
+ + + + + + + + + + + +
void SetAnimation (animation::Duration d,
animation::easing::Function f )
+
+ +

Set how the underline should animate.

+
Parameters
+ + + +
dThe duration of the animation.
fThe easing function of the animation.
+
+
+ +

Definition at line 34 of file component_options.cpp.

+ +
+
+ +

◆ SetAnimationDuration()

+ +
+
+ + + + + + + +
void SetAnimationDuration (animation::Duration d)
+
+ +

Set how the underline should animate.

+
Parameters
+ + +
dThe duration of the animation.
+
+
+ +

Definition at line 42 of file component_options.cpp.

+ +
+
+ +

◆ SetAnimationFunction() [1/2]

+ +
+
+ + + + + + + +
void SetAnimationFunction (animation::easing::Function f)
+
+ +

Set how the underline should animate.

+
Parameters
+ + +
fThe easing function of the animation.
+
+
+ +

Definition at line 49 of file component_options.cpp.

+ +
+
+ +

◆ SetAnimationFunction() [2/2]

+ +
+
+ + + + + + + + + + + +
void SetAnimationFunction (animation::easing::Function f_leader,
animation::easing::Function f_follower )
+
+ +

Set how the underline should animate. This is useful to desynchronize the animation of the leader and the follower.

+
Parameters
+ + + +
f_leaderThe duration of the animation for the leader.
f_followerThe duration of the animation for the follower.
+
+
+ +

Definition at line 59 of file component_options.cpp.

+ +
+
+

Member Data Documentation

+ +

◆ enabled

+ +
+
+ + + + +
bool enabled = false
+
+ +

Definition at line 34 of file component_options.hpp.

+ +
+
+ +

◆ color_active

+ +
+
+ + + + +
Color color_active = Color::White
+
+ +

Definition at line 36 of file component_options.hpp.

+ +
+
+ +

◆ color_inactive

+ +
+
+ + + + +
Color color_inactive = Color::GrayDark
+
+ +

Definition at line 37 of file component_options.hpp.

+ +
+
+ +

◆ leader_function

+ +
+
+ + + + +
animation::easing::Function leader_function
+
+Initial value: +

Definition at line 39 of file component_options.hpp.

+ +
+
+ +

◆ follower_function

+ +
+
+ + + + +
animation::easing::Function follower_function
+
+Initial value: +

Definition at line 41 of file component_options.hpp.

+ +
+
+ +

◆ leader_duration

+ +
+
+ + + + +
animation::Duration leader_duration = std::chrono::milliseconds(250)
+
+ +

Definition at line 44 of file component_options.hpp.

+ +
+
+ +

◆ leader_delay

+ +
+
+ + + + +
animation::Duration leader_delay = std::chrono::milliseconds(0)
+
+ +

Definition at line 45 of file component_options.hpp.

+ +
+
+ +

◆ follower_duration

+ +
+
+ + + + +
animation::Duration follower_duration = std::chrono::milliseconds(250)
+
+ +

Definition at line 46 of file component_options.hpp.

+ +
+
+ +

◆ follower_delay

+ +
+
+ + + + +
animation::Duration follower_delay = std::chrono::milliseconds(0)
+
+ +

Definition at line 47 of file component_options.hpp.

+ +
+
+ +
+
+ +

◆ ftxui::AnimatedColorOption

+ +
+
+ + + + +
struct ftxui::AnimatedColorOption
+
+

Option about a potentially animated color.

+ +

Definition at line 58 of file component_options.hpp.

+
+ + + + + + + + + + + + + + + +

Public Member Functions

void Set (Color inactive, Color active, animation::Duration duration=std::chrono::milliseconds(250), animation::easing::Function function=animation::easing::QuadraticInOut)
 A color option that can be animated. @params _inactive The color when the component is inactive. @params _active The color when the component is active. @params _duration The duration of the animation. @params _function The easing function of the animation.
 

Public Attributes

bool enabled = false
 
Color inactive
 
Color active
 
animation::Duration duration = std::chrono::milliseconds(250)
 
animation::easing::Function function = animation::easing::QuadraticInOut
 
+

Member Function Documentation

+ +

◆ Set()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
void Set (Color inactive,
Color active,
animation::Duration duration = std::chrono::milliseconds(250),
animation::easing::Function function = animation::easing::QuadraticInOut )
+
+ +

A color option that can be animated. @params _inactive The color when the component is inactive. @params _active The color when the component is active. @params _duration The duration of the animation. @params _function The easing function of the animation.

+ +

Definition at line 20 of file component_options.cpp.

+ +
+
+

Member Data Documentation

+ +

◆ enabled

+ +
+
+ + + + +
bool enabled = false
+
+
Examples
examples/component/menu_entries_animated.cpp.
+
+ +

Definition at line 65 of file component_options.hpp.

+ +
+
+ +

◆ inactive

+ +
+
+ + + + +
Color inactive
+
+
Examples
examples/component/menu_entries_animated.cpp.
+
+ +

Definition at line 66 of file component_options.hpp.

+ +
+
+ +

◆ active

+ +
+
+ + + + +
Color active
+
+
Examples
examples/component/menu_entries_animated.cpp.
+
+ +

Definition at line 67 of file component_options.hpp.

+ +
+
+ +

◆ duration

+ +
+
+ + + + +
animation::Duration duration = std::chrono::milliseconds(250)
+
+ +

Definition at line 68 of file component_options.hpp.

+ +
+
+ +

◆ function

+ +
+
+ + + + +
animation::easing::Function function = animation::easing::QuadraticInOut
+
+ +

Definition at line 69 of file component_options.hpp.

+ +
+
+ +
+
+ +

◆ ftxui::MenuEntryOption

+ +
+
+ + + + +
struct ftxui::MenuEntryOption
+
+

Option for the MenuEntry component.

+
Examples
examples/component/menu_entries.cpp, and examples/component/menu_entries_animated.cpp.
+
+ +

Definition at line 79 of file component_options.hpp.

+
+ + + + + + + +

Public Attributes

ConstStringRef label = "MenuEntry"
 
std::function< Element(const EntryState &state)> transform
 
AnimatedColorsOption animated_colors
 
+

Member Data Documentation

+ +

◆ label

+ +
+
+ + + + +
ConstStringRef label = "MenuEntry"
+
+ +

Definition at line 80 of file component_options.hpp.

+ +
+
+ +

◆ transform

+ +
+
+ + + + +
std::function<Element(const EntryState& state)> transform
+
+
Examples
examples/component/menu_entries.cpp.
+
+ +

Definition at line 81 of file component_options.hpp.

+ +
+
+ +

◆ animated_colors

+ +
+
+ + + + +
AnimatedColorsOption animated_colors
+
+
Examples
examples/component/menu_entries_animated.cpp.
+
+ +

Definition at line 82 of file component_options.hpp.

+ +
+
+ +
+
+ +

◆ ftxui::MenuOption

+ +
+
+ + + + +
struct ftxui::MenuOption
+
+

Option for the Menu component.

+
Examples
examples/component/menu.cpp, and examples/component/menu2.cpp.
+
+ +

Definition at line 87 of file component_options.hpp.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Static Public Member Functions

static MenuOption Horizontal ()
 Standard options for a horizontal menu. This can be useful to implement a tab bar.
 
static MenuOption HorizontalAnimated ()
 Standard options for an animated horizontal menu. This can be useful to implement a tab bar.
 
static MenuOption Vertical ()
 Standard options for a vertical menu. This can be useful to implement a list of selectable items.
 
static MenuOption VerticalAnimated ()
 Standard options for an animated vertical menu. This can be useful to implement a list of selectable items.
 
static MenuOption Toggle ()
 Standard options for a horizontal menu with some separator. This can be useful to implement a tab bar.
 

Public Attributes

ConstStringListRef entries
 
Ref< int > selected = 0
 
UnderlineOption underline
 
MenuEntryOption entries_option
 
Direction direction = Direction::Down
 
std::function< Element()> elements_prefix
 
std::function< Element()> elements_infix
 
std::function< Element()> elements_postfix
 
std::function< void()> on_change
 
std::function< void()> on_enter
 
Ref< int > focused_entry = 0
 
+

Member Function Documentation

+ +

◆ Horizontal()

+ +
+
+ + + + + +
+ + + + + + + +
MenuOption Horizontal ()
+
+static
+
+ +

Standard options for a horizontal menu. This can be useful to implement a tab bar.

+ +

Definition at line 69 of file component_options.cpp.

+ +
+
+ +

◆ HorizontalAnimated()

+ +
+
+ + + + + +
+ + + + + + + +
MenuOption HorizontalAnimated ()
+
+static
+
+ +

Standard options for an animated horizontal menu. This can be useful to implement a tab bar.

+ +

Definition at line 93 of file component_options.cpp.

+ +
+
+ +

◆ Vertical()

+ +
+
+ + + + + +
+ + + + + + + +
MenuOption Vertical ()
+
+static
+
+ +

Standard options for a vertical menu. This can be useful to implement a list of selectable items.

+ +

Definition at line 102 of file component_options.cpp.

+ +
+
+ +

◆ VerticalAnimated()

+ +
+
+ + + + + +
+ + + + + + + +
MenuOption VerticalAnimated ()
+
+static
+
+ +

Standard options for an animated vertical menu. This can be useful to implement a list of selectable items.

+ +

Definition at line 123 of file component_options.cpp.

+ +
+
+ +

◆ Toggle()

+ +
+
+ + + + + +
+ + + + + + + +
MenuOption Toggle ()
+
+static
+
+ +

Standard options for a horizontal menu with some separator. This can be useful to implement a tab bar.

+ +

Definition at line 145 of file component_options.cpp.

+ +
+
+

Member Data Documentation

+ +

◆ entries

+ +
+
+ + + + +
ConstStringListRef entries
+
+ +

Definition at line 95 of file component_options.hpp.

+ +
+
+ +

◆ selected

+ +
+
+ + + + +
Ref<int> selected = 0
+
+
+

‍The list of entries.

+
+ +

Definition at line 96 of file component_options.hpp.

+ +
+
+ +

◆ underline

+ +
+
+ + + + +
UnderlineOption underline
+
+
+

‍The index of the selected entry.

+
+ +

Definition at line 99 of file component_options.hpp.

+ +
+
+ +

◆ entries_option

+ +
+
+ + + + +
MenuEntryOption entries_option
+
+ +

Definition at line 100 of file component_options.hpp.

+ +
+
+ +

◆ direction

+ +
+
+ + + + +
Direction direction = Direction::Down
+
+ +

Definition at line 101 of file component_options.hpp.

+ +
+
+ +

◆ elements_prefix

+ +
+
+ + + + +
std::function<Element()> elements_prefix
+
+ +

Definition at line 102 of file component_options.hpp.

+ +
+
+ +

◆ elements_infix

+ +
+
+ + + + +
std::function<Element()> elements_infix
+
+ +

Definition at line 103 of file component_options.hpp.

+ +
+
+ +

◆ elements_postfix

+ +
+
+ + + + +
std::function<Element()> elements_postfix
+
+ +

Definition at line 104 of file component_options.hpp.

+ +
+
+ +

◆ on_change

+ +
+
+ + + + +
std::function<void()> on_change
+
+ +

Definition at line 107 of file component_options.hpp.

+ +
+
+ +

◆ on_enter

+ +
+
+ + + + +
std::function<void()> on_enter
+
+
+

‍Called when the selected entry changes.

+
+
Examples
examples/component/menu.cpp.
+
+ +

Definition at line 108 of file component_options.hpp.

+ +
+
+ +

◆ focused_entry

+ +
+
+ + + + +
Ref<int> focused_entry = 0
+
+
+

‍Called when the user presses enter.

+
+ +

Definition at line 109 of file component_options.hpp.

+ +
+
+ +
+
+ +

◆ ftxui::ButtonOption

+ +
+
+ + + + +
struct ftxui::ButtonOption
+
+

Option for the AnimatedButton component.

+
Examples
examples/component/button.cpp.
+
+ +

Definition at line 114 of file component_options.hpp.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Static Public Member Functions

static ButtonOption Ascii ()
 Create a ButtonOption, highlighted using [] characters.
 
static ButtonOption Simple ()
 Create a ButtonOption, inverted when focused.
 
static ButtonOption Border ()
 Create a ButtonOption. The button is shown using a border, inverted when focused. This is the current default.
 
static ButtonOption Animated ()
 Create a ButtonOption, using animated colors.
 
static ButtonOption Animated (Color color)
 Create a ButtonOption, using animated colors.
 
static ButtonOption Animated (Color background, Color foreground)
 Create a ButtonOption, using animated colors.
 
static ButtonOption Animated (Color background, Color foreground, Color background_active, Color foreground_active)
 Create a ButtonOption, using animated colors.
 

Public Attributes

ConstStringRef label = "Button"
 
std::function< void()> on_click = [] {}
 
std::function< Element(const EntryState &)> transform
 
AnimatedColorsOption animated_colors
 
+

Member Function Documentation

+ +

◆ Ascii()

+ +
+
+ + + + + +
+ + + + + + + +
ButtonOption Ascii ()
+
+static
+
+ +

Create a ButtonOption, highlighted using [] characters.

+ +

Definition at line 153 of file component_options.cpp.

+ +
+
+ +

◆ Simple()

+ +
+
+ + + + + +
+ + + + + + + +
ButtonOption Simple ()
+
+static
+
+ +

Create a ButtonOption, inverted when focused.

+ +

Definition at line 165 of file component_options.cpp.

+ +
+
+ +

◆ Border()

+ +
+
+ + + + + +
+ + + + + + + +
ButtonOption Border ()
+
+static
+
+ +

Create a ButtonOption. The button is shown using a border, inverted when focused. This is the current default.

+ +

Definition at line 179 of file component_options.cpp.

+ +
+
+ +

◆ Animated() [1/4]

+ +
+
+ + + + + +
+ + + + + + + +
ButtonOption Animated ()
+
+static
+
+ +

Create a ButtonOption, using animated colors.

+ +

Definition at line 196 of file component_options.cpp.

+ +
+
+ +

◆ Animated() [2/4]

+ +
+
+ + + + + +
+ + + + + + + +
ButtonOption Animated (Color color)
+
+static
+
+ +

Create a ButtonOption, using animated colors.

+ +

Definition at line 203 of file component_options.cpp.

+ +
+
+ +

◆ Animated() [3/4]

+ +
+
+ + + + + +
+ + + + + + + + + + + +
ButtonOption Animated (Color background,
Color foreground )
+
+static
+
+ +

Create a ButtonOption, using animated colors.

+ +

Definition at line 213 of file component_options.cpp.

+ +
+
+ +

◆ Animated() [4/4]

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
ButtonOption Animated (Color background,
Color foreground,
Color background_active,
Color foreground_active )
+
+static
+
+ +

Create a ButtonOption, using animated colors.

+ +

Definition at line 225 of file component_options.cpp.

+ +
+
+

Member Data Documentation

+ +

◆ label

+ +
+
+ + + + +
ConstStringRef label = "Button"
+
+ +

Definition at line 127 of file component_options.hpp.

+ +
+
+ +

◆ on_click

+ +
+
+ + + + +
std::function<void()> on_click = [] {}
+
+ +

Definition at line 128 of file component_options.hpp.

+ +
+
+ +

◆ transform

+ +
+
+ + + + +
std::function<Element(const EntryState&)> transform
+
+ +

Definition at line 131 of file component_options.hpp.

+ +
+
+ +

◆ animated_colors

+ +
+
+ + + + +
AnimatedColorsOption animated_colors
+
+ +

Definition at line 132 of file component_options.hpp.

+ +
+
+ +
+
+ +

◆ ftxui::CheckboxOption

+ +
+
+ + + + +
struct ftxui::CheckboxOption
+
+

Option for the Checkbox component.

+ +

Definition at line 137 of file component_options.hpp.

+
+ + + + + + + + + + + + + + +

Static Public Member Functions

static CheckboxOption Simple ()
 Option for standard Checkbox.
 

Public Attributes

ConstStringRef label = "Checkbox"
 
Ref< bool > checked = false
 
std::function< Element(const EntryState &)> transform
 
std::function< void()> on_change = [] {}
 Called when the user change the state.
 
+

Member Function Documentation

+ +

◆ Simple()

+ +
+
+ + + + + +
+ + + + + + + +
CheckboxOption Simple ()
+
+static
+
+ +

Option for standard Checkbox.

+ +

Definition at line 244 of file component_options.cpp.

+ +
+
+

Member Data Documentation

+ +

◆ label

+ +
+
+ + + + +
ConstStringRef label = "Checkbox"
+
+ +

Definition at line 141 of file component_options.hpp.

+ +
+
+ +

◆ checked

+ +
+
+ + + + +
Ref<bool> checked = false
+
+ +

Definition at line 143 of file component_options.hpp.

+ +
+
+ +

◆ transform

+ +
+
+ + + + +
std::function<Element(const EntryState&)> transform
+
+ +

Definition at line 146 of file component_options.hpp.

+ +
+
+ +

◆ on_change

+ +
+
+ + + + +
std::function<void()> on_change = [] {}
+
+ +

Called when the user change the state.

+ +

Definition at line 150 of file component_options.hpp.

+ +
+
+ +
+
+ +

◆ ftxui::InputOption

+ +
+
+ + + + +
struct ftxui::InputOption
+
+

Option for the Input component.

+
Examples
examples/component/homescreen.cpp, examples/component/input.cpp, and examples/component/input_style.cpp.
+
+ +

Definition at line 164 of file component_options.hpp.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Static Public Member Functions

static InputOption Default ()
 Create the default input style:
 
static InputOption Spacious ()
 A white on black style with high margins:
 

Public Attributes

StringRef content = ""
 The content of the input.
 
StringRef placeholder = ""
 The content of the input when it's empty.
 
std::function< Element(InputState)> transform
 
Ref< bool > password = false
 Obscure the input content using '*'.
 
Ref< bool > multiline = true
 Whether the input can be multiline.
 
Ref< bool > insert = true
 Insert or overtype character mode.
 
std::function< void()> on_change = [] {}
 Called when the content changes.
 
std::function< void()> on_enter = [] {}
 Called when the user presses enter.
 
Ref< int > cursor_position = 0
 
+

Member Function Documentation

+ +

◆ Default()

+ +
+
+ + + + + +
+ + + + + + + +
InputOption Default ()
+
+static
+
+ +

Create the default input style:

+

Standard options for the input component.

+ +

Definition at line 292 of file component_options.cpp.

+ +
+
+ +

◆ Spacious()

+ +
+
+ + + + + +
+ + + + + + + +
InputOption Spacious ()
+
+static
+
+ +

A white on black style with high margins:

+

Standard options for a more beautiful input component.

+ +

Definition at line 314 of file component_options.cpp.

+ +
+
+

Member Data Documentation

+ +

◆ content

+ +
+
+ + + + +
StringRef content = ""
+
+ +

The content of the input.

+ +

Definition at line 173 of file component_options.hpp.

+ +
+
+ +

◆ placeholder

+ +
+
+ + + + +
StringRef placeholder = ""
+
+ +

The content of the input when it's empty.

+ +

Definition at line 176 of file component_options.hpp.

+ +
+
+ +

◆ transform

+ +
+
+ + + + +
std::function<Element(InputState)> transform
+
+
Examples
examples/component/input_style.cpp.
+
+ +

Definition at line 179 of file component_options.hpp.

+ +
+
+ +

◆ password

+ +
+
+ + + + +
Ref<bool> password = false
+
+ +

Obscure the input content using '*'.

+
Examples
examples/component/input.cpp.
+
+ +

Definition at line 180 of file component_options.hpp.

+ +
+
+ +

◆ multiline

+ +
+
+ + + + +
Ref<bool> multiline = true
+
+ +

Whether the input can be multiline.

+ +

Definition at line 181 of file component_options.hpp.

+ +
+
+ +

◆ insert

+ +
+
+ + + + +
Ref<bool> insert = true
+
+ +

Insert or overtype character mode.

+ +

Definition at line 182 of file component_options.hpp.

+ +
+
+ +

◆ on_change

+ +
+
+ + + + +
std::function<void()> on_change = [] {}
+
+ +

Called when the content changes.

+ +

Definition at line 185 of file component_options.hpp.

+ +
+
+ +

◆ on_enter

+ +
+
+ + + + +
std::function<void()> on_enter = [] {}
+
+ +

Called when the user presses enter.

+ +

Definition at line 187 of file component_options.hpp.

+ +
+
+ +

◆ cursor_position

+ +
+
+ + + + +
Ref<int> cursor_position = 0
+
+ +

Definition at line 190 of file component_options.hpp.

+ +
+
+ +
+
+ +

◆ ftxui::RadioboxOption

+ +
+
+ + + + +
struct ftxui::RadioboxOption
+
+

Option for the Radiobox component.

+ +

Definition at line 195 of file component_options.hpp.

+
+ + + + + + + + + + + + + + + + +

Static Public Member Functions

static RadioboxOption Simple ()
 Option for standard Radiobox.
 

Public Attributes

ConstStringListRef entries
 
Ref< int > selected = 0
 
std::function< Element(const EntryState &)> transform
 
std::function< void()> on_change = [] {}
 Called when the selected entry changes.
 
Ref< int > focused_entry = 0
 
+

Member Function Documentation

+ +

◆ Simple()

+ +
+
+ + + + + +
+ + + + + + + +
RadioboxOption Simple ()
+
+static
+
+ +

Option for standard Radiobox.

+ +

Definition at line 268 of file component_options.cpp.

+ +
+
+

Member Data Documentation

+ +

◆ entries

+ +
+
+ + + + +
ConstStringListRef entries
+
+ +

Definition at line 200 of file component_options.hpp.

+ +
+
+ +

◆ selected

+ +
+
+ + + + +
Ref<int> selected = 0
+
+ +

Definition at line 201 of file component_options.hpp.

+ +
+
+ +

◆ transform

+ +
+
+ + + + +
std::function<Element(const EntryState&)> transform
+
+ +

Definition at line 204 of file component_options.hpp.

+ +
+
+ +

◆ on_change

+ +
+
+ + + + +
std::function<void()> on_change = [] {}
+
+ +

Called when the selected entry changes.

+ +

Definition at line 208 of file component_options.hpp.

+ +
+
+ +

◆ focused_entry

+ +
+
+ + + + +
Ref<int> focused_entry = 0
+
+ +

Definition at line 209 of file component_options.hpp.

+ +
+
+ +
+
+ +

◆ ftxui::WindowRenderState

+ +
+
+ + + + +
struct ftxui::WindowRenderState
+
+

State passed to the Window component's render function.

+ +

Definition at line 238 of file component_options.hpp.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Attributes

Element inner
 The element wrapped inside this window.
 
const std::string & title
 The title of the window.
 
bool active = false
 Whether the window is the active one.
 
bool drag = false
 Whether the window is being dragged.
 
bool resize = false
 Whether the window is being resized.
 
bool hover_left = false
 Whether the resizeable left side is hovered.
 
bool hover_right = false
 Whether the resizeable right side is hovered.
 
bool hover_top = false
 Whether the resizeable top side is hovered.
 
bool hover_down = false
 Whether the resizeable down side is hovered.
 
+

Member Data Documentation

+ +

◆ inner

+ +
+
+ + + + +
Element inner
+
+ +

The element wrapped inside this window.

+ +

Definition at line 239 of file component_options.hpp.

+ +
+
+ +

◆ title

+ +
+
+ + + + +
const std::string& title
+
+ +

The title of the window.

+ +

Definition at line 240 of file component_options.hpp.

+ +
+
+ +

◆ active

+ +
+
+ + + + +
bool active = false
+
+ +

Whether the window is the active one.

+ +

Definition at line 241 of file component_options.hpp.

+ +
+
+ +

◆ drag

+ +
+
+ + + + +
bool drag = false
+
+ +

Whether the window is being dragged.

+ +

Definition at line 242 of file component_options.hpp.

+ +
+
+ +

◆ resize

+ +
+
+ + + + +
bool resize = false
+
+ +

Whether the window is being resized.

+ +

Definition at line 243 of file component_options.hpp.

+ +
+
+ +

◆ hover_left

+ +
+
+ + + + +
bool hover_left = false
+
+ +

Whether the resizeable left side is hovered.

+ +

Definition at line 244 of file component_options.hpp.

+ +
+
+ +

◆ hover_right

+ +
+
+ + + + +
bool hover_right = false
+
+ +

Whether the resizeable right side is hovered.

+ +

Definition at line 245 of file component_options.hpp.

+ +
+
+ +

◆ hover_top

+ +
+
+ + + + +
bool hover_top = false
+
+ +

Whether the resizeable top side is hovered.

+ +

Definition at line 246 of file component_options.hpp.

+ +
+
+ +

◆ hover_down

+ +
+
+ + + + +
bool hover_down = false
+
+ +

Whether the resizeable down side is hovered.

+ +

Definition at line 247 of file component_options.hpp.

+ +
+
+ +
+
+ +

◆ ftxui::DropdownOption

+ +
+
+ + + + +
struct ftxui::DropdownOption
+
+

Option for the Dropdown component.

+

A dropdown menu is a checkbox opening/closing a radiobox.

+ +

Definition at line 273 of file component_options.hpp.

+
+ + + + + + + + + + +

Public Attributes

Ref< bool > open = false
 Whether the dropdown is open or closed:
 
CheckboxOption checkbox
 
RadioboxOption radiobox
 
std::function< Element(bool open, Element checkbox, Element radiobox)> transform
 
+

Member Data Documentation

+ +

◆ open

+ +
+
+ + + + +
Ref<bool> open = false
+
+ +

Whether the dropdown is open or closed:

+ +

Definition at line 275 of file component_options.hpp.

+ +
+
+ +

◆ checkbox

+ +
+
+ + + + +
CheckboxOption checkbox
+
+ +

Definition at line 277 of file component_options.hpp.

+ +
+
+ +

◆ radiobox

+ +
+
+ + + + +
RadioboxOption radiobox
+
+ +

Definition at line 279 of file component_options.hpp.

+ +
+
+ +

◆ transform

+ +
+
+ + + + +
std::function<Element(bool open, Element checkbox, Element radiobox)> transform
+
+ +

Definition at line 282 of file component_options.hpp.

+ +
+
+ +
+
+ +

◆ ftxui::Event

+ +
+
+ + + + +
struct ftxui::Event
+
+

Represent an event. It can be key press event, a terminal resize, or more ...

+

For example:

    +
  • Printable character can be created using Event::Character('a').
  • +
  • Some special are predefined, like Event::ArrowLeft.
  • +
  • One can find arbitrary code for special Events using: ./example/util/print_key_press For instance, CTLR+A maps to Event::Special({1});
  • +
+

Useful documentation about xterm specification: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html

+
Examples
examples/component/canvas_animated.cpp, examples/component/custom_loop.cpp, examples/component/input.cpp, and examples/component/print_key_press.cpp.
+
+ +

Definition at line 29 of file event.hpp.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

bool operator== (const Event &other) const
 
bool operator!= (const Event &other) const
 
bool operator< (const Event &other) const
 
const std::string & input () const
 
bool is_character () const
 
std::string character () const
 
bool is_mouse () const
 
struct Mousemouse ()
 
bool is_cursor_position () const
 
int cursor_x () const
 
int cursor_y () const
 
bool is_cursor_shape () const
 
int cursor_shape () const
 
std::string DebugString () const
 Return a string representation of the event.
 

Static Public Member Functions

static Event Character (std::string)
 An event corresponding to a given typed character.
 
static Event Character (char)
 An event corresponding to a given typed character.
 
static Event Character (wchar_t)
 An event corresponding to a given typed character.
 
static Event Special (std::string)
 An custom event whose meaning is defined by the user of the library.
 
static Event Mouse (std::string, Mouse mouse)
 An event corresponding to a given typed character.
 
static Event CursorPosition (std::string, int x, int y)
 
static Event CursorShape (std::string, int shape)
 An event corresponding to a terminal DCS (Device Control String).
 

Public Attributes

ScreenInteractivescreen_ = nullptr
 

Static Public Attributes

static const Event ArrowLeft = Event::Special("\x1B[D")
 
static const Event ArrowRight = Event::Special("\x1B[C")
 
static const Event ArrowUp = Event::Special("\x1B[A")
 
static const Event ArrowDown = Event::Special("\x1B[B")
 
static const Event ArrowLeftCtrl = Event::Special("\x1B[1;5D")
 
static const Event ArrowRightCtrl = Event::Special("\x1B[1;5C")
 
static const Event ArrowUpCtrl = Event::Special("\x1B[1;5A")
 
static const Event ArrowDownCtrl = Event::Special("\x1B[1;5B")
 
static const Event Backspace = Event::Special({127})
 
static const Event Delete = Event::Special("\x1B[3~")
 
static const Event Return = Event::Special({10})
 
static const Event Escape = Event::Special("\x1B")
 
static const Event Tab = Event::Special({9})
 
static const Event TabReverse = Event::Special({27, 91, 90})
 
static const Event Insert = Event::Special("\x1B[2~")
 
static const Event Home = Event::Special({27, 91, 72})
 
static const Event End = Event::Special({27, 91, 70})
 
static const Event PageUp = Event::Special({27, 91, 53, 126})
 
static const Event PageDown = Event::Special({27, 91, 54, 126})
 
static const Event F1 = Event::Special("\x1BOP")
 
static const Event F2 = Event::Special("\x1BOQ")
 
static const Event F3 = Event::Special("\x1BOR")
 
static const Event F4 = Event::Special("\x1BOS")
 
static const Event F5 = Event::Special("\x1B[15~")
 
static const Event F6 = Event::Special("\x1B[17~")
 
static const Event F7 = Event::Special("\x1B[18~")
 
static const Event F8 = Event::Special("\x1B[19~")
 
static const Event F9 = Event::Special("\x1B[20~")
 
static const Event F10 = Event::Special("\x1B[21~")
 
static const Event F11 = Event::Special("\x1B[23~")
 
static const Event F12 = Event::Special("\x1B[24~")
 
static const Event a = Event::Character("a")
 
static const Event A = Event::Character("A")
 
static const Event CtrlA = Event::Special("\x01")
 
static const Event AltA = Event::Special("\x1b""a")
 
static const Event CtrlAltA = Event::Special("\x1b\x01")
 
static const Event b = Event::Character("b")
 
static const Event B = Event::Character("B")
 
static const Event CtrlB = Event::Special("\x02")
 
static const Event AltB = Event::Special("\x1b""b")
 
static const Event CtrlAltB = Event::Special("\x1b\x02")
 
static const Event c = Event::Character("c")
 
static const Event C = Event::Character("C")
 
static const Event CtrlC = Event::Special("\x03")
 
static const Event AltC = Event::Special("\x1b""c")
 
static const Event CtrlAltC = Event::Special("\x1b\x03")
 
static const Event d = Event::Character("d")
 
static const Event D = Event::Character("D")
 
static const Event CtrlD = Event::Special("\x04")
 
static const Event AltD = Event::Special("\x1b""d")
 
static const Event CtrlAltD = Event::Special("\x1b\x04")
 
static const Event e = Event::Character("e")
 
static const Event E = Event::Character("E")
 
static const Event CtrlE = Event::Special("\x05")
 
static const Event AltE = Event::Special("\x1b""e")
 
static const Event CtrlAltE = Event::Special("\x1b\x05")
 
static const Event f = Event::Character("f")
 
static const Event F = Event::Character("F")
 
static const Event CtrlF = Event::Special("\x06")
 
static const Event AltF = Event::Special("\x1b""f")
 
static const Event CtrlAltF = Event::Special("\x1b\x06")
 
static const Event g = Event::Character("g")
 
static const Event G = Event::Character("G")
 
static const Event CtrlG = Event::Special("\x07")
 
static const Event AltG = Event::Special("\x1b""g")
 
static const Event CtrlAltG = Event::Special("\x1b\x07")
 
static const Event h = Event::Character("h")
 
static const Event H = Event::Character("H")
 
static const Event CtrlH = Event::Special("\x08")
 
static const Event AltH = Event::Special("\x1b""h")
 
static const Event CtrlAltH = Event::Special("\x1b\x08")
 
static const Event i = Event::Character("i")
 
static const Event I = Event::Character("I")
 
static const Event CtrlI = Event::Special("\x09")
 
static const Event AltI = Event::Special("\x1b""i")
 
static const Event CtrlAltI = Event::Special("\x1b\x09")
 
static const Event j = Event::Character("j")
 
static const Event J = Event::Character("J")
 
static const Event CtrlJ = Event::Special("\x0a")
 
static const Event AltJ = Event::Special("\x1b""j")
 
static const Event CtrlAltJ = Event::Special("\x1b\x0a")
 
static const Event k = Event::Character("k")
 
static const Event K = Event::Character("K")
 
static const Event CtrlK = Event::Special("\x0b")
 
static const Event AltK = Event::Special("\x1b""k")
 
static const Event CtrlAltK = Event::Special("\x1b\x0b")
 
static const Event l = Event::Character("l")
 
static const Event L = Event::Character("L")
 
static const Event CtrlL = Event::Special("\x0c")
 
static const Event AltL = Event::Special("\x1b""l")
 
static const Event CtrlAltL = Event::Special("\x1b\x0c")
 
static const Event m = Event::Character("m")
 
static const Event M = Event::Character("M")
 
static const Event CtrlM = Event::Special("\x0d")
 
static const Event AltM = Event::Special("\x1b""m")
 
static const Event CtrlAltM = Event::Special("\x1b\x0d")
 
static const Event n = Event::Character("n")
 
static const Event N = Event::Character("N")
 
static const Event CtrlN = Event::Special("\x0e")
 
static const Event AltN = Event::Special("\x1b""n")
 
static const Event CtrlAltN = Event::Special("\x1b\x0e")
 
static const Event o = Event::Character("o")
 
static const Event O = Event::Character("O")
 
static const Event CtrlO = Event::Special("\x0f")
 
static const Event AltO = Event::Special("\x1b""o")
 
static const Event CtrlAltO = Event::Special("\x1b\x0f")
 
static const Event p = Event::Character("p")
 
static const Event P = Event::Character("P")
 
static const Event CtrlP = Event::Special("\x10")
 
static const Event AltP = Event::Special("\x1b""p")
 
static const Event CtrlAltP = Event::Special("\x1b\x10")
 
static const Event q = Event::Character("q")
 
static const Event Q = Event::Character("Q")
 
static const Event CtrlQ = Event::Special("\x11")
 
static const Event AltQ = Event::Special("\x1b""q")
 
static const Event CtrlAltQ = Event::Special("\x1b\x11")
 
static const Event r = Event::Character("r")
 
static const Event R = Event::Character("R")
 
static const Event CtrlR = Event::Special("\x12")
 
static const Event AltR = Event::Special("\x1b""r")
 
static const Event CtrlAltR = Event::Special("\x1b\x12")
 
static const Event s = Event::Character("s")
 
static const Event S = Event::Character("S")
 
static const Event CtrlS = Event::Special("\x13")
 
static const Event AltS = Event::Special("\x1b""s")
 
static const Event CtrlAltS = Event::Special("\x1b\x13")
 
static const Event t = Event::Character("t")
 
static const Event T = Event::Character("T")
 
static const Event CtrlT = Event::Special("\x14")
 
static const Event AltT = Event::Special("\x1b""t")
 
static const Event CtrlAltT = Event::Special("\x1b\x14")
 
static const Event u = Event::Character("u")
 
static const Event U = Event::Character("U")
 
static const Event CtrlU = Event::Special("\x15")
 
static const Event AltU = Event::Special("\x1b""u")
 
static const Event CtrlAltU = Event::Special("\x1b\x15")
 
static const Event v = Event::Character("v")
 
static const Event V = Event::Character("V")
 
static const Event CtrlV = Event::Special("\x16")
 
static const Event AltV = Event::Special("\x1b""v")
 
static const Event CtrlAltV = Event::Special("\x1b\x16")
 
static const Event w = Event::Character("w")
 
static const Event W = Event::Character("W")
 
static const Event CtrlW = Event::Special("\x17")
 
static const Event AltW = Event::Special("\x1b""w")
 
static const Event CtrlAltW = Event::Special("\x1b\x17")
 
static const Event x = Event::Character("x")
 
static const Event X = Event::Character("X")
 
static const Event CtrlX = Event::Special("\x18")
 
static const Event AltX = Event::Special("\x1b""x")
 
static const Event CtrlAltX = Event::Special("\x1b\x18")
 
static const Event y = Event::Character("y")
 
static const Event Y = Event::Character("Y")
 
static const Event CtrlY = Event::Special("\x19")
 
static const Event AltY = Event::Special("\x1b""y")
 
static const Event CtrlAltY = Event::Special("\x1b\x19")
 
static const Event z = Event::Character("z")
 
static const Event Z = Event::Character("Z")
 
static const Event CtrlZ = Event::Special("\x1a")
 
static const Event AltZ = Event::Special("\x1b""z")
 
static const Event CtrlAltZ = Event::Special("\x1b\x1a")
 
static const Event Custom = Event::Special({0})
 
+

Member Function Documentation

+ +

◆ Character() [1/3]

+ +
+
+ + + + + +
+ + + + + + + +
Event Character (std::string input)
+
+static
+
+ +

An event corresponding to a given typed character.

+
Parameters
+ + +
inputThe character typed by the user.
+
+
+ +

Definition at line 28 of file event.cpp.

+ +
+
+ +

◆ Character() [2/3]

+ +
+
+ + + + + +
+ + + + + + + +
Event Character (char c)
+
+static
+
+ +

An event corresponding to a given typed character.

+
Parameters
+ + +
cThe character typed by the user.
+
+
+ +

Definition at line 38 of file event.cpp.

+ +
+
+ +

◆ Character() [3/3]

+ +
+
+ + + + + +
+ + + + + + + +
Event Character (wchar_t c)
+
+static
+
+ +

An event corresponding to a given typed character.

+
Parameters
+ + +
cThe character typed by the user.
+
+
+ +

Definition at line 45 of file event.cpp.

+ +
+
+ +

◆ Special()

+ +
+
+ + + + + +
+ + + + + + + +
Event Special (std::string input)
+
+static
+
+ +

An custom event whose meaning is defined by the user of the library.

+
Parameters
+ + +
inputAn arbitrary sequence of character defined by the developer.
+
+
+ +

Definition at line 74 of file event.cpp.

+ +
+
+ +

◆ Mouse()

+ +
+
+ + + + + +
+ + + + + + + + + + + +
Event Mouse (std::string input,
Mouse mouse )
+
+static
+
+ +

An event corresponding to a given typed character.

+
Parameters
+ + + +
inputThe sequence of character send by the terminal.
mouseThe mouse state.
+
+
+ +

Definition at line 53 of file event.cpp.

+ +
+
+ +

◆ CursorPosition()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + +
Event CursorPosition (std::string input,
int x,
int y )
+
+static
+
+ +

Definition at line 82 of file event.cpp.

+ +
+
+ +

◆ CursorShape()

+ +
+
+ + + + + +
+ + + + + + + + + + + +
Event CursorShape (std::string input,
int shape )
+
+static
+
+ +

An event corresponding to a terminal DCS (Device Control String).

+ +

Definition at line 63 of file event.cpp.

+ +
+
+ +

◆ operator==()

+ +
+
+ + + + + +
+ + + + + + + +
bool operator== (const Event & other) const
+
+inline
+
+ +

Definition at line 100 of file event.hpp.

+ +
+
+ +

◆ operator!=()

+ +
+
+ + + + + +
+ + + + + + + +
bool operator!= (const Event & other) const
+
+inline
+
+ +

Definition at line 101 of file event.hpp.

+ +
+
+ +

◆ operator<()

+ +
+
+ + + + + +
+ + + + + + + +
bool operator< (const Event & other) const
+
+inline
+
+ +

Definition at line 102 of file event.hpp.

+ +
+
+ +

◆ input()

+ +
+
+ + + + + +
+ + + + + + + +
const std::string & input () const
+
+inline
+
+
Examples
examples/component/print_key_press.cpp.
+
+ +

Definition at line 104 of file event.hpp.

+ +
+
+ +

◆ is_character()

+ +
+
+ + + + + +
+ + + + + + + +
bool is_character () const
+
+inline
+
+ +

Definition at line 106 of file event.hpp.

+ +
+
+ +

◆ character()

+ +
+
+ + + + + +
+ + + + + + + +
std::string character () const
+
+inline
+
+
Examples
examples/component/input.cpp.
+
+ +

Definition at line 107 of file event.hpp.

+ +
+
+ +

◆ is_mouse()

+ +
+
+ + + + + +
+ + + + + + + +
bool is_mouse () const
+
+inline
+
+
Examples
examples/component/canvas_animated.cpp.
+
+ +

Definition at line 109 of file event.hpp.

+ +
+
+ +

◆ mouse()

+ +
+
+ + + + + +
+ + + + + + + +
struct Mouse & mouse ()
+
+inline
+
+ +

Definition at line 110 of file event.hpp.

+ +
+
+ +

◆ is_cursor_position()

+ +
+
+ + + + + +
+ + + + + + + +
bool is_cursor_position () const
+
+inline
+
+ +

Definition at line 113 of file event.hpp.

+ +
+
+ +

◆ cursor_x()

+ +
+
+ + + + + +
+ + + + + + + +
int cursor_x () const
+
+inline
+
+ +

Definition at line 114 of file event.hpp.

+ +
+
+ +

◆ cursor_y()

+ +
+
+ + + + + +
+ + + + + + + +
int cursor_y () const
+
+inline
+
+ +

Definition at line 115 of file event.hpp.

+ +
+
+ +

◆ is_cursor_shape()

+ +
+
+ + + + + +
+ + + + + + + +
bool is_cursor_shape () const
+
+inline
+
+ +

Definition at line 117 of file event.hpp.

+ +
+
+ +

◆ cursor_shape()

+ +
+
+ + + + + +
+ + + + + + + +
int cursor_shape () const
+
+inline
+
+ +

Definition at line 118 of file event.hpp.

+ +
+
+ +

◆ DebugString()

+ +
+
+ + + + + + + +
std::string DebugString () const
+
+ +

Return a string representation of the event.

+ +

Definition at line 91 of file event.cpp.

+ +
+
+

Member Data Documentation

+ +

◆ ArrowLeft

+ +
+
+ + + + + +
+ + + + +
const Event ArrowLeft = Event::Special("\x1B[D")
+
+static
+
+ +

Definition at line 40 of file event.hpp.

+ +
+
+ +

◆ ArrowRight

+ +
+
+ + + + + +
+ + + + +
const Event ArrowRight = Event::Special("\x1B[C")
+
+static
+
+ +

Definition at line 41 of file event.hpp.

+ +
+
+ +

◆ ArrowUp

+ +
+
+ + + + + +
+ + + + +
const Event ArrowUp = Event::Special("\x1B[A")
+
+static
+
+ +

Definition at line 42 of file event.hpp.

+ +
+
+ +

◆ ArrowDown

+ +
+
+ + + + + +
+ + + + +
const Event ArrowDown = Event::Special("\x1B[B")
+
+static
+
+ +

Definition at line 43 of file event.hpp.

+ +
+
+ +

◆ ArrowLeftCtrl

+ +
+
+ + + + + +
+ + + + +
const Event ArrowLeftCtrl = Event::Special("\x1B[1;5D")
+
+static
+
+ +

Definition at line 45 of file event.hpp.

+ +
+
+ +

◆ ArrowRightCtrl

+ +
+
+ + + + + +
+ + + + +
const Event ArrowRightCtrl = Event::Special("\x1B[1;5C")
+
+static
+
+ +

Definition at line 46 of file event.hpp.

+ +
+
+ +

◆ ArrowUpCtrl

+ +
+
+ + + + + +
+ + + + +
const Event ArrowUpCtrl = Event::Special("\x1B[1;5A")
+
+static
+
+ +

Definition at line 47 of file event.hpp.

+ +
+
+ +

◆ ArrowDownCtrl

+ +
+
+ + + + + +
+ + + + +
const Event ArrowDownCtrl = Event::Special("\x1B[1;5B")
+
+static
+
+ +

Definition at line 48 of file event.hpp.

+ +
+
+ +

◆ Backspace

+ +
+
+ + + + + +
+ + + + +
const Event Backspace = Event::Special({127})
+
+static
+
+ +

Definition at line 51 of file event.hpp.

+ +
+
+ +

◆ Delete

+ +
+
+ + + + + +
+ + + + +
const Event Delete = Event::Special("\x1B[3~")
+
+static
+
+ +

Definition at line 52 of file event.hpp.

+ +
+
+ +

◆ Return

+ +
+
+ + + + + +
+ + + + +
const Event Return = Event::Special({10})
+
+static
+
+ +

Definition at line 53 of file event.hpp.

+ +
+
+ +

◆ Escape

+ +
+
+ + + + + +
+ + + + +
const Event Escape = Event::Special("\x1B")
+
+static
+
+ +

Definition at line 54 of file event.hpp.

+ +
+
+ +

◆ Tab

+ +
+
+ + + + + +
+ + + + +
const Event Tab = Event::Special({9})
+
+static
+
+ +

Definition at line 55 of file event.hpp.

+ +
+
+ +

◆ TabReverse

+ +
+
+ + + + + +
+ + + + +
const Event TabReverse = Event::Special({27, 91, 90})
+
+static
+
+ +

Definition at line 56 of file event.hpp.

+ +
+
+ +

◆ Insert

+ +
+
+ + + + + +
+ + + + +
const Event Insert = Event::Special("\x1B[2~")
+
+static
+
+ +

Definition at line 59 of file event.hpp.

+ +
+
+ +

◆ Home

+ +
+
+ + + + + +
+ + + + +
const Event Home = Event::Special({27, 91, 72})
+
+static
+
+ +

Definition at line 60 of file event.hpp.

+ +
+
+ +

◆ End

+ +
+
+ + + + + +
+ + + + +
const Event End = Event::Special({27, 91, 70})
+
+static
+
+ +

Definition at line 61 of file event.hpp.

+ +
+
+ +

◆ PageUp

+ +
+
+ + + + + +
+ + + + +
const Event PageUp = Event::Special({27, 91, 53, 126})
+
+static
+
+ +

Definition at line 62 of file event.hpp.

+ +
+
+ +

◆ PageDown

+ +
+
+ + + + + +
+ + + + +
const Event PageDown = Event::Special({27, 91, 54, 126})
+
+static
+
+ +

Definition at line 63 of file event.hpp.

+ +
+
+ +

◆ F1

+ +
+
+ + + + + +
+ + + + +
const Event F1 = Event::Special("\x1BOP")
+
+static
+
+ +

Definition at line 66 of file event.hpp.

+ +
+
+ +

◆ F2

+ +
+
+ + + + + +
+ + + + +
const Event F2 = Event::Special("\x1BOQ")
+
+static
+
+ +

Definition at line 66 of file event.hpp.

+ +
+
+ +

◆ F3

+ +
+
+ + + + + +
+ + + + +
const Event F3 = Event::Special("\x1BOR")
+
+static
+
+ +

Definition at line 66 of file event.hpp.

+ +
+
+ +

◆ F4

+ +
+
+ + + + + +
+ + + + +
const Event F4 = Event::Special("\x1BOS")
+
+static
+
+ +

Definition at line 66 of file event.hpp.

+ +
+
+ +

◆ F5

+ +
+
+ + + + + +
+ + + + +
const Event F5 = Event::Special("\x1B[15~")
+
+static
+
+ +

Definition at line 66 of file event.hpp.

+ +
+
+ +

◆ F6

+ +
+
+ + + + + +
+ + + + +
const Event F6 = Event::Special("\x1B[17~")
+
+static
+
+ +

Definition at line 66 of file event.hpp.

+ +
+
+ +

◆ F7

+ +
+
+ + + + + +
+ + + + +
const Event F7 = Event::Special("\x1B[18~")
+
+static
+
+ +

Definition at line 66 of file event.hpp.

+ +
+
+ +

◆ F8

+ +
+
+ + + + + +
+ + + + +
const Event F8 = Event::Special("\x1B[19~")
+
+static
+
+ +

Definition at line 66 of file event.hpp.

+ +
+
+ +

◆ F9

+ +
+
+ + + + + +
+ + + + +
const Event F9 = Event::Special("\x1B[20~")
+
+static
+
+ +

Definition at line 66 of file event.hpp.

+ +
+
+ +

◆ F10

+ +
+
+ + + + + +
+ + + + +
const Event F10 = Event::Special("\x1B[21~")
+
+static
+
+ +

Definition at line 66 of file event.hpp.

+ +
+
+ +

◆ F11

+ +
+
+ + + + + +
+ + + + +
const Event F11 = Event::Special("\x1B[23~")
+
+static
+
+ +

Definition at line 66 of file event.hpp.

+ +
+
+ +

◆ F12

+ +
+
+ + + + + +
+ + + + +
const Event F12 = Event::Special("\x1B[24~")
+
+static
+
+ +

Definition at line 66 of file event.hpp.

+ +
+
+ +

◆ a

+ +
+
+ + + + + +
+ + + + +
const Event a = Event::Character("a")
+
+static
+
+ +

Definition at line 69 of file event.hpp.

+ +
+
+ +

◆ A

+ +
+
+ + + + + +
+ + + + +
const Event A = Event::Character("A")
+
+static
+
+ +

Definition at line 69 of file event.hpp.

+ +
+
+ +

◆ CtrlA

+ +
+
+ + + + + +
+ + + + +
const Event CtrlA = Event::Special("\x01")
+
+static
+
+ +

Definition at line 69 of file event.hpp.

+ +
+
+ +

◆ AltA

+ +
+
+ + + + + +
+ + + + +
const Event AltA = Event::Special("\x1b""a")
+
+static
+
+ +

Definition at line 69 of file event.hpp.

+ +
+
+ +

◆ CtrlAltA

+ +
+
+ + + + + +
+ + + + +
const Event CtrlAltA = Event::Special("\x1b\x01")
+
+static
+
+ +

Definition at line 69 of file event.hpp.

+ +
+
+ +

◆ b

+ +
+
+ + + + + +
+ + + + +
const Event b = Event::Character("b")
+
+static
+
+ +

Definition at line 70 of file event.hpp.

+ +
+
+ +

◆ B

+ +
+
+ + + + + +
+ + + + +
const Event B = Event::Character("B")
+
+static
+
+ +

Definition at line 70 of file event.hpp.

+ +
+
+ +

◆ CtrlB

+ +
+
+ + + + + +
+ + + + +
const Event CtrlB = Event::Special("\x02")
+
+static
+
+ +

Definition at line 70 of file event.hpp.

+ +
+
+ +

◆ AltB

+ +
+
+ + + + + +
+ + + + +
const Event AltB = Event::Special("\x1b""b")
+
+static
+
+ +

Definition at line 70 of file event.hpp.

+ +
+
+ +

◆ CtrlAltB

+ +
+
+ + + + + +
+ + + + +
const Event CtrlAltB = Event::Special("\x1b\x02")
+
+static
+
+ +

Definition at line 70 of file event.hpp.

+ +
+
+ +

◆ c

+ +
+
+ + + + + +
+ + + + +
const Event c = Event::Character("c")
+
+static
+
+ +

Definition at line 71 of file event.hpp.

+ +
+
+ +

◆ C

+ +
+
+ + + + + +
+ + + + +
const Event C = Event::Character("C")
+
+static
+
+ +

Definition at line 71 of file event.hpp.

+ +
+
+ +

◆ CtrlC

+ +
+
+ + + + + +
+ + + + +
const Event CtrlC = Event::Special("\x03")
+
+static
+
+ +

Definition at line 71 of file event.hpp.

+ +
+
+ +

◆ AltC

+ +
+
+ + + + + +
+ + + + +
const Event AltC = Event::Special("\x1b""c")
+
+static
+
+ +

Definition at line 71 of file event.hpp.

+ +
+
+ +

◆ CtrlAltC

+ +
+
+ + + + + +
+ + + + +
const Event CtrlAltC = Event::Special("\x1b\x03")
+
+static
+
+ +

Definition at line 71 of file event.hpp.

+ +
+
+ +

◆ d

+ +
+
+ + + + + +
+ + + + +
const Event d = Event::Character("d")
+
+static
+
+ +

Definition at line 72 of file event.hpp.

+ +
+
+ +

◆ D

+ +
+
+ + + + + +
+ + + + +
const Event D = Event::Character("D")
+
+static
+
+ +

Definition at line 72 of file event.hpp.

+ +
+
+ +

◆ CtrlD

+ +
+
+ + + + + +
+ + + + +
const Event CtrlD = Event::Special("\x04")
+
+static
+
+ +

Definition at line 72 of file event.hpp.

+ +
+
+ +

◆ AltD

+ +
+
+ + + + + +
+ + + + +
const Event AltD = Event::Special("\x1b""d")
+
+static
+
+ +

Definition at line 72 of file event.hpp.

+ +
+
+ +

◆ CtrlAltD

+ +
+
+ + + + + +
+ + + + +
const Event CtrlAltD = Event::Special("\x1b\x04")
+
+static
+
+ +

Definition at line 72 of file event.hpp.

+ +
+
+ +

◆ e

+ +
+
+ + + + + +
+ + + + +
const Event e = Event::Character("e")
+
+static
+
+ +

Definition at line 73 of file event.hpp.

+ +
+
+ +

◆ E

+ +
+
+ + + + + +
+ + + + +
const Event E = Event::Character("E")
+
+static
+
+ +

Definition at line 73 of file event.hpp.

+ +
+
+ +

◆ CtrlE

+ +
+
+ + + + + +
+ + + + +
const Event CtrlE = Event::Special("\x05")
+
+static
+
+ +

Definition at line 73 of file event.hpp.

+ +
+
+ +

◆ AltE

+ +
+
+ + + + + +
+ + + + +
const Event AltE = Event::Special("\x1b""e")
+
+static
+
+ +

Definition at line 73 of file event.hpp.

+ +
+
+ +

◆ CtrlAltE

+ +
+
+ + + + + +
+ + + + +
const Event CtrlAltE = Event::Special("\x1b\x05")
+
+static
+
+ +

Definition at line 73 of file event.hpp.

+ +
+
+ +

◆ f

+ +
+
+ + + + + +
+ + + + +
const Event f = Event::Character("f")
+
+static
+
+ +

Definition at line 74 of file event.hpp.

+ +
+
+ +

◆ F

+ +
+
+ + + + + +
+ + + + +
const Event F = Event::Character("F")
+
+static
+
+ +

Definition at line 74 of file event.hpp.

+ +
+
+ +

◆ CtrlF

+ +
+
+ + + + + +
+ + + + +
const Event CtrlF = Event::Special("\x06")
+
+static
+
+ +

Definition at line 74 of file event.hpp.

+ +
+
+ +

◆ AltF

+ +
+
+ + + + + +
+ + + + +
const Event AltF = Event::Special("\x1b""f")
+
+static
+
+ +

Definition at line 74 of file event.hpp.

+ +
+
+ +

◆ CtrlAltF

+ +
+
+ + + + + +
+ + + + +
const Event CtrlAltF = Event::Special("\x1b\x06")
+
+static
+
+ +

Definition at line 74 of file event.hpp.

+ +
+
+ +

◆ g

+ +
+
+ + + + + +
+ + + + +
const Event g = Event::Character("g")
+
+static
+
+ +

Definition at line 75 of file event.hpp.

+ +
+
+ +

◆ G

+ +
+
+ + + + + +
+ + + + +
const Event G = Event::Character("G")
+
+static
+
+ +

Definition at line 75 of file event.hpp.

+ +
+
+ +

◆ CtrlG

+ +
+
+ + + + + +
+ + + + +
const Event CtrlG = Event::Special("\x07")
+
+static
+
+ +

Definition at line 75 of file event.hpp.

+ +
+
+ +

◆ AltG

+ +
+
+ + + + + +
+ + + + +
const Event AltG = Event::Special("\x1b""g")
+
+static
+
+ +

Definition at line 75 of file event.hpp.

+ +
+
+ +

◆ CtrlAltG

+ +
+
+ + + + + +
+ + + + +
const Event CtrlAltG = Event::Special("\x1b\x07")
+
+static
+
+ +

Definition at line 75 of file event.hpp.

+ +
+
+ +

◆ h

+ +
+
+ + + + + +
+ + + + +
const Event h = Event::Character("h")
+
+static
+
+ +

Definition at line 76 of file event.hpp.

+ +
+
+ +

◆ H

+ +
+
+ + + + + +
+ + + + +
const Event H = Event::Character("H")
+
+static
+
+ +

Definition at line 76 of file event.hpp.

+ +
+
+ +

◆ CtrlH

+ +
+
+ + + + + +
+ + + + +
const Event CtrlH = Event::Special("\x08")
+
+static
+
+ +

Definition at line 76 of file event.hpp.

+ +
+
+ +

◆ AltH

+ +
+
+ + + + + +
+ + + + +
const Event AltH = Event::Special("\x1b""h")
+
+static
+
+ +

Definition at line 76 of file event.hpp.

+ +
+
+ +

◆ CtrlAltH

+ +
+
+ + + + + +
+ + + + +
const Event CtrlAltH = Event::Special("\x1b\x08")
+
+static
+
+ +

Definition at line 76 of file event.hpp.

+ +
+
+ +

◆ i

+ +
+
+ + + + + +
+ + + + +
const Event i = Event::Character("i")
+
+static
+
+ +

Definition at line 77 of file event.hpp.

+ +
+
+ +

◆ I

+ +
+
+ + + + + +
+ + + + +
const Event I = Event::Character("I")
+
+static
+
+ +

Definition at line 77 of file event.hpp.

+ +
+
+ +

◆ CtrlI

+ +
+
+ + + + + +
+ + + + +
const Event CtrlI = Event::Special("\x09")
+
+static
+
+ +

Definition at line 77 of file event.hpp.

+ +
+
+ +

◆ AltI

+ +
+
+ + + + + +
+ + + + +
const Event AltI = Event::Special("\x1b""i")
+
+static
+
+ +

Definition at line 77 of file event.hpp.

+ +
+
+ +

◆ CtrlAltI

+ +
+
+ + + + + +
+ + + + +
const Event CtrlAltI = Event::Special("\x1b\x09")
+
+static
+
+ +

Definition at line 77 of file event.hpp.

+ +
+
+ +

◆ j

+ +
+
+ + + + + +
+ + + + +
const Event j = Event::Character("j")
+
+static
+
+ +

Definition at line 78 of file event.hpp.

+ +
+
+ +

◆ J

+ +
+
+ + + + + +
+ + + + +
const Event J = Event::Character("J")
+
+static
+
+ +

Definition at line 78 of file event.hpp.

+ +
+
+ +

◆ CtrlJ

+ +
+
+ + + + + +
+ + + + +
const Event CtrlJ = Event::Special("\x0a")
+
+static
+
+ +

Definition at line 78 of file event.hpp.

+ +
+
+ +

◆ AltJ

+ +
+
+ + + + + +
+ + + + +
const Event AltJ = Event::Special("\x1b""j")
+
+static
+
+ +

Definition at line 78 of file event.hpp.

+ +
+
+ +

◆ CtrlAltJ

+ +
+
+ + + + + +
+ + + + +
const Event CtrlAltJ = Event::Special("\x1b\x0a")
+
+static
+
+ +

Definition at line 78 of file event.hpp.

+ +
+
+ +

◆ k

+ +
+
+ + + + + +
+ + + + +
const Event k = Event::Character("k")
+
+static
+
+ +

Definition at line 79 of file event.hpp.

+ +
+
+ +

◆ K

+ +
+
+ + + + + +
+ + + + +
const Event K = Event::Character("K")
+
+static
+
+ +

Definition at line 79 of file event.hpp.

+ +
+
+ +

◆ CtrlK

+ +
+
+ + + + + +
+ + + + +
const Event CtrlK = Event::Special("\x0b")
+
+static
+
+ +

Definition at line 79 of file event.hpp.

+ +
+
+ +

◆ AltK

+ +
+
+ + + + + +
+ + + + +
const Event AltK = Event::Special("\x1b""k")
+
+static
+
+ +

Definition at line 79 of file event.hpp.

+ +
+
+ +

◆ CtrlAltK

+ +
+
+ + + + + +
+ + + + +
const Event CtrlAltK = Event::Special("\x1b\x0b")
+
+static
+
+ +

Definition at line 79 of file event.hpp.

+ +
+
+ +

◆ l

+ +
+
+ + + + + +
+ + + + +
const Event l = Event::Character("l")
+
+static
+
+ +

Definition at line 80 of file event.hpp.

+ +
+
+ +

◆ L

+ +
+
+ + + + + +
+ + + + +
const Event L = Event::Character("L")
+
+static
+
+ +

Definition at line 80 of file event.hpp.

+ +
+
+ +

◆ CtrlL

+ +
+
+ + + + + +
+ + + + +
const Event CtrlL = Event::Special("\x0c")
+
+static
+
+ +

Definition at line 80 of file event.hpp.

+ +
+
+ +

◆ AltL

+ +
+
+ + + + + +
+ + + + +
const Event AltL = Event::Special("\x1b""l")
+
+static
+
+ +

Definition at line 80 of file event.hpp.

+ +
+
+ +

◆ CtrlAltL

+ +
+
+ + + + + +
+ + + + +
const Event CtrlAltL = Event::Special("\x1b\x0c")
+
+static
+
+ +

Definition at line 80 of file event.hpp.

+ +
+
+ +

◆ m

+ +
+
+ + + + + +
+ + + + +
const Event m = Event::Character("m")
+
+static
+
+ +

Definition at line 81 of file event.hpp.

+ +
+
+ +

◆ M

+ +
+
+ + + + + +
+ + + + +
const Event M = Event::Character("M")
+
+static
+
+ +

Definition at line 81 of file event.hpp.

+ +
+
+ +

◆ CtrlM

+ +
+
+ + + + + +
+ + + + +
const Event CtrlM = Event::Special("\x0d")
+
+static
+
+ +

Definition at line 81 of file event.hpp.

+ +
+
+ +

◆ AltM

+ +
+
+ + + + + +
+ + + + +
const Event AltM = Event::Special("\x1b""m")
+
+static
+
+ +

Definition at line 81 of file event.hpp.

+ +
+
+ +

◆ CtrlAltM

+ +
+
+ + + + + +
+ + + + +
const Event CtrlAltM = Event::Special("\x1b\x0d")
+
+static
+
+ +

Definition at line 81 of file event.hpp.

+ +
+
+ +

◆ n

+ +
+
+ + + + + +
+ + + + +
const Event n = Event::Character("n")
+
+static
+
+ +

Definition at line 82 of file event.hpp.

+ +
+
+ +

◆ N

+ +
+
+ + + + + +
+ + + + +
const Event N = Event::Character("N")
+
+static
+
+ +

Definition at line 82 of file event.hpp.

+ +
+
+ +

◆ CtrlN

+ +
+
+ + + + + +
+ + + + +
const Event CtrlN = Event::Special("\x0e")
+
+static
+
+ +

Definition at line 82 of file event.hpp.

+ +
+
+ +

◆ AltN

+ +
+
+ + + + + +
+ + + + +
const Event AltN = Event::Special("\x1b""n")
+
+static
+
+ +

Definition at line 82 of file event.hpp.

+ +
+
+ +

◆ CtrlAltN

+ +
+
+ + + + + +
+ + + + +
const Event CtrlAltN = Event::Special("\x1b\x0e")
+
+static
+
+ +

Definition at line 82 of file event.hpp.

+ +
+
+ +

◆ o

+ +
+
+ + + + + +
+ + + + +
const Event o = Event::Character("o")
+
+static
+
+ +

Definition at line 83 of file event.hpp.

+ +
+
+ +

◆ O

+ +
+
+ + + + + +
+ + + + +
const Event O = Event::Character("O")
+
+static
+
+ +

Definition at line 83 of file event.hpp.

+ +
+
+ +

◆ CtrlO

+ +
+
+ + + + + +
+ + + + +
const Event CtrlO = Event::Special("\x0f")
+
+static
+
+ +

Definition at line 83 of file event.hpp.

+ +
+
+ +

◆ AltO

+ +
+
+ + + + + +
+ + + + +
const Event AltO = Event::Special("\x1b""o")
+
+static
+
+ +

Definition at line 83 of file event.hpp.

+ +
+
+ +

◆ CtrlAltO

+ +
+
+ + + + + +
+ + + + +
const Event CtrlAltO = Event::Special("\x1b\x0f")
+
+static
+
+ +

Definition at line 83 of file event.hpp.

+ +
+
+ +

◆ p

+ +
+
+ + + + + +
+ + + + +
const Event p = Event::Character("p")
+
+static
+
+ +

Definition at line 84 of file event.hpp.

+ +
+
+ +

◆ P

+ +
+
+ + + + + +
+ + + + +
const Event P = Event::Character("P")
+
+static
+
+ +

Definition at line 84 of file event.hpp.

+ +
+
+ +

◆ CtrlP

+ +
+
+ + + + + +
+ + + + +
const Event CtrlP = Event::Special("\x10")
+
+static
+
+ +

Definition at line 84 of file event.hpp.

+ +
+
+ +

◆ AltP

+ +
+
+ + + + + +
+ + + + +
const Event AltP = Event::Special("\x1b""p")
+
+static
+
+ +

Definition at line 84 of file event.hpp.

+ +
+
+ +

◆ CtrlAltP

+ +
+
+ + + + + +
+ + + + +
const Event CtrlAltP = Event::Special("\x1b\x10")
+
+static
+
+ +

Definition at line 84 of file event.hpp.

+ +
+
+ +

◆ q

+ +
+
+ + + + + +
+ + + + +
const Event q = Event::Character("q")
+
+static
+
+ +

Definition at line 85 of file event.hpp.

+ +
+
+ +

◆ Q

+ +
+
+ + + + + +
+ + + + +
const Event Q = Event::Character("Q")
+
+static
+
+ +

Definition at line 85 of file event.hpp.

+ +
+
+ +

◆ CtrlQ

+ +
+
+ + + + + +
+ + + + +
const Event CtrlQ = Event::Special("\x11")
+
+static
+
+ +

Definition at line 85 of file event.hpp.

+ +
+
+ +

◆ AltQ

+ +
+
+ + + + + +
+ + + + +
const Event AltQ = Event::Special("\x1b""q")
+
+static
+
+ +

Definition at line 85 of file event.hpp.

+ +
+
+ +

◆ CtrlAltQ

+ +
+
+ + + + + +
+ + + + +
const Event CtrlAltQ = Event::Special("\x1b\x11")
+
+static
+
+ +

Definition at line 85 of file event.hpp.

+ +
+
+ +

◆ r

+ +
+
+ + + + + +
+ + + + +
const Event r = Event::Character("r")
+
+static
+
+ +

Definition at line 86 of file event.hpp.

+ +
+
+ +

◆ R

+ +
+
+ + + + + +
+ + + + +
const Event R = Event::Character("R")
+
+static
+
+ +

Definition at line 86 of file event.hpp.

+ +
+
+ +

◆ CtrlR

+ +
+
+ + + + + +
+ + + + +
const Event CtrlR = Event::Special("\x12")
+
+static
+
+ +

Definition at line 86 of file event.hpp.

+ +
+
+ +

◆ AltR

+ +
+
+ + + + + +
+ + + + +
const Event AltR = Event::Special("\x1b""r")
+
+static
+
+ +

Definition at line 86 of file event.hpp.

+ +
+
+ +

◆ CtrlAltR

+ +
+
+ + + + + +
+ + + + +
const Event CtrlAltR = Event::Special("\x1b\x12")
+
+static
+
+ +

Definition at line 86 of file event.hpp.

+ +
+
+ +

◆ s

+ +
+
+ + + + + +
+ + + + +
const Event s = Event::Character("s")
+
+static
+
+ +

Definition at line 87 of file event.hpp.

+ +
+
+ +

◆ S

+ +
+
+ + + + + +
+ + + + +
const Event S = Event::Character("S")
+
+static
+
+ +

Definition at line 87 of file event.hpp.

+ +
+
+ +

◆ CtrlS

+ +
+
+ + + + + +
+ + + + +
const Event CtrlS = Event::Special("\x13")
+
+static
+
+ +

Definition at line 87 of file event.hpp.

+ +
+
+ +

◆ AltS

+ +
+
+ + + + + +
+ + + + +
const Event AltS = Event::Special("\x1b""s")
+
+static
+
+ +

Definition at line 87 of file event.hpp.

+ +
+
+ +

◆ CtrlAltS

+ +
+
+ + + + + +
+ + + + +
const Event CtrlAltS = Event::Special("\x1b\x13")
+
+static
+
+ +

Definition at line 87 of file event.hpp.

+ +
+
+ +

◆ t

+ +
+
+ + + + + +
+ + + + +
const Event t = Event::Character("t")
+
+static
+
+ +

Definition at line 88 of file event.hpp.

+ +
+
+ +

◆ T

+ +
+
+ + + + + +
+ + + + +
const Event T = Event::Character("T")
+
+static
+
+ +

Definition at line 88 of file event.hpp.

+ +
+
+ +

◆ CtrlT

+ +
+
+ + + + + +
+ + + + +
const Event CtrlT = Event::Special("\x14")
+
+static
+
+ +

Definition at line 88 of file event.hpp.

+ +
+
+ +

◆ AltT

+ +
+
+ + + + + +
+ + + + +
const Event AltT = Event::Special("\x1b""t")
+
+static
+
+ +

Definition at line 88 of file event.hpp.

+ +
+
+ +

◆ CtrlAltT

+ +
+
+ + + + + +
+ + + + +
const Event CtrlAltT = Event::Special("\x1b\x14")
+
+static
+
+ +

Definition at line 88 of file event.hpp.

+ +
+
+ +

◆ u

+ +
+
+ + + + + +
+ + + + +
const Event u = Event::Character("u")
+
+static
+
+ +

Definition at line 89 of file event.hpp.

+ +
+
+ +

◆ U

+ +
+
+ + + + + +
+ + + + +
const Event U = Event::Character("U")
+
+static
+
+ +

Definition at line 89 of file event.hpp.

+ +
+
+ +

◆ CtrlU

+ +
+
+ + + + + +
+ + + + +
const Event CtrlU = Event::Special("\x15")
+
+static
+
+ +

Definition at line 89 of file event.hpp.

+ +
+
+ +

◆ AltU

+ +
+
+ + + + + +
+ + + + +
const Event AltU = Event::Special("\x1b""u")
+
+static
+
+ +

Definition at line 89 of file event.hpp.

+ +
+
+ +

◆ CtrlAltU

+ +
+
+ + + + + +
+ + + + +
const Event CtrlAltU = Event::Special("\x1b\x15")
+
+static
+
+ +

Definition at line 89 of file event.hpp.

+ +
+
+ +

◆ v

+ +
+
+ + + + + +
+ + + + +
const Event v = Event::Character("v")
+
+static
+
+ +

Definition at line 90 of file event.hpp.

+ +
+
+ +

◆ V

+ +
+
+ + + + + +
+ + + + +
const Event V = Event::Character("V")
+
+static
+
+ +

Definition at line 90 of file event.hpp.

+ +
+
+ +

◆ CtrlV

+ +
+
+ + + + + +
+ + + + +
const Event CtrlV = Event::Special("\x16")
+
+static
+
+ +

Definition at line 90 of file event.hpp.

+ +
+
+ +

◆ AltV

+ +
+
+ + + + + +
+ + + + +
const Event AltV = Event::Special("\x1b""v")
+
+static
+
+ +

Definition at line 90 of file event.hpp.

+ +
+
+ +

◆ CtrlAltV

+ +
+
+ + + + + +
+ + + + +
const Event CtrlAltV = Event::Special("\x1b\x16")
+
+static
+
+ +

Definition at line 90 of file event.hpp.

+ +
+
+ +

◆ w

+ +
+
+ + + + + +
+ + + + +
const Event w = Event::Character("w")
+
+static
+
+ +

Definition at line 91 of file event.hpp.

+ +
+
+ +

◆ W

+ +
+
+ + + + + +
+ + + + +
const Event W = Event::Character("W")
+
+static
+
+ +

Definition at line 91 of file event.hpp.

+ +
+
+ +

◆ CtrlW

+ +
+
+ + + + + +
+ + + + +
const Event CtrlW = Event::Special("\x17")
+
+static
+
+ +

Definition at line 91 of file event.hpp.

+ +
+
+ +

◆ AltW

+ +
+
+ + + + + +
+ + + + +
const Event AltW = Event::Special("\x1b""w")
+
+static
+
+ +

Definition at line 91 of file event.hpp.

+ +
+
+ +

◆ CtrlAltW

+ +
+
+ + + + + +
+ + + + +
const Event CtrlAltW = Event::Special("\x1b\x17")
+
+static
+
+ +

Definition at line 91 of file event.hpp.

+ +
+
+ +

◆ x

+ +
+
+ + + + + +
+ + + + +
const Event x = Event::Character("x")
+
+static
+
+ +

Definition at line 92 of file event.hpp.

+ +
+
+ +

◆ X

+ +
+
+ + + + + +
+ + + + +
const Event X = Event::Character("X")
+
+static
+
+ +

Definition at line 92 of file event.hpp.

+ +
+
+ +

◆ CtrlX

+ +
+
+ + + + + +
+ + + + +
const Event CtrlX = Event::Special("\x18")
+
+static
+
+ +

Definition at line 92 of file event.hpp.

+ +
+
+ +

◆ AltX

+ +
+
+ + + + + +
+ + + + +
const Event AltX = Event::Special("\x1b""x")
+
+static
+
+ +

Definition at line 92 of file event.hpp.

+ +
+
+ +

◆ CtrlAltX

+ +
+
+ + + + + +
+ + + + +
const Event CtrlAltX = Event::Special("\x1b\x18")
+
+static
+
+ +

Definition at line 92 of file event.hpp.

+ +
+
+ +

◆ y

+ +
+
+ + + + + +
+ + + + +
const Event y = Event::Character("y")
+
+static
+
+ +

Definition at line 93 of file event.hpp.

+ +
+
+ +

◆ Y

+ +
+
+ + + + + +
+ + + + +
const Event Y = Event::Character("Y")
+
+static
+
+ +

Definition at line 93 of file event.hpp.

+ +
+
+ +

◆ CtrlY

+ +
+
+ + + + + +
+ + + + +
const Event CtrlY = Event::Special("\x19")
+
+static
+
+ +

Definition at line 93 of file event.hpp.

+ +
+
+ +

◆ AltY

+ +
+
+ + + + + +
+ + + + +
const Event AltY = Event::Special("\x1b""y")
+
+static
+
+ +

Definition at line 93 of file event.hpp.

+ +
+
+ +

◆ CtrlAltY

+ +
+
+ + + + + +
+ + + + +
const Event CtrlAltY = Event::Special("\x1b\x19")
+
+static
+
+ +

Definition at line 93 of file event.hpp.

+ +
+
+ +

◆ z

+ +
+
+ + + + + +
+ + + + +
const Event z = Event::Character("z")
+
+static
+
+ +

Definition at line 94 of file event.hpp.

+ +
+
+ +

◆ Z

+ +
+
+ + + + + +
+ + + + +
const Event Z = Event::Character("Z")
+
+static
+
+ +

Definition at line 94 of file event.hpp.

+ +
+
+ +

◆ CtrlZ

+ +
+
+ + + + + +
+ + + + +
const Event CtrlZ = Event::Special("\x1a")
+
+static
+
+ +

Definition at line 94 of file event.hpp.

+ +
+
+ +

◆ AltZ

+ +
+
+ + + + + +
+ + + + +
const Event AltZ = Event::Special("\x1b""z")
+
+static
+
+ +

Definition at line 94 of file event.hpp.

+ +
+
+ +

◆ CtrlAltZ

+ +
+
+ + + + + +
+ + + + +
const Event CtrlAltZ = Event::Special("\x1b\x1a")
+
+static
+
+ +

Definition at line 94 of file event.hpp.

+ +
+
+ +

◆ Custom

+ +
+
+ + + + + +
+ + + + +
const Event Custom = Event::Special({0})
+
+static
+
+ +

Definition at line 97 of file event.hpp.

+ +
+
+ +

◆ screen_

+ +
+
+ + + + +
ScreenInteractive* screen_ = nullptr
+
+ +

Definition at line 124 of file event.hpp.

+ +
+
+ +

◆ mouse

+ +
+
+ + + + +
struct Mouse mouse
+
+
Examples
examples/component/canvas_animated.cpp.
+
+ +

Definition at line 144 of file event.hpp.

+ +
+
+ +

◆ cursor

+ +
+
+ + + + +
struct Cursor cursor
+
+ +

Definition at line 145 of file event.hpp.

+ +
+
+ +

◆ cursor_shape

+ +
+
+ + + + +
int cursor_shape
+
+ +

Definition at line 146 of file event.hpp.

+ +
+
+ +
+
+ +

◆ ftxui::Loop

+ +
+
+ + + + +
class ftxui::Loop
+
+

Loop is a class that manages the event loop for a component.

+

It is responsible for running the component, handling events, and updating the screen.

+

The Loop class is designed to be used with a ScreenInteractive object, which represents the terminal screen.

+

Example

+ + +
+
int main() {
+ +
auto component = ftxui::Button("Click me", [] { ... });
+
+
ftxui::Loop loop(screen.get(), component);
+
+
// Either
+
loop.Run(); // Blocking until the component quits.
+
+
// Or
+
loop.RunOnce(); // Non-blocking, returns immediately.
+
+
// Or
+
loop.RunOnceBlocking(); // Blocking until handling one event.
+
+
// Or in a loop:
+
while (!loop.HasQuitted()) {
+
loop.RunOnce();
+
+
// Do something else like running a different library loop function.
+
}
+
}
+ + +
static ScreenInteractive TerminalOutput()
+
Loop is a class that manages the event loop for a component.
Definition loop.hpp:56
+
Component Button(ButtonOption options)
Draw a button. Execute a function when clicked.
+ + +
Examples
examples/component/custom_loop.cpp, and examples/component/homescreen.cpp.
+
+ +

Definition at line 56 of file loop.hpp.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

 Loop (ScreenInteractive *screen, Component component)
 A Loop is a wrapper around a Component and a ScreenInteractive. It is used to run a Component in a terminal.
 
 ~Loop ()
 
bool HasQuitted ()
 Whether the loop has quitted.
 
void RunOnce ()
 Execute the loop. Make the component to process every pending tasks/events. A new frame might be drawn if the previous was invalidated. Return true until the loop hasn't completed.
 
void RunOnceBlocking ()
 Wait for at least one event to be handled and execute Loop::RunOnce().
 
void Run ()
 
 Loop (const Loop &)=default
 
 Loop (Loop &&)=delete
 
Loopoperator= (Loop &&)=delete
 
 Loop (const ScreenInteractive &)=delete
 
Loopoperator= (const Loop &)=delete
 
+

Constructor & Destructor Documentation

+ +

◆ Loop() [1/4]

+ +
+
+ + + + + + + + + + + +
Loop (ScreenInteractive * screen,
Component component )
+
+ +

A Loop is a wrapper around a Component and a ScreenInteractive. It is used to run a Component in a terminal.

+
See also
Component, ScreenInteractive.
+
+ScreenInteractive::Loop().
+
+ScreenInteractive::ExitLoop().
+
Parameters
+ + + +
[in]screenThe screen to use.
[in]componentThe component to run.
+
+
+ +

Definition at line 20 of file loop.cpp.

+ +
+
+ +

◆ ~Loop()

+ +
+
+ + + + + + + +
~Loop ()
+
+ +

Definition at line 25 of file loop.cpp.

+ +
+
+ +

◆ Loop() [2/4]

+ +
+
+ + + + + +
+ + + + + + + +
Loop (const Loop & )
+
+default
+
+ +
+
+ +

◆ Loop() [3/4]

+ +
+
+ + + + + +
+ + + + + + + +
Loop (Loop && )
+
+delete
+
+ +
+
+ +

◆ Loop() [4/4]

+ +
+
+ + + + + +
+ + + + + + + +
Loop (const ScreenInteractive & )
+
+delete
+
+ +
+
+

Member Function Documentation

+ +

◆ HasQuitted()

+ +
+
+ + + + + + + +
bool HasQuitted ()
+
+ +

Whether the loop has quitted.

+ +

Definition at line 30 of file loop.cpp.

+ +
+
+ +

◆ RunOnce()

+ +
+
+ + + + + + + +
void RunOnce ()
+
+ +

Execute the loop. Make the component to process every pending tasks/events. A new frame might be drawn if the previous was invalidated. Return true until the loop hasn't completed.

+ +

Definition at line 37 of file loop.cpp.

+ +
+
+ +

◆ RunOnceBlocking()

+ +
+
+ + + + + + + +
void RunOnceBlocking ()
+
+ +

Wait for at least one event to be handled and execute Loop::RunOnce().

+ +

Definition at line 43 of file loop.cpp.

+ +
+
+ +

◆ Run()

+ +
+
+ + + + + + + +
void Run ()
+
+

Execute the loop, blocking the current thread, up until the loop has quitted.

+ +

Definition at line 49 of file loop.cpp.

+ +
+
+ +

◆ operator=() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
Loop & operator= (Loop && )
+
+delete
+
+ +
+
+ +

◆ operator=() [2/2]

+ +
+
+ + + + + +
+ + + + + + + +
Loop & operator= (const Loop & )
+
+delete
+
+ +
+
+ +
+
+ +

◆ ftxui::Mouse

+ +
+
+ + + + +
struct ftxui::Mouse
+
+

A mouse event. It contains the coordinate of the mouse, the button pressed and the modifier (shift, ctrl, meta).

+ +

Definition at line 11 of file mouse.hpp.

+
+ + + + + + + + + + + + + + + + + + + + +

Public Types

enum  Button {
+  Left = 0 +,
+  Middle = 1 +,
+  Right = 2 +,
+  None = 3 +,
+  WheelUp = 4 +,
+  WheelDown = 5 +,
+  WheelLeft = 6 +,
+  WheelRight = 7 +
+ }
 
enum  Motion {
+  Released = 0 +,
+  Pressed = 1 +,
+  Moved = 2 +
+ }
 

Public Attributes

Button button = Button::None
 
Motion motion = Motion::Pressed
 
bool shift = false
 
bool meta = false
 
bool control = false
 
int x = 0
 
int y = 0
 
+

Member Enumeration Documentation

+ +

◆ Button

+ +
+
+ + + + +
enum Button
+
+ + + + + + + + + +
Enumerator
Left 
Middle 
Right 
None 
WheelUp 
WheelDown 
WheelLeft 
WheelRight 

Supported terminal only.

+
+ +

Definition at line 12 of file mouse.hpp.

+ +
+
+ +

◆ Motion

+ +
+
+ + + + +
enum Motion
+
+ + + + +
Enumerator
Released 
Pressed 
Moved 
+ +

Definition at line 23 of file mouse.hpp.

+ +
+
+

Member Data Documentation

+ +

◆ button

+ +
+
+ + + + +
Button button = Button::None
+
+ +

Definition at line 30 of file mouse.hpp.

+ +
+
+ +

◆ motion

+ +
+
+ + + + +
Motion motion = Motion::Pressed
+
+ +

Definition at line 33 of file mouse.hpp.

+ +
+
+ +

◆ shift

+ +
+
+ + + + +
bool shift = false
+
+ +

Definition at line 36 of file mouse.hpp.

+ +
+
+ +

◆ meta

+ +
+
+ + + + +
bool meta = false
+
+ +

Definition at line 37 of file mouse.hpp.

+ +
+
+ +

◆ control

+ +
+
+ + + + +
bool control = false
+
+ +

Definition at line 38 of file mouse.hpp.

+ +
+
+ +

◆ x

+ +
+
+ + + + +
int x = 0
+
+ +

Definition at line 41 of file mouse.hpp.

+ +
+
+ +

◆ y

+ +
+
+ + + + +
int y = 0
+
+ +

Definition at line 42 of file mouse.hpp.

+ +
+
+ +
+
+ +

◆ ftxui::ScreenInteractive

+ +
+
+ + + + +
class ftxui::ScreenInteractive
+
+

ScreenInteractive is a Screen that can handle events, run a main loop, and manage components.

+ +

Definition at line 35 of file screen_interactive.hpp.

+
+ + Inheritance diagram for ScreenInteractive:
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Types

using SelectionStyle = std::function<void(Pixel&)>
 

Public Member Functions

 ~ScreenInteractive ()
 
void TrackMouse (bool enable=true)
 Set whether mouse is tracked and events reported. called outside of the main loop. E.g ScreenInteractive::Loop(...).
 
void Loop (Component)
 Execute the main loop.
 
void Exit ()
 Exit the main loop.
 
Closure ExitLoopClosure ()
 Return a function to exit the main loop.
 
void Post (Task task)
 Add a task to the main loop. It will be executed later, after every other scheduled tasks.
 
void PostEvent (Event event)
 Add an event to the main loop. It will be executed later, after every other scheduled events.
 
void RequestAnimationFrame ()
 Add a task to draw the screen one more time, until all the animations are done.
 
CapturedMouse CaptureMouse ()
 Try to get the unique lock about behing able to capture the mouse.
 
Closure WithRestoredIO (Closure)
 Decorate a function. It executes the same way, but with the currently active screen terminal hooks temporarilly uninstalled during its execution.
 
void ForceHandleCtrlC (bool force)
 Force FTXUI to handle or not handle Ctrl-C, even if the component catches the Event::CtrlC.
 
void ForceHandleCtrlZ (bool force)
 Force FTXUI to handle or not handle Ctrl-Z, even if the component catches the Event::CtrlZ.
 
std::string GetSelection ()
 Returns the content of the current selection.
 
void SelectionChange (std::function< void()> callback)
 
std::string ToString () const
 
void Print () const
 
void Clear ()
 Clear all the pixel from the screen.
 
std::string ResetPosition (bool clear=false) const
 Return a string to be printed in order to reset the cursor position to the beginning of the screen.
 
void ApplyShader ()
 
Cursor cursor () const
 
void SetCursor (Cursor cursor)
 
uint8_t RegisterHyperlink (const std::string &link)
 
const std::string & Hyperlink (uint8_t id) const
 
const SelectionStyleGetSelectionStyle () const
 Return the current selection style.
 
void SetSelectionStyle (SelectionStyle decorator)
 Set the current selection style.
 
std::string & at (int x, int y)
 Access a character in a cell at a given position.
 
const std::string & at (int x, int y) const
 Access a character in a cell at a given position.
 
PixelPixelAt (int x, int y)
 Access a cell (Pixel) at a given position.
 
const PixelPixelAt (int x, int y) const
 Access a cell (Pixel) at a given position.
 
int dimx () const
 
int dimy () const
 

Static Public Member Functions

static ScreenInteractive FixedSize (int dimx, int dimy)
 
static ScreenInteractive Fullscreen ()
 
static ScreenInteractive FullscreenPrimaryScreen ()
 
static ScreenInteractive FullscreenAlternateScreen ()
 
static ScreenInteractive FitComponent ()
 
static ScreenInteractive TerminalOutput ()
 
static ScreenInteractiveActive ()
 Return the currently active screen, or null if none.
 
static Screen Create (Dimensions dimension)
 Create a screen with the given dimension.
 
static Screen Create (Dimensions width, Dimensions height)
 Create a screen with the given dimension along the x-axis and y-axis.
 

Public Attributes

friend Private
 
Box stencil
 

Protected Attributes

Cursor cursor_
 
std::vector< std::string > hyperlinks_ = {""}
 
SelectionStyle selection_style_
 
int dimx_
 
int dimy_
 
std::vector< std::vector< Pixel > > pixels_
 
+

Member Typedef Documentation

+ +

◆ SelectionStyle

+ +
+
+ + + + + +
+ + + + +
using SelectionStyle = std::function<void(Pixel&)>
+
+inherited
+
+ +

Definition at line 74 of file screen.hpp.

+ +
+
+

Constructor & Destructor Documentation

+ +

◆ ~ScreenInteractive()

+ +
+
+ + + + + +
+ + + + + + + +
~ScreenInteractive ()
+
+default
+
+ +
+
+

Member Function Documentation

+ +

◆ FixedSize()

+ +
+
+ + + + + +
+ + + + + + + + + + + +
ScreenInteractive FixedSize (int dimx,
int dimy )
+
+static
+
+ +

Definition at line 284 of file screen_interactive.cpp.

+ +
+
+ +

◆ Fullscreen()

+ +
+
+ + + + + +
+ + + + + + + +
ScreenInteractive Fullscreen ()
+
+static
+
+

Create a ScreenInteractive taking the full terminal size. This is using the alternate screen buffer to avoid messing with the terminal content.

Note
This is the same as ScreenInteractive::FullscreenAlternateScreen()
+ +

Definition at line 297 of file screen_interactive.cpp.

+ +
+
+ +

◆ FullscreenPrimaryScreen()

+ +
+
+ + + + + +
+ + + + + + + +
ScreenInteractive FullscreenPrimaryScreen ()
+
+static
+
+

Create a ScreenInteractive taking the full terminal size. The primary screen buffer is being used. It means if the terminal is resized, the previous content might mess up with the terminal content.

+ +

Definition at line 305 of file screen_interactive.cpp.

+ +
+
+ +

◆ FullscreenAlternateScreen()

+ +
+
+ + + + + +
+ + + + + + + +
ScreenInteractive FullscreenAlternateScreen ()
+
+static
+
+

Create a ScreenInteractive taking the full terminal size. This is using the alternate screen buffer to avoid messing with the terminal content.

+ +

Definition at line 318 of file screen_interactive.cpp.

+ +
+
+ +

◆ FitComponent()

+ +
+
+ + + + + +
+ + + + + + + +
ScreenInteractive FitComponent ()
+
+static
+
+

Create a ScreenInteractive whose width and height match the component being drawn.

+ +

Definition at line 346 of file screen_interactive.cpp.

+ +
+
+ +

◆ TerminalOutput()

+ +
+
+ + + + + +
+ + + + + + + +
ScreenInteractive TerminalOutput ()
+
+static
+
+

Create a ScreenInteractive whose width match the terminal output width and the height matches the component being drawn.

+ +

Definition at line 331 of file screen_interactive.cpp.

+ +
+
+ +

◆ TrackMouse()

+ +
+
+ + + + + + + +
void TrackMouse (bool enable = true)
+
+ +

Set whether mouse is tracked and events reported. called outside of the main loop. E.g ScreenInteractive::Loop(...).

+
Parameters
+ + +
enableWhether to enable mouse event tracking.
+
+
+
Note
This muse be called outside of the main loop. E.g. before calling ScreenInteractive::Loop.
+
+Mouse tracking is enabled by default.
+
+Mouse tracking is only supported on terminals that supports it.
+

+Example

+
+
screen.TrackMouse(false);
+
screen.Loop(component);
+
+

Definition at line 371 of file screen_interactive.cpp.

+ +
+
+ +

◆ Active()

+ +
+
+ + + + + +
+ + + + + + + +
ScreenInteractive * Active ()
+
+static
+
+ +

Return the currently active screen, or null if none.

+ +

Definition at line 515 of file screen_interactive.cpp.

+ +
+
+ +

◆ Loop()

+ +
+
+ + + + + + + +
void Loop (Component component)
+
+ +

Execute the main loop.

+
Parameters
+ + +
componentThe component to draw.
+
+
+ +

Definition at line 417 of file screen_interactive.cpp.

+ +
+
+ +

◆ Exit()

+ +
+
+ + + + + + + +
void Exit ()
+
+ +

Exit the main loop.

+ +

Definition at line 978 of file screen_interactive.cpp.

+ +
+
+ +

◆ ExitLoopClosure()

+ +
+
+ + + + + + + +
Closure ExitLoopClosure ()
+
+ +

Return a function to exit the main loop.

+ +

Definition at line 973 of file screen_interactive.cpp.

+ +
+
+ +

◆ Post()

+ +
+
+ + + + + + + +
void Post (Task task)
+
+ +

Add a task to the main loop. It will be executed later, after every other scheduled tasks.

+ +

Definition at line 377 of file screen_interactive.cpp.

+ +
+
+ +

◆ PostEvent()

+ +
+
+ + + + + + + +
void PostEvent (Event event)
+
+ +

Add an event to the main loop. It will be executed later, after every other scheduled events.

+ +

Definition at line 385 of file screen_interactive.cpp.

+ +
+
+ +

◆ RequestAnimationFrame()

+ +
+
+ + + + + + + +
void RequestAnimationFrame ()
+
+ +

Add a task to draw the screen one more time, until all the animations are done.

+ +

Definition at line 391 of file screen_interactive.cpp.

+ +
+
+ +

◆ CaptureMouse()

+ +
+
+ + + + + + + +
CapturedMouse CaptureMouse ()
+
+ +

Try to get the unique lock about behing able to capture the mouse.

+
Returns
A unique lock if the mouse is not already captured, otherwise a null.
+ +

Definition at line 406 of file screen_interactive.cpp.

+ +
+
+ +

◆ WithRestoredIO()

+ +
+
+ + + + + + + +
Closure WithRestoredIO (Closure fn)
+
+ +

Decorate a function. It executes the same way, but with the currently active screen terminal hooks temporarilly uninstalled during its execution.

+
Parameters
+ + +
fnThe function to decorate.
+
+
+ +

Definition at line 481 of file screen_interactive.cpp.

+ +
+
+ +

◆ ForceHandleCtrlC()

+ +
+
+ + + + + + + +
void ForceHandleCtrlC (bool force)
+
+ +

Force FTXUI to handle or not handle Ctrl-C, even if the component catches the Event::CtrlC.

+ +

Definition at line 491 of file screen_interactive.cpp.

+ +
+
+ +

◆ ForceHandleCtrlZ()

+ +
+
+ + + + + + + +
void ForceHandleCtrlZ (bool force)
+
+ +

Force FTXUI to handle or not handle Ctrl-Z, even if the component catches the Event::CtrlZ.

+ +

Definition at line 497 of file screen_interactive.cpp.

+ +
+
+ +

◆ GetSelection()

+ +
+
+ + + + + + + +
std::string GetSelection ()
+
+ +

Returns the content of the current selection.

+ +

Definition at line 502 of file screen_interactive.cpp.

+ +
+
+ +

◆ SelectionChange()

+ +
+
+ + + + + + + +
void SelectionChange (std::function< void()> callback)
+
+ +

Definition at line 509 of file screen_interactive.cpp.

+ +
+
+ +

◆ Create() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
Screen Create (Dimensions dimension)
+
+staticinherited
+
+ +

Create a screen with the given dimension.

+ +

Definition at line 395 of file screen.cpp.

+ +
+
+ +

◆ Create() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + +
Screen Create (Dimensions width,
Dimensions height )
+
+staticinherited
+
+ +

Create a screen with the given dimension along the x-axis and y-axis.

+ +

Definition at line 389 of file screen.cpp.

+ +
+
+ +

◆ ToString()

+ +
+
+ + + + + +
+ + + + + + + +
std::string ToString () const
+
+inherited
+
+

Produce a std::string that can be used to print the Screen on the terminal.

Note
Don't forget to flush stdout. Alternatively, you can use Screen::Print();
+ +

Definition at line 416 of file screen.cpp.

+ +
+
+ +

◆ Print()

+ +
+
+ + + + + +
+ + + + + + + +
void Print () const
+
+inherited
+
+ +

Definition at line 453 of file screen.cpp.

+ +
+
+ +

◆ Clear()

+ +
+
+ + + + + +
+ + + + + + + +
void Clear ()
+
+inherited
+
+ +

Clear all the pixel from the screen.

+ +

Definition at line 495 of file screen.cpp.

+ +
+
+ +

◆ ResetPosition()

+ +
+
+ + + + + +
+ + + + + + + +
std::string ResetPosition (bool clear = false) const
+
+inherited
+
+ +

Return a string to be printed in order to reset the cursor position to the beginning of the screen.

+
std::string reset_position;
+
while(true) {
+
auto document = render();
+
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
Render(screen, document);
+
std::cout << reset_position << screen.ToString() << std::flush;
+
reset_position = screen.ResetPosition();
+
+
using namespace std::chrono_literals;
+
std::this_thread::sleep_for(0.01s);
+
}
+
void Render(Screen &screen, const Element &element)
Display an element on a ftxui::Screen.
Definition node.cpp:84
+
static Screen Create(Dimensions dimension)
Create a screen with the given dimension.
Definition screen.cpp:395
+
Returns
The string to print in order to reset the cursor position to the beginning.
+ +

Definition at line 476 of file screen.cpp.

+ +
+
+ +

◆ ApplyShader()

+ +
+
+ + + + + +
+ + + + + + + +
void ApplyShader ()
+
+inherited
+
+ +

Definition at line 507 of file screen.cpp.

+ +
+
+ +

◆ cursor()

+ +
+
+ + + + + +
+ + + + + + + +
Cursor cursor () const
+
+inlineinherited
+
+ +

Definition at line 66 of file screen.hpp.

+ +
+
+ +

◆ SetCursor()

+ +
+
+ + + + + +
+ + + + + + + +
void SetCursor (Cursor cursor)
+
+inlineinherited
+
+ +

Definition at line 67 of file screen.hpp.

+ +
+
+ +

◆ RegisterHyperlink()

+ +
+
+ + + + + +
+ + + + + + + +
std::uint8_t RegisterHyperlink (const std::string & link)
+
+inherited
+
+ +

Definition at line 534 of file screen.cpp.

+ +
+
+ +

◆ Hyperlink()

+ +
+
+ + + + + +
+ + + + + + + +
const std::string & Hyperlink (uint8_t id) const
+
+inherited
+
+ +

Definition at line 547 of file screen.cpp.

+ +
+
+ +

◆ GetSelectionStyle()

+ +
+
+ + + + + +
+ + + + + + + +
const Screen::SelectionStyle & GetSelectionStyle () const
+
+inherited
+
+ +

Return the current selection style.

+
See also
SetSelectionStyle
+ +

Definition at line 556 of file screen.cpp.

+ +
+
+ +

◆ SetSelectionStyle()

+ +
+
+ + + + + +
+ + + + + + + +
void SetSelectionStyle (SelectionStyle decorator)
+
+inherited
+
+ +

Set the current selection style.

+
See also
GetSelectionStyle
+ +

Definition at line 562 of file screen.cpp.

+ +
+
+ +

◆ at() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + +
std::string & at (int x,
int y )
+
+inherited
+
+ +

Access a character in a cell at a given position.

+
Parameters
+ + + +
xThe cell position along the x-axis.
yThe cell position along the y-axis.
+
+
+ +

Definition at line 29 of file image.cpp.

+ +
+
+ +

◆ at() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + +
const std::string & at (int x,
int y ) const
+
+inherited
+
+ +

Access a character in a cell at a given position.

+
Parameters
+ + + +
xThe cell position along the x-axis.
yThe cell position along the y-axis.
+
+
+ +

Definition at line 36 of file image.cpp.

+ +
+
+ +

◆ PixelAt() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + +
Pixel & PixelAt (int x,
int y )
+
+inherited
+
+ +

Access a cell (Pixel) at a given position.

+
Parameters
+ + + +
xThe cell position along the x-axis.
yThe cell position along the y-axis.
+
+
+ +

Definition at line 43 of file image.cpp.

+ +
+
+ +

◆ PixelAt() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + +
const Pixel & PixelAt (int x,
int y ) const
+
+inherited
+
+ +

Access a cell (Pixel) at a given position.

+
Parameters
+ + + +
xThe cell position along the x-axis.
yThe cell position along the y-axis.
+
+
+ +

Definition at line 50 of file image.cpp.

+ +
+
+ +

◆ dimx()

+ +
+
+ + + + + +
+ + + + + + + +
int dimx () const
+
+inlineinherited
+
+ +

Definition at line 35 of file image.hpp.

+ +
+
+ +

◆ dimy()

+ +
+
+ + + + + +
+ + + + + + + +
int dimy () const
+
+inlineinherited
+
+ +

Definition at line 36 of file image.hpp.

+ +
+
+

Member Data Documentation

+ +

◆ Private

+ +
+
+ + + + +
friend Private
+
+ +

Definition at line 176 of file screen_interactive.hpp.

+ +
+
+ +

◆ cursor_

+ +
+
+ + + + + +
+ + + + +
Cursor cursor_
+
+protectedinherited
+
+ +

Definition at line 79 of file screen.hpp.

+ +
+
+ +

◆ hyperlinks_

+ +
+
+ + + + + +
+ + + + +
std::vector<std::string> hyperlinks_ = {""}
+
+protectedinherited
+
+ +

Definition at line 80 of file screen.hpp.

+ +
+
+ +

◆ selection_style_

+ +
+
+ + + + + +
+ + + + +
SelectionStyle selection_style_
+
+protectedinherited
+
+Initial value:
= [](Pixel& pixel) {
+
pixel.inverted ^= true;
+
}
+
+

Definition at line 83 of file screen.hpp.

+ +
+
+ +

◆ stencil

+ +
+
+ + + + + +
+ + + + +
Box stencil
+
+inherited
+
+ +

Definition at line 41 of file image.hpp.

+ +
+
+ +

◆ dimx_

+ +
+
+ + + + + +
+ + + + +
int dimx_
+
+protectedinherited
+
+ +

Definition at line 44 of file image.hpp.

+ +
+
+ +

◆ dimy_

+ +
+
+ + + + + +
+ + + + +
int dimy_
+
+protectedinherited
+
+ +

Definition at line 45 of file image.hpp.

+ +
+
+ +

◆ pixels_

+ +
+
+ + + + + +
+ + + + +
std::vector<std::vector<Pixel> > pixels_
+
+protectedinherited
+
+ +

Definition at line 46 of file image.hpp.

+ +
+
+ +
+
+

Function Documentation

+ +

◆ RequestAnimationFrame()

+ +
+
+ + + + + + + +
void RequestAnimationFrame ()
+
+ +

RequestAnimationFrame is a function that requests a new frame to be drawn in the next animation cycle.

+
Note
This function is typically called by components that need to update their state or appearance over time, such as animations or transitions. This is useful when the change doesn't depend depend on the events seen by the terminal, but rather on the passage of time.
+

Components who haven't completed their animation can call this function to request a new frame to be drawn later.

+

When there is no new events and no animations to complete, no new frame is drawn.

+ +

Definition at line 77 of file screen_interactive.cpp.

+ +
+
+ +

◆ Button() [1/2]

+ +
+
+ + + + + + + +
Component Button (ButtonOption option)
+
+ +

Draw a button. Execute a function when clicked.

+
Parameters
+ + +
optionAdditional optional parameters.
+
+
+
See also
ButtonBase
+

+Example

+
+
Component button = Button({
+
.label = "Click to quit",
+
.on_click = screen.ExitLoopClosure(),
+
});
+
screen.Loop(button)
+
static ScreenInteractive FitComponent()
+
std::shared_ptr< ComponentBase > Component
+

+Output

+
┌─────────────┐
+
│Click to quit│
+
└─────────────┘
+
+

Definition at line 175 of file src/ftxui/component/button.cpp.

+ +
+
+ +

◆ Button() [2/2]

+ +
+
+ + + + + + + + + + + + + + + + +
Component Button (ConstStringRef label,
std::function< void()> on_click,
ButtonOption option )
+
+ +

Draw a button. Execute a function when clicked.

+
Parameters
+ + + + +
labelThe label of the button.
on_clickThe action to execute when clicked.
optionAdditional optional parameters.
+
+
+
See also
ButtonBase
+

+Example

+
+
std::string label = "Click to quit";
+
Component button = Button(&label, screen.ExitLoopClosure());
+
screen.Loop(button)
+

+Output

+
┌─────────────┐
+
│Click to quit│
+
└─────────────┘
+
+

Definition at line 203 of file src/ftxui/component/button.cpp.

+ +
+
+ +

◆ CatchEvent() [1/2]

+ +
+
+ + + + + + + + + + + +
Component CatchEvent (Component child,
std::function< bool(Event event)> on_event )
+
+ +

Return a component, using |on_event| to catch events. This function must returns true when the event has been handled, false otherwise.

+
Parameters
+ + + +
childThe wrapped component.
on_eventThe function drawing the interface.
+
+
+

+Example

+
+
auto renderer = Renderer([] {
+
return text("My interface");
+
});
+
auto component = CatchEvent(renderer, [&](Event event) {
+
if (event == Event::Character('q')) {
+
screen.ExitLoopClosure()();
+
return true;
+
}
+
return false;
+
});
+
screen.Loop(component);
+
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
+
Element text(std::wstring text)
Display a piece of unicode text.
Definition text.cpp:160
+
Component CatchEvent(Component child, std::function< bool(Event)>)
+
+

Definition at line 54 of file catch_event.cpp.

+ +
+
+ +

◆ CatchEvent() [2/2]

+ +
+
+ + + + + + + +
ComponentDecorator CatchEvent (std::function< bool(Event)> on_event)
+
+ +

Decorate a component, using |on_event| to catch events. This function must returns true when the event has been handled, false otherwise.

+
Parameters
+ + +
on_eventThe function drawing the interface.
+
+
+

+Example

+
+
auto renderer = Renderer([] { return text("Hello world"); });
+
renderer |= CatchEvent([&](Event event) {
+
if (event == Event::Character('q')) {
+
screen.ExitLoopClosure()();
+
return true;
+
}
+
return false;
+
});
+
screen.Loop(renderer);
+
+

Definition at line 80 of file catch_event.cpp.

+ +
+
+ +

◆ Checkbox() [1/2]

+ +
+
+ + + + + + + +
Component Checkbox (CheckboxOption option)
+
+ +

Draw checkable element.

+
Parameters
+ + +
optionAdditional optional parameters.
+
+
+
See also
CheckboxBase
+

+Example

+
+ +
option.label = "Make a sandwidth";
+
option.checked = false;
+
Component checkbox = Checkbox(option);
+
screen.Loop(checkbox)
+ + +
Component Checkbox(CheckboxOption options)
Draw checkable element.
+
Option for the Checkbox component.
+

+Output

+
☐ Make a sandwitch
+
+

Definition at line 108 of file src/ftxui/component/checkbox.cpp.

+ +
+
+ +

◆ Checkbox() [2/2]

+ +
+
+ + + + + + + + + + + + + + + + +
Component Checkbox (ConstStringRef label,
bool * checked,
CheckboxOption option )
+
+ +

Draw checkable element.

+
Parameters
+ + + + +
labelThe label of the checkbox.
checkedWhether the checkbox is checked or not.
optionAdditional optional parameters.
+
+
+
See also
CheckboxBase
+

+Example

+
+
std::string label = "Make a sandwidth";
+
bool checked = false;
+
Component checkbox = Checkbox(&label, &checked);
+
screen.Loop(checkbox)
+

+Output

+
☐ Make a sandwitch
+
+

Definition at line 135 of file src/ftxui/component/checkbox.cpp.

+ +
+
+ +

◆ Vertical() [1/2]

+ +
+
+ + + + + + + +
Component Vertical (Components children)
+
+ +

A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or 'j'/'k' keys.

+
Parameters
+ + +
childrenthe list of components.
+
+
+
See also
ContainerBase
+

+Example

+
auto container = Container::Vertical({
+
children_1,
+
children_2,
+
children_3,
+
children_4,
+
});
+
Component Vertical(Components children)
A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
+
+

Definition at line 317 of file container.cpp.

+ +
+
+ +

◆ Vertical() [2/2]

+ +
+
+ + + + + + + + + + + +
Component Vertical (Components children,
int * selector )
+
+ +

A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or 'j'/'k' keys. This is useful for implementing a Menu for instance.

+
Parameters
+ + + +
childrenthe list of components.
selectorA reference to the index of the selected children.
+
+
+
See also
ContainerBase
+

+Example

+
auto container = Container::Vertical({
+
children_1,
+
children_2,
+
children_3,
+
children_4,
+
}, &selected_children);
+
+

Definition at line 339 of file container.cpp.

+ +
+
+ +

◆ Horizontal() [1/2]

+ +
+
+ + + + + + + +
Component Horizontal (Components children)
+
+ +

A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow key or 'h'/'l' keys.

+
Parameters
+ + +
childrenthe list of components.
+
+
+
See also
ContainerBase
+

+Example

+
int selected_children = 2;
+
auto container = Container::Horizontal({
+
children_1,
+
children_2,
+
children_3,
+
children_4,
+
});
+
Component Horizontal(Components children)
A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow...
+
+

Definition at line 360 of file container.cpp.

+ +
+
+ +

◆ Horizontal() [2/2]

+ +
+
+ + + + + + + + + + + +
Component Horizontal (Components children,
int * selector )
+
+ +

A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow key or 'h'/'l' keys.

+
Parameters
+ + + +
childrenthe list of components.
selectorA reference to the index of the selected children.
+
+
+
See also
ContainerBase
+

+Example

+
int selected_children = 2;
+
auto container = Container::Horizontal({
+
children_1,
+
children_2,
+
children_3,
+
children_4,
+
}, selected_children);
+
+

Definition at line 382 of file container.cpp.

+ +
+
+ +

◆ Tab()

+ +
+
+ + + + + + + + + + + +
Component Tab (Components children,
int * selector )
+
+ +

A list of components, where only one is drawn and interacted with at a time. The |selector| gives the index of the selected component. This is useful to implement tabs.

+
Parameters
+ + + +
childrenThe list of components.
selectorThe index of the drawn children.
+
+
+
See also
ContainerBase
+

+Example

+
int tab_drawn = 0;
+
auto container = Container::Tab({
+
children_1,
+
children_2,
+
children_3,
+
children_4,
+
}, &tab_drawn);
+
Component Tab(Components children, int *selector)
A list of components, where only one is drawn and interacted with at a time. The |selector| gives the...
+
+

Definition at line 405 of file container.cpp.

+ +
+
+ +

◆ Stacked()

+ +
+
+ + + + + + + +
Component Stacked (Components children)
+
+ +

A list of components to be stacked on top of each other. Events are propagated to the first component, then the second if not handled, etc. The components are drawn in the reverse order they are given. When a component take focus, it is put at the front, without changing the relative order of the other elements.

+

This should be used with the Window component.

+
Parameters
+ + +
childrenThe list of components.
+
+
+
See also
Window
+

+Example

+
auto container = Container::Stacked({
+
children_1,
+
children_2,
+
children_3,
+
children_4,
+
});
+
Component Stacked(Components children)
A list of components to be stacked on top of each other. Events are propagated to the first component...
+
+

Definition at line 432 of file container.cpp.

+ +
+
+ +

◆ Dropdown() [1/2]

+ +
+
+ + + + + + + + + + + +
Component Dropdown (ConstStringListRef entries,
int * selected )
+
+ +

A dropdown menu.

+
Parameters
+ + + +
entriesThe list of entries to display.
selectedThe index of the selected entry.
+
+
+ +

Definition at line 22 of file src/ftxui/component/dropdown.cpp.

+ +
+
+ +

◆ Dropdown() [2/2]

+ +
+
+ + + + + + + +
Component Dropdown (DropdownOption option)
+
+ +

A dropdown menu.

+
Parameters
+ + +
optionThe options for the dropdown.
+
+
+ +

Definition at line 33 of file src/ftxui/component/dropdown.cpp.

+ +
+
+ +

◆ Hoverable() [1/6]

+ +
+
+ + + + + + + + + + + +
Component Hoverable (Component component,
bool * hover )
+
+ +

Wrap a component. Gives the ability to know if it is hovered by the mouse.

+
Parameters
+ + + +
componentThe wrapped component.
hoverThe value to reflect whether the component is hovered or not.
+
+
+

+Example

+
auto button = Button("exit", screen.ExitLoopClosure());
+
bool hover = false;
+
auto button_hover = Hoverable(button, &hover);
+
Component Hoverable(Component component, bool *hover)
Wrap a component. Gives the ability to know if it is hovered by the mouse.
Definition hoverable.cpp:43
+
+

Definition at line 43 of file hoverable.cpp.

+ +
+
+ +

◆ Hoverable() [2/6]

+ +
+
+ + + + + + + + + + + + + + + + +
Component Hoverable (Component component,
std::function< void()> on_enter,
std::function< void()> on_leave )
+
+ +

Wrap a component. Uses callbacks.

+
Parameters
+ + + + +
componentThe wrapped component.
on_enterCallback OnEnter
on_leaveCallback OnLeave
+
+
+

+Example

+
auto button = Button("exit", screen.ExitLoopClosure());
+
bool hover = false;
+
auto button_hover = Hoverable(button, &hover);
+
+

Definition at line 86 of file hoverable.cpp.

+ +
+
+ +

◆ Hoverable() [3/6]

+ +
+
+ + + + + + + +
ComponentDecorator Hoverable (bool * hover)
+
+ +

Wrap a component. Gives the ability to know if it is hovered by the mouse.

+
Parameters
+ + +
hoverThe value to reflect whether the component is hovered or not.
+
+
+

+Example

+
bool hover = false;
+
auto button = Button("exit", screen.ExitLoopClosure());
+
button |= Hoverable(&hover);
+
+

Definition at line 141 of file hoverable.cpp.

+ +
+
+ +

◆ Hoverable() [4/6]

+ +
+
+ + + + + + + + + + + +
ComponentDecorator Hoverable (std::function< void()> on_enter,
std::function< void()> on_leave )
+
+ +

Wrap a component. Gives the ability to know if it is hovered by the mouse.

+
Parameters
+ + + +
on_enteris called when the mouse hover the component.
on_leaveis called when the mouse leave the component.
+
+
+

+Example

+
auto button = Button("exit", screen.ExitLoopClosure());
+
int on_enter_cnt = 0;
+
int on_leave_cnt = 0;
+
button |= Hoverable(
+
[&]{ on_enter_cnt++; },
+
[&]{ on_leave_cnt++; }
+
);
+
+

Definition at line 165 of file hoverable.cpp.

+ +
+
+ +

◆ Hoverable() [5/6]

+ +
+
+ + + + + + + + + + + +
Component Hoverable (Component component,
std::function< void(bool)> on_change )
+
+ +

Wrap a component. Gives the ability to know if it is hovered by the mouse.

+
Parameters
+ + + +
componentthe wrapped component.
on_changeis called when the mouse enter or leave the component.
+
+
+

+Example

+
auto button = Button("exit", screen.ExitLoopClosure());
+
bool hovered = false;
+
auto button_hoverable = Hoverable(button,
+
[&](bool hover) { hovered = hover;});
+
+

Definition at line 188 of file hoverable.cpp.

+ +
+
+ +

◆ Hoverable() [6/6]

+ +
+
+ + + + + + + +
ComponentDecorator Hoverable (std::function< void(bool)> on_change)
+
+ +

Wrap a component. Gives the ability to know if it is hovered by the mouse.

+
Parameters
+ + +
on_changeis called when the mouse enter or leave the component.
+
+
+

+Example

+
auto button = Button("exit", screen.ExitLoopClosure());
+
bool hovered = false;
+
button |= Hoverable([&](bool hover) { hovered = hover;});
+
+

Definition at line 209 of file hoverable.cpp.

+ +
+
+ +

◆ Input() [1/3]

+ +
+
+ + + + + + + +
Component Input (InputOption option)
+
+ +

An input box for editing text.

+
Parameters
+ + +
optionAdditional optional parameters.
+
+
+
See also
InputBase
+

+Example

+
+
std::string content= "";
+
std::string placeholder = "placeholder";
+
Component input = Input({
+
.content = &content,
+
.placeholder = &placeholder,
+
})
+
screen.Loop(input);
+
Component Input(InputOption options={})
An input box for editing text.
+

+Output

+
placeholder
+
+

Definition at line 571 of file src/ftxui/component/input.cpp.

+ +
+
+ +

◆ Input() [2/3]

+ +
+
+ + + + + + + + + + + +
Component Input (StringRef content,
InputOption option )
+
+ +

An input box for editing text.

+
Parameters
+ + + +
contentThe editable content.
optionAdditional optional parameters.
+
+
+
See also
InputBase
+

+Example

+
+
std::string content= "";
+
std::string placeholder = "placeholder";
+
Component input = Input(content, {
+
.placeholder = &placeholder,
+
.password = true,
+
})
+
screen.Loop(input);
+

+Output

+
placeholder
+
+

Definition at line 599 of file src/ftxui/component/input.cpp.

+ +
+
+ +

◆ Input() [3/3]

+ +
+
+ + + + + + + + + + + + + + + + +
Component Input (StringRef content,
StringRef placeholder,
InputOption option )
+
+ +

An input box for editing text.

+
Parameters
+ + + + +
contentThe editable content.
placeholderThe placeholder text.
optionAdditional optional parameters.
+
+
+
See also
InputBase
+

+Example

+
+
std::string content= "";
+
std::string placeholder = "placeholder";
+
Component input = Input(content, placeholder);
+
screen.Loop(input);
+

+Output

+
placeholder
+
+

Definition at line 626 of file src/ftxui/component/input.cpp.

+ +
+
+ +

◆ Maybe() [1/4]

+ +
+
+ + + + + + + + + + + +
Component Maybe (Component child,
std::function< bool()> show )
+
+ +

Decorate a component |child|. It is shown only when |show| returns true.

+
Parameters
+ + + +
childthe component to decorate.
showa function returning whether |child| should shown.
+
+
+ +

Definition at line 21 of file src/ftxui/component/maybe.cpp.

+ +
+
+ +

◆ Maybe() [2/4]

+ +
+
+ + + + + + + +
ComponentDecorator Maybe (std::function< bool()> show)
+
+ +

Decorate a component. It is shown only when the |show| function returns true.

+
Parameters
+ + +
showa function returning whether the decorated component should be shown.
+
+
+

+Example

+
auto component = Renderer([]{ return text("Hello World!"); });
+
auto maybe_component = component | Maybe([&]{ return counter == 42; });
+
Component Maybe(Component, const bool *show)
Decorate a component |child|. It is shown only when |show| is true.
+
+

Definition at line 57 of file src/ftxui/component/maybe.cpp.

+ +
+
+ +

◆ Maybe() [3/4]

+ +
+
+ + + + + + + + + + + +
Component Maybe (Component child,
const bool * show )
+
+ +

Decorate a component |child|. It is shown only when |show| is true.

+
Parameters
+ + + +
childthe component to decorate.
showa boolean. |child| is shown when |show| is true.
+
+
+

+Example

+
auto component = Renderer([]{ return text("Hello World!"); });
+
auto maybe_component = Maybe(component, &show);
+
+

Definition at line 74 of file src/ftxui/component/maybe.cpp.

+ +
+
+ +

◆ Maybe() [4/4]

+ +
+
+ + + + + + + +
ComponentDecorator Maybe (const bool * show)
+
+ +

Decorate a component. It is shown only when |show| is true.

+
Parameters
+ + +
showa boolean. |child| is shown when |show| is true.
+
+
+

+Example

+
auto component = Renderer([]{ return text("Hello World!"); });
+
auto maybe_component = component | Maybe(&show);
+
+

Definition at line 88 of file src/ftxui/component/maybe.cpp.

+ +
+
+ +

◆ Menu() [1/2]

+ +
+
+ + + + + + + +
Component Menu (MenuOption option)
+
+ +

A list of text. The focused element is selected.

+
Parameters
+ + +
optiona structure containing all the paramters.
+
+
+

+Example

+
+
std::vector<std::string> entries = {
+
"entry 1",
+
"entry 2",
+
"entry 3",
+
};
+
int selected = 0;
+
auto menu = Menu({
+
.entries = &entries,
+
.selected = &selected,
+
});
+
screen.Loop(menu);
+
Component Menu(MenuOption options)
A list of text. The focused element is selected.
+

+Output

+
> entry 1
+
entry 2
+
entry 3
+
+

Definition at line 512 of file src/ftxui/component/menu.cpp.

+ +
+
+ +

◆ Menu() [2/2]

+ +
+
+ + + + + + + + + + + + + + + + +
Component Menu (ConstStringListRef entries,
int * selected,
MenuOption option )
+
+ +

A list of text. The focused element is selected.

+
Parameters
+ + + + +
entriesThe list of entries in the menu.
selectedThe index of the currently selected element.
optionAdditional optional parameters.
+
+
+

+Example

+
+
std::vector<std::string> entries = {
+
"entry 1",
+
"entry 2",
+
"entry 3",
+
};
+
int selected = 0;
+
auto menu = Menu(&entries, &selected);
+
screen.Loop(menu);
+

+Output

+
> entry 1
+
entry 2
+
entry 3
+
+

Definition at line 543 of file src/ftxui/component/menu.cpp.

+ +
+
+ +

◆ Toggle()

+ +
+
+ + + + + + + + + + + +
Component Toggle (ConstStringListRef entries,
int * selected )
+
+ +

An horizontal list of elements. The user can navigate through them.

+
Parameters
+ + + +
entriesThe list of selectable entries to display.
selectedReference the selected entry. See also |Menu|.
+
+
+ +

Definition at line 554 of file src/ftxui/component/menu.cpp.

+ +
+
+ +

◆ MenuEntry() [1/2]

+ +
+
+ + + + + + + + + + + +
Component MenuEntry (ConstStringRef label,
MenuEntryOption option )
+
+ +

A specific menu entry. They can be put into a Container::Vertical to form a menu.

+
Parameters
+ + + +
labelThe text drawn representing this element.
optionAdditional optional parameters.
+
+
+

+Example

+
+
int selected = 0;
+
auto menu = Container::Vertical({
+
MenuEntry("entry 1"),
+
MenuEntry("entry 2"),
+
MenuEntry("entry 3"),
+
}, &selected);
+
screen.Loop(menu);
+
Component MenuEntry(MenuEntryOption options)
A specific menu entry. They can be put into a Container::Vertical to form a menu.
+

+Output

+
> entry 1
+
entry 2
+
entry 3
+
+

Definition at line 584 of file src/ftxui/component/menu.cpp.

+ +
+
+ +

◆ MenuEntry() [2/2]

+ +
+
+ + + + + + + +
Component MenuEntry (MenuEntryOption option)
+
+ +

A specific menu entry. They can be put into a Container::Vertical to form a menu.

+
Parameters
+ + +
optionThe parameters.
+
+
+

+Example

+
+
int selected = 0;
+
auto menu = Container::Vertical({
+
MenuEntry({.label = "entry 1"}),
+
MenuEntry({.label = "entry 2"}),
+
MenuEntry({.label = "entry 3"}),
+
}, &selected);
+
screen.Loop(menu);
+

+Output

+
> entry 1
+
entry 2
+
entry 3
+
+

Definition at line 614 of file src/ftxui/component/menu.cpp.

+ +
+
+ +

◆ Modal() [1/2]

+ +
+
+ + + + + + + + + + + + + + + + +
Component Modal (Component main,
Component modal,
const bool * show_modal )
+
+ +

Definition at line 18 of file modal.cpp.

+ +
+
+ +

◆ Modal() [2/2]

+ +
+
+ + + + + + + + + + + +
ComponentDecorator Modal (Component modal,
const bool * show_modal )
+
+ +

Definition at line 58 of file modal.cpp.

+ +
+
+ +

◆ Radiobox() [1/2]

+ +
+
+ + + + + + + +
Component Radiobox (RadioboxOption option)
+
+ +

A list of element, where only one can be selected.

+
Parameters
+ + +
optionThe parameters
+
+
+
See also
RadioboxBase
+

+Example

+
+
std::vector<std::string> entries = {
+
"entry 1",
+
"entry 2",
+
"entry 3",
+
};
+
int selected = 0;
+
auto menu = Radiobox({
+
.entries = entries,
+
.selected = &selected,
+
});
+
screen.Loop(menu);
+
Component Radiobox(RadioboxOption options)
A list of element, where only one can be selected.
+

+Output

+
◉ entry 1
+
○ entry 2
+
○ entry 3
+

NOLINTNEXTLINE

+ +

Definition at line 204 of file src/ftxui/component/radiobox.cpp.

+ +
+
+ +

◆ Radiobox() [2/2]

+ +
+
+ + + + + + + + + + + + + + + + +
Component Radiobox (ConstStringListRef entries,
int * selected,
RadioboxOption option )
+
+ +

A list of element, where only one can be selected.

+
Parameters
+ + + + +
entriesThe list of entries in the list.
selectedThe index of the currently selected element.
optionAdditional optional parameters.
+
+
+
See also
RadioboxBase
+

+Example

+
+
std::vector<std::string> entries = {
+
"entry 1",
+
"entry 2",
+
"entry 3",
+
};
+
int selected = 0;
+
auto menu = Radiobox(&entries, &selected);
+
screen.Loop(menu);
+

+Output

+
◉ entry 1
+
○ entry 2
+
○ entry 3
+
+

Definition at line 236 of file src/ftxui/component/radiobox.cpp.

+ +
+
+ +

◆ Renderer() [1/4]

+ +
+
+ + + + + + + +
Component Renderer (std::function< Element()> render)
+
+ +

Return a component, using |render| to render its interface.

+
Parameters
+ + +
renderThe function drawing the interface.
+
+
+

+Example

+
+
auto renderer = Renderer([] {
+
return text("My interface");
+
});
+
screen.Loop(renderer);
+
+

Definition at line 29 of file src/ftxui/component/renderer.cpp.

+ +
+
+ +

◆ Renderer() [2/4]

+ +
+
+ + + + + + + + + + + +
Component Renderer (Component child,
std::function< Element()> render )
+
+ +

Return a new Component, similar to |child|, but using |render| as the Component::Render() event.

+
Parameters
+ + + +
childThe component to forward events to.
renderThe function drawing the interface.
+
+
+

+Example

+
+
std::string label = "Click to quit";
+
auto button = Button(&label, screen.ExitLoopClosure());
+
auto renderer = Renderer(button, [&] {
+
return hbox({
+
text("A button:"),
+
button->Render(),
+
});
+
});
+
screen.Loop(renderer);
+
virtual void Render(Screen &screen)
Display an element on a ftxui::Screen.
Definition node.cpp:59
+
Element hbox(Elements)
A container displaying elements horizontally one by one.
Definition hbox.cpp:94
+
+

Definition at line 61 of file src/ftxui/component/renderer.cpp.

+ +
+
+ +

◆ Renderer() [3/4]

+ +
+
+ + + + + + + +
Component Renderer (std::function< Element(bool)> render)
+
+ +

Return a focusable component, using |render| to render its interface.

+
Parameters
+ + +
renderThe function drawing the interface, taking a boolean telling whether the component is focused or not.
+
+
+

+Example

+
+
auto renderer = Renderer([] (bool focused) {
+
if (focused)
+
return text("My interface") | inverted;
+
else
+
return text("My interface");
+
});
+
screen.Loop(renderer);
+
Element inverted(Element)
Add a filter that will invert the foreground and the background colors.
Definition inverted.cpp:34
+
+

Definition at line 84 of file src/ftxui/component/renderer.cpp.

+ +
+
+ +

◆ Renderer() [4/4]

+ +
+
+ + + + + + + +
ComponentDecorator Renderer (ElementDecorator decorator)
+
+ +

Decorate a component, by decorating what it renders.

+
Parameters
+ + +
decoratorthe function modifying the element it renders.
+
+
+

+Example

+
+
auto renderer = */
+
// Renderer([] { return text("Hello");)
+
/** | Renderer(bold)
+
| Renderer(inverted);
+
screen.Loop(renderer);
+
+

Definition at line 125 of file src/ftxui/component/renderer.cpp.

+ +
+
+ +

◆ ResizableSplitLeft()

+ +
+
+ + + + + + + + + + + + + + + + +
Component ResizableSplitLeft (Component main,
Component back,
int * main_size )
+
+ +

An horizontal split in between two components, configurable using the mouse.

+
Parameters
+ + + + +
mainThe main component of size |main_size|, on the left.
backThe back component taking the remaining size, on the right.
main_sizeThe size of the |main| component.
+
+
+

+Example

+
+
int left_size = 10;
+
auto left = Renderer([] { return text("Left") | center;});
+
auto right = Renderer([] { return text("right") | center;});
+
auto split = ResizableSplitLeft(left, right, &left_size);
+
screen.Loop(split);
+
static ScreenInteractive Fullscreen()
+
Component ResizableSplitLeft(Component main, Component back, int *main_size)
An horizontal split in between two components, configurable using the mouse.
+
Element center(Element)
Center an element horizontally and vertically.
+
std::uint8_t left
Definition screen.cpp:130
+
std::uint8_t right
Definition screen.cpp:132
+

+Output

+
+
left │ right
+
+
+

Definition at line 215 of file src/ftxui/component/resizable_split.cpp.

+ +
+
+ +

◆ ResizableSplitRight()

+ +
+
+ + + + + + + + + + + + + + + + +
Component ResizableSplitRight (Component main,
Component back,
int * main_size )
+
+ +

An horizontal split in between two components, configurable using the mouse.

+
Parameters
+ + + + +
mainThe main component of size |main_size|, on the right.
backThe back component taking the remaining size, on the left.
main_sizeThe size of the |main| component.
+
+
+

+Example

+
+
int right_size = 10;
+
auto left = Renderer([] { return text("Left") | center;});
+
auto right = Renderer([] { return text("right") | center;});
+
auto split = ResizableSplitRight(right, left, &right_size)
+
screen.Loop(split);
+
Component ResizableSplitRight(Component main, Component back, int *main_size)
An horizontal split in between two components, configurable using the mouse.
+

+Output

+
+
left │ right
+
+
+

Definition at line 249 of file src/ftxui/component/resizable_split.cpp.

+ +
+
+ +

◆ ResizableSplitTop()

+ +
+
+ + + + + + + + + + + + + + + + +
Component ResizableSplitTop (Component main,
Component back,
int * main_size )
+
+ +

An vertical split in between two components, configurable using the mouse.

+
Parameters
+ + + + +
mainThe main component of size |main_size|, on the top.
backThe back component taking the remaining size, on the bottom.
main_sizeThe size of the |main| component.
+
+
+

+Example

+
+
int top_size = 1;
+
auto top = Renderer([] { return text("Top") | center;});
+
auto bottom = Renderer([] { return text("Bottom") | center;});
+
auto split = ResizableSplitTop(top, bottom, &top_size)
+
screen.Loop(split);
+
Component ResizableSplitTop(Component main, Component back, int *main_size)
An vertical split in between two components, configurable using the mouse.
+
std::uint8_t top
Definition screen.cpp:131
+

+Output

+
top
+
────────────
+
bottom
+
+

Definition at line 283 of file src/ftxui/component/resizable_split.cpp.

+ +
+
+ +

◆ ResizableSplitBottom()

+ +
+
+ + + + + + + + + + + + + + + + +
Component ResizableSplitBottom (Component main,
Component back,
int * main_size )
+
+ +

An vertical split in between two components, configurable using the mouse.

+
Parameters
+ + + + +
mainThe main component of size |main_size|, on the bottom.
backThe back component taking the remaining size, on the top.
main_sizeThe size of the |main| component.
+
+
+

+Example

+
+
int bottom_size = 1;
+
auto top = Renderer([] { return text("Top") | center;});
+
auto bottom = Renderer([] { return text("Bottom") | center;});
+
auto split = ResizableSplit::Bottom(bottom, top, &bottom_size)
+
screen.Loop(split);
+

+Output

+
top
+
────────────
+
bottom
+
+

Definition at line 317 of file src/ftxui/component/resizable_split.cpp.

+ +
+
+ +

◆ Slider()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Component Slider (ConstStringRef label,
Ref< int > value,
ConstRef< int > min,
ConstRef< int > max,
ConstRef< int > increment )
+
+ +

An horizontal slider.

+
Parameters
+ + + + + + +
labelThe name of the slider.
valueThe current value of the slider.
minThe minimum value.
maxThe maximum value.
incrementThe increment when used by the cursor.
+
+
+

+Example

+
+
int value = 50;
+
auto slider = Slider("Value:", &value, 0, 100, 1);
+
screen.Loop(slider);
+
Component Slider(SliderOption< T > options)
A slider in any direction.
+

+Output

+
Value:[██████████████████████████ ]
+
+

Definition at line 259 of file src/ftxui/component/slider.cpp.

+ +
+
+ +

◆ Window()

+ +
+
+ + + + + + + +
Component Window (WindowOptions option)
+
+ +

A draggeable / resizeable window. To use multiple of them, they must be stacked using Container::Stacked({...}) component;.

+
Parameters
+ + +
optionA struct holding every parameters.
+
+
+
See also
Window
+

+Example

+
auto window_1= Window({
+
.inner = DummyWindowContent(),
+
.title = "First window",
+
});
+
+
auto window_2= Window({
+
.inner = DummyWindowContent(),
+
.title = "Second window",
+
});
+
+
auto container = Container::Stacked({
+
window_1,
+
window_2,
+
});
+
Component Window(WindowOptions option)
A draggeable / resizeable window. To use multiple of them, they must be stacked using Container::Stac...
+
Component DummyWindowContent()
Definition scrollbar.cpp:10
+
+

Definition at line 312 of file src/ftxui/component/window.cpp.

+ +
+
+
+
+ + + + + diff --git a/group__component.js b/group__component.js new file mode 100644 index 000000000..b061d8862 --- /dev/null +++ b/group__component.js @@ -0,0 +1,268 @@ +var group__component = +[ + [ "ComponentBase", "group__component.html#classftxui_1_1ComponentBase", [ + [ "ComponentBase", "group__component.html#ad2a5b6ce11bc7a8ce1150cf0ba9144c0", null ], + [ "~ComponentBase", "group__component.html#ae490d465a018a9d81bb4e30604708fba", null ], + [ "ComponentBase", "group__component.html#acda4c8b63ffbc2e9e2e28f056edbf01c", null ], + [ "ComponentBase", "group__component.html#abd8cf6a9df5eb4678fb9925b686c7aea", null ], + [ "ComponentBase", "group__component.html#a9b3cf357cf150023641969d5fcb7d08f", null ], + [ "operator=", "group__component.html#ac444ac233dcbd4b2ad7972d2086ecc73", null ], + [ "operator=", "group__component.html#a9e3b99c8fc32f2ce151e2ba737c0d546", null ], + [ "Parent", "group__component.html#aaf284a408631f31558694973a04186c2", null ], + [ "ChildAt", "group__component.html#aceb41a98abe10fb0b521ff8b65529b7f", null ], + [ "ChildCount", "group__component.html#a9ae5f77e923e2f0f8b0e26dcd4affb5b", null ], + [ "Index", "group__component.html#a8ef12397d1682615bc3108c397734179", null ], + [ "Add", "group__component.html#a21f040bec9104e164bfa6c3ad45be3a1", null ], + [ "Detach", "group__component.html#abb7a2b60240651d16e17d02eb6f636cf", null ], + [ "DetachAllChildren", "group__component.html#a84bd6480cf5e8f51cf5965f81b1f2460", null ], + [ "Render", "group__component.html#a28d41d6113c5b29c8dd45846582b3299", null ], + [ "OnRender", "group__component.html#ab79303652dad19eac0540848487cf8c5", null ], + [ "OnEvent", "group__component.html#ab84629a8fecad2e1cdd426b7ddc72277", null ], + [ "OnAnimation", "group__component.html#aebad858485d02f035a8ea34af66a7fa7", null ], + [ "ActiveChild", "group__component.html#a5c421f00a2a7f50c542c5c286d2e696c", null ], + [ "Focusable", "group__component.html#a02ccd3db74312f1c66aa8e7931489318", null ], + [ "Active", "group__component.html#a52beef6d7a687d4d109e6cec1606e32e", null ], + [ "Focused", "group__component.html#a0cc612fa3d753b456e0f480f44654a9f", null ], + [ "SetActiveChild", "group__component.html#a8cbf27680c6154e15c8b32d6601340de", null ], + [ "SetActiveChild", "group__component.html#a50ad32ad14dd7912e681fab0ee294be2", null ], + [ "TakeFocus", "group__component.html#a2cf27e9d7128a6a4b3263ecd34c19105", null ], + [ "CaptureMouse", "group__component.html#a164d10a2cf367bdd4ae14318a6c7d769", null ], + [ "children_", "group__component.html#a22b4fa4d6aa4c9c2eef275cd25aa8ab9", null ] + ] ], + [ "UnderlineOption", "group__component.html#structftxui_1_1UnderlineOption", [ + [ "SetAnimation", "group__component.html#a754d89398aac6051ced26fd452c62589", null ], + [ "SetAnimationDuration", "group__component.html#a798360474be7511364b8171f0c62f6d5", null ], + [ "SetAnimationFunction", "group__component.html#a34e6222dbf10e899074054160870816c", null ], + [ "SetAnimationFunction", "group__component.html#a7d978b34c37e9d08c57a22477016204c", null ], + [ "enabled", "group__component.html#a8740ba80e30dd75e71d09fa1dcf04f3d", null ], + [ "color_active", "group__component.html#a593f1ba15add21d1972c01372db369df", null ], + [ "color_inactive", "group__component.html#ad5a77e0bc0ce649271a13949a7a0a635", null ], + [ "leader_function", "group__component.html#a1886d86b757123859c89f3336631b1f8", null ], + [ "follower_function", "group__component.html#a7dca406bc24422caeb8f39705334dbd1", null ], + [ "leader_duration", "group__component.html#a6112ea2b5db5a4c50fe7d5ae70dfd016", null ], + [ "leader_delay", "group__component.html#ae29bb2e2c1e7f6eca70781e6fcd63a64", null ], + [ "follower_duration", "group__component.html#a13a6488c25b667256590c85aacb1f518", null ], + [ "follower_delay", "group__component.html#a2b5d480250b61cd7e62e7c6567345e38", null ] + ] ], + [ "AnimatedColorOption", "group__component.html#structftxui_1_1AnimatedColorOption", [ + [ "Set", "group__component.html#ad186d5a36e45174bbc7c50df85c2e91e", null ], + [ "enabled", "group__component.html#a8740ba80e30dd75e71d09fa1dcf04f3d", null ], + [ "inactive", "group__component.html#a898e4eb6c2a93ea3b71fc373f39854eb", null ], + [ "active", "group__component.html#a5c04e41d802330270ae14a9861c1e2df", null ], + [ "duration", "group__component.html#a7449575119a6168a323351fb04a7eb64", null ], + [ "function", "group__component.html#a23a21de13ab9c6644225966245df3fe3", null ] + ] ], + [ "MenuEntryOption", "group__component.html#structftxui_1_1MenuEntryOption", [ + [ "label", "group__component.html#a336758144ce2b1095f2a0ef062551f5b", null ], + [ "transform", "group__component.html#a5641c45021a8cc20bdd21498563825a0", null ], + [ "animated_colors", "group__component.html#ab7131557fbe84a6b4b2f2ffcff7d44f0", null ] + ] ], + [ "MenuOption", "group__component.html#structftxui_1_1MenuOption", [ + [ "entries", "group__component.html#a7b534b117dbbe826d34ba17af85f1e93", null ], + [ "selected", "group__component.html#ac42a32c3439d08be9c5626a5fbc3a0c4", null ], + [ "underline", "group__component.html#a55b558727e02acce3f5259811b2dfe5b", null ], + [ "entries_option", "group__component.html#a2076e7253c5acce2321c067e9b7a1823", null ], + [ "direction", "group__component.html#a53421c695d00016ab925777d423b4eb6", null ], + [ "elements_prefix", "group__component.html#a11476ea3dc58bf17777879693fb2985a", null ], + [ "elements_infix", "group__component.html#a9504d8d3bfa1daaab000e5455536b20d", null ], + [ "elements_postfix", "group__component.html#ab08362a5698543aec0fbb37f99777119", null ], + [ "on_change", "group__component.html#abdfe3c83deeec2323ff90248815b8f0a", null ], + [ "on_enter", "group__component.html#a4ba9530701be07334a17c0184747c535", null ], + [ "focused_entry", "group__component.html#a93d5d37708b77971a666b73486017835", null ] + ] ], + [ "ButtonOption", "group__component.html#structftxui_1_1ButtonOption", [ + [ "label", "group__component.html#a336758144ce2b1095f2a0ef062551f5b", null ], + [ "on_click", "group__component.html#a0ae001950b0ed23752b298963cecf3d1", null ], + [ "transform", "group__component.html#afe14c161494dad905597e75661c7b6a0", null ], + [ "animated_colors", "group__component.html#ab7131557fbe84a6b4b2f2ffcff7d44f0", null ] + ] ], + [ "CheckboxOption", "group__component.html#structftxui_1_1CheckboxOption", [ + [ "label", "group__component.html#a336758144ce2b1095f2a0ef062551f5b", null ], + [ "checked", "group__component.html#ab7741e52624c0d7906159d77edffe27e", null ], + [ "transform", "group__component.html#afe14c161494dad905597e75661c7b6a0", null ], + [ "on_change", "group__component.html#abdfe3c83deeec2323ff90248815b8f0a", null ] + ] ], + [ "InputOption", "group__component.html#structftxui_1_1InputOption", [ + [ "content", "group__component.html#ac9f6c2acd72d74eeb3a18baf32b02932", null ], + [ "placeholder", "group__component.html#aaca8e18f9fe70089d8fd4165f4b518e1", null ], + [ "transform", "group__component.html#a93721d00aaf44f42cc0399024514b628", null ], + [ "password", "group__component.html#a927bd46792ffe38c7545a764d847d066", null ], + [ "multiline", "group__component.html#af18b2db29029e23c13a8bfc233c62878", null ], + [ "insert", "group__component.html#a3ae35fa7cff9f950b9c66536523c69c1", null ], + [ "on_change", "group__component.html#abdfe3c83deeec2323ff90248815b8f0a", null ], + [ "on_enter", "group__component.html#a4ba9530701be07334a17c0184747c535", null ], + [ "cursor_position", "group__component.html#a699547942204afa70864e0e6df94c96c", null ] + ] ], + [ "RadioboxOption", "group__component.html#structftxui_1_1RadioboxOption", [ + [ "entries", "group__component.html#a7b534b117dbbe826d34ba17af85f1e93", null ], + [ "selected", "group__component.html#ac42a32c3439d08be9c5626a5fbc3a0c4", null ], + [ "transform", "group__component.html#afe14c161494dad905597e75661c7b6a0", null ], + [ "on_change", "group__component.html#abdfe3c83deeec2323ff90248815b8f0a", null ], + [ "focused_entry", "group__component.html#a93d5d37708b77971a666b73486017835", null ] + ] ], + [ "WindowRenderState", "group__component.html#structftxui_1_1WindowRenderState", [ + [ "inner", "group__component.html#a5486612c1fe0c8651fbb399ac512fccf", null ], + [ "title", "group__component.html#a32309346e2ae5546e342e991d0a53b37", null ], + [ "active", "group__component.html#a03c996f9fcf0e10baeb3e700be0c409a", null ], + [ "drag", "group__component.html#a2104e875bdb7c78a8bf7dfd3728459c5", null ], + [ "resize", "group__component.html#a47beb6819c84c39255cb60f5710714ce", null ], + [ "hover_left", "group__component.html#abca2d427dd57d2b5eecb6685ed68e857", null ], + [ "hover_right", "group__component.html#a8e6af441e03d44f593bcb0d17ee809b1", null ], + [ "hover_top", "group__component.html#acb4dc002e621733f1e6c232f369af8ca", null ], + [ "hover_down", "group__component.html#a2fbfe3e43b596c8a47c5548b38e4d721", null ] + ] ], + [ "DropdownOption", "group__component.html#structftxui_1_1DropdownOption", [ + [ "open", "group__component.html#aa9ee4f52203c5dec717cf45077b82776", null ], + [ "checkbox", "group__component.html#a0797deb307cd89059137a4ca6075fcbf", null ], + [ "radiobox", "group__component.html#a83288bb2ebb6ca0eef0651285a71291e", null ], + [ "transform", "group__component.html#ae2d438a2693c6279aba8a2549a161601", null ] + ] ], + [ "Event", "group__component.html#structftxui_1_1Event", [ + [ "operator==", "group__component.html#ad5b326fac977a9c1c832ddb508f713da", null ], + [ "operator!=", "group__component.html#ae4581774f4417f68d335de865fd2e6d3", null ], + [ "operator<", "group__component.html#a7590045e19360277dfc54320b627002c", null ], + [ "input", "group__component.html#a947e2de698c4bef07c78674218330677", null ], + [ "is_character", "group__component.html#ae75703788c6f68b39fc51f8db3ba156d", null ], + [ "character", "group__component.html#a07022c6e92b9144a0e5b337b562f9892", null ], + [ "is_mouse", "group__component.html#a2c835925299d56941ffd2e2421f0fd13", null ], + [ "mouse", "group__component.html#a37daf59df57eb6415eb34c8df11a4892", null ], + [ "is_cursor_position", "group__component.html#a4464a1cace713dc3544922cc6d5acdc1", null ], + [ "cursor_x", "group__component.html#a1ef75084a5f2a9d26df8cafcf048526e", null ], + [ "cursor_y", "group__component.html#a1a24372c00e6485f2648350df4301ae3", null ], + [ "is_cursor_shape", "group__component.html#af795895177b7686bf63ab113e70159c8", null ], + [ "cursor_shape", "group__component.html#a022c841864c305d5e3ef69f6957dc367", null ], + [ "DebugString", "group__component.html#a764be64f3029f8b8e23511061d8de355", null ], + [ "screen_", "group__component.html#a57ae65156ecf0f469cc559a49e6c4f2f", null ], + [ "mouse", "group__component.html#a761c3b7a78d8408dfbe76131209532d7", null ], + [ "cursor", "group__component.html#a9d8d873964fd143f113fce55e15c37fb", null ], + [ "cursor_shape", "group__component.html#a25a0efbff7ae0393c695f6d720cb5542", null ] + ] ], + [ "Loop", "group__component.html#classftxui_1_1Loop", [ + [ "Loop", "group__component.html#aacbc899babaac445c3b9b831322e8c70", null ], + [ "~Loop", "group__component.html#a84c72a09400ffc01ce3257d2109453a2", null ], + [ "Loop", "group__component.html#ad72ac0aa7a08850990b76f15e13dbe79", null ], + [ "Loop", "group__component.html#adfc045f0113bbf7f6dc5895ff7ce3ac5", null ], + [ "Loop", "group__component.html#a734882bfa3e357e4bb57581494e8699b", null ], + [ "HasQuitted", "group__component.html#a0f10869cb1cad212e8885deac6960a41", null ], + [ "RunOnce", "group__component.html#ad638ec512bc0d9876c2bf1c15913e9d3", null ], + [ "RunOnceBlocking", "group__component.html#afe89c4e52cb64cd7271c3fa8a04e7b61", null ], + [ "Run", "group__component.html#aa3eca255b6be227d7d901cc2a72017a5", null ], + [ "operator=", "group__component.html#add07fd33947183c42a79cb4759129ff8", null ], + [ "operator=", "group__component.html#ab35ce310313b96f28233ebc9279b5dd3", null ] + ] ], + [ "Mouse", "group__component.html#structftxui_1_1Mouse", [ + [ "Button", "group__component.html#a03bfec859eac87be20f8952c1eb89de0", [ + [ "Left", "group__component.html#a03bfec859eac87be20f8952c1eb89de0a9d4d8b0b72fc2659da772d761a3c5ecb", null ], + [ "Middle", "group__component.html#a03bfec859eac87be20f8952c1eb89de0a673e6efef9aafe98078c5552e99c923c", null ], + [ "Right", "group__component.html#a03bfec859eac87be20f8952c1eb89de0ad48f7af8c070184f3774c8e85854eb66", null ], + [ "None", "group__component.html#a03bfec859eac87be20f8952c1eb89de0ac9d3e887722f2bc482bcca9d41c512af", null ], + [ "WheelUp", "group__component.html#a03bfec859eac87be20f8952c1eb89de0ab51f2e2fc1697565b732263f86a976d6", null ], + [ "WheelDown", "group__component.html#a03bfec859eac87be20f8952c1eb89de0afd8a27c9d7eac3486f6fbd2d608da0db", null ], + [ "WheelLeft", "group__component.html#a03bfec859eac87be20f8952c1eb89de0a160e671a76bd0d1f424a8b9700275375", null ], + [ "WheelRight", "group__component.html#a03bfec859eac87be20f8952c1eb89de0ae73184b2d38af984b5cda75057471adc", null ] + ] ], + [ "Motion", "group__component.html#a099c889d2b948b264c7a665b66e3a9b6", [ + [ "Released", "group__component.html#a099c889d2b948b264c7a665b66e3a9b6ad9417ac74f0134b9577d1d85cf422c25", null ], + [ "Pressed", "group__component.html#a099c889d2b948b264c7a665b66e3a9b6a05f4abb2322aa023aba9570c327aff25", null ], + [ "Moved", "group__component.html#a099c889d2b948b264c7a665b66e3a9b6a9bf35ab1cecfbb50d8f1d708a4921fc6", null ] + ] ], + [ "button", "group__component.html#aa56e877ca6a7524cf1e891c7435c3ace", null ], + [ "motion", "group__component.html#af8ec4d0833a67c0bcd400f9e30bd07c7", null ], + [ "shift", "group__component.html#ace78b37abb3d96740735fd8eb41235e6", null ], + [ "meta", "group__component.html#a46e545ef1aafd5ca9f1d6055fcebeeca", null ], + [ "control", "group__component.html#ad155fe5a68eb888a7e0eb897a3dfc015", null ], + [ "x", "group__component.html#a6150e0515f7202e2fb518f7206ed97dc", null ], + [ "y", "group__component.html#a0a2f84ed7838f07779ae24c5a9086d33", null ] + ] ], + [ "ScreenInteractive", "group__component.html#classftxui_1_1ScreenInteractive", [ + [ "Private", "classftxui_1_1ScreenInteractive_1_1Private.html", null ], + [ "SelectionStyle", "group__component.html#a0424ec9a980000671f12bfa39fc32273", null ], + [ "~ScreenInteractive", "group__component.html#a2c4f2d0819fb7afa3ce40cc0e3107053", null ], + [ "TrackMouse", "group__component.html#ad5961c1d4caf0ba9a030e5675162a164", null ], + [ "Loop", "group__component.html#a9bd3dbd471fce0038700caaa47dddc1a", null ], + [ "Exit", "group__component.html#a1a6a7739e9cc01ba888b57d1f9457f4c", null ], + [ "ExitLoopClosure", "group__component.html#ae295157a88e6300609df83769ed885f2", null ], + [ "Post", "group__component.html#a49209b09dcf8bc540f79e2bfd0a7ee88", null ], + [ "PostEvent", "group__component.html#a29e75bdaa1d5465518787ec014b2c3bf", null ], + [ "RequestAnimationFrame", "group__component.html#ad94d3d42aba3359550759aae5bcffbe9", null ], + [ "CaptureMouse", "group__component.html#aad61519d291dcc216d2ac618618a45a2", null ], + [ "WithRestoredIO", "group__component.html#af9df2de690486078fea4a7151b83b089", null ], + [ "ForceHandleCtrlC", "group__component.html#ae48c11a6c9160dc14cd5504ebe69304b", null ], + [ "ForceHandleCtrlZ", "group__component.html#af1c772ab581e587daad086227435f2ec", null ], + [ "GetSelection", "group__component.html#ac25769e248caa01d336f5eaa79cd6160", null ], + [ "SelectionChange", "group__component.html#ad6daabb2df61b6be6f0b2a8950ac3281", null ], + [ "ToString", "group__component.html#a19c380b03cea21d7ac7325136a131ff0", null ], + [ "Print", "group__component.html#ad93edbe885499a712129356f1ffd506b", null ], + [ "Clear", "group__component.html#aa71d36872f416feaa853788a7a7a7ef8", null ], + [ "ResetPosition", "group__component.html#a9677c078c4270afdb7451cdc0b0871d4", null ], + [ "ApplyShader", "group__component.html#a04d18c0cb0df3ed7a01ca5c3b8711ff7", null ], + [ "cursor", "group__component.html#a94febaac347b83267ff6a10b7837d612", null ], + [ "SetCursor", "group__component.html#a1aa24862a3d050b3aea2ade1300d51a7", null ], + [ "RegisterHyperlink", "group__component.html#a38015a8bc3dda474354ec8a374a6e2de", null ], + [ "Hyperlink", "group__component.html#a0b55b16969dfccc79195fe61c5ba6d1a", null ], + [ "GetSelectionStyle", "group__component.html#a056c2ad43affdac744b6907e9ea81463", null ], + [ "SetSelectionStyle", "group__component.html#aba0d30b90db17d6b7561f704ed63b5e6", null ], + [ "at", "group__component.html#a55b0a995463c6936efb33391f29565bc", null ], + [ "at", "group__component.html#a0882d58bb8ca1be9953135338456cf9e", null ], + [ "PixelAt", "group__component.html#a483f8ee1967e200cfc9e277b3ce00174", null ], + [ "PixelAt", "group__component.html#a03b2b39bb8f4d72068744776093125b3", null ], + [ "dimx", "group__component.html#ae7a460c9dacd70ed81b1adfea46b492e", null ], + [ "dimy", "group__component.html#a0d283cfb1ec16b3fc13d344ebfea93d4", null ], + [ "Loop", "group__component.html#a6f7095d721dd1dbd490d97c028eb676f", null ], + [ "Private", "group__component.html#a55bfcd8369da28d548069f2761d2c39f", null ], + [ "cursor_", "group__component.html#a9df9d1ae7ed66857ca987963b2365904", null ], + [ "hyperlinks_", "group__component.html#acff83d382ef60ad2a0fca3ba68e9397f", null ], + [ "selection_style_", "group__component.html#ab9f757d5d67255f61e27950be4131be1", null ], + [ "stencil", "group__component.html#a92cacd07ba30909855f19edc01192ff0", null ], + [ "dimx_", "group__component.html#a1b254c3faacd432c325efff4268ca683", null ], + [ "dimy_", "group__component.html#a9e9d5df4b41aaa5eca27cdcaca6d4574", null ], + [ "pixels_", "group__component.html#aeab8c1788b3f2c7403749c3be95a68ae", null ] + ] ], + [ "RequestAnimationFrame", "group__component.html#gad94d3d42aba3359550759aae5bcffbe9", null ], + [ "Button", "group__component.html#ga4e8295ec77dd31b0acc5063b134473e7", null ], + [ "Button", "group__component.html#ga0488e28ee9388e0ddca26f1d03d827d1", null ], + [ "CatchEvent", "group__component.html#ga0bfd67a2815807dc6fc9bc0f79bce29e", null ], + [ "CatchEvent", "group__component.html#gad2948235799c010c76c6de861c050c59", null ], + [ "Checkbox", "group__component.html#gae0d441d2c83740f187f62db566bbefcd", null ], + [ "Checkbox", "group__component.html#ga5e9dbb03c44d549f10c96f134269366f", null ], + [ "Vertical", "group__component.html#ga6471e39f5664d059144746c5801d37e6", null ], + [ "Vertical", "group__component.html#ga25099e2d2ead8a46c8d9a899982070b7", null ], + [ "Horizontal", "group__component.html#ga01563bae9454fe64c0b29b0eb3755e68", null ], + [ "Horizontal", "group__component.html#ga337564f8a13c98222025d8fe7e47df4c", null ], + [ "Tab", "group__component.html#gaea9fe244eeeb420276bcc5760b46953d", null ], + [ "Stacked", "group__component.html#gaafd394665b0c231380a143b810339d8e", null ], + [ "Dropdown", "group__component.html#gaa22bddff4aeed66e20f30d0715596999", null ], + [ "Dropdown", "group__component.html#gaa4b353566017558bac648ee1409930de", null ], + [ "Hoverable", "group__component.html#ga562d984d3830d63285643565cd55d16f", null ], + [ "Hoverable", "group__component.html#ga92ec2f5ccb509da2e2c24ae6a1f6b12b", null ], + [ "Hoverable", "group__component.html#ga9d94b37352be13d3551a9d5785f75439", null ], + [ "Hoverable", "group__component.html#ga34adfc9c76cf3603156cba32ad5d7142", null ], + [ "Hoverable", "group__component.html#ga91cac81077c483efdb952268aee9a523", null ], + [ "Hoverable", "group__component.html#gafd7cbaef5378a907111a64ee69aed56a", null ], + [ "Input", "group__component.html#ga7f285fcbc4dd0a0767b89a255fd062dc", null ], + [ "Input", "group__component.html#ga9d118d596e33bf5bee9d5eccb6265d15", null ], + [ "Input", "group__component.html#ga82ba18065d2c29514f034c7278dead74", null ], + [ "Maybe", "group__component.html#ga70afe9695167fb736631173201969730", null ], + [ "Maybe", "group__component.html#gae39ad8b223e6bb7704c77a3708571a7d", null ], + [ "Maybe", "group__component.html#ga20b66a70c1cd4ff3f0ff571a4507d2b4", null ], + [ "Maybe", "group__component.html#ga83b6fd5e1524023722a7450f987f15d0", null ], + [ "Menu", "group__component.html#ga27828fc39da10a18478ba84b1b162039", null ], + [ "Menu", "group__component.html#gad793a3a507766ffa711c4332a3815e24", null ], + [ "Toggle", "group__component.html#ga3537fccac66b07cd792874c9a6086811", null ], + [ "MenuEntry", "group__component.html#gafca94c5cdae5fbf3c6aa81fc1cd7b1c0", null ], + [ "MenuEntry", "group__component.html#ga2c0a27959e6a5d90109f6d4506e00f69", null ], + [ "Modal", "group__component.html#ga5185342fbba215496cb8a6805f36089c", null ], + [ "Modal", "group__component.html#ga5babae0bb25f8cada57784cc5d27fb74", null ], + [ "Radiobox", "group__component.html#ga3e7a44f321fa910f07aef5879e67af95", null ], + [ "Radiobox", "group__component.html#gac73eebf15ff6b5386b7ee6c6cb4a4890", null ], + [ "Renderer", "group__component.html#gaf03d3df7243bf71bb1a73686628f7f2b", null ], + [ "Renderer", "group__component.html#ga533e883e2aeea28de2b60564fcaf0361", null ], + [ "Renderer", "group__component.html#ga099cb57274a99396ee10f38acbfe62a7", null ], + [ "Renderer", "group__component.html#ga41d63b7af41dee1570b54915821abd30", null ], + [ "ResizableSplitLeft", "group__component.html#gae2205fc172615b43e1e3307bb614be4c", null ], + [ "ResizableSplitRight", "group__component.html#ga9030d0beb64f653603cab382b02750a8", null ], + [ "ResizableSplitTop", "group__component.html#ga238b4b650aca14716b82b2198695e008", null ], + [ "ResizableSplitBottom", "group__component.html#gacb75e6e61a021829893f7b57aeb7e3a2", null ], + [ "Slider", "group__component.html#gafdce74ff1421c2f1bda336c8dacefcbd", null ], + [ "Window", "group__component.html#ga638693abef9289912f5fa39606390b20", null ] +]; \ No newline at end of file diff --git a/group__component_classftxui_1_1ComponentBase.js b/group__component_classftxui_1_1ComponentBase.js new file mode 100644 index 000000000..dd91881fb --- /dev/null +++ b/group__component_classftxui_1_1ComponentBase.js @@ -0,0 +1,30 @@ +var group__component_classftxui_1_1ComponentBase = +[ + [ "ComponentBase", "group__component.html#ad2a5b6ce11bc7a8ce1150cf0ba9144c0", null ], + [ "~ComponentBase", "group__component.html#ae490d465a018a9d81bb4e30604708fba", null ], + [ "ComponentBase", "group__component.html#acda4c8b63ffbc2e9e2e28f056edbf01c", null ], + [ "ComponentBase", "group__component.html#abd8cf6a9df5eb4678fb9925b686c7aea", null ], + [ "ComponentBase", "group__component.html#a9b3cf357cf150023641969d5fcb7d08f", null ], + [ "operator=", "group__component.html#ac444ac233dcbd4b2ad7972d2086ecc73", null ], + [ "operator=", "group__component.html#a9e3b99c8fc32f2ce151e2ba737c0d546", null ], + [ "Parent", "group__component.html#aaf284a408631f31558694973a04186c2", null ], + [ "ChildAt", "group__component.html#aceb41a98abe10fb0b521ff8b65529b7f", null ], + [ "ChildCount", "group__component.html#a9ae5f77e923e2f0f8b0e26dcd4affb5b", null ], + [ "Index", "group__component.html#a8ef12397d1682615bc3108c397734179", null ], + [ "Add", "group__component.html#a21f040bec9104e164bfa6c3ad45be3a1", null ], + [ "Detach", "group__component.html#abb7a2b60240651d16e17d02eb6f636cf", null ], + [ "DetachAllChildren", "group__component.html#a84bd6480cf5e8f51cf5965f81b1f2460", null ], + [ "Render", "group__component.html#a28d41d6113c5b29c8dd45846582b3299", null ], + [ "OnRender", "group__component.html#ab79303652dad19eac0540848487cf8c5", null ], + [ "OnEvent", "group__component.html#ab84629a8fecad2e1cdd426b7ddc72277", null ], + [ "OnAnimation", "group__component.html#aebad858485d02f035a8ea34af66a7fa7", null ], + [ "ActiveChild", "group__component.html#a5c421f00a2a7f50c542c5c286d2e696c", null ], + [ "Focusable", "group__component.html#a02ccd3db74312f1c66aa8e7931489318", null ], + [ "Active", "group__component.html#a52beef6d7a687d4d109e6cec1606e32e", null ], + [ "Focused", "group__component.html#a0cc612fa3d753b456e0f480f44654a9f", null ], + [ "SetActiveChild", "group__component.html#a8cbf27680c6154e15c8b32d6601340de", null ], + [ "SetActiveChild", "group__component.html#a50ad32ad14dd7912e681fab0ee294be2", null ], + [ "TakeFocus", "group__component.html#a2cf27e9d7128a6a4b3263ecd34c19105", null ], + [ "CaptureMouse", "group__component.html#a164d10a2cf367bdd4ae14318a6c7d769", null ], + [ "children_", "group__component.html#a22b4fa4d6aa4c9c2eef275cd25aa8ab9", null ] +]; \ No newline at end of file diff --git a/group__component_classftxui_1_1Loop.js b/group__component_classftxui_1_1Loop.js new file mode 100644 index 000000000..93fa68f20 --- /dev/null +++ b/group__component_classftxui_1_1Loop.js @@ -0,0 +1,14 @@ +var group__component_classftxui_1_1Loop = +[ + [ "Loop", "group__component.html#aacbc899babaac445c3b9b831322e8c70", null ], + [ "~Loop", "group__component.html#a84c72a09400ffc01ce3257d2109453a2", null ], + [ "Loop", "group__component.html#ad72ac0aa7a08850990b76f15e13dbe79", null ], + [ "Loop", "group__component.html#adfc045f0113bbf7f6dc5895ff7ce3ac5", null ], + [ "Loop", "group__component.html#a734882bfa3e357e4bb57581494e8699b", null ], + [ "HasQuitted", "group__component.html#a0f10869cb1cad212e8885deac6960a41", null ], + [ "RunOnce", "group__component.html#ad638ec512bc0d9876c2bf1c15913e9d3", null ], + [ "RunOnceBlocking", "group__component.html#afe89c4e52cb64cd7271c3fa8a04e7b61", null ], + [ "Run", "group__component.html#aa3eca255b6be227d7d901cc2a72017a5", null ], + [ "operator=", "group__component.html#add07fd33947183c42a79cb4759129ff8", null ], + [ "operator=", "group__component.html#ab35ce310313b96f28233ebc9279b5dd3", null ] +]; \ No newline at end of file diff --git a/group__component_classftxui_1_1ScreenInteractive.js b/group__component_classftxui_1_1ScreenInteractive.js new file mode 100644 index 000000000..23731eba8 --- /dev/null +++ b/group__component_classftxui_1_1ScreenInteractive.js @@ -0,0 +1,45 @@ +var group__component_classftxui_1_1ScreenInteractive = +[ + [ "Private", "classftxui_1_1ScreenInteractive_1_1Private.html", null ], + [ "SelectionStyle", "group__component.html#a0424ec9a980000671f12bfa39fc32273", null ], + [ "~ScreenInteractive", "group__component.html#a2c4f2d0819fb7afa3ce40cc0e3107053", null ], + [ "TrackMouse", "group__component.html#ad5961c1d4caf0ba9a030e5675162a164", null ], + [ "Loop", "group__component.html#a9bd3dbd471fce0038700caaa47dddc1a", null ], + [ "Exit", "group__component.html#a1a6a7739e9cc01ba888b57d1f9457f4c", null ], + [ "ExitLoopClosure", "group__component.html#ae295157a88e6300609df83769ed885f2", null ], + [ "Post", "group__component.html#a49209b09dcf8bc540f79e2bfd0a7ee88", null ], + [ "PostEvent", "group__component.html#a29e75bdaa1d5465518787ec014b2c3bf", null ], + [ "RequestAnimationFrame", "group__component.html#ad94d3d42aba3359550759aae5bcffbe9", null ], + [ "CaptureMouse", "group__component.html#aad61519d291dcc216d2ac618618a45a2", null ], + [ "WithRestoredIO", "group__component.html#af9df2de690486078fea4a7151b83b089", null ], + [ "ForceHandleCtrlC", "group__component.html#ae48c11a6c9160dc14cd5504ebe69304b", null ], + [ "ForceHandleCtrlZ", "group__component.html#af1c772ab581e587daad086227435f2ec", null ], + [ "GetSelection", "group__component.html#ac25769e248caa01d336f5eaa79cd6160", null ], + [ "SelectionChange", "group__component.html#ad6daabb2df61b6be6f0b2a8950ac3281", null ], + [ "ToString", "group__component.html#a19c380b03cea21d7ac7325136a131ff0", null ], + [ "Print", "group__component.html#ad93edbe885499a712129356f1ffd506b", null ], + [ "Clear", "group__component.html#aa71d36872f416feaa853788a7a7a7ef8", null ], + [ "ResetPosition", "group__component.html#a9677c078c4270afdb7451cdc0b0871d4", null ], + [ "ApplyShader", "group__component.html#a04d18c0cb0df3ed7a01ca5c3b8711ff7", null ], + [ "cursor", "group__component.html#a94febaac347b83267ff6a10b7837d612", null ], + [ "SetCursor", "group__component.html#a1aa24862a3d050b3aea2ade1300d51a7", null ], + [ "RegisterHyperlink", "group__component.html#a38015a8bc3dda474354ec8a374a6e2de", null ], + [ "Hyperlink", "group__component.html#a0b55b16969dfccc79195fe61c5ba6d1a", null ], + [ "GetSelectionStyle", "group__component.html#a056c2ad43affdac744b6907e9ea81463", null ], + [ "SetSelectionStyle", "group__component.html#aba0d30b90db17d6b7561f704ed63b5e6", null ], + [ "at", "group__component.html#a55b0a995463c6936efb33391f29565bc", null ], + [ "at", "group__component.html#a0882d58bb8ca1be9953135338456cf9e", null ], + [ "PixelAt", "group__component.html#a483f8ee1967e200cfc9e277b3ce00174", null ], + [ "PixelAt", "group__component.html#a03b2b39bb8f4d72068744776093125b3", null ], + [ "dimx", "group__component.html#ae7a460c9dacd70ed81b1adfea46b492e", null ], + [ "dimy", "group__component.html#a0d283cfb1ec16b3fc13d344ebfea93d4", null ], + [ "Loop", "group__component.html#a6f7095d721dd1dbd490d97c028eb676f", null ], + [ "Private", "group__component.html#a55bfcd8369da28d548069f2761d2c39f", null ], + [ "cursor_", "group__component.html#a9df9d1ae7ed66857ca987963b2365904", null ], + [ "hyperlinks_", "group__component.html#acff83d382ef60ad2a0fca3ba68e9397f", null ], + [ "selection_style_", "group__component.html#ab9f757d5d67255f61e27950be4131be1", null ], + [ "stencil", "group__component.html#a92cacd07ba30909855f19edc01192ff0", null ], + [ "dimx_", "group__component.html#a1b254c3faacd432c325efff4268ca683", null ], + [ "dimy_", "group__component.html#a9e9d5df4b41aaa5eca27cdcaca6d4574", null ], + [ "pixels_", "group__component.html#aeab8c1788b3f2c7403749c3be95a68ae", null ] +]; \ No newline at end of file diff --git a/group__component_structftxui_1_1AnimatedColorOption.js b/group__component_structftxui_1_1AnimatedColorOption.js new file mode 100644 index 000000000..a8ffccab5 --- /dev/null +++ b/group__component_structftxui_1_1AnimatedColorOption.js @@ -0,0 +1,9 @@ +var group__component_structftxui_1_1AnimatedColorOption = +[ + [ "Set", "group__component.html#ad186d5a36e45174bbc7c50df85c2e91e", null ], + [ "enabled", "group__component.html#a8740ba80e30dd75e71d09fa1dcf04f3d", null ], + [ "inactive", "group__component.html#a898e4eb6c2a93ea3b71fc373f39854eb", null ], + [ "active", "group__component.html#a5c04e41d802330270ae14a9861c1e2df", null ], + [ "duration", "group__component.html#a7449575119a6168a323351fb04a7eb64", null ], + [ "function", "group__component.html#a23a21de13ab9c6644225966245df3fe3", null ] +]; \ No newline at end of file diff --git a/group__component_structftxui_1_1ButtonOption.js b/group__component_structftxui_1_1ButtonOption.js new file mode 100644 index 000000000..fd5e66a49 --- /dev/null +++ b/group__component_structftxui_1_1ButtonOption.js @@ -0,0 +1,7 @@ +var group__component_structftxui_1_1ButtonOption = +[ + [ "label", "group__component.html#a336758144ce2b1095f2a0ef062551f5b", null ], + [ "on_click", "group__component.html#a0ae001950b0ed23752b298963cecf3d1", null ], + [ "transform", "group__component.html#afe14c161494dad905597e75661c7b6a0", null ], + [ "animated_colors", "group__component.html#ab7131557fbe84a6b4b2f2ffcff7d44f0", null ] +]; \ No newline at end of file diff --git a/group__component_structftxui_1_1CheckboxOption.js b/group__component_structftxui_1_1CheckboxOption.js new file mode 100644 index 000000000..94609673d --- /dev/null +++ b/group__component_structftxui_1_1CheckboxOption.js @@ -0,0 +1,7 @@ +var group__component_structftxui_1_1CheckboxOption = +[ + [ "label", "group__component.html#a336758144ce2b1095f2a0ef062551f5b", null ], + [ "checked", "group__component.html#ab7741e52624c0d7906159d77edffe27e", null ], + [ "transform", "group__component.html#afe14c161494dad905597e75661c7b6a0", null ], + [ "on_change", "group__component.html#abdfe3c83deeec2323ff90248815b8f0a", null ] +]; \ No newline at end of file diff --git a/group__component_structftxui_1_1DropdownOption.js b/group__component_structftxui_1_1DropdownOption.js new file mode 100644 index 000000000..76109116d --- /dev/null +++ b/group__component_structftxui_1_1DropdownOption.js @@ -0,0 +1,7 @@ +var group__component_structftxui_1_1DropdownOption = +[ + [ "open", "group__component.html#aa9ee4f52203c5dec717cf45077b82776", null ], + [ "checkbox", "group__component.html#a0797deb307cd89059137a4ca6075fcbf", null ], + [ "radiobox", "group__component.html#a83288bb2ebb6ca0eef0651285a71291e", null ], + [ "transform", "group__component.html#ae2d438a2693c6279aba8a2549a161601", null ] +]; \ No newline at end of file diff --git a/group__component_structftxui_1_1Event.js b/group__component_structftxui_1_1Event.js new file mode 100644 index 000000000..67cb09d47 --- /dev/null +++ b/group__component_structftxui_1_1Event.js @@ -0,0 +1,21 @@ +var group__component_structftxui_1_1Event = +[ + [ "operator==", "group__component.html#ad5b326fac977a9c1c832ddb508f713da", null ], + [ "operator!=", "group__component.html#ae4581774f4417f68d335de865fd2e6d3", null ], + [ "operator<", "group__component.html#a7590045e19360277dfc54320b627002c", null ], + [ "input", "group__component.html#a947e2de698c4bef07c78674218330677", null ], + [ "is_character", "group__component.html#ae75703788c6f68b39fc51f8db3ba156d", null ], + [ "character", "group__component.html#a07022c6e92b9144a0e5b337b562f9892", null ], + [ "is_mouse", "group__component.html#a2c835925299d56941ffd2e2421f0fd13", null ], + [ "mouse", "group__component.html#a37daf59df57eb6415eb34c8df11a4892", null ], + [ "is_cursor_position", "group__component.html#a4464a1cace713dc3544922cc6d5acdc1", null ], + [ "cursor_x", "group__component.html#a1ef75084a5f2a9d26df8cafcf048526e", null ], + [ "cursor_y", "group__component.html#a1a24372c00e6485f2648350df4301ae3", null ], + [ "is_cursor_shape", "group__component.html#af795895177b7686bf63ab113e70159c8", null ], + [ "cursor_shape", "group__component.html#a022c841864c305d5e3ef69f6957dc367", null ], + [ "DebugString", "group__component.html#a764be64f3029f8b8e23511061d8de355", null ], + [ "screen_", "group__component.html#a57ae65156ecf0f469cc559a49e6c4f2f", null ], + [ "mouse", "group__component.html#a761c3b7a78d8408dfbe76131209532d7", null ], + [ "cursor", "group__component.html#a9d8d873964fd143f113fce55e15c37fb", null ], + [ "cursor_shape", "group__component.html#a25a0efbff7ae0393c695f6d720cb5542", null ] +]; \ No newline at end of file diff --git a/group__component_structftxui_1_1InputOption.js b/group__component_structftxui_1_1InputOption.js new file mode 100644 index 000000000..04f31c95d --- /dev/null +++ b/group__component_structftxui_1_1InputOption.js @@ -0,0 +1,12 @@ +var group__component_structftxui_1_1InputOption = +[ + [ "content", "group__component.html#ac9f6c2acd72d74eeb3a18baf32b02932", null ], + [ "placeholder", "group__component.html#aaca8e18f9fe70089d8fd4165f4b518e1", null ], + [ "transform", "group__component.html#a93721d00aaf44f42cc0399024514b628", null ], + [ "password", "group__component.html#a927bd46792ffe38c7545a764d847d066", null ], + [ "multiline", "group__component.html#af18b2db29029e23c13a8bfc233c62878", null ], + [ "insert", "group__component.html#a3ae35fa7cff9f950b9c66536523c69c1", null ], + [ "on_change", "group__component.html#abdfe3c83deeec2323ff90248815b8f0a", null ], + [ "on_enter", "group__component.html#a4ba9530701be07334a17c0184747c535", null ], + [ "cursor_position", "group__component.html#a699547942204afa70864e0e6df94c96c", null ] +]; \ No newline at end of file diff --git a/group__component_structftxui_1_1MenuEntryOption.js b/group__component_structftxui_1_1MenuEntryOption.js new file mode 100644 index 000000000..cad9d244e --- /dev/null +++ b/group__component_structftxui_1_1MenuEntryOption.js @@ -0,0 +1,6 @@ +var group__component_structftxui_1_1MenuEntryOption = +[ + [ "label", "group__component.html#a336758144ce2b1095f2a0ef062551f5b", null ], + [ "transform", "group__component.html#a5641c45021a8cc20bdd21498563825a0", null ], + [ "animated_colors", "group__component.html#ab7131557fbe84a6b4b2f2ffcff7d44f0", null ] +]; \ No newline at end of file diff --git a/group__component_structftxui_1_1MenuOption.js b/group__component_structftxui_1_1MenuOption.js new file mode 100644 index 000000000..492a5c254 --- /dev/null +++ b/group__component_structftxui_1_1MenuOption.js @@ -0,0 +1,14 @@ +var group__component_structftxui_1_1MenuOption = +[ + [ "entries", "group__component.html#a7b534b117dbbe826d34ba17af85f1e93", null ], + [ "selected", "group__component.html#ac42a32c3439d08be9c5626a5fbc3a0c4", null ], + [ "underline", "group__component.html#a55b558727e02acce3f5259811b2dfe5b", null ], + [ "entries_option", "group__component.html#a2076e7253c5acce2321c067e9b7a1823", null ], + [ "direction", "group__component.html#a53421c695d00016ab925777d423b4eb6", null ], + [ "elements_prefix", "group__component.html#a11476ea3dc58bf17777879693fb2985a", null ], + [ "elements_infix", "group__component.html#a9504d8d3bfa1daaab000e5455536b20d", null ], + [ "elements_postfix", "group__component.html#ab08362a5698543aec0fbb37f99777119", null ], + [ "on_change", "group__component.html#abdfe3c83deeec2323ff90248815b8f0a", null ], + [ "on_enter", "group__component.html#a4ba9530701be07334a17c0184747c535", null ], + [ "focused_entry", "group__component.html#a93d5d37708b77971a666b73486017835", null ] +]; \ No newline at end of file diff --git a/group__component_structftxui_1_1Mouse.js b/group__component_structftxui_1_1Mouse.js new file mode 100644 index 000000000..b143e12ab --- /dev/null +++ b/group__component_structftxui_1_1Mouse.js @@ -0,0 +1,25 @@ +var group__component_structftxui_1_1Mouse = +[ + [ "Button", "group__component.html#a03bfec859eac87be20f8952c1eb89de0", [ + [ "Left", "group__component.html#a03bfec859eac87be20f8952c1eb89de0a9d4d8b0b72fc2659da772d761a3c5ecb", null ], + [ "Middle", "group__component.html#a03bfec859eac87be20f8952c1eb89de0a673e6efef9aafe98078c5552e99c923c", null ], + [ "Right", "group__component.html#a03bfec859eac87be20f8952c1eb89de0ad48f7af8c070184f3774c8e85854eb66", null ], + [ "None", "group__component.html#a03bfec859eac87be20f8952c1eb89de0ac9d3e887722f2bc482bcca9d41c512af", null ], + [ "WheelUp", "group__component.html#a03bfec859eac87be20f8952c1eb89de0ab51f2e2fc1697565b732263f86a976d6", null ], + [ "WheelDown", "group__component.html#a03bfec859eac87be20f8952c1eb89de0afd8a27c9d7eac3486f6fbd2d608da0db", null ], + [ "WheelLeft", "group__component.html#a03bfec859eac87be20f8952c1eb89de0a160e671a76bd0d1f424a8b9700275375", null ], + [ "WheelRight", "group__component.html#a03bfec859eac87be20f8952c1eb89de0ae73184b2d38af984b5cda75057471adc", null ] + ] ], + [ "Motion", "group__component.html#a099c889d2b948b264c7a665b66e3a9b6", [ + [ "Released", "group__component.html#a099c889d2b948b264c7a665b66e3a9b6ad9417ac74f0134b9577d1d85cf422c25", null ], + [ "Pressed", "group__component.html#a099c889d2b948b264c7a665b66e3a9b6a05f4abb2322aa023aba9570c327aff25", null ], + [ "Moved", "group__component.html#a099c889d2b948b264c7a665b66e3a9b6a9bf35ab1cecfbb50d8f1d708a4921fc6", null ] + ] ], + [ "button", "group__component.html#aa56e877ca6a7524cf1e891c7435c3ace", null ], + [ "motion", "group__component.html#af8ec4d0833a67c0bcd400f9e30bd07c7", null ], + [ "shift", "group__component.html#ace78b37abb3d96740735fd8eb41235e6", null ], + [ "meta", "group__component.html#a46e545ef1aafd5ca9f1d6055fcebeeca", null ], + [ "control", "group__component.html#ad155fe5a68eb888a7e0eb897a3dfc015", null ], + [ "x", "group__component.html#a6150e0515f7202e2fb518f7206ed97dc", null ], + [ "y", "group__component.html#a0a2f84ed7838f07779ae24c5a9086d33", null ] +]; \ No newline at end of file diff --git a/group__component_structftxui_1_1RadioboxOption.js b/group__component_structftxui_1_1RadioboxOption.js new file mode 100644 index 000000000..00f5f8831 --- /dev/null +++ b/group__component_structftxui_1_1RadioboxOption.js @@ -0,0 +1,8 @@ +var group__component_structftxui_1_1RadioboxOption = +[ + [ "entries", "group__component.html#a7b534b117dbbe826d34ba17af85f1e93", null ], + [ "selected", "group__component.html#ac42a32c3439d08be9c5626a5fbc3a0c4", null ], + [ "transform", "group__component.html#afe14c161494dad905597e75661c7b6a0", null ], + [ "on_change", "group__component.html#abdfe3c83deeec2323ff90248815b8f0a", null ], + [ "focused_entry", "group__component.html#a93d5d37708b77971a666b73486017835", null ] +]; \ No newline at end of file diff --git a/group__component_structftxui_1_1UnderlineOption.js b/group__component_structftxui_1_1UnderlineOption.js new file mode 100644 index 000000000..3e2f2121d --- /dev/null +++ b/group__component_structftxui_1_1UnderlineOption.js @@ -0,0 +1,16 @@ +var group__component_structftxui_1_1UnderlineOption = +[ + [ "SetAnimation", "group__component.html#a754d89398aac6051ced26fd452c62589", null ], + [ "SetAnimationDuration", "group__component.html#a798360474be7511364b8171f0c62f6d5", null ], + [ "SetAnimationFunction", "group__component.html#a34e6222dbf10e899074054160870816c", null ], + [ "SetAnimationFunction", "group__component.html#a7d978b34c37e9d08c57a22477016204c", null ], + [ "enabled", "group__component.html#a8740ba80e30dd75e71d09fa1dcf04f3d", null ], + [ "color_active", "group__component.html#a593f1ba15add21d1972c01372db369df", null ], + [ "color_inactive", "group__component.html#ad5a77e0bc0ce649271a13949a7a0a635", null ], + [ "leader_function", "group__component.html#a1886d86b757123859c89f3336631b1f8", null ], + [ "follower_function", "group__component.html#a7dca406bc24422caeb8f39705334dbd1", null ], + [ "leader_duration", "group__component.html#a6112ea2b5db5a4c50fe7d5ae70dfd016", null ], + [ "leader_delay", "group__component.html#ae29bb2e2c1e7f6eca70781e6fcd63a64", null ], + [ "follower_duration", "group__component.html#a13a6488c25b667256590c85aacb1f518", null ], + [ "follower_delay", "group__component.html#a2b5d480250b61cd7e62e7c6567345e38", null ] +]; \ No newline at end of file diff --git a/group__component_structftxui_1_1WindowRenderState.js b/group__component_structftxui_1_1WindowRenderState.js new file mode 100644 index 000000000..03abd2690 --- /dev/null +++ b/group__component_structftxui_1_1WindowRenderState.js @@ -0,0 +1,12 @@ +var group__component_structftxui_1_1WindowRenderState = +[ + [ "inner", "group__component.html#a5486612c1fe0c8651fbb399ac512fccf", null ], + [ "title", "group__component.html#a32309346e2ae5546e342e991d0a53b37", null ], + [ "active", "group__component.html#a03c996f9fcf0e10baeb3e700be0c409a", null ], + [ "drag", "group__component.html#a2104e875bdb7c78a8bf7dfd3728459c5", null ], + [ "resize", "group__component.html#a47beb6819c84c39255cb60f5710714ce", null ], + [ "hover_left", "group__component.html#abca2d427dd57d2b5eecb6685ed68e857", null ], + [ "hover_right", "group__component.html#a8e6af441e03d44f593bcb0d17ee809b1", null ], + [ "hover_top", "group__component.html#acb4dc002e621733f1e6c232f369af8ca", null ], + [ "hover_down", "group__component.html#a2fbfe3e43b596c8a47c5548b38e4d721", null ] +]; \ No newline at end of file diff --git a/group__dom.html b/group__dom.html new file mode 100644 index 000000000..ce11fb5aa --- /dev/null +++ b/group__dom.html @@ -0,0 +1,8323 @@ + + + + + + + + +FTXUI: ftxui/dom + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
ftxui/dom
+
+
+

Detailed Description

+

Please check the tutorial of the ftxui/dom module.

+ + + + + + + + + + + + + + + + + + + + + + + +

+Classes

struct  Canvas
 Canvas is a drawable buffer associated with drawing operations. More...
 
struct  FlexboxConfig
 FlexboxConfig is a configuration structure that defines the layout properties for a flexbox container. More...
 
struct  LinearGradient
 A class representing the settings for linear-gradient color effect. More...
 
class  Node
 Node is the base class for all elements in the DOM tree. More...
 
struct  Requirement
 Requirement is a structure that defines the layout requirements for a Node in the terminal user interface. More...
 
class  Selection
 Represents a selection in a terminal user interface. More...
 
class  Table
 Table is a utility to draw tables. More...
 
+ + + + + + + +

+Enumerations

enum class  Direction {
+  Up = 0 +,
+  Down = 1 +,
+  Left = 2 +,
+  Right = 3 +
+ }
 Direction is an enumeration that represents the four cardinal directions. More...
 
enum  BorderStyle {
+  LIGHT +,
+  DASHED +,
+  HEAVY +,
+  DOUBLE +,
+  ROUNDED +,
+  EMPTY +
+ }
 BorderStyle is an enumeration that represents the different styles of borders that can be applied to elements in the terminal UI. More...
 
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+Functions

Element automerge (Element child)
 Enable character to be automatically merged with others nearby.
 
Element blink (Element child)
 The text drawn alternates in between visible and hidden.
 
Element bold (Element child)
 Use a bold font, for elements with more emphasis.
 
Element border (Element child)
 Draw a border around the element.
 
Decorator borderWith (const Pixel &pixel)
 Same as border but with a constant Pixel around the element.
 
Decorator borderStyled (BorderStyle style)
 Same as border but with different styles.
 
Decorator borderStyled (Color foreground_color)
 Same as border but with a foreground color.
 
Decorator borderStyled (BorderStyle style, Color foreground_color)
 Same as border but with a foreground color and a different style.
 
Element borderDashed (Element child)
 Draw a dashed border around the element.
 
Element borderLight (Element child)
 Draw a light border around the element.
 
Element borderHeavy (Element child)
 Draw a heavy border around the element.
 
Element borderDouble (Element child)
 Draw a double border around the element.
 
Element borderRounded (Element child)
 Draw a rounded border around the element.
 
Element borderEmpty (Element child)
 Draw an empty border around the element.
 
Element window (Element title, Element content, BorderStyle border)
 Draw window with a title and a border around the element.
 
Element clear_under (Element element)
 Before drawing |child|, clear the pixels below. This is useful in combination with dbox.
 
Element color (Color color, Element child)
 Set the foreground color of an element.
 
Element bgcolor (Color color, Element child)
 Set the background color of an element.
 
Decorator color (Color c)
 Decorate using a foreground color.
 
Decorator bgcolor (Color color)
 Decorate using a background color.
 
Element hcenter (Element child)
 Center an element horizontally.
 
Element vcenter (Element child)
 Center an element vertically.
 
Element center (Element child)
 Center an element horizontally and vertically.
 
Element align_right (Element child)
 Align an element on the right side.
 
Element dbox (Elements children_)
 Stack several element on top of each other.
 
Element dim (Element child)
 Use a light font, for elements with less emphasis.
 
Element filler ()
 An element that will take expand proportionally to the space left in a container.
 
Element flex (Element child)
 Make a child element to expand proportionally to the space left in a container.
 
Element xflex (Element child)
 Expand/Minimize if possible/needed on the X axis.
 
Element yflex (Element child)
 Expand/Minimize if possible/needed on the Y axis.
 
Element flex_grow (Element child)
 Expand if possible.
 
Element xflex_grow (Element child)
 Expand if possible on the X axis.
 
Element yflex_grow (Element child)
 Expand if possible on the Y axis.
 
Element flex_shrink (Element child)
 Minimize if needed.
 
Element xflex_shrink (Element child)
 Minimize if needed on the X axis.
 
Element yflex_shrink (Element child)
 Minimize if needed on the Y axis.
 
Element notflex (Element child)
 Make the element not flexible.
 
Decorator focusPositionRelative (float x, float y)
 Used inside a frame, this force the view to be scrolled toward a a given position. The position is expressed in proportion of the requested size.
 
Decorator focusPosition (int x, int y)
 Used inside a frame, this force the view to be scrolled toward a a given position. The position is expressed in the numbers of cells.
 
Element focus (Element child)
 Set the child to be the one focused among its siblings.
 
Element focusCursorBlock (Element child)
 Same as focus, but set the cursor shape to be a still block.
 
Element focusCursorBlockBlinking (Element child)
 Same as focus, but set the cursor shape to be a blinking block.
 
Element focusCursorBar (Element child)
 Same as focus, but set the cursor shape to be a still block.
 
Element focusCursorBarBlinking (Element child)
 Same as focus, but set the cursor shape to be a blinking bar.
 
Element focusCursorUnderline (Element child)
 Same as focus, but set the cursor shape to be a still underline.
 
Element focusCursorUnderlineBlinking (Element child)
 Same as focus, but set the cursor shape to be a blinking underline.
 
Element gaugeDirection (float progress, Direction direction)
 Draw a high definition progress bar progressing in specified direction.
 
Element gaugeRight (float progress)
 Draw a high definition progress bar progressing from left to right.
 
Element gaugeLeft (float progress)
 Draw a high definition progress bar progressing from right to left.
 
Element gaugeUp (float progress)
 Draw a high definition progress bar progressing from bottom to top.
 
Element gaugeDown (float progress)
 Draw a high definition progress bar progressing from top to bottom.
 
Element gauge (float progress)
 Draw a high definition progress bar.
 
Element hyperlink (std::string link, Element child)
 Make the rendered area clickable using a web browser. The link will be opened when the user clicks on it. This is supported only on a limited set of terminal emulators. List: https://github.com/Alhadis/OSC8-Adoption/.
 
Decorator hyperlink (std::string link)
 Decorate using a hyperlink. The link will be opened when the user clicks on it. This is supported only on a limited set of terminal emulators. List: https://github.com/Alhadis/OSC8-Adoption/.
 
Element inverted (Element child)
 Add a filter that will invert the foreground and the background colors.
 
Element italic (Element child)
 Apply a underlinedDouble to text.
 
Element color (const LinearGradient &gradient, Element child)
 Set the foreground color of an element with linear-gradient effect.
 
Element bgcolor (const LinearGradient &gradient, Element child)
 Set the background color of an element with linear-gradient effect.
 
Decorator color (const LinearGradient &gradient)
 Decorate using a linear-gradient effect on the foreground color.
 
Decorator bgcolor (const LinearGradient &gradient)
 Decorate using a linear-gradient effect on the background color.
 
void Render (Screen &screen, const Element &element)
 Display an element on a ftxui::Screen.
 
void Render (Screen &screen, Node *node)
 Display an element on a ftxui::Screen.
 
Element paragraph (const std::string &the_text)
 Return an element drawing the paragraph on multiple lines.
 
Element paragraphAlignLeft (const std::string &the_text)
 Return an element drawing the paragraph on multiple lines, aligned on the left.
 
Element paragraphAlignRight (const std::string &the_text)
 Return an element drawing the paragraph on multiple lines, aligned on the right.
 
Element paragraphAlignCenter (const std::string &the_text)
 Return an element drawing the paragraph on multiple lines, aligned on the center.
 
Element paragraphAlignJustify (const std::string &the_text)
 Return an element drawing the paragraph on multiple lines, aligned using a justified alignment. the center.
 
Element vscroll_indicator (Element child)
 Display a vertical scrollbar on the right. Colors follow the content.
 
Element hscroll_indicator (Element child)
 Display a horizontal scrollbar at the bottom. Colors follow the content.
 
Element separator ()
 Draw a vertical or horizontal separation in between two other elements.
 
Element separatorStyled (BorderStyle style)
 Draw a vertical or horizontal separation in between two other elements.
 
Element separatorLight ()
 Draw a vertical or horizontal separation in between two other elements, using the LIGHT style.
 
Element separatorDashed ()
 Draw a vertical or horizontal separation in between two other elements, using the DASHED style.
 
Element separatorHeavy ()
 Draw a vertical or horizontal separation in between two other elements, using the HEAVY style.
 
Element separatorDouble ()
 Draw a vertical or horizontal separation in between two other elements, using the DOUBLE style.
 
Element separatorEmpty ()
 Draw a vertical or horizontal separation in between two other elements, using the EMPTY style.
 
Element separatorCharacter (std::string value)
 Draw a vertical or horizontal separation in between two other elements.
 
Element separator (Pixel pixel)
 Draw a separator in between two element filled with a given pixel.
 
Decorator size (WidthOrHeight direction, Constraint constraint, int value)
 Apply a constraint on the size of an element.
 
Element spinner (int charset_index, size_t image_index)
 Useful to represent the effect of time and/or events. This displays an ASCII art "video".
 
Element strikethrough (Element child)
 Apply a strikethrough to text.
 
Element text (std::string text)
 Display a piece of UTF8 encoded unicode text.
 
Element text (std::wstring text)
 Display a piece of unicode text.
 
Element vtext (std::string text)
 Display a piece of unicode text vertically.
 
Element vtext (std::wstring text)
 Display a piece unicode text vertically.
 
Element underlined (Element child)
 Underline the given element.
 
Element underlinedDouble (Element child)
 Apply a underlinedDouble to text.
 
Element nothing (Element element)
 A decoration doing absolutely nothing.
 
Decorator operator| (Decorator a, Decorator b)
 Compose two decorator into one.
 
Elements operator| (Elements elements, Decorator decorator)
 From a set of element, apply a decorator to every elements.
 
Element operator| (Element element, Decorator decorator)
 From an element, apply a decorator.
 
Elementoperator|= (Element &e, Decorator d)
 Apply a decorator to an element.
 
Element emptyElement ()
 
Element vbox (Elements children)
 A container displaying elements vertically one by one.
 
void SetColorSupport (Color color)
 Override terminal color support in case auto-detection fails.
 
+

Class Documentation

+ +

◆ ftxui::Canvas

+ +
+
+ + + + +
struct ftxui::Canvas
+
+

Canvas is a drawable buffer associated with drawing operations.

+

Canvas is a drawable area that can be used to create complex graphics. It supports drawing points, lines, circles, ellipses, text, and images using braille, block, or normal characters.

+

Note: A terminal contains cells. A cells is a unit of:

    +
  • 2x4 braille characters (1x1 pixel)
  • +
  • 2x2 block characters (2x2 pixels)
  • +
  • 2x4 normal characters (2x4 pixels)
  • +
+

You need to multiply the x coordinate by 2 and the y coordinate by 4 to get the correct position in the terminal.

+
Examples
examples/component/canvas_animated.cpp, and examples/dom/canvas.cpp.
+
+ +

Definition at line 38 of file canvas.hpp.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Types

using Stylizer = std::function<void(Pixel&)>
 

Public Member Functions

 Canvas ()=default
 
 Canvas (int width, int height)
 Constructor.
 
int width () const
 
int height () const
 
Pixel GetPixel (int x, int y) const
 Get the content of a cell.
 
void DrawPointOn (int x, int y)
 Draw a braille dot.
 
void DrawPointOff (int x, int y)
 Erase a braille dot.
 
void DrawPointToggle (int x, int y)
 Toggle a braille dot. A filled one will be erased, and the other will be drawn.
 
void DrawPoint (int x, int y, bool value)
 Draw a braille dot.
 
void DrawPoint (int x, int y, bool value, const Stylizer &s)
 Draw a braille dot.
 
void DrawPoint (int x, int y, bool value, const Color &color)
 Draw a braille dot.
 
void DrawPointLine (int x1, int y1, int x2, int y2)
 Draw a line made of braille dots.
 
void DrawPointLine (int x1, int y1, int x2, int y2, const Stylizer &s)
 Draw a line made of braille dots.
 
void DrawPointLine (int x1, int y1, int x2, int y2, const Color &color)
 Draw a line made of braille dots.
 
void DrawPointCircle (int x, int y, int radius)
 Draw a circle made of braille dots.
 
void DrawPointCircle (int x, int y, int radius, const Stylizer &s)
 Draw a circle made of braille dots.
 
void DrawPointCircle (int x, int y, int radius, const Color &color)
 Draw a circle made of braille dots.
 
void DrawPointCircleFilled (int x, int y, int radius)
 Draw a filled circle made of braille dots.
 
void DrawPointCircleFilled (int x, int y, int radius, const Stylizer &s)
 Draw a filled circle made of braille dots.
 
void DrawPointCircleFilled (int x, int y, int radius, const Color &color)
 Draw a filled circle made of braille dots.
 
void DrawPointEllipse (int x, int y, int r1, int r2)
 Draw an ellipse made of braille dots.
 
void DrawPointEllipse (int x, int y, int r1, int r2, const Color &color)
 Draw an ellipse made of braille dots.
 
void DrawPointEllipse (int x, int y, int r1, int r2, const Stylizer &s)
 Draw an ellipse made of braille dots.
 
void DrawPointEllipseFilled (int x, int y, int r1, int r2)
 Draw a filled ellipse made of braille dots.
 
void DrawPointEllipseFilled (int x, int y, int r1, int r2, const Color &color)
 Draw a filled ellipse made of braille dots.
 
void DrawPointEllipseFilled (int x, int y, int r1, int r2, const Stylizer &s)
 Draw a filled ellipse made of braille dots.
 
void DrawBlockOn (int x, int y)
 Draw a block.
 
void DrawBlockOff (int x, int y)
 Erase a block.
 
void DrawBlockToggle (int x, int y)
 Toggle a block. If it is filled, it will be erased. If it is empty, it will be filled.
 
void DrawBlock (int x, int y, bool value)
 Draw a block.
 
void DrawBlock (int x, int y, bool value, const Stylizer &s)
 Draw a block.
 
void DrawBlock (int x, int y, bool value, const Color &color)
 Draw a block.
 
void DrawBlockLine (int x1, int y1, int x2, int y2)
 Draw a line made of block characters.
 
void DrawBlockLine (int x1, int y1, int x2, int y2, const Stylizer &s)
 Draw a line made of block characters.
 
void DrawBlockLine (int x1, int y1, int x2, int y2, const Color &color)
 Draw a line made of block characters.
 
void DrawBlockCircle (int x1, int y1, int radius)
 Draw a circle made of block characters.
 
void DrawBlockCircle (int x1, int y1, int radius, const Stylizer &s)
 Draw a circle made of block characters.
 
void DrawBlockCircle (int x1, int y1, int radius, const Color &color)
 Draw a circle made of block characters.
 
void DrawBlockCircleFilled (int x1, int y1, int radius)
 Draw a filled circle made of block characters.
 
void DrawBlockCircleFilled (int x1, int y1, int radius, const Stylizer &s)
 Draw a filled circle made of block characters.
 
void DrawBlockCircleFilled (int x1, int y1, int radius, const Color &color)
 Draw a filled circle made of block characters.
 
void DrawBlockEllipse (int x1, int y1, int r1, int r2)
 Draw an ellipse made of block characters.
 
void DrawBlockEllipse (int x1, int y1, int r1, int r2, const Stylizer &s)
 Draw an ellipse made of block characters.
 
void DrawBlockEllipse (int x1, int y1, int r1, int r2, const Color &color)
 Draw an ellipse made of block characters.
 
void DrawBlockEllipseFilled (int x1, int y1, int r1, int r2)
 Draw a filled ellipse made of block characters.
 
void DrawBlockEllipseFilled (int x1, int y1, int r1, int r2, const Stylizer &s)
 Draw a filled ellipse made of block characters.
 
void DrawBlockEllipseFilled (int x1, int y1, int r1, int r2, const Color &color)
 Draw a filled ellipse made of block characters.
 
void DrawText (int x, int y, const std::string &value)
 Draw a piece of text.
 
void DrawText (int x, int y, const std::string &value, const Color &color)
 Draw a piece of text.
 
void DrawText (int x, int y, const std::string &value, const Stylizer &style)
 Draw a piece of text.
 
void DrawPixel (int x, int y, const Pixel &)
 Directly draw a predefined pixel at the given coordinate.
 
void DrawImage (int x, int y, const Image &)
 Draw a predefined image, with top-left corner at the given coordinate You can supply negative coordinates to align the image however you like - only the 'visible' portion will be drawn.
 
void Style (int x, int y, const Stylizer &style)
 Modify a pixel at a given location.
 
+

Member Typedef Documentation

+ +

◆ Stylizer

+ +
+
+ + + + +
using Stylizer = std::function<void(Pixel&)>
+
+ +

Definition at line 48 of file canvas.hpp.

+ +
+
+

Constructor & Destructor Documentation

+ +

◆ Canvas() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
Canvas ()
+
+default
+
+ +
+
+ +

◆ Canvas() [2/2]

+ +
+
+ + + + + + + + + + + +
Canvas (int width,
int height )
+
+ +

Constructor.

+
Parameters
+ + + +
widththe width of the canvas. A cell is a 2x4 braille dot.
heightthe height of the canvas. A cell is a 2x4 braille dot.
+
+
+ +

Definition at line 90 of file src/ftxui/dom/canvas.cpp.

+ +
+
+

Member Function Documentation

+ +

◆ width()

+ +
+
+ + + + + +
+ + + + + + + +
int width () const
+
+inline
+
+ +

Definition at line 44 of file canvas.hpp.

+ +
+
+ +

◆ height()

+ +
+
+ + + + + +
+ + + + + + + +
int height () const
+
+inline
+
+ +

Definition at line 45 of file canvas.hpp.

+ +
+
+ +

◆ GetPixel()

+ +
+
+ + + + + + + + + + + +
Pixel GetPixel (int x,
int y ) const
+
+ +

Get the content of a cell.

+
Parameters
+ + + +
xthe x coordinate of the cell.
ythe y coordinate of the cell.
+
+
+ +

Definition at line 98 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawPointOn()

+ +
+
+ + + + + + + + + + + +
void DrawPointOn (int x,
int y )
+
+ +

Draw a braille dot.

+
Parameters
+ + + +
xthe x coordinate of the dot.
ythe y coordinate of the dot.
+
+
+ +

Definition at line 137 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawPointOff()

+ +
+
+ + + + + + + + + + + +
void DrawPointOff (int x,
int y )
+
+ +

Erase a braille dot.

+
Parameters
+ + + +
xthe x coordinate of the dot.
ythe y coordinate of the dot.
+
+
+ +

Definition at line 154 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawPointToggle()

+ +
+
+ + + + + + + + + + + +
void DrawPointToggle (int x,
int y )
+
+ +

Toggle a braille dot. A filled one will be erased, and the other will be drawn.

+
Parameters
+ + + +
xthe x coordinate of the dot.
ythe y coordinate of the dot.
+
+
+ +

Definition at line 172 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawPoint() [1/3]

+ +
+
+ + + + + + + + + + + + + + + + +
void DrawPoint (int x,
int y,
bool value )
+
+ +

Draw a braille dot.

+
Parameters
+ + + + +
xthe x coordinate of the dot.
ythe y coordinate of the dot.
valuewhether the dot is filled or not.
+
+
+ +

Definition at line 107 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawPoint() [2/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
void DrawPoint (int x,
int y,
bool value,
const Stylizer & style )
+
+ +

Draw a braille dot.

+
Parameters
+ + + + + +
xthe x coordinate of the dot.
ythe y coordinate of the dot.
valuewhether the dot is filled or not.
stylethe style of the cell.
+
+
+ +

Definition at line 125 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawPoint() [3/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
void DrawPoint (int x,
int y,
bool value,
const Color & color )
+
+ +

Draw a braille dot.

+
Parameters
+ + + + + +
xthe x coordinate of the dot.
ythe y coordinate of the dot.
valuewhether the dot is filled or not.
colorthe color of the dot.
+
+
+ +

Definition at line 116 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawPointLine() [1/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
void DrawPointLine (int x1,
int y1,
int x2,
int y2 )
+
+ +

Draw a line made of braille dots.

+
Parameters
+ + + + + +
x1the x coordinate of the first dot.
y1the y coordinate of the first dot.
x2the x coordinate of the second dot.
y2the y coordinate of the second dot.
+
+
+ +

Definition at line 191 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawPointLine() [2/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
void DrawPointLine (int x1,
int y1,
int x2,
int y2,
const Stylizer & style )
+
+ +

Draw a line made of braille dots.

+
Parameters
+ + + + + + +
x1the x coordinate of the first dot.
y1the y coordinate of the first dot.o
x2the x coordinate of the second dot.
y2the y coordinate of the second dot.
stylethe style of the line.
+
+
+ +

Definition at line 212 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawPointLine() [3/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
void DrawPointLine (int x1,
int y1,
int x2,
int y2,
const Color & color )
+
+ +

Draw a line made of braille dots.

+
Parameters
+ + + + + + +
x1the x coordinate of the first dot.
y1the y coordinate of the first dot.
x2the x coordinate of the second dot.
y2the y coordinate of the second dot.
colorthe color of the line.
+
+
+ +

Definition at line 201 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawPointCircle() [1/3]

+ +
+
+ + + + + + + + + + + + + + + + +
void DrawPointCircle (int x,
int y,
int radius )
+
+ +

Draw a circle made of braille dots.

+
Parameters
+ + + + +
xthe x coordinate of the center of the circle.
ythe y coordinate of the center of the circle.
radiusthe radius of the circle.
+
+
+ +

Definition at line 249 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawPointCircle() [2/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
void DrawPointCircle (int x,
int y,
int radius,
const Stylizer & style )
+
+ +

Draw a circle made of braille dots.

+
Parameters
+ + + + + +
xthe x coordinate of the center of the circle.
ythe y coordinate of the center of the circle.
radiusthe radius of the circle.
stylethe style of the circle.
+
+
+ +

Definition at line 268 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawPointCircle() [3/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
void DrawPointCircle (int x,
int y,
int radius,
const Color & color )
+
+ +

Draw a circle made of braille dots.

+
Parameters
+ + + + + +
xthe x coordinate of the center of the circle.
ythe y coordinate of the center of the circle.
radiusthe radius of the circle.
colorthe color of the circle.
+
+
+ +

Definition at line 258 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawPointCircleFilled() [1/3]

+ +
+
+ + + + + + + + + + + + + + + + +
void DrawPointCircleFilled (int x,
int y,
int radius )
+
+ +

Draw a filled circle made of braille dots.

+
Parameters
+ + + + +
xthe x coordinate of the center of the circle.
ythe y coordinate of the center of the circle.
radiusthe radius of the circle.
+
+
+ +

Definition at line 276 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawPointCircleFilled() [2/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
void DrawPointCircleFilled (int x,
int y,
int radius,
const Stylizer & style )
+
+ +

Draw a filled circle made of braille dots.

+
Parameters
+ + + + + +
xthe x coordinate of the center of the circle.
ythe y coordinate of the center of the circle.
radiusthe radius of the circle.
stylethe style of the circle.
+
+
+ +

Definition at line 298 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawPointCircleFilled() [3/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
void DrawPointCircleFilled (int x,
int y,
int radius,
const Color & color )
+
+ +

Draw a filled circle made of braille dots.

+
Parameters
+ + + + + +
xthe x coordinate of the center of the circle.
ythe y coordinate of the center of the circle.
radiusthe radius of the circle.
colorthe color of the circle.
+
+
+ +

Definition at line 285 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawPointEllipse() [1/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
void DrawPointEllipse (int x,
int y,
int r1,
int r2 )
+
+ +

Draw an ellipse made of braille dots.

+
Parameters
+ + + + + +
xthe x coordinate of the center of the ellipse.
ythe y coordinate of the center of the ellipse.
r1the radius of the ellipse along the x axis.
r2the radius of the ellipse along the y axis.
+
+
+ +

Definition at line 310 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawPointEllipse() [2/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
void DrawPointEllipse (int x,
int y,
int r1,
int r2,
const Color & color )
+
+ +

Draw an ellipse made of braille dots.

+
Parameters
+ + + + + + +
xthe x coordinate of the center of the ellipse.
ythe y coordinate of the center of the ellipse.
r1the radius of the ellipse along the x axis.
r2the radius of the ellipse along the y axis.
colorthe color of the ellipse.
+
+
+ +

Definition at line 320 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawPointEllipse() [3/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
void DrawPointEllipse (int x1,
int y1,
int r1,
int r2,
const Stylizer & s )
+
+ +

Draw an ellipse made of braille dots.

+
Parameters
+ + + + + + +
x1the x coordinate of the center of the ellipse.
y1the y coordinate of the center of the ellipse.
r1the radius of the ellipse along the x axis.
r2the radius of the ellipse along the y axis.
sthe style of the ellipse.
+
+
+ +

Definition at line 335 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawPointEllipseFilled() [1/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
void DrawPointEllipseFilled (int x1,
int y1,
int r1,
int r2 )
+
+ +

Draw a filled ellipse made of braille dots.

+
Parameters
+ + + + + +
x1the x coordinate of the center of the ellipse.
y1the y coordinate of the center of the ellipse.
r1the radius of the ellipse along the x axis.
r2the radius of the ellipse along the y axis.
+
+
+ +

Definition at line 374 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawPointEllipseFilled() [2/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
void DrawPointEllipseFilled (int x1,
int y1,
int r1,
int r2,
const Color & color )
+
+ +

Draw a filled ellipse made of braille dots.

+
Parameters
+ + + + + + +
x1the x coordinate of the center of the ellipse.
y1the y coordinate of the center of the ellipse.
r1the radius of the ellipse along the x axis.
r2the radius of the ellipse along the y axis.
colorthe color of the ellipse.
+
+
+ +

Definition at line 384 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawPointEllipseFilled() [3/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
void DrawPointEllipseFilled (int x1,
int y1,
int r1,
int r2,
const Stylizer & s )
+
+ +

Draw a filled ellipse made of braille dots.

+
Parameters
+ + + + + + +
x1the x coordinate of the center of the ellipse.
y1the y coordinate of the center of the ellipse.
r1the radius of the ellipse along the x axis.
r2the radius of the ellipse along the y axis.
sthe style of the ellipse.
+
+
+ +

Definition at line 399 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawBlockOn()

+ +
+
+ + + + + + + + + + + +
void DrawBlockOn (int x,
int y )
+
+ +

Draw a block.

+
Parameters
+ + + +
xthe x coordinate of the block.
ythe y coordinate of the block.
+
+
+ +

Definition at line 468 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawBlockOff()

+ +
+
+ + + + + + + + + + + +
void DrawBlockOff (int x,
int y )
+
+ +

Erase a block.

+
Parameters
+ + + +
xthe x coordinate of the block.
ythe y coordinate of the block.
+
+
+ +

Definition at line 488 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawBlockToggle()

+ +
+
+ + + + + + + + + + + +
void DrawBlockToggle (int x,
int y )
+
+ +

Toggle a block. If it is filled, it will be erased. If it is empty, it will be filled.

+
Parameters
+ + + +
xthe x coordinate of the block.
ythe y coordinate of the block.
+
+
+ +

Definition at line 509 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawBlock() [1/3]

+ +
+
+ + + + + + + + + + + + + + + + +
void DrawBlock (int x,
int y,
bool value )
+
+ +

Draw a block.

+
Parameters
+ + + + +
xthe x coordinate of the block.
ythe y coordinate of the block.
valuewhether the block is filled or not.
+
+
+ +

Definition at line 438 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawBlock() [2/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
void DrawBlock (int x,
int y,
bool value,
const Stylizer & style )
+
+ +

Draw a block.

+
Parameters
+ + + + + +
xthe x coordinate of the block.
ythe y coordinate of the block.
valuewhether the block is filled or not.
stylethe style of the block.
+
+
+ +

Definition at line 456 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawBlock() [3/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
void DrawBlock (int x,
int y,
bool value,
const Color & color )
+
+ +

Draw a block.

+
Parameters
+ + + + + +
xthe x coordinate of the block.
ythe y coordinate of the block.
valuewhether the block is filled or not.
colorthe color of the block.
+
+
+ +

Definition at line 447 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawBlockLine() [1/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
void DrawBlockLine (int x1,
int y1,
int x2,
int y2 )
+
+ +

Draw a line made of block characters.

+
Parameters
+ + + + + +
x1the x coordinate of the first point of the line.
y1the y coordinate of the first point of the line.
x2the x coordinate of the second point of the line.
y2the y coordinate of the second point of the line.
+
+
+ +

Definition at line 531 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawBlockLine() [2/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
void DrawBlockLine (int x1,
int y1,
int x2,
int y2,
const Stylizer & style )
+
+ +

Draw a line made of block characters.

+
Parameters
+ + + + + + +
x1the x coordinate of the first point of the line.
y1the y coordinate of the first point of the line.
x2the x coordinate of the second point of the line.
y2the y coordinate of the second point of the line.
stylethe style of the line.
+
+
+ +

Definition at line 552 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawBlockLine() [3/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
void DrawBlockLine (int x1,
int y1,
int x2,
int y2,
const Color & color )
+
+ +

Draw a line made of block characters.

+
Parameters
+ + + + + + +
x1the x coordinate of the first point of the line.
y1the y coordinate of the first point of the line.
x2the x coordinate of the second point of the line.
y2the y coordinate of the second point of the line.
colorthe color of the line.
+
+
+ +

Definition at line 541 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawBlockCircle() [1/3]

+ +
+
+ + + + + + + + + + + + + + + + +
void DrawBlockCircle (int x,
int y,
int radius )
+
+ +

Draw a circle made of block characters.

+
Parameters
+ + + + +
xthe x coordinate of the center of the circle.
ythe y coordinate of the center of the circle.
radiusthe radius of the circle.
+
+
+ +

Definition at line 592 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawBlockCircle() [2/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
void DrawBlockCircle (int x,
int y,
int radius,
const Stylizer & style )
+
+ +

Draw a circle made of block characters.

+
Parameters
+ + + + + +
xthe x coordinate of the center of the circle.
ythe y coordinate of the center of the circle.
radiusthe radius of the circle.
stylethe style of the circle.
+
+
+ +

Definition at line 611 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawBlockCircle() [3/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
void DrawBlockCircle (int x,
int y,
int radius,
const Color & color )
+
+ +

Draw a circle made of block characters.

+
Parameters
+ + + + + +
xthe x coordinate of the center of the circle.
ythe y coordinate of the center of the circle.
radiusthe radius of the circle.
colorthe color of the circle.
+
+
+ +

Definition at line 601 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawBlockCircleFilled() [1/3]

+ +
+
+ + + + + + + + + + + + + + + + +
void DrawBlockCircleFilled (int x,
int y,
int radius )
+
+ +

Draw a filled circle made of block characters.

+
Parameters
+ + + + +
xthe x coordinate of the center of the circle.
ythe y coordinate of the center of the circle.
radiusthe radius of the circle.
+
+
+ +

Definition at line 619 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawBlockCircleFilled() [2/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
void DrawBlockCircleFilled (int x,
int y,
int radius,
const Stylizer & s )
+
+ +

Draw a filled circle made of block characters.

+
Parameters
+ + + + + +
xthe x coordinate of the center of the circle.
ythe y coordinate of the center of the circle.
radiusthe radius of the circle.
sthe style of the circle.
+
+
+ +

Definition at line 641 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawBlockCircleFilled() [3/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
void DrawBlockCircleFilled (int x,
int y,
int radius,
const Color & color )
+
+ +

Draw a filled circle made of block characters.

+
Parameters
+ + + + + +
xthe x coordinate of the center of the circle.
ythe y coordinate of the center of the circle.
radiusthe radius of the circle.
colorthe color of the circle.
+
+
+ +

Definition at line 628 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawBlockEllipse() [1/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
void DrawBlockEllipse (int x,
int y,
int r1,
int r2 )
+
+ +

Draw an ellipse made of block characters.

+
Parameters
+ + + + + +
xthe x coordinate of the center of the ellipse.
ythe y coordinate of the center of the ellipse.
r1the radius of the ellipse along the x axis.
r2the radius of the ellipse along the y axis.
+
+
+ +

Definition at line 653 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawBlockEllipse() [2/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
void DrawBlockEllipse (int x1,
int y1,
int r1,
int r2,
const Stylizer & s )
+
+ +

Draw an ellipse made of block characters.

+
Parameters
+ + + + + + +
x1the x coordinate of the center of the ellipse.
y1the y coordinate of the center of the ellipse.
r1the radius of the ellipse along the x axis.
r2the radius of the ellipse along the y axis.
sthe style of the ellipse.
+
+
+ +

Definition at line 678 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawBlockEllipse() [3/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
void DrawBlockEllipse (int x,
int y,
int r1,
int r2,
const Color & color )
+
+ +

Draw an ellipse made of block characters.

+
Parameters
+ + + + + + +
xthe x coordinate of the center of the ellipse.
ythe y coordinate of the center of the ellipse.
r1the radius of the ellipse along the x axis.
r2the radius of the ellipse along the y axis.
colorthe color of the ellipse.
+
+
+ +

Definition at line 663 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawBlockEllipseFilled() [1/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
void DrawBlockEllipseFilled (int x,
int y,
int r1,
int r2 )
+
+ +

Draw a filled ellipse made of block characters.

+
Parameters
+ + + + + +
xthe x coordinate of the center of the ellipse.
ythe y coordinate of the center of the ellipse.
r1the radius of the ellipse along the x axis.
r2the radius of the ellipse along the y axis.
+
+
+ +

Definition at line 719 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawBlockEllipseFilled() [2/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
void DrawBlockEllipseFilled (int x1,
int y1,
int r1,
int r2,
const Stylizer & s )
+
+ +

Draw a filled ellipse made of block characters.

+
Parameters
+ + + + + + +
x1the x coordinate of the center of the ellipse.
y1the y coordinate of the center of the ellipse.
r1the radius of the ellipse along the x axis.
r2the radius of the ellipse along the y axis.
sthe style of the ellipse.
+
+
+ +

Definition at line 744 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawBlockEllipseFilled() [3/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
void DrawBlockEllipseFilled (int x,
int y,
int r1,
int r2,
const Color & color )
+
+ +

Draw a filled ellipse made of block characters.

+
Parameters
+ + + + + + +
xthe x coordinate of the center of the ellipse.
ythe y coordinate of the center of the ellipse.
r1the radius of the ellipse along the x axis.
r2the radius of the ellipse along the y axis.
colorthe color of the ellipse.
+
+
+ +

Definition at line 729 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawText() [1/3]

+ +
+
+ + + + + + + + + + + + + + + + +
void DrawText (int x,
int y,
const std::string & value )
+
+ +

Draw a piece of text.

+
Parameters
+ + + + +
xthe x coordinate of the text.
ythe y coordinate of the text.
valuethe text to draw.
+
+
+ +

Definition at line 785 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawText() [2/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
void DrawText (int x,
int y,
const std::string & value,
const Color & color )
+
+ +

Draw a piece of text.

+
Parameters
+ + + + + +
xthe x coordinate of the text.
ythe y coordinate of the text.
valuethe text to draw.
colorthe color of the text.
+
+
+ +

Definition at line 794 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawText() [3/3]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
void DrawText (int x,
int y,
const std::string & value,
const Stylizer & style )
+
+ +

Draw a piece of text.

+
Parameters
+ + + + + +
xthe x coordinate of the text.
ythe y coordinate of the text.
valuethe text to draw.
stylethe style of the text.
+
+
+ +

Definition at line 806 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawPixel()

+ +
+
+ + + + + + + + + + + + + + + + +
void DrawPixel (int x,
int y,
const Pixel & p )
+
+ +

Directly draw a predefined pixel at the given coordinate.

+
Parameters
+ + + + +
xthe x coordinate of the pixel.
ythe y coordinate of the pixel.
pthe pixel to draw.
+
+
+ +

Definition at line 827 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ DrawImage()

+ +
+
+ + + + + + + + + + + + + + + + +
void DrawImage (int x,
int y,
const Image & image )
+
+ +

Draw a predefined image, with top-left corner at the given coordinate You can supply negative coordinates to align the image however you like - only the 'visible' portion will be drawn.

+
Parameters
+ + + + +
xthe x coordinate corresponding to the top-left corner of the image.
ythe y coordinate corresponding to the top-left corner of the image.
imagethe image to draw.
+
+
+ +

Definition at line 839 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +

◆ Style()

+ +
+
+ + + + + + + + + + + + + + + + +
void Style (int x,
int y,
const Stylizer & style )
+
+ +

Modify a pixel at a given location.

+
Parameters
+ + +
stylea function that modifies the pixel.
+
+
+ +

Definition at line 861 of file src/ftxui/dom/canvas.cpp.

+ +
+
+ +
+
+ +

◆ ftxui::FlexboxConfig

+ +
+
+ + + + +
struct ftxui::FlexboxConfig
+
+

FlexboxConfig is a configuration structure that defines the layout properties for a flexbox container.

+

It allows you to specify the direction of the flex items, whether they should wrap, how they should be justified along the main axis, and how they should be aligned along the cross axis. It also includes properties for gaps between flex items in both the main and cross axes. This structure is used to configure the layout behavior of flexbox containers in a terminal user interface.

+
Examples
examples/component/flexbox_gallery.cpp, and examples/component/homescreen.cpp.
+
+ +

Definition at line 27 of file flexbox_config.hpp.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Types

enum class  Direction {
+  Row +,
+  RowInversed +,
+  Column +,
+  ColumnInversed +
+ }
 
enum class  Wrap {
+  NoWrap +,
+  Wrap +,
+  WrapInversed +
+ }
 
enum class  JustifyContent {
+  FlexStart +,
+  FlexEnd +,
+  Center +,
+  Stretch +,
+  SpaceBetween +,
+  SpaceAround +,
+  SpaceEvenly +
+ }
 
enum class  AlignItems {
+  FlexStart +,
+  FlexEnd +,
+  Center +,
+  Stretch +
+ }
 
enum class  AlignContent {
+  FlexStart +,
+  FlexEnd +,
+  Center +,
+  Stretch +,
+  SpaceBetween +,
+  SpaceAround +,
+  SpaceEvenly +
+ }
 

Public Member Functions

FlexboxConfigSet (FlexboxConfig::Direction)
 Set the flexbox direction.
 
FlexboxConfigSet (FlexboxConfig::Wrap)
 Set the flexbox wrap.
 
FlexboxConfigSet (FlexboxConfig::JustifyContent)
 Set the flexbox justify content.
 
FlexboxConfigSet (FlexboxConfig::AlignItems)
 Set the flexbox align items.
 
FlexboxConfigSet (FlexboxConfig::AlignContent)
 Set the flexbox align content.
 
FlexboxConfigSetGap (int gap_x, int gap_y)
 Set the flexbox flex direction.
 

Public Attributes

Direction direction = Direction::Row
 
Wrap wrap = Wrap::Wrap
 
JustifyContent justify_content = JustifyContent::FlexStart
 
AlignItems align_items = AlignItems::FlexStart
 
AlignContent align_content = AlignContent::FlexStart
 
int gap_x = 0
 
int gap_y = 0
 
+

Member Enumeration Documentation

+ +

◆ Direction

+ +
+
+ + + + + +
+ + + + +
enum class Direction
+
+strong
+
+

This establishes the main-axis, thus defining the direction flex items are placed in the flex container. Flexbox is (aside wrapping) single-direction layout concept. Think of flex items as primarily laying out either in horizontal rows or vertical columns.

+ + + + + +
Enumerator
Row 

Flex items are laid out in a row.

+
RowInversed 

Flex items are laid out in a row, but in reverse order.

+
Column 

Flex items are laid out in a column.

+
ColumnInversed 

Flex items are laid out in a column, but in reverse order.

+
+ +

Definition at line 32 of file flexbox_config.hpp.

+ +
+
+ +

◆ Wrap

+ +
+
+ + + + + +
+ + + + +
enum class Wrap
+
+strong
+
+

By default, flex items will all try to fit onto one line. You can change that and allow the items to wrap as needed with this property.

+ + + + +
Enumerator
NoWrap 

Flex items will all try to fit onto one line.

+
Wrap 

Flex items will wrap onto multiple lines.

+
WrapInversed 

Flex items will wrap onto multiple lines, but in reverse order.

+
+ +

Definition at line 43 of file flexbox_config.hpp.

+ +
+
+ +

◆ JustifyContent

+ +
+
+ + + + + +
+ + + + +
enum class JustifyContent
+
+strong
+
+

This defines the alignment along the main axis. It helps distribute extra free space leftover when either all the flex items on a line are inflexible, or are flexible but have reached their maximum size. It also exerts some control over the alignment of items when they overflow the line.

+ + + + + + + + +
Enumerator
FlexStart 

Items are aligned to the start of flexbox's direction.

+
FlexEnd 

Items are aligned to the end of flexbox's direction.

+
Center 

Items are centered along the line.

+
Stretch 

Items are stretched to fill the line.

+
SpaceBetween 

Items are evenly distributed in the line; first item is on the start.

+
SpaceAround 

Items are evenly distributed in the line with equal space around them. Note that visually the spaces aren’t equal, since all the items have equal space on both sides. The first item will have one unit of space against the container edge, but two units of space between the next item because that next item has its own spacing that applies.

+
SpaceEvenly 

Items are distributed so that the spacing between any two items (and the space to the edges) is equal.

+
+ +

Definition at line 56 of file flexbox_config.hpp.

+ +
+
+ +

◆ AlignItems

+ +
+
+ + + + + +
+ + + + +
enum class AlignItems
+
+strong
+
+

This defines the default behavior for how flex items are laid out along the cross axis on the current line. Think of it as the justify-content version for the cross-axis (perpendicular to the main-axis).

+ + + + + +
Enumerator
FlexStart 

items are placed at the start of the cross axis.

+
FlexEnd 

items are placed at the end of the cross axis.

+
Center 

items are centered along the cross axis.

+
Stretch 

items are stretched to fill the cross axis.

+
+ +

Definition at line 83 of file flexbox_config.hpp.

+ +
+
+ +

◆ AlignContent

+ +
+
+ + + + + +
+ + + + +
enum class AlignContent
+
+strong
+
+ + + + + + + + +
Enumerator
FlexStart 

items are placed at the start of the cross axis.

+
FlexEnd 

items are placed at the end of the cross axis.

+
Center 

items are centered along the cross axis.

+
Stretch 

items are stretched to fill the cross axis.

+
SpaceBetween 

items are evenly distributed in the cross axis.

+
SpaceAround 

tems evenly distributed with equal space around each line.

+
SpaceEvenly 

items are evenly distributed in the cross axis with equal space around them.

+
+ +

Definition at line 94 of file flexbox_config.hpp.

+ +
+
+

Member Function Documentation

+ +

◆ Set() [1/5]

+ +
+
+ + + + + + + +
FlexboxConfig & Set (FlexboxConfig::Direction d)
+
+ +

Set the flexbox direction.

+
Examples
examples/component/flexbox_gallery.cpp.
+
+ +

Definition at line 9 of file flexbox_config.cpp.

+ +
+
+ +

◆ Set() [2/5]

+ +
+
+ + + + + + + +
FlexboxConfig & Set (FlexboxConfig::Wrap w)
+
+ +

Set the flexbox wrap.

+ +

Definition at line 15 of file flexbox_config.cpp.

+ +
+
+ +

◆ Set() [3/5]

+ +
+
+ + + + + + + +
FlexboxConfig & Set (FlexboxConfig::JustifyContent j)
+
+ +

Set the flexbox justify content.

+ +

Definition at line 21 of file flexbox_config.cpp.

+ +
+
+ +

◆ Set() [4/5]

+ +
+
+ + + + + + + +
FlexboxConfig & Set (FlexboxConfig::AlignItems a)
+
+ +

Set the flexbox align items.

+ +

Definition at line 27 of file flexbox_config.cpp.

+ +
+
+ +

◆ Set() [5/5]

+ +
+
+ + + + + + + +
FlexboxConfig & Set (FlexboxConfig::AlignContent a)
+
+ +

Set the flexbox align content.

+ +

Definition at line 33 of file flexbox_config.cpp.

+ +
+
+ +

◆ SetGap()

+ +
+
+ + + + + + + + + + + +
FlexboxConfig & SetGap (int gap_x,
int gap_y )
+
+ +

Set the flexbox flex direction.

+
Examples
examples/component/homescreen.cpp.
+
+ +

Definition at line 39 of file flexbox_config.cpp.

+ +
+
+

Member Data Documentation

+ +

◆ direction

+ +
+
+ + + + +
Direction direction = Direction::Row
+
+
Examples
examples/component/flexbox_gallery.cpp.
+
+ +

Definition at line 39 of file flexbox_config.hpp.

+ +
+
+ +

◆ wrap

+ +
+
+ + + + +
Wrap wrap = Wrap::Wrap
+
+
Examples
examples/component/flexbox_gallery.cpp.
+
+ +

Definition at line 49 of file flexbox_config.hpp.

+ +
+
+ +

◆ justify_content

+ +
+
+ + + + +
JustifyContent justify_content = JustifyContent::FlexStart
+
+
Examples
examples/component/flexbox_gallery.cpp.
+
+ +

Definition at line 78 of file flexbox_config.hpp.

+ +
+
+ +

◆ align_items

+ +
+
+ + + + +
AlignItems align_items = AlignItems::FlexStart
+
+
Examples
examples/component/flexbox_gallery.cpp.
+
+ +

Definition at line 89 of file flexbox_config.hpp.

+ +
+
+ +

◆ align_content

+ +
+
+ + + + +
AlignContent align_content = AlignContent::FlexStart
+
+
Examples
examples/component/flexbox_gallery.cpp.
+
+ +

Definition at line 105 of file flexbox_config.hpp.

+ +
+
+ +

◆ gap_x

+ +
+
+ + + + +
int gap_x = 0
+
+ +

Definition at line 107 of file flexbox_config.hpp.

+ +
+
+ +

◆ gap_y

+ +
+
+ + + + +
int gap_y = 0
+
+ +

Definition at line 108 of file flexbox_config.hpp.

+ +
+
+ +
+
+ +

◆ ftxui::LinearGradient

+ +
+
+ + + + +
struct ftxui::LinearGradient
+
+

A class representing the settings for linear-gradient color effect.

+

Example:

+
.Angle(45)
+
.Stop(Color::Red, 0.0)
+
.Stop(Color::Green, 0.5)
+
.Stop(Color::Blue, 1.0);
+
LinearGradient()
Build the "empty" gradient. This is often followed by calls to LinearGradient::Angle() and LinearGrad...
+ + + +

There are also shorthand constructors:

Examples
examples/component/input_style.cpp, examples/component/linear_gradient_gallery.cpp, examples/dom/linear_gradient.cpp, and examples/dom/style_color.cpp.
+
+ +

Definition at line 32 of file linear_gradient.hpp.

+
+ + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

 LinearGradient ()
 Build the "empty" gradient. This is often followed by calls to LinearGradient::Angle() and LinearGradient::Stop(). Example:
 
 LinearGradient (Color begin, Color end)
 Build a gradient with two colors.
 
 LinearGradient (float angle, Color begin, Color end)
 Build a gradient with two colors and an angle.
 
LinearGradientAngle (float angle)
 Set the angle of the gradient.
 
LinearGradientStop (Color color, float position)
 Add a color stop to the gradient.
 
LinearGradientStop (Color color)
 Add a color stop to the gradient.
 

Public Attributes

float angle = 0.f
 
std::vector< Stopstops
 
+

Constructor & Destructor Documentation

+ +

◆ LinearGradient() [1/3]

+ +
+
+ + + + + +
+ + + + + + + +
LinearGradient ()
+
+default
+
+ +

Build the "empty" gradient. This is often followed by calls to LinearGradient::Angle() and LinearGradient::Stop(). Example:

+
auto gradient =
+ +
.Angle(45)
+
.Stop(Color::Red, 0.0)
+
.Stop(Color::Green, 0.5)
+
.Stop(Color::Blue, 1.0);;
+
+
+
+ +

◆ LinearGradient() [2/3]

+ +
+
+ + + + + + + + + + + +
LinearGradient (Color begin,
Color end )
+
+ +

Build a gradient with two colors.

+
Parameters
+ + + +
beginThe color at the beginning of the gradient.
endThe color at the end of the gradient.
+
+
+ +

Definition at line 197 of file src/ftxui/dom/linear_gradient.cpp.

+ +
+
+ +

◆ LinearGradient() [3/3]

+ +
+
+ + + + + + + + + + + + + + + + +
LinearGradient (float a,
Color begin,
Color end )
+
+ +

Build a gradient with two colors and an angle.

+
Parameters
+ + + + +
aThe angle of the gradient.
beginThe color at the beginning of the gradient.
endThe color at the end of the gradient.
+
+
+ +

Definition at line 204 of file src/ftxui/dom/linear_gradient.cpp.

+ +
+
+

Member Function Documentation

+ +

◆ Angle()

+ +
+
+ + + + + + + +
LinearGradient & Angle (float a)
+
+ +

Set the angle of the gradient.

+
Parameters
+ + +
aThe angle of the gradient.
+
+
+
Returns
The gradient.
+ +

Definition at line 212 of file src/ftxui/dom/linear_gradient.cpp.

+ +
+
+ +

◆ Stop() [1/2]

+ +
+
+ + + + + + + + + + + +
LinearGradient & Stop (Color c,
float p )
+
+ +

Add a color stop to the gradient.

+
Parameters
+ + + +
cThe color of the stop.
pThe position of the stop.
+
+
+ +

Definition at line 220 of file src/ftxui/dom/linear_gradient.cpp.

+ +
+
+ +

◆ Stop() [2/2]

+ +
+
+ + + + + + + +
LinearGradient & Stop (Color c)
+
+ +

Add a color stop to the gradient.

+
Parameters
+ + +
cThe color of the stop.
+
+
+
Returns
The gradient.
+
Note
The position of the stop is interpolated from nearby stops.
+ +

Definition at line 229 of file src/ftxui/dom/linear_gradient.cpp.

+ +
+
+

Member Data Documentation

+ +

◆ angle

+ +
+
+ + + + +
float angle = 0.f
+
+ +

Definition at line 33 of file linear_gradient.hpp.

+ +
+
+ +

◆ stops

+ +
+
+ + + + +
std::vector<Stop> stops
+
+ +

Definition at line 43 of file linear_gradient.hpp.

+ +
+
+ +
+
+ +

◆ ftxui::Node

+ +
+
+ + + + +
class ftxui::Node
+
+

Node is the base class for all elements in the DOM tree.

+

It represents a single node in the document object model (DOM) and provides the basic structure for layout and rendering. It contains methods for computing layout requirements, setting the box dimensions, selecting content, rendering to the screen, and checking the layout status. It typically contains child elements, which are also instances of Node.

+

Users are expected to derive from this class to create custom elements.

+

A list of builtin elements can be found in the elements.hpp file.

+ +

Definition at line 37 of file node.hpp.

+
+ + Inheritance diagram for Node:
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

 Node ()
 
 Node (Elements children)
 
 Node (const Node &)=delete
 
 Node (const Node &&)=delete
 
Nodeoperator= (const Node &)=delete
 
Nodeoperator= (const Node &&)=delete
 
virtual ~Node ()
 
virtual void ComputeRequirement ()
 Compute how much space an element needs.
 
Requirement requirement ()
 
virtual void SetBox (Box box)
 Assign a position and a dimension to an element for drawing.
 
virtual void Select (Selection &selection)
 Compute the selection of an element.
 
virtual void Render (Screen &screen)
 Display an element on a ftxui::Screen.
 
virtual std::string GetSelectedContent (Selection &selection)
 
virtual void Check (Status *status)
 

Protected Attributes

Elements children_
 
Requirement requirement_
 
Box box_
 
+

Constructor & Destructor Documentation

+ +

◆ Node() [1/4]

+ +
+
+ + + + + +
+ + + + + + + +
Node ()
+
+default
+
+ +
+
+ +

◆ Node() [2/4]

+ +
+
+ + + + + +
+ + + + + + + +
Node (Elements children)
+
+explicit
+
+ +

Definition at line 16 of file node.cpp.

+ +
+
+ +

◆ Node() [3/4]

+ +
+
+ + + + + +
+ + + + + + + +
Node (const Node & )
+
+delete
+
+ +
+
+ +

◆ Node() [4/4]

+ +
+
+ + + + + +
+ + + + + + + +
Node (const Node && )
+
+delete
+
+ +
+
+ +

◆ ~Node()

+ +
+
+ + + + + +
+ + + + + + + +
~Node ()
+
+virtualdefault
+
+ +
+
+

Member Function Documentation

+ +

◆ operator=() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
Node & operator= (const Node & )
+
+delete
+
+ +
+
+ +

◆ operator=() [2/2]

+ +
+
+ + + + + +
+ + + + + + + +
Node & operator= (const Node && )
+
+delete
+
+ +
+
+ +

◆ ComputeRequirement()

+ +
+
+ + + + + +
+ + + + + + + +
void ComputeRequirement ()
+
+virtual
+
+ +

Compute how much space an element needs.

+ +

Reimplemented in NodeDecorator.

+ +

Definition at line 20 of file node.cpp.

+ +
+
+ +

◆ requirement()

+ +
+
+ + + + + +
+ + + + + + + +
Requirement requirement ()
+
+inline
+
+ +

Definition at line 52 of file node.hpp.

+ +
+
+ +

◆ SetBox()

+ +
+
+ + + + + +
+ + + + + + + +
void SetBox (Box box)
+
+virtual
+
+ +

Assign a position and a dimension to an element for drawing.

+ +

Reimplemented in NodeDecorator.

+ +

Definition at line 41 of file node.cpp.

+ +
+
+ +

◆ Select()

+ +
+
+ + + + + +
+ + + + + + + +
void Select (Selection & selection)
+
+virtual
+
+ +

Compute the selection of an element.

+ +

Definition at line 46 of file node.cpp.

+ +
+
+ +

◆ Render()

+ +
+
+ + + + + +
+ + + + + + + +
void Render (Screen & screen)
+
+virtual
+
+ +

Display an element on a ftxui::Screen.

+ +

Definition at line 59 of file node.cpp.

+ +
+
+ +

◆ GetSelectedContent()

+ +
+
+ + + + + +
+ + + + + + + +
std::string GetSelectedContent (Selection & selection)
+
+virtual
+
+ +

Definition at line 72 of file node.cpp.

+ +
+
+ +

◆ Check()

+ +
+
+ + + + + +
+ + + + + + + +
void Check (Status * status)
+
+virtual
+
+ +

Definition at line 65 of file node.cpp.

+ +
+
+

Member Data Documentation

+ +

◆ children_

+ +
+
+ + + + + +
+ + + + +
Elements children_
+
+protected
+
+ +

Definition at line 79 of file node.hpp.

+ +
+
+ +

◆ requirement_

+ +
+
+ + + + + +
+ + + + +
Requirement requirement_
+
+protected
+
+ +

Definition at line 80 of file node.hpp.

+ +
+
+ +

◆ box_

+ +
+
+ + + + + +
+ + + + +
Box box_
+
+protected
+
+ +

Definition at line 81 of file node.hpp.

+ +
+
+ +
+
+ +

◆ ftxui::Requirement

+ +
+
+ + + + +
struct ftxui::Requirement
+
+

Requirement is a structure that defines the layout requirements for a Node in the terminal user interface.

+

It specifies the minimum size required to fully draw the element,

+ +

Definition at line 18 of file requirement.hpp.

+
+ + + + + + + + + + + + + + + +

Public Attributes

int min_x = 0
 
int min_y = 0
 
int flex_grow_x = 0
 
int flex_grow_y = 0
 
int flex_shrink_x = 0
 
int flex_shrink_y = 0
 
Focused focused
 
+

Member Data Documentation

+ +

◆ min_x

+ +
+
+ + + + +
int min_x = 0
+
+ +

Definition at line 20 of file requirement.hpp.

+ +
+
+ +

◆ min_y

+ +
+
+ + + + +
int min_y = 0
+
+ +

Definition at line 21 of file requirement.hpp.

+ +
+
+ +

◆ flex_grow_x

+ +
+
+ + + + +
int flex_grow_x = 0
+
+ +

Definition at line 24 of file requirement.hpp.

+ +
+
+ +

◆ flex_grow_y

+ +
+
+ + + + +
int flex_grow_y = 0
+
+ +

Definition at line 25 of file requirement.hpp.

+ +
+
+ +

◆ flex_shrink_x

+ +
+
+ + + + +
int flex_shrink_x = 0
+
+ +

Definition at line 26 of file requirement.hpp.

+ +
+
+ +

◆ flex_shrink_y

+ +
+
+ + + + +
int flex_shrink_y = 0
+
+ +

Definition at line 27 of file requirement.hpp.

+ +
+
+ +

◆ focused

+ +
+
+ + + + +
Focused focused
+
+ +

Definition at line 51 of file requirement.hpp.

+ +
+
+ +
+
+ +

◆ ftxui::Selection

+ +
+
+ + + + +
class ftxui::Selection
+
+

Represents a selection in a terminal user interface.

+

Selection is a class that represents the two endpoints of a selection in a terminal user interface.

+ +

Definition at line 22 of file selection.hpp.

+
+ + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

 Selection ()
 Create an empty selection.
 
 Selection (int start_x, int start_y, int end_x, int end_y)
 Create a selection.
 
const BoxGetBox () const
 Get the box of the selection.
 
Selection SaturateHorizontal (Box box)
 Saturate the selection to be inside the box. This is called by hbox to propagate the selection to its children.
 
Selection SaturateVertical (Box box)
 Saturate the selection to be inside the box. This is called by vbox to propagate the selection to its children.
 
bool IsEmpty () const
 
void AddPart (const std::string &part, int y, int left, int right)
 
std::string GetParts ()
 
+

Constructor & Destructor Documentation

+ +

◆ Selection() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
Selection ()
+
+default
+
+ +

Create an empty selection.

+ +
+
+ +

◆ Selection() [2/2]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
Selection (int start_x,
int start_y,
int end_x,
int end_y )
+
+ +

Create a selection.

+
Parameters
+ + + + + +
start_xThe x coordinate of the start of the selection.
start_yThe y coordinate of the start of the selection.
end_xThe x coordinate of the end of the selection.
end_yThe y coordinate of the end of the selection.
+
+
+ +

Definition at line 34 of file src/ftxui/dom/selection.cpp.

+ +
+
+

Member Function Documentation

+ +

◆ GetBox()

+ +
+
+ + + + + + + +
const Box & GetBox () const
+
+ +

Get the box of the selection.

+
Returns
The box of the selection.
+ +

Definition at line 67 of file src/ftxui/dom/selection.cpp.

+ +
+
+ +

◆ SaturateHorizontal()

+ +
+
+ + + + + + + +
Selection SaturateHorizontal (Box box)
+
+ +

Saturate the selection to be inside the box. This is called by hbox to propagate the selection to its children.

+
Parameters
+ + +
boxThe box to saturate the selection in.
+
+
+
Returns
The saturated selection.
+ +

Definition at line 75 of file src/ftxui/dom/selection.cpp.

+ +
+
+ +

◆ SaturateVertical()

+ +
+
+ + + + + + + +
Selection SaturateVertical (Box box)
+
+ +

Saturate the selection to be inside the box. This is called by vbox to propagate the selection to its children.

+
Parameters
+ + +
boxThe box to saturate the selection in.
+
+
+
Returns
The saturated selection.
+ +

Definition at line 113 of file src/ftxui/dom/selection.cpp.

+ +
+
+ +

◆ IsEmpty()

+ +
+
+ + + + + +
+ + + + + + + +
bool IsEmpty () const
+
+inline
+
+ +

Definition at line 31 of file selection.hpp.

+ +
+
+ +

◆ AddPart()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
void AddPart (const std::string & part,
int y,
int left,
int right )
+
+ +

Definition at line 146 of file src/ftxui/dom/selection.cpp.

+ +
+
+ +

◆ GetParts()

+ +
+
+ + + + + +
+ + + + + + + +
std::string GetParts ()
+
+inline
+
+ +

Definition at line 34 of file selection.hpp.

+ +
+
+ +
+
+ +

◆ ftxui::Table

+ +
+
+ + + + +
class ftxui::Table
+
+

Table is a utility to draw tables.

+

example

auto table = Table({
+
{"X", "Y"},
+
{"-1", "1"},
+
{"+0", "0"},
+
{"+1", "1"},
+
});
+
+
table.SelectAll().Border(LIGHT);
+
table.SelectRow(1).Border(DOUBLE);
+
table.SelectRow(1).SeparatorInternal(LIGHT);
+
+
std::move(table).Render();
+
Table()
Create an empty table.
+
@ DOUBLE
Definition elements.hpp:39
+
@ LIGHT
Definition elements.hpp:36
+
Examples
examples/dom/table.cpp.
+
+ +

Definition at line 36 of file table.hpp.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

 Table ()
 Create an empty table.
 
 Table (std::vector< std::vector< std::string > >)
 Create a table from a vector of vector of string.
 
 Table (std::vector< std::vector< Element > >)
 Create a table from a vector of vector of Element.
 
 Table (std::initializer_list< std::vector< std::string > > init)
 
TableSelection SelectAll ()
 Select all the table.
 
TableSelection SelectCell (int column, int row)
 Select a cell of the table.
 
TableSelection SelectRow (int row_index)
 Select a row of the table.
 
TableSelection SelectRows (int row_min, int row_max)
 Select a range of rows of the table.
 
TableSelection SelectColumn (int column_index)
 Select a column of the table.
 
TableSelection SelectColumns (int column_min, int column_max)
 Select a range of columns of the table.
 
TableSelection SelectRectangle (int column_min, int column_max, int row_min, int row_max)
 Select a rectangle of the table.
 
Element Render ()
 Render the table.
 
+

Constructor & Destructor Documentation

+ +

◆ Table() [1/4]

+ +
+
+ + + + + + + +
Table ()
+
+ +

Create an empty table.

+ +

Definition at line 47 of file src/ftxui/dom/table.cpp.

+ +
+
+ +

◆ Table() [2/4]

+ +
+
+ + + + + +
+ + + + + + + +
Table (std::vector< std::vector< std::string > > input)
+
+explicit
+
+ +

Create a table from a vector of vector of string.

+
Parameters
+ + +
inputThe input data.
+
+
+ +

Definition at line 53 of file src/ftxui/dom/table.cpp.

+ +
+
+ +

◆ Table() [3/4]

+ +
+
+ + + + + +
+ + + + + + + +
Table (std::vector< std::vector< Element > > input)
+
+explicit
+
+ +

Create a table from a vector of vector of Element.

+
Parameters
+ + +
inputThe input elements.
+
+
+ +

Definition at line 69 of file src/ftxui/dom/table.cpp.

+ +
+
+ +

◆ Table() [4/4]

+ +
+
+ + + + + + + +
Table (std::initializer_list< std::vector< std::string > > init)
+
+ +

Definition at line 75 of file src/ftxui/dom/table.cpp.

+ +
+
+

Member Function Documentation

+ +

◆ SelectAll()

+ +
+
+ + + + + + + +
TableSelection SelectAll ()
+
+ +

Select all the table.

+
Examples
examples/dom/table.cpp.
+
+ +

Definition at line 200 of file src/ftxui/dom/table.cpp.

+ +
+
+ +

◆ SelectCell()

+ +
+
+ + + + + + + + + + + +
TableSelection SelectCell (int column,
int row )
+
+ +

Select a cell of the table.

+
Parameters
+ + + +
columnThe column of the cell to select.
rowThe row of the cell to select.
+
+
+
Note
You can use negative index to select from the end.
+ +

Definition at line 169 of file src/ftxui/dom/table.cpp.

+ +
+
+ +

◆ SelectRow()

+ +
+
+ + + + + + + +
TableSelection SelectRow (int index)
+
+ +

Select a row of the table.

+
Parameters
+ + +
indexThe index of the row to select.
+
+
+
Note
You can use negative index to select from the end.
+ +

Definition at line 138 of file src/ftxui/dom/table.cpp.

+ +
+
+ +

◆ SelectRows()

+ +
+
+ + + + + + + + + + + +
TableSelection SelectRows (int row_min,
int row_max )
+
+ +

Select a range of rows of the table.

+
Parameters
+ + + +
row_minThe first row to select.
row_maxThe last row to select.
+
+
+
Note
You can use negative index to select from the end.
+ +

Definition at line 146 of file src/ftxui/dom/table.cpp.

+ +
+
+ +

◆ SelectColumn()

+ +
+
+ + + + + + + +
TableSelection SelectColumn (int index)
+
+ +

Select a column of the table.

+
Parameters
+ + +
indexThe index of the column to select.
+
+
+
Note
You can use negative index to select from the end.
+ +

Definition at line 153 of file src/ftxui/dom/table.cpp.

+ +
+
+ +

◆ SelectColumns()

+ +
+
+ + + + + + + + + + + +
TableSelection SelectColumns (int column_min,
int column_max )
+
+ +

Select a range of columns of the table.

+
Parameters
+ + + +
column_minThe first column to select.
column_maxThe last column to select.
+
+
+
Note
You can use negative index to select from the end.
+ +

Definition at line 161 of file src/ftxui/dom/table.cpp.

+ +
+
+ +

◆ SelectRectangle()

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
TableSelection SelectRectangle (int column_min,
int column_max,
int row_min,
int row_max )
+
+ +

Select a rectangle of the table.

+
Parameters
+ + + + + +
column_minThe first column to select.
column_maxThe last column to select.
row_minThe first row to select.
row_maxThe last row to select.
+
+
+
Note
You can use negative index to select from the end.
+ +

Definition at line 179 of file src/ftxui/dom/table.cpp.

+ +
+
+ +

◆ Render()

+ +
+
+ + + + + + + +
Element Render ()
+
+ +

Render the table.

+
Returns
The rendered table. This is an element you can draw.
+ +

Definition at line 212 of file src/ftxui/dom/table.cpp.

+ +
+
+ +
+
+

Enumeration Type Documentation

+ +

◆ Direction

+ +
+
+ + + + + +
+ + + + +
enum class Direction
+
+strong
+
+ +

Direction is an enumeration that represents the four cardinal directions.

+ + + + + +
Enumerator
Up 
Down 
Left 
Right 
+ +

Definition at line 13 of file direction.hpp.

+ +
+
+ +

◆ BorderStyle

+ +
+
+ + + + +
enum BorderStyle
+
+ +

BorderStyle is an enumeration that represents the different styles of borders that can be applied to elements in the terminal UI.

+

BorderStyle is an enumeration that represents the different styles of borders that can be applied to elements in the terminal UI. It is used to define the visual appearance of borders around elements, such as windows, frames, or separators.

+ + + + + + + +
Enumerator
LIGHT 
DASHED 
HEAVY 
DOUBLE 
ROUNDED 
EMPTY 
+ +

Definition at line 35 of file elements.hpp.

+ +
+
+

Function Documentation

+ +

◆ automerge()

+ +
+
+ + + + + + + +
Element automerge (Element child)
+
+ +

Enable character to be automatically merged with others nearby.

+ +

Definition at line 17 of file automerge.cpp.

+ +
+
+ +

◆ blink()

+ +
+
+ + + + + + + +
Element blink (Element child)
+
+ +

The text drawn alternates in between visible and hidden.

+ +

Definition at line 33 of file blink.cpp.

+ +
+
+ +

◆ bold()

+ +
+
+ + + + + + + +
Element bold (Element child)
+
+ +

Use a bold font, for elements with more emphasis.

+ +

Definition at line 33 of file bold.cpp.

+ +
+
+ +

◆ border()

+ +
+
+ + + + + + + +
Element border (Element child)
+
+ +

Draw a border around the element.

+
See also
border
+
+borderLight
+
+borderDashed
+
+borderDouble
+
+borderHeavy
+
+borderEmpty
+
+borderRounded
+
+borderStyled
+
+borderWith
+

Add a border around an element

+

+Example

+
// Use 'border' as a function...
+
Element document = border(text("The element"));
+
+
// ...Or as a 'pipe'.
+
Element document = text("The element") | border;
+
Element text(std::wstring text)
Display a piece of unicode text.
Definition text.cpp:160
+
Element border(Element)
Draw a border around the element.
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+

+Output

+
┌───────────┐
+
│The element│
+
└───────────┘
+
+

Definition at line 227 of file src/ftxui/dom/border.cpp.

+ +
+
+ +

◆ borderWith()

+ +
+
+ + + + + + + +
Decorator borderWith (const Pixel & pixel)
+
+ +

Same as border but with a constant Pixel around the element.

+
See also
border
+ +

Definition at line 234 of file src/ftxui/dom/border.cpp.

+ +
+
+ +

◆ borderStyled() [1/3]

+ +
+
+ + + + + + + +
Decorator borderStyled (BorderStyle style)
+
+ +

Same as border but with different styles.

+
See also
border
+ +

Definition at line 243 of file src/ftxui/dom/border.cpp.

+ +
+
+ +

◆ borderStyled() [2/3]

+ +
+
+ + + + + + + +
Decorator borderStyled (Color foreground_color)
+
+ +

Same as border but with a foreground color.

+
See also
border
+ +

Definition at line 252 of file src/ftxui/dom/border.cpp.

+ +
+
+ +

◆ borderStyled() [3/3]

+ +
+
+ + + + + + + + + + + +
Decorator borderStyled (BorderStyle style,
Color foreground_color )
+
+ +

Same as border but with a foreground color and a different style.

+
See also
border
+ +

Definition at line 262 of file src/ftxui/dom/border.cpp.

+ +
+
+ +

◆ borderDashed()

+ +
+
+ + + + + + + +
Element borderDashed (Element child)
+
+ +

Draw a dashed border around the element.

+
See also
border
+
+borderLight
+
+borderDashed
+
+borderDouble
+
+borderHeavy
+
+borderRounded
+
+borderEmpty
+
+borderStyled
+
+borderWith
+

Add a border around an element

+

+Example

+
// Use 'borderDash' as a function...
+
Element document = borderDash(text("The element"));
+
+
// ...Or as a 'pipe'.
+
Element document = text("The element") | borderDAsh;
+

+Output

+
┏╍╍╍╍╍╍╍╍╍╍╍╍╍╍┓
+
╏The element ╏
+
┗╍╍╍╍╍╍╍╍╍╍╍╍╍╍┛
+
+

Definition at line 300 of file src/ftxui/dom/border.cpp.

+ +
+
+ +

◆ borderLight()

+ +
+
+ + + + + + + +
Element borderLight (Element child)
+
+ +

Draw a light border around the element.

+
See also
border
+
+borderLight
+
+borderDashed
+
+borderDouble
+
+borderHeavy
+
+borderRounded
+
+borderEmpty
+
+borderStyled
+
+borderWith
+

Add a border around an element

+

+Example

+
// Use 'borderLight' as a function...
+
Element document = borderLight(text("The element"));
+
+
// ...Or as a 'pipe'.
+
Element document = text("The element") | borderLight;
+
Element borderLight(Element)
Draw a light border around the element.
+

+Output

+
┌──────────────┐
+
│The element │
+
└──────────────┘
+
+

Definition at line 335 of file src/ftxui/dom/border.cpp.

+ +
+
+ +

◆ borderHeavy()

+ +
+
+ + + + + + + +
Element borderHeavy (Element child)
+
+ +

Draw a heavy border around the element.

+
See also
border
+
+borderLight
+
+borderDashed
+
+borderDouble
+
+borderHeavy
+
+borderRounded
+
+borderEmpty
+
+borderStyled
+
+borderWith
+

Add a border around an element

+

+Example

+
// Use 'borderHeavy' as a function...
+
Element document = borderHeavy(text("The element"));
+
+
// ...Or as a 'pipe'.
+
Element document = text("The element") | borderHeavy;
+
Element borderHeavy(Element)
Draw a heavy border around the element.
+

+Output

+
┏━━━━━━━━━━━━━━┓
+
┃The element ┃
+
┗━━━━━━━━━━━━━━┛
+
+

Definition at line 370 of file src/ftxui/dom/border.cpp.

+ +
+
+ +

◆ borderDouble()

+ +
+
+ + + + + + + +
Element borderDouble (Element child)
+
+ +

Draw a double border around the element.

+
See also
border
+
+borderLight
+
+borderDashed
+
+borderDouble
+
+borderHeavy
+
+borderRounded
+
+borderEmpty
+
+borderStyled
+
+borderWith
+

Add a border around an element

+

+Example

+
// Use 'borderDouble' as a function...
+
Element document = borderDouble(text("The element"));
+
+
// ...Or as a 'pipe'.
+
Element document = text("The element") | borderDouble;
+
Element borderDouble(Element)
Draw a double border around the element.
+

+Output

+
╔══════════════╗
+
║The element ║
+
╚══════════════╝
+
+

Definition at line 405 of file src/ftxui/dom/border.cpp.

+ +
+
+ +

◆ borderRounded()

+ +
+
+ + + + + + + +
Element borderRounded (Element child)
+
+ +

Draw a rounded border around the element.

+
See also
border
+
+borderLight
+
+borderDashed
+
+borderDouble
+
+borderHeavy
+
+borderRounded
+
+borderEmpty
+
+borderStyled
+
+borderWith
+

Add a border around an element

+

+Example

+
// Use 'borderRounded' as a function...
+
Element document = borderRounded(text("The element"));
+
+
// ...Or as a 'pipe'.
+
Element document = text("The element") | borderRounded;
+
Element borderRounded(Element)
Draw a rounded border around the element.
+

+Output

+
╭──────────────╮
+
│The element │
+
╰──────────────╯
+
+

Definition at line 440 of file src/ftxui/dom/border.cpp.

+ +
+
+ +

◆ borderEmpty()

+ +
+
+ + + + + + + +
Element borderEmpty (Element child)
+
+ +

Draw an empty border around the element.

+
See also
border
+
+borderLight
+
+borderDashed
+
+borderDouble
+
+borderHeavy
+
+borderRounded
+
+borderEmpty
+
+borderStyled
+
+borderWith
+

Add a border around an element

+

+Example

+
// Use 'borderRounded' as a function...
+
Element document = borderRounded(text("The element"));
+
+
// ...Or as a 'pipe'.
+
Element document = text("The element") | borderRounded;
+

+Output

+
The element
+
+

Definition at line 475 of file src/ftxui/dom/border.cpp.

+ +
+
+ +

◆ window()

+ +
+
+ + + + + + + + + + + + + + + + +
Element window (Element title,
Element content,
BorderStyle border )
+
+ +

Draw window with a title and a border around the element.

+
Parameters
+ + + + +
titleThe title of the window.
contentThe element to be wrapped.
borderThe style of the border. Default is ROUNDED.
+
+
+
See also
border
+

+Example

+
Element document = window(text("Title"),
+
text("content")
+
);
+
+
// With specifying border
+
Element document = window(text("Title"),
+
text("content"),
+ +
);
+
Element window(Element title, Element content, BorderStyle border=ROUNDED)
Draw window with a title and a border around the element.
+
@ ROUNDED
Definition elements.hpp:40
+

+Output

+
┌Title──┐
+
│content│
+
└───────┘
+
+

Definition at line 507 of file src/ftxui/dom/border.cpp.

+ +
+
+ +

◆ clear_under()

+ +
+
+ + + + + + + +
Element clear_under (Element element)
+
+ +

Before drawing |child|, clear the pixels below. This is useful in combination with dbox.

+
See also
ftxui::dbox
+ +

Definition at line 38 of file clear_under.cpp.

+ +
+
+ +

◆ color() [1/4]

+ +
+
+ + + + + + + + + + + +
Element color (Color color,
Element child )
+
+ +

Set the foreground color of an element.

+
Parameters
+ + + +
colorThe color of the output element.
childThe input element.
+
+
+
Returns
The output element colored.
+

+Example

+
Element document = color(Color::Green, text("Success")),
+
Decorator color(Color)
Decorate using a foreground color.
+
+

Definition at line 81 of file dom/color.cpp.

+ +
+
+ +

◆ bgcolor() [1/4]

+ +
+
+ + + + + + + + + + + +
Element bgcolor (Color color,
Element child )
+
+ +

Set the background color of an element.

+
Parameters
+ + + +
colorThe color of the output element.
childThe input element.
+
+
+
Returns
The output element colored.
+

+Example

+
Element document = bgcolor(Color::Green, text("Success")),
+
Decorator bgcolor(Color)
Decorate using a background color.
+
+

Definition at line 96 of file dom/color.cpp.

+ +
+
+ +

◆ color() [2/4]

+ +
+
+ + + + + + + +
Decorator color (Color c)
+
+ +

Decorate using a foreground color.

+
Parameters
+ + +
cThe foreground color to be applied.
+
+
+
Returns
The Decorator applying the color.
+

+Example

+
Element document = text("red") | color(Color::Red);
+
+

Definition at line 110 of file dom/color.cpp.

+ +
+
+ +

◆ bgcolor() [2/4]

+ +
+
+ + + + + + + +
Decorator bgcolor (Color color)
+
+ +

Decorate using a background color.

+
Parameters
+ + +
colorThe background color to be applied.
+
+
+
Returns
The Decorator applying the color.
+

+Example

+
Element document = text("red") | bgcolor(Color::Red);
+
+

Definition at line 124 of file dom/color.cpp.

+ +
+
+ +

◆ hcenter()

+ +
+
+ + + + + + + +
Element hcenter (Element child)
+
+ +

Center an element horizontally.

+
Parameters
+ + +
childThe decorated element.
+
+
+
Returns
The centered element.
+ +

Definition at line 15 of file composite_decorator.cpp.

+ +
+
+ +

◆ vcenter()

+ +
+
+ + + + + + + +
Element vcenter (Element child)
+
+ +

Center an element vertically.

+
Parameters
+ + +
childThe decorated element.
+
+
+
Returns
The centered element.
+ +

Definition at line 23 of file composite_decorator.cpp.

+ +
+
+ +

◆ center()

+ +
+
+ + + + + + + +
Element center (Element child)
+
+ +

Center an element horizontally and vertically.

+
Parameters
+ + +
childThe decorated element.
+
+
+
Returns
The centered element.
+ +

Definition at line 31 of file composite_decorator.cpp.

+ +
+
+ +

◆ align_right()

+ +
+
+ + + + + + + +
Element align_right (Element child)
+
+ +

Align an element on the right side.

+
Parameters
+ + +
childThe decorated element.
+
+
+
Returns
The right aligned element.
+ +

Definition at line 39 of file composite_decorator.cpp.

+ +
+
+ +

◆ dbox()

+ +
+
+ + + + + + + +
Element dbox (Elements children_)
+
+ +

Stack several element on top of each other.

+
Parameters
+ + +
children_The input element.
+
+
+
Returns
The right aligned element.
+ +

Definition at line 55 of file src/ftxui/dom/dbox.cpp.

+ +
+
+ +

◆ dim()

+ +
+
+ + + + + + + +
Element dim (Element child)
+
+ +

Use a light font, for elements with less emphasis.

+ +

Definition at line 33 of file dim.cpp.

+ +
+
+ +

◆ filler()

+ +
+
+ + + + + + + +
Element filler ()
+
+ +

An element that will take expand proportionally to the space left in a container.

+ +

Definition at line 98 of file flex.cpp.

+ +
+
+ +

◆ flex()

+ +
+
+ + + + + + + +
Element flex (Element child)
+
+ +

Make a child element to expand proportionally to the space left in a container.

+

+Examples:

+
+
text("left") | border ,
+
text("middle") | border | flex,
+
text("right") | border,
+
});
+
Element flex(Element)
Make a child element to expand proportionally to the space left in a container.
Definition flex.cpp:123
+
Element hbox(Elements)
A container displaying elements horizontally one by one.
Definition hbox.cpp:94
+

+Output:

+
┌────┐┌─────────────────────────────────────────────────────────┐┌─────┐
+
│left││middle ││right│
+
└────┘└─────────────────────────────────────────────────────────┘└─────┘
+
+

Definition at line 123 of file flex.cpp.

+ +
+
+ +

◆ xflex()

+ +
+
+ + + + + + + +
Element xflex (Element child)
+
+ +

Expand/Minimize if possible/needed on the X axis.

+ +

Definition at line 129 of file flex.cpp.

+ +
+
+ +

◆ yflex()

+ +
+
+ + + + + + + +
Element yflex (Element child)
+
+ +

Expand/Minimize if possible/needed on the Y axis.

+ +

Definition at line 135 of file flex.cpp.

+ +
+
+ +

◆ flex_grow()

+ +
+
+ + + + + + + +
Element flex_grow (Element child)
+
+ +

Expand if possible.

+ +

Definition at line 141 of file flex.cpp.

+ +
+
+ +

◆ xflex_grow()

+ +
+
+ + + + + + + +
Element xflex_grow (Element child)
+
+ +

Expand if possible on the X axis.

+ +

Definition at line 147 of file flex.cpp.

+ +
+
+ +

◆ yflex_grow()

+ +
+
+ + + + + + + +
Element yflex_grow (Element child)
+
+ +

Expand if possible on the Y axis.

+ +

Definition at line 153 of file flex.cpp.

+ +
+
+ +

◆ flex_shrink()

+ +
+
+ + + + + + + +
Element flex_shrink (Element child)
+
+ +

Minimize if needed.

+ +

Definition at line 159 of file flex.cpp.

+ +
+
+ +

◆ xflex_shrink()

+ +
+
+ + + + + + + +
Element xflex_shrink (Element child)
+
+ +

Minimize if needed on the X axis.

+ +

Definition at line 165 of file flex.cpp.

+ +
+
+ +

◆ yflex_shrink()

+ +
+
+ + + + + + + +
Element yflex_shrink (Element child)
+
+ +

Minimize if needed on the Y axis.

+ +

Definition at line 171 of file flex.cpp.

+ +
+
+ +

◆ notflex()

+ +
+
+ + + + + + + +
Element notflex (Element child)
+
+ +

Make the element not flexible.

+ +

Definition at line 177 of file flex.cpp.

+ +
+
+ +

◆ focusPositionRelative()

+ +
+
+ + + + + + + + + + + +
Decorator focusPositionRelative (float x,
float y )
+
+ +

Used inside a frame, this force the view to be scrolled toward a a given position. The position is expressed in proportion of the requested size.

+

For instance:

    +
  • (0, 0) means that the view is scrolled toward the upper left.
  • +
  • (1, 0) means that the view is scrolled toward the upper right.
  • +
  • (0, 1) means that the view is scrolled toward the bottom left.
  • +
+

+Example

+
Element document = huge_document()
+ +
| frame;
+
Decorator focusPositionRelative(float x, float y)
Used inside a frame, this force the view to be scrolled toward a a given position....
+
Element frame(Element)
Allow an element to be displayed inside a 'virtual' area. It size can be larger than its container....
Definition frame.cpp:118
+
+

Definition at line 31 of file src/ftxui/dom/focus.cpp.

+ +
+
+ +

◆ focusPosition()

+ +
+
+ + + + + + + + + + + +
Decorator focusPosition (int x,
int y )
+
+ +

Used inside a frame, this force the view to be scrolled toward a a given position. The position is expressed in the numbers of cells.

+

+Example

+
Element document = huge_document()
+
| focusPosition(10, 10)
+
| frame;
+
Decorator focusPosition(int x, int y)
Used inside a frame, this force the view to be scrolled toward a a given position....
+
+

Definition at line 69 of file src/ftxui/dom/focus.cpp.

+ +
+
+ +

◆ focus()

+ +
+
+ + + + + + + +
Element focus (Element child)
+
+ +

Set the child to be the one focused among its siblings.

+
Parameters
+ + +
childThe element to be focused.
+
+
+ +

Definition at line 101 of file frame.cpp.

+ +
+
+ +

◆ focusCursorBlock()

+ +
+
+ + + + + + + +
Element focusCursorBlock (Element child)
+
+ +

Same as focus, but set the cursor shape to be a still block.

+
See also
focus
+
+focusCursorBlock
+
+focusCursorBlockBlinking
+
+focusCursorBar
+
+focusCursorBarBlinking
+
+focusCursorUnderline
+
+focusCursorUnderlineBlinking
+ +

Definition at line 147 of file frame.cpp.

+ +
+
+ +

◆ focusCursorBlockBlinking()

+ +
+
+ + + + + + + +
Element focusCursorBlockBlinking (Element child)
+
+ +

Same as focus, but set the cursor shape to be a blinking block.

+
See also
focus
+
+focusCursorBlock
+
+focusCursorBlockBlinking
+
+focusCursorBar
+
+focusCursorBarBlinking
+
+focusCursorUnderline
+
+focusCursorUnderlineBlinking
+ +

Definition at line 161 of file frame.cpp.

+ +
+
+ +

◆ focusCursorBar()

+ +
+
+ + + + + + + +
Element focusCursorBar (Element child)
+
+ +

Same as focus, but set the cursor shape to be a still block.

+
See also
focus
+
+focusCursorBlock
+
+focusCursorBlockBlinking
+
+focusCursorBar
+
+focusCursorBarBlinking
+
+focusCursorUnderline
+
+focusCursorUnderlineBlinking
+ +

Definition at line 175 of file frame.cpp.

+ +
+
+ +

◆ focusCursorBarBlinking()

+ +
+
+ + + + + + + +
Element focusCursorBarBlinking (Element child)
+
+ +

Same as focus, but set the cursor shape to be a blinking bar.

+
See also
focus
+
+focusCursorBlock
+
+focusCursorBlockBlinking
+
+focusCursorBar
+
+focusCursorBarBlinking
+
+focusCursorUnderline
+
+focusCursorUnderlineBlinking
+ +

Definition at line 189 of file frame.cpp.

+ +
+
+ +

◆ focusCursorUnderline()

+ +
+
+ + + + + + + +
Element focusCursorUnderline (Element child)
+
+ +

Same as focus, but set the cursor shape to be a still underline.

+
See also
focus
+
+focusCursorBlock
+
+focusCursorBlockBlinking
+
+focusCursorBar
+
+focusCursorBarBlinking
+
+focusCursorUnderline
+
+focusCursorUnderlineBlinking
+ +

Definition at line 203 of file frame.cpp.

+ +
+
+ +

◆ focusCursorUnderlineBlinking()

+ +
+
+ + + + + + + +
Element focusCursorUnderlineBlinking (Element child)
+
+ +

Same as focus, but set the cursor shape to be a blinking underline.

+
See also
focus
+
+focusCursorBlock
+
+focusCursorBlockBlinking
+
+focusCursorBar
+
+focusCursorBarBlinking
+
+focusCursorUnderline
+
+focusCursorUnderlineBlinking
+ +

Definition at line 217 of file frame.cpp.

+ +
+
+ +

◆ gaugeDirection()

+ +
+
+ + + + + + + + + + + +
Element gaugeDirection (float progress,
Direction direction )
+
+ +

Draw a high definition progress bar progressing in specified direction.

+
Parameters
+ + + +
progressThe proportion of the area to be filled. Belong to [0,1].
directionDirection of progress bars progression.
+
+
+ +

Definition at line 169 of file src/ftxui/dom/gauge.cpp.

+ +
+
+ +

◆ gaugeRight()

+ +
+
+ + + + + + + +
Element gaugeRight (float progress)
+
+ +

Draw a high definition progress bar progressing from left to right.

+
Parameters
+ + +
progressThe proportion of the area to be filled. Belong to [0,1].
+
+
+

+Example

+

A gauge. It can be used to represent a progress bar.

+
Element gaugeRight(float progress)
Draw a high definition progress bar progressing from left to right.
+

+Output

+
┌──────────────────────────────────────────────────────────────────────────┐
+
│█████████████████████████████████████ │
+
└──────────────────────────────────────────────────────────────────────────┘
+
+

Definition at line 191 of file src/ftxui/dom/gauge.cpp.

+ +
+
+ +

◆ gaugeLeft()

+ +
+
+ + + + + + + +
Element gaugeLeft (float progress)
+
+ +

Draw a high definition progress bar progressing from right to left.

+
Parameters
+ + +
progressThe proportion of the area to be filled. Belong to [0,1].
+
+
+

+Example

+

A gauge. It can be used to represent a progress bar.

+
Element gaugeLeft(float progress)
Draw a high definition progress bar progressing from right to left.
+

+Output

+
┌──────────────────────────────────────────────────────────────────────────┐
+
│ █████████████████████████████████████│
+
└──────────────────────────────────────────────────────────────────────────┘
+
+

Definition at line 213 of file src/ftxui/dom/gauge.cpp.

+ +
+
+ +

◆ gaugeUp()

+ +
+
+ + + + + + + +
Element gaugeUp (float progress)
+
+ +

Draw a high definition progress bar progressing from bottom to top.

+
Parameters
+ + +
progressThe proportion of the area to be filled. Belong to [0,1].
+
+
+

+Example

+

A gauge. It can be used to represent a progress bar.

+
Element gaugeUp(float progress)
Draw a high definition progress bar progressing from bottom to top.
+

+Output

+
┌─┐
+
│ │
+
│ │
+
│ │
+
│ │
+
│█│
+
│█│
+
│█│
+
│█│
+
└─┘
+
+

Definition at line 242 of file src/ftxui/dom/gauge.cpp.

+ +
+
+ +

◆ gaugeDown()

+ +
+
+ + + + + + + +
Element gaugeDown (float progress)
+
+ +

Draw a high definition progress bar progressing from top to bottom.

+
Parameters
+ + +
progressThe proportion of the area to be filled. Belong to [0,1].
+
+
+

+Example

+

A gauge. It can be used to represent a progress bar.

+
Element gaugeDown(float progress)
Draw a high definition progress bar progressing from top to bottom.
+

+Output

+
┌─┐
+
│█│
+
│█│
+
│█│
+
│█│
+
│ │
+
│ │
+
│ │
+
│ │
+
└─┘
+
+

Definition at line 271 of file src/ftxui/dom/gauge.cpp.

+ +
+
+ +

◆ gauge()

+ +
+
+ + + + + + + +
Element gauge (float progress)
+
+ +

Draw a high definition progress bar.

+
Parameters
+ + +
progressThe proportion of the area to be filled. Belong to [0,1].
+
+
+

+Example

+

A gauge. It can be used to represent a progress bar.

+
Element gauge(float progress)
Draw a high definition progress bar.
+

+Output

+
┌──────────────────────────────────────────────────────────────────────────┐
+
│█████████████████████████████████████ │
+
└──────────────────────────────────────────────────────────────────────────┘
+
+

Definition at line 293 of file src/ftxui/dom/gauge.cpp.

+ +
+
+ +

◆ hyperlink() [1/2]

+ +
+
+ + + + + + + + + + + +
Element hyperlink (std::string link,
Element child )
+
+ +

Make the rendered area clickable using a web browser. The link will be opened when the user clicks on it. This is supported only on a limited set of terminal emulators. List: https://github.com/Alhadis/OSC8-Adoption/.

+
Parameters
+ + + +
linkThe link
childThe input element.
+
+
+
Returns
The output element with the link.
+

+Example

+
Element document =
+
hyperlink("https://github.com/ArthurSonzogni/FTXUI", "link");
+
Decorator hyperlink(std::string link)
Decorate using a hyperlink. The link will be opened when the user clicks on it. This is supported onl...
Definition hyperlink.cpp:70
+
+

Definition at line 51 of file hyperlink.cpp.

+ +
+
+ +

◆ hyperlink() [2/2]

+ +
+
+ + + + + + + +
Decorator hyperlink (std::string link)
+
+ +

Decorate using a hyperlink. The link will be opened when the user clicks on it. This is supported only on a limited set of terminal emulators. List: https://github.com/Alhadis/OSC8-Adoption/.

+
Parameters
+ + +
linkThe link to redirect the users to.
+
+
+
Returns
The Decorator applying the hyperlink.
+

+Example

+
Element document =
+
text("red") | hyperlink("https://github.com/Arthursonzogni/FTXUI");
+
+

Definition at line 70 of file hyperlink.cpp.

+ +
+
+ +

◆ inverted()

+ +
+
+ + + + + + + +
Element inverted (Element child)
+
+ +

Add a filter that will invert the foreground and the background colors.

+ +

Definition at line 34 of file inverted.cpp.

+ +
+
+ +

◆ italic()

+ +
+
+ + + + + + + +
Element italic (Element child)
+
+ +

Apply a underlinedDouble to text.

+ +

Definition at line 17 of file italic.cpp.

+ +
+
+ +

◆ color() [3/4]

+ +
+
+ + + + + + + + + + + +
Element color (const LinearGradient & gradient,
Element child )
+
+ +

Set the foreground color of an element with linear-gradient effect.

+
Parameters
+ + + +
gradientThe gradient effect to be applied on the output element.
childThe input element.
+
+
+
Returns
The output element colored.
+

+Example

+
+
A class representing the settings for linear-gradient color effect.
+
+

Definition at line 245 of file src/ftxui/dom/linear_gradient.cpp.

+ +
+
+ +

◆ bgcolor() [3/4]

+ +
+
+ + + + + + + + + + + +
Element bgcolor (const LinearGradient & gradient,
Element child )
+
+ +

Set the background color of an element with linear-gradient effect.

+
Parameters
+ + + +
gradientThe gradient effect to be applied on the output element.
childThe input element.
+
+
+
Returns
The output element colored.
+

+Example

+ +

Definition at line 261 of file src/ftxui/dom/linear_gradient.cpp.

+ +
+
+ +

◆ color() [4/4]

+ +
+
+ + + + + + + +
Decorator color (const LinearGradient & gradient)
+
+ +

Decorate using a linear-gradient effect on the foreground color.

+
Parameters
+ + +
gradientThe gradient effect to be applied on the output element.
+
+
+
Returns
The Decorator applying the color.
+

+Example

+ +

Definition at line 276 of file src/ftxui/dom/linear_gradient.cpp.

+ +
+
+ +

◆ bgcolor() [4/4]

+ +
+
+ + + + + + + +
Decorator bgcolor (const LinearGradient & gradient)
+
+ +

Decorate using a linear-gradient effect on the background color.

+
Parameters
+ + +
gradientThe gradient effect to be applied on the output element.
+
+
+
Returns
The Decorator applying the color.
+

+Example

+ +

Definition at line 291 of file src/ftxui/dom/linear_gradient.cpp.

+ +
+
+ +

◆ Render() [1/2]

+ +
+
+ + + + + + + + + + + +
void Render (Screen & screen,
const Element & element )
+
+ +

Display an element on a ftxui::Screen.

+ +

Definition at line 84 of file node.cpp.

+ +
+
+ +

◆ Render() [2/2]

+ +
+
+ + + + + + + + + + + +
void Render (Screen & screen,
Node * node )
+
+ +

Display an element on a ftxui::Screen.

+ +

Definition at line 91 of file node.cpp.

+ +
+
+ +

◆ paragraph()

+ +
+
+ + + + + + + +
Element paragraph (const std::string & the_text)
+
+ +

Return an element drawing the paragraph on multiple lines.

+
See also
flexbox.
+ +

Definition at line 41 of file src/ftxui/dom/paragraph.cpp.

+ +
+
+ +

◆ paragraphAlignLeft()

+ +
+
+ + + + + + + +
Element paragraphAlignLeft (const std::string & the_text)
+
+ +

Return an element drawing the paragraph on multiple lines, aligned on the left.

+
See also
flexbox.
+ +

Definition at line 49 of file src/ftxui/dom/paragraph.cpp.

+ +
+
+ +

◆ paragraphAlignRight()

+ +
+
+ + + + + + + +
Element paragraphAlignRight (const std::string & the_text)
+
+ +

Return an element drawing the paragraph on multiple lines, aligned on the right.

+
See also
flexbox.
+ +

Definition at line 60 of file src/ftxui/dom/paragraph.cpp.

+ +
+
+ +

◆ paragraphAlignCenter()

+ +
+
+ + + + + + + +
Element paragraphAlignCenter (const std::string & the_text)
+
+ +

Return an element drawing the paragraph on multiple lines, aligned on the center.

+
See also
flexbox.
+ +

Definition at line 72 of file src/ftxui/dom/paragraph.cpp.

+ +
+
+ +

◆ paragraphAlignJustify()

+ +
+
+ + + + + + + +
Element paragraphAlignJustify (const std::string & the_text)
+
+ +

Return an element drawing the paragraph on multiple lines, aligned using a justified alignment. the center.

+
See also
flexbox.
+ +

Definition at line 85 of file src/ftxui/dom/paragraph.cpp.

+ +
+
+ +

◆ vscroll_indicator()

+ +
+
+ + + + + + + +
Element vscroll_indicator (Element child)
+
+ +

Display a vertical scrollbar on the right. Colors follow the content.

+ +

Definition at line 21 of file scroll_indicator.cpp.

+ +
+
+ +

◆ hscroll_indicator()

+ +
+
+ + + + + + + +
Element hscroll_indicator (Element child)
+
+ +

Display a horizontal scrollbar at the bottom. Colors follow the content.

+ +

Definition at line 76 of file scroll_indicator.cpp.

+ +
+
+ +

◆ separator() [1/2]

+ +
+
+ + + + + + + +
Element separator ()
+
+ +

Draw a vertical or horizontal separation in between two other elements.

+
See also
separator
+
+separatorLight
+
+separatorDashed
+
+separatorDouble
+
+separatorHeavy
+
+separatorEmpty
+
+separatorRounded
+
+separatorStyled
+
+separatorCharacter
+

Add a visual separation in between two elements.

+

+Example

+
// Use 'border' as a function...
+
Element document = vbox({
+
text("up"),
+ +
text("down"),
+
});
+
Element separator()
Draw a vertical or horizontal separation in between two other elements.
+
Element vbox(Elements)
A container displaying elements vertically one by one.
Definition vbox.cpp:96
+

+Output

+
up
+
────
+
down
+
+

Definition at line 134 of file src/ftxui/dom/separator.cpp.

+ +
+
+ +

◆ separatorStyled()

+ +
+
+ + + + + + + +
Element separatorStyled (BorderStyle style)
+
+ +

Draw a vertical or horizontal separation in between two other elements.

+
Parameters
+ + +
stylethe style of the separator.
+
+
+
See also
separator
+
+separatorLight
+
+separatorDashed
+
+separatorDouble
+
+separatorHeavy
+
+separatorEmpty
+
+separatorRounded
+
+separatorStyled
+
+separatorCharacter
+

Add a visual separation in between two elements.

+

+Example

+
// Use 'border' as a function...
+
Element document = vbox({
+
text("up"),
+ +
text("down"),
+
});
+
Element separatorStyled(BorderStyle)
Draw a vertical or horizontal separation in between two other elements.
+

+Output

+
up
+
════
+
down
+
+

Definition at line 172 of file src/ftxui/dom/separator.cpp.

+ +
+
+ +

◆ separatorLight()

+ +
+
+ + + + + + + +
Element separatorLight ()
+
+ +

Draw a vertical or horizontal separation in between two other elements, using the LIGHT style.

+
See also
separator
+
+separatorLight
+
+separatorDashed
+
+separatorDouble
+
+separatorHeavy
+
+separatorEmpty
+
+separatorRounded
+
+separatorStyled
+
+separatorCharacter
+

Add a visual separation in between two elements.

+

+Example

+
// Use 'border' as a function...
+
Element document = vbox({
+
text("up"),
+ +
text("down"),
+
});
+
Element separatorLight()
Draw a vertical or horizontal separation in between two other elements, using the LIGHT style.
+

+Output

+
up
+
────
+
down
+
+

Definition at line 209 of file src/ftxui/dom/separator.cpp.

+ +
+
+ +

◆ separatorDashed()

+ +
+
+ + + + + + + +
Element separatorDashed ()
+
+ +

Draw a vertical or horizontal separation in between two other elements, using the DASHED style.

+
See also
separator
+
+separatorLight
+
+separatorDashed
+
+separatorDouble
+
+separatorHeavy
+
+separatorEmpty
+
+separatorRounded
+
+separatorStyled
+
+separatorCharacter
+

Add a visual separation in between two elements.

+

+Example

+
// Use 'border' as a function...
+
Element document = vbox({
+
text("up"),
+ +
text("down"),
+
});
+

+Output

+
up
+
╍╍╍╍
+
down
+
+

Definition at line 246 of file src/ftxui/dom/separator.cpp.

+ +
+
+ +

◆ separatorHeavy()

+ +
+
+ + + + + + + +
Element separatorHeavy ()
+
+ +

Draw a vertical or horizontal separation in between two other elements, using the HEAVY style.

+
See also
separator
+
+separatorLight
+
+separatorDashed
+
+separatorDouble
+
+separatorHeavy
+
+separatorEmpty
+
+separatorRounded
+
+separatorStyled
+
+separatorCharacter
+

Add a visual separation in between two elements.

+

+Example

+
// Use 'border' as a function...
+
Element document = vbox({
+
text("up"),
+ +
text("down"),
+
});
+
Element separatorHeavy()
Draw a vertical or horizontal separation in between two other elements, using the HEAVY style.
+

+Output

+
up
+
━━━━
+
down
+
+

Definition at line 283 of file src/ftxui/dom/separator.cpp.

+ +
+
+ +

◆ separatorDouble()

+ +
+
+ + + + + + + +
Element separatorDouble ()
+
+ +

Draw a vertical or horizontal separation in between two other elements, using the DOUBLE style.

+
See also
separator
+
+separatorLight
+
+separatorDashed
+
+separatorDouble
+
+separatorHeavy
+
+separatorEmpty
+
+separatorRounded
+
+separatorStyled
+
+separatorCharacter
+

Add a visual separation in between two elements.

+

+Example

+
// Use 'border' as a function...
+
Element document = vbox({
+
text("up"),
+ +
text("down"),
+
});
+
Element separatorDouble()
Draw a vertical or horizontal separation in between two other elements, using the DOUBLE style.
+

+Output

+
up
+
════
+
down
+
+

Definition at line 320 of file src/ftxui/dom/separator.cpp.

+ +
+
+ +

◆ separatorEmpty()

+ +
+
+ + + + + + + +
Element separatorEmpty ()
+
+ +

Draw a vertical or horizontal separation in between two other elements, using the EMPTY style.

+
See also
separator
+
+separatorLight
+
+separatorDashed
+
+separatorDouble
+
+separatorHeavy
+
+separatorEmpty
+
+separatorRounded
+
+separatorStyled
+
+separatorCharacter
+

Add a visual separation in between two elements.

+

+Example

+
// Use 'border' as a function...
+
Element document = vbox({
+
text("up"),
+ +
text("down"),
+
});
+

+Output

+
up
+
+
down
+
+

Definition at line 357 of file src/ftxui/dom/separator.cpp.

+ +
+
+ +

◆ separatorCharacter()

+ +
+
+ + + + + + + +
Element separatorCharacter (std::string value)
+
+ +

Draw a vertical or horizontal separation in between two other elements.

+
Parameters
+ + +
valuethe character to fill the separator area.
+
+
+
See also
separator
+
+separatorLight
+
+separatorDashed
+
+separatorDouble
+
+separatorHeavy
+
+separatorEmpty
+
+separatorRounded
+
+separatorStyled
+
+separatorCharacter
+

Add a visual separation in between two elements.

+

+Example

+
// Use 'border' as a function...
+
Element document = vbox({
+
text("up"),
+ +
text("down"),
+
});
+

+Output

+
up
+
────
+
down
+
+

Definition at line 395 of file src/ftxui/dom/separator.cpp.

+ +
+
+ +

◆ separator() [2/2]

+ +
+
+ + + + + + + +
Element separator (Pixel pixel)
+
+ +

Draw a separator in between two element filled with a given pixel.

+
See also
separator
+
+separatorLight
+
+separatorDashed
+
+separatorHeavy
+
+separatorDouble
+
+separatorStyled
+

+Example

+
Pixel empty;
+
Element document = vbox({
+
text("Up"),
+
separator(empty),
+
text("Down"),
+
})
+
A Unicode character and its associated style.
Definition pixel.hpp:15
+

+Output

+
Up
+
+
Down
+
+

Definition at line 426 of file src/ftxui/dom/separator.cpp.

+ +
+
+ +

◆ size()

+ +
+
+ + + + + + + + + + + + + + + + +
Decorator size (WidthOrHeight direction,
Constraint constraint,
int value )
+
+ +

Apply a constraint on the size of an element.

+
Parameters
+ + + + +
directionWhether the WIDTH of the HEIGHT of the element must be constrained.
constraintThe type of constaint.
valueThe value.
+
+
+ +

Definition at line 89 of file src/ftxui/dom/size.cpp.

+ +
+
+ +

◆ spinner()

+ +
+
+ + + + + + + + + + + +
Element spinner (int charset_index,
size_t image_index )
+
+ +

Useful to represent the effect of time and/or events. This displays an ASCII art "video".

+
Parameters
+ + + +
charset_indexThe type of "video".
image_indexThe "frame" of the video. You need to increase this for every "step".
+
+
+ +

Definition at line 282 of file src/ftxui/dom/spinner.cpp.

+ +
+
+ +

◆ strikethrough()

+ +
+
+ + + + + + + +
Element strikethrough (Element child)
+
+ +

Apply a strikethrough to text.

+ +

Definition at line 17 of file strikethrough.cpp.

+ +
+
+ +

◆ text() [1/2]

+ +
+
+ + + + + + + +
Element text (std::string text)
+
+ +

Display a piece of UTF8 encoded unicode text.

+
See also
ftxui::to_wstring
+

+Example

+
Element document = text("Hello world!");
+

+Output

+
Hello world!
+
+

Definition at line 141 of file text.cpp.

+ +
+
+ +

◆ text() [2/2]

+ +
+
+ + + + + + + +
Element text (std::wstring text)
+
+ +

Display a piece of unicode text.

+
See also
ftxui::to_wstring
+

+Example

+
Element document = text(L"Hello world!");
+

+Output

+
Hello world!
+
+

Definition at line 160 of file text.cpp.

+ +
+
+ +

◆ vtext() [1/2]

+ +
+
+ + + + + + + +
Element vtext (std::string text)
+
+ +

Display a piece of unicode text vertically.

+
See also
ftxui::to_wstring
+

+Example

+
Element document = vtext("Hello world!");
+
Element vtext(std::wstring text)
Display a piece unicode text vertically.
Definition text.cpp:220
+

+Output

+
H
+
e
+
l
+
l
+
o
+
+
w
+
o
+
r
+
l
+
d
+
!
+
+

Definition at line 190 of file text.cpp.

+ +
+
+ +

◆ vtext() [2/2]

+ +
+
+ + + + + + + +
Element vtext (std::wstring text)
+
+ +

Display a piece unicode text vertically.

+
See also
ftxui::to_wstring
+

+Example

+
Element document = vtext(L"Hello world!");
+

+Output

+
H
+
e
+
l
+
l
+
o
+
+
w
+
o
+
r
+
l
+
d
+
!
+
+

Definition at line 220 of file text.cpp.

+ +
+
+ +

◆ underlined()

+ +
+
+ + + + + + + +
Element underlined (Element child)
+
+ +

Underline the given element.

+ +

Definition at line 33 of file underlined.cpp.

+ +
+
+ +

◆ underlinedDouble()

+ +
+
+ + + + + + + +
Element underlinedDouble (Element child)
+
+ +

Apply a underlinedDouble to text.

+ +

Definition at line 17 of file underlined_double.cpp.

+ +
+
+ +

◆ nothing()

+ +
+
+ + + + + + + +
Element nothing (Element element)
+
+ +

A decoration doing absolutely nothing.

+ +

Definition at line 28 of file dom/util.cpp.

+ +
+
+ +

◆ operator|() [1/3]

+ +
+
+ + + + + + + + + + + +
Decorator operator| (Decorator a,
Decorator b )
+
+ +

Compose two decorator into one.

+

+Example

+
auto decorator = bold | blink;
+
Element blink(Element)
The text drawn alternates in between visible and hidden.
Definition blink.cpp:33
+
+

Definition at line 40 of file dom/util.cpp.

+ +
+
+ +

◆ operator|() [2/3]

+ +
+
+ + + + + + + + + + + +
Elements operator| (Elements elements,
Decorator decorator )
+
+ +

From a set of element, apply a decorator to every elements.

+
Returns
the set of decorated element.
+ +

Definition at line 48 of file dom/util.cpp.

+ +
+
+ +

◆ operator|() [3/3]

+ +
+
+ + + + + + + + + + + +
Element operator| (Element element,
Decorator decorator )
+
+ +

From an element, apply a decorator.

+
Returns
the decorated element.
+

+Example

+

Both of these are equivalent:

bold(text("Hello"));
+
Element bold(Element)
Use a bold font, for elements with more emphasis.
Definition bold.cpp:33
+
text("Hello") | bold;
+
+

Definition at line 70 of file dom/util.cpp.

+ +
+
+ +

◆ operator|=()

+ +
+
+ + + + + + + + + + + +
Element & operator|= (Element & e,
Decorator d )
+
+ +

Apply a decorator to an element.

+
Returns
the decorated element.
+

+Example

+

Both of these are equivalent:

auto element = text("Hello");
+
element |= bold;
+
+

Definition at line 85 of file dom/util.cpp.

+ +
+
+ +

◆ emptyElement()

+ +
+
+ + + + + + + +
Element emptyElement ()
+
+

An element of size 0x0 drawing nothing.

+ +

Definition at line 140 of file dom/util.cpp.

+ +
+
+ +

◆ vbox()

+ +
+
+ + + + + + + +
Element vbox (Elements children)
+
+ +

A container displaying elements vertically one by one.

+
Parameters
+ + +
childrenThe elements in the container
+
+
+
Returns
The container.
+

+Example

+
+
text("Up"),
+
text("Down"),
+
});
+
+

Definition at line 96 of file vbox.cpp.

+ +
+
+ +

◆ SetColorSupport()

+ +
+
+ + + + + + + +
void SetColorSupport (Color color)
+
+ +

Override terminal color support in case auto-detection fails.

+ +

Definition at line 140 of file terminal.cpp.

+ +
+
+
+
+ + + + + diff --git a/group__dom.js b/group__dom.js new file mode 100644 index 000000000..201109535 --- /dev/null +++ b/group__dom.js @@ -0,0 +1,297 @@ +var group__dom = +[ + [ "Canvas", "group__dom.html#structftxui_1_1Canvas", [ + [ "Stylizer", "group__dom.html#a407f299e079846ce6169f2a709ad4aae", null ], + [ "Canvas", "group__dom.html#a3cbcd839ac8597df2e0f351850ec4735", null ], + [ "Canvas", "group__dom.html#a6a78dda2095054ffa03f215f0153bdbb", null ], + [ "width", "group__dom.html#ad72663daf610f2a0833a2fc3d78e4fdf", null ], + [ "height", "group__dom.html#ad3774f6419003470f54fd495124ef51f", null ], + [ "GetPixel", "group__dom.html#a656c4e679bf9254e4688f2049989a9bd", null ], + [ "DrawPointOn", "group__dom.html#a5f488ea43e72f25cc25d055bf18dac5b", null ], + [ "DrawPointOff", "group__dom.html#a64ad8a12830a3341d4a5afb380913474", null ], + [ "DrawPointToggle", "group__dom.html#afd64176f05f91df2d96e8f3bb0631c51", null ], + [ "DrawPoint", "group__dom.html#a8707f2585ed8b787b6b14032a5c761a1", null ], + [ "DrawPoint", "group__dom.html#a356677acf431f88673b59526f290eb0c", null ], + [ "DrawPoint", "group__dom.html#ab89d4e0bd8bf78ba40dde08cd5779fa7", null ], + [ "DrawPointLine", "group__dom.html#a2b6800c9a6a93457a921d9b570fb2f30", null ], + [ "DrawPointLine", "group__dom.html#a4eb34a7688220b3b8ad274ff9d0f3649", null ], + [ "DrawPointLine", "group__dom.html#a6a3d2396239afce89f1cda3c69665095", null ], + [ "DrawPointCircle", "group__dom.html#ad21641f8f1fd60aa5f1d149379eba3eb", null ], + [ "DrawPointCircle", "group__dom.html#a644133eccde18caeaf06e5b7fdb5ef51", null ], + [ "DrawPointCircle", "group__dom.html#adcc98793cdb931c3438b5ec35ed7a0dd", null ], + [ "DrawPointCircleFilled", "group__dom.html#a5b6388d2515edcfb6c88a39ea56805b2", null ], + [ "DrawPointCircleFilled", "group__dom.html#af7a213e8dbed8debae0155f1b707fd74", null ], + [ "DrawPointCircleFilled", "group__dom.html#adace7c348090660c1a6a5fffce18b7d2", null ], + [ "DrawPointEllipse", "group__dom.html#a79ee88b3cfe258309041469f707dcf68", null ], + [ "DrawPointEllipse", "group__dom.html#a6926683a29ff97d77e40ae533bb51eed", null ], + [ "DrawPointEllipse", "group__dom.html#acdafc386934cf7e11b529c0c38b788a3", null ], + [ "DrawPointEllipseFilled", "group__dom.html#a2633b8a556a82c74438fe41b253b39ee", null ], + [ "DrawPointEllipseFilled", "group__dom.html#a395ec10a91d15be650afddcb85757945", null ], + [ "DrawPointEllipseFilled", "group__dom.html#a22ec58bdf5a3578ce68c52ace9324fb6", null ], + [ "DrawBlockOn", "group__dom.html#a43cd60e79e418d3173e757a1809fde09", null ], + [ "DrawBlockOff", "group__dom.html#ad626747e5e54412d0376ba870565dce6", null ], + [ "DrawBlockToggle", "group__dom.html#ab4154641384d18497de60c2626b71a94", null ], + [ "DrawBlock", "group__dom.html#ae38b2e4f5bcda94c060bb77779d1e339", null ], + [ "DrawBlock", "group__dom.html#a0a51b12eb4089c9a3afb8d3052599b98", null ], + [ "DrawBlock", "group__dom.html#ab5717755b773771ef642e9e774dbb1a0", null ], + [ "DrawBlockLine", "group__dom.html#a182a915a7e3fc863f5c222253de01ff1", null ], + [ "DrawBlockLine", "group__dom.html#a2911f015b5085dd2f74a4f88910eabe3", null ], + [ "DrawBlockLine", "group__dom.html#a8543417c0289090a5eefb2d6fcd521fc", null ], + [ "DrawBlockCircle", "group__dom.html#ac3977d4b06ca96ff799a3b72437c8a0b", null ], + [ "DrawBlockCircle", "group__dom.html#a685bec108334c6a43ceb5ca8a0666cd7", null ], + [ "DrawBlockCircle", "group__dom.html#ab2bf509dc9519bd9f76a7721b5b152bf", null ], + [ "DrawBlockCircleFilled", "group__dom.html#acffdcd5bae224992e155facb0baf4119", null ], + [ "DrawBlockCircleFilled", "group__dom.html#a60a31c3685d296333e594feb8ec04c48", null ], + [ "DrawBlockCircleFilled", "group__dom.html#a70cd877698afe354ca070c6b93ef3847", null ], + [ "DrawBlockEllipse", "group__dom.html#a8dd75f2dfc5bef37aa2c8bc8cfaf0579", null ], + [ "DrawBlockEllipse", "group__dom.html#ac53509c067c979cc6ec766b4db8e6e2c", null ], + [ "DrawBlockEllipse", "group__dom.html#a0916ab1d55ac16c158571d135893e88a", null ], + [ "DrawBlockEllipseFilled", "group__dom.html#a78dc3c908f7ce1c30837bd3043f19526", null ], + [ "DrawBlockEllipseFilled", "group__dom.html#aa3f717282aab0cee9835503ef1eb6f1b", null ], + [ "DrawBlockEllipseFilled", "group__dom.html#a616781dd82158e306ebf71d87283e6f8", null ], + [ "DrawText", "group__dom.html#a3791777bd6d3c6f8ff6281efd19a5161", null ], + [ "DrawText", "group__dom.html#a389991302f9a1d5554eff24b48d6b6ec", null ], + [ "DrawText", "group__dom.html#a648ed3b48973ac1dc58ca22d54ecf6af", null ], + [ "DrawPixel", "group__dom.html#afde1b1962124ef417569bef59c6dcdcc", null ], + [ "DrawImage", "group__dom.html#a02b6e8bab532a2c43d3102674e1e1647", null ], + [ "Style", "group__dom.html#ae9e7d3f5b753cf2650057623960d4cb4", null ] + ] ], + [ "FlexboxConfig", "group__dom.html#structftxui_1_1FlexboxConfig", [ + [ "Direction", "group__dom.html#a224b9163917ac32fc95a60d8c1eec3aa", [ + [ "Row", "group__dom.html#a224b9163917ac32fc95a60d8c1eec3aaaa70367aa7cb74e510f4f9413ccf059d3", null ], + [ "RowInversed", "group__dom.html#a224b9163917ac32fc95a60d8c1eec3aaabba4d6f3a9cec9c96600e3e0d17b9f6a", null ], + [ "Column", "group__dom.html#a224b9163917ac32fc95a60d8c1eec3aaa1976d7f704de389d9fe064e08ea35b2d", null ], + [ "ColumnInversed", "group__dom.html#a224b9163917ac32fc95a60d8c1eec3aaa338df815740895b690c7b07716acda20", null ] + ] ], + [ "Wrap", "group__dom.html#a6c844a611650cf7e956dbe269a0e72ab", [ + [ "NoWrap", "group__dom.html#a6c844a611650cf7e956dbe269a0e72aba93ac740a98eb4cc45b853c780ed16c44", null ], + [ "Wrap", "group__dom.html#a6c844a611650cf7e956dbe269a0e72abaa212b19ef5f2fb30acf92e6cbccc1f2d", null ], + [ "WrapInversed", "group__dom.html#a6c844a611650cf7e956dbe269a0e72abad639e613e3589af04e39135707dbc642", null ] + ] ], + [ "JustifyContent", "group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2", [ + [ "FlexStart", "group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2a8d5898e4f1bd5527306b1f62fa4fd952", null ], + [ "FlexEnd", "group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2a923a60a08f41dc3052190403fc2a6b25", null ], + [ "Center", "group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2a4f1f6016fc9f3f2353c0cc7c67b292bd", null ], + [ "Stretch", "group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2afbb09a82eafab60150d0996e8fe46560", null ], + [ "SpaceBetween", "group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2afa2f3f8f296dcb6e5c287d69eae1c119", null ], + [ "SpaceAround", "group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2aa711fff5f720542ab104aab0805e2565", null ], + [ "SpaceEvenly", "group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2a34ad3eaf7ee60a45210ad60bd731e235", null ] + ] ], + [ "AlignItems", "group__dom.html#a821af961ece5fe13540ad48b54c7a9e7", [ + [ "FlexStart", "group__dom.html#a821af961ece5fe13540ad48b54c7a9e7a8d5898e4f1bd5527306b1f62fa4fd952", null ], + [ "FlexEnd", "group__dom.html#a821af961ece5fe13540ad48b54c7a9e7a923a60a08f41dc3052190403fc2a6b25", null ], + [ "Center", "group__dom.html#a821af961ece5fe13540ad48b54c7a9e7a4f1f6016fc9f3f2353c0cc7c67b292bd", null ], + [ "Stretch", "group__dom.html#a821af961ece5fe13540ad48b54c7a9e7afbb09a82eafab60150d0996e8fe46560", null ] + ] ], + [ "AlignContent", "group__dom.html#a1f99410fd0fc632a5bc2497b6a447420", [ + [ "FlexStart", "group__dom.html#a1f99410fd0fc632a5bc2497b6a447420a8d5898e4f1bd5527306b1f62fa4fd952", null ], + [ "FlexEnd", "group__dom.html#a1f99410fd0fc632a5bc2497b6a447420a923a60a08f41dc3052190403fc2a6b25", null ], + [ "Center", "group__dom.html#a1f99410fd0fc632a5bc2497b6a447420a4f1f6016fc9f3f2353c0cc7c67b292bd", null ], + [ "Stretch", "group__dom.html#a1f99410fd0fc632a5bc2497b6a447420afbb09a82eafab60150d0996e8fe46560", null ], + [ "SpaceBetween", "group__dom.html#a1f99410fd0fc632a5bc2497b6a447420afa2f3f8f296dcb6e5c287d69eae1c119", null ], + [ "SpaceAround", "group__dom.html#a1f99410fd0fc632a5bc2497b6a447420aa711fff5f720542ab104aab0805e2565", null ], + [ "SpaceEvenly", "group__dom.html#a1f99410fd0fc632a5bc2497b6a447420a34ad3eaf7ee60a45210ad60bd731e235", null ] + ] ], + [ "Set", "group__dom.html#ae47b5b0d793d0c2312e4805a1f40012a", null ], + [ "Set", "group__dom.html#a5afe52066ea76ddc7948b77ac155a011", null ], + [ "Set", "group__dom.html#a3de11197951ee3c9037ba7f2a2586a06", null ], + [ "Set", "group__dom.html#a07ef12f61272636369543b34932614f3", null ], + [ "Set", "group__dom.html#a6df4ec3da7d3d2cd0b216f5d2c72cbd6", null ], + [ "SetGap", "group__dom.html#a98d9a43033c09c7f967cdec791408bad", null ], + [ "direction", "group__dom.html#a53421c695d00016ab925777d423b4eb6", null ], + [ "wrap", "group__dom.html#a68b5470ece4f0a492cc1d2057c9bd5e0", null ], + [ "justify_content", "group__dom.html#ab3173252829e796ee1c100b447243748", null ], + [ "align_items", "group__dom.html#a1514fd3d64965c521555fdc2cf2002ce", null ], + [ "align_content", "group__dom.html#a103275cb09167852e469450cf8471256", null ], + [ "gap_x", "group__dom.html#a109ea05d5d6e08d052672465ff8dac61", null ], + [ "gap_y", "group__dom.html#ab01b75a8a9419ec5c47650772f342ba3", null ] + ] ], + [ "LinearGradient", "group__dom.html#structftxui_1_1LinearGradient", [ + [ "Stop", "structftxui_1_1LinearGradient_1_1Stop.html", [ + [ "color", "structftxui_1_1LinearGradient_1_1Stop.html#aa5f4d1eda21c196bd8401ff73f105073", null ], + [ "position", "structftxui_1_1LinearGradient_1_1Stop.html#a2f3c9e83b473a71f2882ee1ec4fb88de", null ] + ] ], + [ "LinearGradient", "group__dom.html#a5e989e4841fbba91e1714f977c5c58b9", null ], + [ "LinearGradient", "group__dom.html#ac57e39e64c79b5389f234eeaebfbb2fd", null ], + [ "LinearGradient", "group__dom.html#adbf0567cfc8e05051a4236d6541f63b8", null ], + [ "Angle", "group__dom.html#a251d447c54f49914a2cbf5dc16fc8b5b", null ], + [ "Stop", "group__dom.html#a03b10012f78e1c731616ce760d28df40", null ], + [ "Stop", "group__dom.html#ab85b009cd214d3bd1b3bb7f704af0da6", null ], + [ "angle", "group__dom.html#ab8ef1bf8a70cc07c6d55823c390a7e76", null ], + [ "stops", "group__dom.html#a9c56e5fb8075d8a48b1b0c3b4ea31831", null ] + ] ], + [ "Node", "group__dom.html#classftxui_1_1Node", [ + [ "Status", "structftxui_1_1Node_1_1Status.html", [ + [ "iteration", "structftxui_1_1Node_1_1Status.html#aa6371382c6b4224e577e14ea610ab9a9", null ], + [ "need_iteration", "structftxui_1_1Node_1_1Status.html#a0fffbfa5479a3b6d3ddf5ff13504a51c", null ] + ] ], + [ "Node", "group__dom.html#a0d313fac56abd7ebe58a17f1530b879e", null ], + [ "Node", "group__dom.html#a19fa1eae4c02e514c62a95e395b383a1", null ], + [ "Node", "group__dom.html#a7eb6a9efa23e5f6f7fc53b5aa3759dff", null ], + [ "Node", "group__dom.html#ac6365e35a2029b3e58eca97905f8124d", null ], + [ "~Node", "group__dom.html#a6fa6bf60f34f1e3efb0e59333428c9c8", null ], + [ "operator=", "group__dom.html#a7e12a390c13d283fc06cafbbfef7eba7", null ], + [ "operator=", "group__dom.html#abe938f0d7bfdca112e345590d4887de6", null ], + [ "ComputeRequirement", "group__dom.html#a40bd818c5de23bb2d208360d275ae59d", null ], + [ "requirement", "group__dom.html#a39a263e8c8786dc62fcb4d734aad7fe6", null ], + [ "SetBox", "group__dom.html#a2ed318aaadb07efc50e76fce1ccf9637", null ], + [ "Select", "group__dom.html#a05352f5a353f1e86630a978060e77305", null ], + [ "Render", "group__dom.html#a7e286fe14880614686ceeec84a9a9702", null ], + [ "GetSelectedContent", "group__dom.html#a2c5cebe05557529299e649867b499680", null ], + [ "Check", "group__dom.html#a5b71d891a102197f2856f53702425581", null ], + [ "Render", "group__dom.html#ab35030b64136afa183d474d11bd1f6dd", null ], + [ "children_", "group__dom.html#a2aeb117dade3254694355ab90e9fc566", null ], + [ "requirement_", "group__dom.html#a3530d99687053ce0d0006b9dee9a1ca7", null ], + [ "box_", "group__dom.html#aa7e7d30102945911407723a5cbcdfabc", null ] + ] ], + [ "Requirement", "group__dom.html#structftxui_1_1Requirement", [ + [ "Focused", "structftxui_1_1Requirement_1_1Focused.html", [ + [ "Prefer", "structftxui_1_1Requirement_1_1Focused.html#a8a204963959c73e971c7d030cbc34134", null ], + [ "enabled", "structftxui_1_1Requirement_1_1Focused.html#a8740ba80e30dd75e71d09fa1dcf04f3d", null ], + [ "box", "structftxui_1_1Requirement_1_1Focused.html#ab19e728e80bc2fc43d8e82c3602f8333", null ], + [ "node", "structftxui_1_1Requirement_1_1Focused.html#ab88cd70dad2e152cea983610f2a16e68", null ], + [ "cursor_shape", "structftxui_1_1Requirement_1_1Focused.html#a21f4c5c8f6862a204f795d4f0cb6d479", null ], + [ "component_active", "structftxui_1_1Requirement_1_1Focused.html#ac3226c18ed017dd81566f593d1257ce1", null ] + ] ], + [ "min_x", "group__dom.html#a9c8ab844b7e5b610b7a4ac433ea148a1", null ], + [ "min_y", "group__dom.html#a5fb18fec2bc2c10f230d683506bb5a8f", null ], + [ "flex_grow_x", "group__dom.html#a874ced28be7064feaaf97c70c2097bd6", null ], + [ "flex_grow_y", "group__dom.html#a13f6aa7165c63a4494fc2f1ed4428880", null ], + [ "flex_shrink_x", "group__dom.html#ad293f2488e260e36e72fd3da9c16df9a", null ], + [ "flex_shrink_y", "group__dom.html#ab4e07297a2a55de7158ef0115b6b46a9", null ], + [ "focused", "group__dom.html#aa4da656616dd87d4e82a4ee718db6b3c", null ] + ] ], + [ "Selection", "group__dom.html#classftxui_1_1Selection", [ + [ "Selection", "group__dom.html#ade00d4039f147221b9fd6b6b402b43b1", null ], + [ "Selection", "group__dom.html#a76eafd8bc098ec9f0405e3b1f6fb42c4", null ], + [ "GetBox", "group__dom.html#a03f5cc5dcad10fecb7a0b8203c86a13e", null ], + [ "SaturateHorizontal", "group__dom.html#af3f2674604d907fbce26d4217cfa9324", null ], + [ "SaturateVertical", "group__dom.html#ace69e1e7c6e64b7ae0c4402e0e1e3336", null ], + [ "IsEmpty", "group__dom.html#a8e12342fc420701fbffd97025421575a", null ], + [ "AddPart", "group__dom.html#a9887e25feddebbf840876824cb3cbf61", null ], + [ "GetParts", "group__dom.html#a4d4387d24d418b865c77ed592602d08d", null ] + ] ], + [ "Table", "group__dom.html#classftxui_1_1Table", [ + [ "Table", "group__dom.html#a2a7f82c625b00a53f710b2ed305248d2", null ], + [ "Table", "group__dom.html#a2055337c538a82ae13d92db1838fc454", null ], + [ "Table", "group__dom.html#acbd904dfec77b46b257e33f9c7d1e71d", null ], + [ "Table", "group__dom.html#a22a1b5a5b90feb5ebbfe20d7dec5c650", null ], + [ "SelectAll", "group__dom.html#ad5f50927f54334b84514bc4b11a14d71", null ], + [ "SelectCell", "group__dom.html#a3c2f178ef9f94da293a53b467ef8643b", null ], + [ "SelectRow", "group__dom.html#a64435bbfbdefd7408241c69b6b8283e7", null ], + [ "SelectRows", "group__dom.html#ab36d32e3675a9353ee79e84405cd7a44", null ], + [ "SelectColumn", "group__dom.html#a4ee8ddbab36f592fba81c6430d26545e", null ], + [ "SelectColumns", "group__dom.html#a79109565fe65710f725eb474778cae36", null ], + [ "SelectRectangle", "group__dom.html#af0021915d0cbda394077929601b8ab8f", null ], + [ "Render", "group__dom.html#a28d41d6113c5b29c8dd45846582b3299", null ] + ] ], + [ "Direction", "group__dom.html#ga224b9163917ac32fc95a60d8c1eec3aa", [ + [ "Up", "group__dom.html#gga224b9163917ac32fc95a60d8c1eec3aaa258f49887ef8d14ac268c92b02503aaa", null ], + [ "Down", "group__dom.html#gga224b9163917ac32fc95a60d8c1eec3aaa08a38277b0309070706f6652eeae9a53", null ], + [ "Left", "group__dom.html#gga224b9163917ac32fc95a60d8c1eec3aaa945d5e233cf7d6240f6b783b36a374ff", null ], + [ "Right", "group__dom.html#gga224b9163917ac32fc95a60d8c1eec3aaa92b09c7c48c520c3c55e497875da437c", null ] + ] ], + [ "BorderStyle", "group__dom.html#gafe3103dd0b8240c5443892484ef5af9c", [ + [ "LIGHT", "group__dom.html#ggafe3103dd0b8240c5443892484ef5af9caf917d6c11c85b4ac32e30d1cc9da25eb", null ], + [ "DASHED", "group__dom.html#ggafe3103dd0b8240c5443892484ef5af9ca830310bdfd296d7cd00c59773579b892", null ], + [ "HEAVY", "group__dom.html#ggafe3103dd0b8240c5443892484ef5af9ca34cd68a92c52759ed9b545969a11c2da", null ], + [ "DOUBLE", "group__dom.html#ggafe3103dd0b8240c5443892484ef5af9ca33465d1d419b1074fb259ef444609e92", null ], + [ "ROUNDED", "group__dom.html#ggafe3103dd0b8240c5443892484ef5af9ca655074b92b285adff7d18a45748bf493", null ], + [ "EMPTY", "group__dom.html#ggafe3103dd0b8240c5443892484ef5af9ca2f0d18fc0d0fa4a6cd92dc328501874d", null ] + ] ], + [ "automerge", "group__dom.html#gaca42bd6c44d8d366d5c1014330402086", null ], + [ "blink", "group__dom.html#gad57613de5895e774218d91dea48d074b", null ], + [ "bold", "group__dom.html#ga353c769068e25303eb41fa2da565c604", null ], + [ "border", "group__dom.html#gae8537acd423d47cf07e61bd774fb1098", null ], + [ "borderWith", "group__dom.html#gaa97cfcfbe6df92dac085454395ec7b2f", null ], + [ "borderStyled", "group__dom.html#gabc9db79957d4dd36deb8ca79938e4c41", null ], + [ "borderStyled", "group__dom.html#gad1dbf36194dcb77674085df9e11c1e22", null ], + [ "borderStyled", "group__dom.html#ga5aab98b289d2e7b2ce8ca0eeee51ce78", null ], + [ "borderDashed", "group__dom.html#ga181c80f8ada12d1356f6bfa0ebb7219f", null ], + [ "borderLight", "group__dom.html#gaa074cdab57eeb47b99f1699bcc8addd8", null ], + [ "borderHeavy", "group__dom.html#ga666c31419cc31cdadc9f8178ed63529e", null ], + [ "borderDouble", "group__dom.html#ga052b504344f3bc1ff86b3493cd934215", null ], + [ "borderRounded", "group__dom.html#ga3cf2db223a5efaa370f0ca6bb405b80e", null ], + [ "borderEmpty", "group__dom.html#gaf20f7d6fb275d109f0bdc01a2e4d3f3e", null ], + [ "window", "group__dom.html#ga03049def08fa7a5eaa4d5e897152bc1a", null ], + [ "clear_under", "group__dom.html#ga17a89519e6b87e12b1e5811a702f7847", null ], + [ "color", "group__dom.html#gadef6e6e66199153de6d3b21b14dcf868", null ], + [ "bgcolor", "group__dom.html#gaae86eacae0a0626b41e9964ac7f4f532", null ], + [ "color", "group__dom.html#gaf61b489da39ca5e24b68e6e1a2b09c0d", null ], + [ "bgcolor", "group__dom.html#ga01d4c5aaf0447e862246849111782245", null ], + [ "hcenter", "group__dom.html#gaf7d0d1e44c1a5424e42a5cddceacf7f7", null ], + [ "vcenter", "group__dom.html#gad907a8a48bb9f9dfdb06402e9fc12316", null ], + [ "center", "group__dom.html#ga5b11656305fce8427b81daf1c35883f1", null ], + [ "align_right", "group__dom.html#ga778e52afe28f1978f1f7ef065ed92d6d", null ], + [ "dbox", "group__dom.html#ga901ab1b6b2e0e8c295552168ab206441", null ], + [ "dim", "group__dom.html#gac6a3b77604739516e809369810896646", null ], + [ "filler", "group__dom.html#gac2a9ed2d22ec3c8811b61f4a901ed367", null ], + [ "flex", "group__dom.html#ga257acd2bd47bab7db879cca2c0e67e23", null ], + [ "xflex", "group__dom.html#ga0dbba98e14f63f1dd5163cbdc4f42da8", null ], + [ "yflex", "group__dom.html#ga42c7a33df6d890de30fc1ebb2d1b3ca6", null ], + [ "flex_grow", "group__dom.html#ga81ed6b31f512e849247f13d249f6f20e", null ], + [ "xflex_grow", "group__dom.html#ga1618cb15307f29eb3d531e7b44c280d3", null ], + [ "yflex_grow", "group__dom.html#ga7eac3f709e905af8f583aed52093b7ce", null ], + [ "flex_shrink", "group__dom.html#ga4629196b5ffc280054d35f2a9977e829", null ], + [ "xflex_shrink", "group__dom.html#ga95275a9271934cf76e970c6650cc224d", null ], + [ "yflex_shrink", "group__dom.html#gaf7d0757f5965aa579bccc125ff909256", null ], + [ "notflex", "group__dom.html#ga845b0ea50d51024aa4e050447b46e1dd", null ], + [ "focusPositionRelative", "group__dom.html#ga13befad33cb4125e2143f2af3eddcc71", null ], + [ "focusPosition", "group__dom.html#ga78447ba1ccb792963ad6d306f4ed1256", null ], + [ "focus", "group__dom.html#gaa2d7d671f184f85e0f396f2610fa6c2e", null ], + [ "focusCursorBlock", "group__dom.html#ga509ef7e7f8913ea3de7efd45e3301ea1", null ], + [ "focusCursorBlockBlinking", "group__dom.html#gadda589914ba8fe863c905b6566557768", null ], + [ "focusCursorBar", "group__dom.html#ga4f89e72e7001064e3eb8189c8317e95b", null ], + [ "focusCursorBarBlinking", "group__dom.html#ga085a7c997e7364c5a54e73c7b84145db", null ], + [ "focusCursorUnderline", "group__dom.html#ga61e1fe02a18c2b18e31ccc9cd3943823", null ], + [ "focusCursorUnderlineBlinking", "group__dom.html#ga33637d59d1e52aa06dd2a94162adbfe9", null ], + [ "gaugeDirection", "group__dom.html#ga1265cc8a52448e1b98d7abe84a04681e", null ], + [ "gaugeRight", "group__dom.html#ga333d781a44885ed4b5ea8444015b86f7", null ], + [ "gaugeLeft", "group__dom.html#ga97898b9f77b3edd330eaef22fce7cf2b", null ], + [ "gaugeUp", "group__dom.html#ga6e9a97b66c14404a2b3f95f4dae414c2", null ], + [ "gaugeDown", "group__dom.html#gafe537f915cac5613261580bae3a8fe33", null ], + [ "gauge", "group__dom.html#gae0b8041a60629fd790716038738c93ce", null ], + [ "hyperlink", "group__dom.html#ga8bacc04e0cbde663ccc4a4891e8b50d5", null ], + [ "hyperlink", "group__dom.html#gad0eac58eac9e6cd9a04879b20f8e123b", null ], + [ "inverted", "group__dom.html#ga672456b8f2091b615a30ff755418b37b", null ], + [ "italic", "group__dom.html#ga8a8d190765de7bbd9e78f9e639c2a96d", null ], + [ "color", "group__dom.html#ga050df9c8ed04eec13309d6c0542c636d", null ], + [ "bgcolor", "group__dom.html#gaaac1622d43662a6a02113d9230a4fdd4", null ], + [ "color", "group__dom.html#ga8af6b5a06b03fd53bf30a6b050b96968", null ], + [ "bgcolor", "group__dom.html#gaee41f3eaff28a123214e81231f8f4593", null ], + [ "Render", "group__dom.html#gad4b8aa9392f56ba41e2b421e046a7d83", null ], + [ "Render", "group__dom.html#ga32a24db985fa1b37bf686b00f7e1b4ff", null ], + [ "paragraph", "group__dom.html#ga3f9093ae1a2790d396fc2cff9990fbbd", null ], + [ "paragraphAlignLeft", "group__dom.html#gaa334a836eccc573e1137a1ba29d07d8a", null ], + [ "paragraphAlignRight", "group__dom.html#ga28a69f06a88c89fe7a507e33ab486411", null ], + [ "paragraphAlignCenter", "group__dom.html#ga6a105f6b0d07d7933379ff1ae9282fb8", null ], + [ "paragraphAlignJustify", "group__dom.html#gae4de548aa67ab77cb345e4ddec6b248b", null ], + [ "vscroll_indicator", "group__dom.html#ga1974176e676afdb96d203e8e0f579219", null ], + [ "hscroll_indicator", "group__dom.html#ga7f48136f949ccbde722dd93a6de4d0de", null ], + [ "separator", "group__dom.html#gac1ef1cf6bf7cd0759ffa195071edb2a0", null ], + [ "separatorStyled", "group__dom.html#ga13cb559cfc7e409b3f211f0bb35ea7fa", null ], + [ "separatorLight", "group__dom.html#ga37c2b93daf557f68064bc9fbf93ebde0", null ], + [ "separatorDashed", "group__dom.html#ga81f2d3256c0cfbc70f820129286f08c6", null ], + [ "separatorHeavy", "group__dom.html#gaf0649e89a9960f1c2703e48c1817645b", null ], + [ "separatorDouble", "group__dom.html#gadd376830fdb51b0bf52672ef17515989", null ], + [ "separatorEmpty", "group__dom.html#ga1934703e56ab66f6f259b9f8da331f1b", null ], + [ "separatorCharacter", "group__dom.html#ga97a10482d591aade2958da0f2f19b371", null ], + [ "separator", "group__dom.html#ga71d9a6a32f65b6d172f9696b3b9579b4", null ], + [ "size", "group__dom.html#ga201220986fbdc539e42efe067985cbdb", null ], + [ "spinner", "group__dom.html#ga3b08e0030a0831d3ec3e2a505908273b", null ], + [ "strikethrough", "group__dom.html#ga8594d70f0491def903370e86132fbf01", null ], + [ "text", "group__dom.html#ga366051704fd333c23460f7932598a5e3", null ], + [ "text", "group__dom.html#ga75baaa2734ed76a9f478beaafa87ae57", null ], + [ "vtext", "group__dom.html#ga64172a43b4b526afeb6313e6e1a6d5a1", null ], + [ "vtext", "group__dom.html#ga9f9f7485a45aa9d432726ca9845d1eac", null ], + [ "underlined", "group__dom.html#ga5ad450c97c4d084b64ffb5b5ca942664", null ], + [ "underlinedDouble", "group__dom.html#ga16d1b74107610750276499ddb3dde8da", null ], + [ "nothing", "group__dom.html#ga1bfd3885ac8b40dc82a1103725003c07", null ], + [ "operator|", "group__dom.html#ga027fbc9cf6fef9e86ae6a2a79e8bf23a", null ], + [ "operator|", "group__dom.html#ga6cbc84eb24a655ae084b3c7d26f9abfc", null ], + [ "operator|", "group__dom.html#ga7e9a69f0592b4013bd725d662f4a76e7", null ], + [ "operator|=", "group__dom.html#ga0be26ac5dcbe6c707857c791d8eec720", null ], + [ "emptyElement", "group__dom.html#ga40451515a5b3049e7a1276cad8b9356c", null ], + [ "vbox", "group__dom.html#gafd28058f0ccbbdf34691a85a7cc9b2e3", null ], + [ "SetColorSupport", "group__dom.html#ga65945a706131f407a47a1b9960dc1a4a", null ] +]; \ No newline at end of file diff --git a/group__dom_classftxui_1_1Node.js b/group__dom_classftxui_1_1Node.js new file mode 100644 index 000000000..0c3c75b68 --- /dev/null +++ b/group__dom_classftxui_1_1Node.js @@ -0,0 +1,22 @@ +var group__dom_classftxui_1_1Node = +[ + [ "Status", "structftxui_1_1Node_1_1Status.html", "structftxui_1_1Node_1_1Status" ], + [ "Node", "group__dom.html#a0d313fac56abd7ebe58a17f1530b879e", null ], + [ "Node", "group__dom.html#a19fa1eae4c02e514c62a95e395b383a1", null ], + [ "Node", "group__dom.html#a7eb6a9efa23e5f6f7fc53b5aa3759dff", null ], + [ "Node", "group__dom.html#ac6365e35a2029b3e58eca97905f8124d", null ], + [ "~Node", "group__dom.html#a6fa6bf60f34f1e3efb0e59333428c9c8", null ], + [ "operator=", "group__dom.html#a7e12a390c13d283fc06cafbbfef7eba7", null ], + [ "operator=", "group__dom.html#abe938f0d7bfdca112e345590d4887de6", null ], + [ "ComputeRequirement", "group__dom.html#a40bd818c5de23bb2d208360d275ae59d", null ], + [ "requirement", "group__dom.html#a39a263e8c8786dc62fcb4d734aad7fe6", null ], + [ "SetBox", "group__dom.html#a2ed318aaadb07efc50e76fce1ccf9637", null ], + [ "Select", "group__dom.html#a05352f5a353f1e86630a978060e77305", null ], + [ "Render", "group__dom.html#a7e286fe14880614686ceeec84a9a9702", null ], + [ "GetSelectedContent", "group__dom.html#a2c5cebe05557529299e649867b499680", null ], + [ "Check", "group__dom.html#a5b71d891a102197f2856f53702425581", null ], + [ "Render", "group__dom.html#ab35030b64136afa183d474d11bd1f6dd", null ], + [ "children_", "group__dom.html#a2aeb117dade3254694355ab90e9fc566", null ], + [ "requirement_", "group__dom.html#a3530d99687053ce0d0006b9dee9a1ca7", null ], + [ "box_", "group__dom.html#aa7e7d30102945911407723a5cbcdfabc", null ] +]; \ No newline at end of file diff --git a/group__dom_classftxui_1_1Selection.js b/group__dom_classftxui_1_1Selection.js new file mode 100644 index 000000000..1e432caba --- /dev/null +++ b/group__dom_classftxui_1_1Selection.js @@ -0,0 +1,11 @@ +var group__dom_classftxui_1_1Selection = +[ + [ "Selection", "group__dom.html#ade00d4039f147221b9fd6b6b402b43b1", null ], + [ "Selection", "group__dom.html#a76eafd8bc098ec9f0405e3b1f6fb42c4", null ], + [ "GetBox", "group__dom.html#a03f5cc5dcad10fecb7a0b8203c86a13e", null ], + [ "SaturateHorizontal", "group__dom.html#af3f2674604d907fbce26d4217cfa9324", null ], + [ "SaturateVertical", "group__dom.html#ace69e1e7c6e64b7ae0c4402e0e1e3336", null ], + [ "IsEmpty", "group__dom.html#a8e12342fc420701fbffd97025421575a", null ], + [ "AddPart", "group__dom.html#a9887e25feddebbf840876824cb3cbf61", null ], + [ "GetParts", "group__dom.html#a4d4387d24d418b865c77ed592602d08d", null ] +]; \ No newline at end of file diff --git a/group__dom_classftxui_1_1Table.js b/group__dom_classftxui_1_1Table.js new file mode 100644 index 000000000..c6e56d59c --- /dev/null +++ b/group__dom_classftxui_1_1Table.js @@ -0,0 +1,15 @@ +var group__dom_classftxui_1_1Table = +[ + [ "Table", "group__dom.html#a2a7f82c625b00a53f710b2ed305248d2", null ], + [ "Table", "group__dom.html#a2055337c538a82ae13d92db1838fc454", null ], + [ "Table", "group__dom.html#acbd904dfec77b46b257e33f9c7d1e71d", null ], + [ "Table", "group__dom.html#a22a1b5a5b90feb5ebbfe20d7dec5c650", null ], + [ "SelectAll", "group__dom.html#ad5f50927f54334b84514bc4b11a14d71", null ], + [ "SelectCell", "group__dom.html#a3c2f178ef9f94da293a53b467ef8643b", null ], + [ "SelectRow", "group__dom.html#a64435bbfbdefd7408241c69b6b8283e7", null ], + [ "SelectRows", "group__dom.html#ab36d32e3675a9353ee79e84405cd7a44", null ], + [ "SelectColumn", "group__dom.html#a4ee8ddbab36f592fba81c6430d26545e", null ], + [ "SelectColumns", "group__dom.html#a79109565fe65710f725eb474778cae36", null ], + [ "SelectRectangle", "group__dom.html#af0021915d0cbda394077929601b8ab8f", null ], + [ "Render", "group__dom.html#a28d41d6113c5b29c8dd45846582b3299", null ] +]; \ No newline at end of file diff --git a/group__dom_structftxui_1_1Canvas.js b/group__dom_structftxui_1_1Canvas.js new file mode 100644 index 000000000..1667ede94 --- /dev/null +++ b/group__dom_structftxui_1_1Canvas.js @@ -0,0 +1,57 @@ +var group__dom_structftxui_1_1Canvas = +[ + [ "Stylizer", "group__dom.html#a407f299e079846ce6169f2a709ad4aae", null ], + [ "Canvas", "group__dom.html#a3cbcd839ac8597df2e0f351850ec4735", null ], + [ "Canvas", "group__dom.html#a6a78dda2095054ffa03f215f0153bdbb", null ], + [ "width", "group__dom.html#ad72663daf610f2a0833a2fc3d78e4fdf", null ], + [ "height", "group__dom.html#ad3774f6419003470f54fd495124ef51f", null ], + [ "GetPixel", "group__dom.html#a656c4e679bf9254e4688f2049989a9bd", null ], + [ "DrawPointOn", "group__dom.html#a5f488ea43e72f25cc25d055bf18dac5b", null ], + [ "DrawPointOff", "group__dom.html#a64ad8a12830a3341d4a5afb380913474", null ], + [ "DrawPointToggle", "group__dom.html#afd64176f05f91df2d96e8f3bb0631c51", null ], + [ "DrawPoint", "group__dom.html#a8707f2585ed8b787b6b14032a5c761a1", null ], + [ "DrawPoint", "group__dom.html#a356677acf431f88673b59526f290eb0c", null ], + [ "DrawPoint", "group__dom.html#ab89d4e0bd8bf78ba40dde08cd5779fa7", null ], + [ "DrawPointLine", "group__dom.html#a2b6800c9a6a93457a921d9b570fb2f30", null ], + [ "DrawPointLine", "group__dom.html#a4eb34a7688220b3b8ad274ff9d0f3649", null ], + [ "DrawPointLine", "group__dom.html#a6a3d2396239afce89f1cda3c69665095", null ], + [ "DrawPointCircle", "group__dom.html#ad21641f8f1fd60aa5f1d149379eba3eb", null ], + [ "DrawPointCircle", "group__dom.html#a644133eccde18caeaf06e5b7fdb5ef51", null ], + [ "DrawPointCircle", "group__dom.html#adcc98793cdb931c3438b5ec35ed7a0dd", null ], + [ "DrawPointCircleFilled", "group__dom.html#a5b6388d2515edcfb6c88a39ea56805b2", null ], + [ "DrawPointCircleFilled", "group__dom.html#af7a213e8dbed8debae0155f1b707fd74", null ], + [ "DrawPointCircleFilled", "group__dom.html#adace7c348090660c1a6a5fffce18b7d2", null ], + [ "DrawPointEllipse", "group__dom.html#a79ee88b3cfe258309041469f707dcf68", null ], + [ "DrawPointEllipse", "group__dom.html#a6926683a29ff97d77e40ae533bb51eed", null ], + [ "DrawPointEllipse", "group__dom.html#acdafc386934cf7e11b529c0c38b788a3", null ], + [ "DrawPointEllipseFilled", "group__dom.html#a2633b8a556a82c74438fe41b253b39ee", null ], + [ "DrawPointEllipseFilled", "group__dom.html#a395ec10a91d15be650afddcb85757945", null ], + [ "DrawPointEllipseFilled", "group__dom.html#a22ec58bdf5a3578ce68c52ace9324fb6", null ], + [ "DrawBlockOn", "group__dom.html#a43cd60e79e418d3173e757a1809fde09", null ], + [ "DrawBlockOff", "group__dom.html#ad626747e5e54412d0376ba870565dce6", null ], + [ "DrawBlockToggle", "group__dom.html#ab4154641384d18497de60c2626b71a94", null ], + [ "DrawBlock", "group__dom.html#ae38b2e4f5bcda94c060bb77779d1e339", null ], + [ "DrawBlock", "group__dom.html#a0a51b12eb4089c9a3afb8d3052599b98", null ], + [ "DrawBlock", "group__dom.html#ab5717755b773771ef642e9e774dbb1a0", null ], + [ "DrawBlockLine", "group__dom.html#a182a915a7e3fc863f5c222253de01ff1", null ], + [ "DrawBlockLine", "group__dom.html#a2911f015b5085dd2f74a4f88910eabe3", null ], + [ "DrawBlockLine", "group__dom.html#a8543417c0289090a5eefb2d6fcd521fc", null ], + [ "DrawBlockCircle", "group__dom.html#ac3977d4b06ca96ff799a3b72437c8a0b", null ], + [ "DrawBlockCircle", "group__dom.html#a685bec108334c6a43ceb5ca8a0666cd7", null ], + [ "DrawBlockCircle", "group__dom.html#ab2bf509dc9519bd9f76a7721b5b152bf", null ], + [ "DrawBlockCircleFilled", "group__dom.html#acffdcd5bae224992e155facb0baf4119", null ], + [ "DrawBlockCircleFilled", "group__dom.html#a60a31c3685d296333e594feb8ec04c48", null ], + [ "DrawBlockCircleFilled", "group__dom.html#a70cd877698afe354ca070c6b93ef3847", null ], + [ "DrawBlockEllipse", "group__dom.html#a8dd75f2dfc5bef37aa2c8bc8cfaf0579", null ], + [ "DrawBlockEllipse", "group__dom.html#ac53509c067c979cc6ec766b4db8e6e2c", null ], + [ "DrawBlockEllipse", "group__dom.html#a0916ab1d55ac16c158571d135893e88a", null ], + [ "DrawBlockEllipseFilled", "group__dom.html#a78dc3c908f7ce1c30837bd3043f19526", null ], + [ "DrawBlockEllipseFilled", "group__dom.html#aa3f717282aab0cee9835503ef1eb6f1b", null ], + [ "DrawBlockEllipseFilled", "group__dom.html#a616781dd82158e306ebf71d87283e6f8", null ], + [ "DrawText", "group__dom.html#a3791777bd6d3c6f8ff6281efd19a5161", null ], + [ "DrawText", "group__dom.html#a389991302f9a1d5554eff24b48d6b6ec", null ], + [ "DrawText", "group__dom.html#a648ed3b48973ac1dc58ca22d54ecf6af", null ], + [ "DrawPixel", "group__dom.html#afde1b1962124ef417569bef59c6dcdcc", null ], + [ "DrawImage", "group__dom.html#a02b6e8bab532a2c43d3102674e1e1647", null ], + [ "Style", "group__dom.html#ae9e7d3f5b753cf2650057623960d4cb4", null ] +]; \ No newline at end of file diff --git a/group__dom_structftxui_1_1FlexboxConfig.js b/group__dom_structftxui_1_1FlexboxConfig.js new file mode 100644 index 000000000..b164b381a --- /dev/null +++ b/group__dom_structftxui_1_1FlexboxConfig.js @@ -0,0 +1,51 @@ +var group__dom_structftxui_1_1FlexboxConfig = +[ + [ "Direction", "group__dom.html#a224b9163917ac32fc95a60d8c1eec3aa", [ + [ "Row", "group__dom.html#a224b9163917ac32fc95a60d8c1eec3aaaa70367aa7cb74e510f4f9413ccf059d3", null ], + [ "RowInversed", "group__dom.html#a224b9163917ac32fc95a60d8c1eec3aaabba4d6f3a9cec9c96600e3e0d17b9f6a", null ], + [ "Column", "group__dom.html#a224b9163917ac32fc95a60d8c1eec3aaa1976d7f704de389d9fe064e08ea35b2d", null ], + [ "ColumnInversed", "group__dom.html#a224b9163917ac32fc95a60d8c1eec3aaa338df815740895b690c7b07716acda20", null ] + ] ], + [ "Wrap", "group__dom.html#a6c844a611650cf7e956dbe269a0e72ab", [ + [ "NoWrap", "group__dom.html#a6c844a611650cf7e956dbe269a0e72aba93ac740a98eb4cc45b853c780ed16c44", null ], + [ "Wrap", "group__dom.html#a6c844a611650cf7e956dbe269a0e72abaa212b19ef5f2fb30acf92e6cbccc1f2d", null ], + [ "WrapInversed", "group__dom.html#a6c844a611650cf7e956dbe269a0e72abad639e613e3589af04e39135707dbc642", null ] + ] ], + [ "JustifyContent", "group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2", [ + [ "FlexStart", "group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2a8d5898e4f1bd5527306b1f62fa4fd952", null ], + [ "FlexEnd", "group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2a923a60a08f41dc3052190403fc2a6b25", null ], + [ "Center", "group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2a4f1f6016fc9f3f2353c0cc7c67b292bd", null ], + [ "Stretch", "group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2afbb09a82eafab60150d0996e8fe46560", null ], + [ "SpaceBetween", "group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2afa2f3f8f296dcb6e5c287d69eae1c119", null ], + [ "SpaceAround", "group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2aa711fff5f720542ab104aab0805e2565", null ], + [ "SpaceEvenly", "group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2a34ad3eaf7ee60a45210ad60bd731e235", null ] + ] ], + [ "AlignItems", "group__dom.html#a821af961ece5fe13540ad48b54c7a9e7", [ + [ "FlexStart", "group__dom.html#a821af961ece5fe13540ad48b54c7a9e7a8d5898e4f1bd5527306b1f62fa4fd952", null ], + [ "FlexEnd", "group__dom.html#a821af961ece5fe13540ad48b54c7a9e7a923a60a08f41dc3052190403fc2a6b25", null ], + [ "Center", "group__dom.html#a821af961ece5fe13540ad48b54c7a9e7a4f1f6016fc9f3f2353c0cc7c67b292bd", null ], + [ "Stretch", "group__dom.html#a821af961ece5fe13540ad48b54c7a9e7afbb09a82eafab60150d0996e8fe46560", null ] + ] ], + [ "AlignContent", "group__dom.html#a1f99410fd0fc632a5bc2497b6a447420", [ + [ "FlexStart", "group__dom.html#a1f99410fd0fc632a5bc2497b6a447420a8d5898e4f1bd5527306b1f62fa4fd952", null ], + [ "FlexEnd", "group__dom.html#a1f99410fd0fc632a5bc2497b6a447420a923a60a08f41dc3052190403fc2a6b25", null ], + [ "Center", "group__dom.html#a1f99410fd0fc632a5bc2497b6a447420a4f1f6016fc9f3f2353c0cc7c67b292bd", null ], + [ "Stretch", "group__dom.html#a1f99410fd0fc632a5bc2497b6a447420afbb09a82eafab60150d0996e8fe46560", null ], + [ "SpaceBetween", "group__dom.html#a1f99410fd0fc632a5bc2497b6a447420afa2f3f8f296dcb6e5c287d69eae1c119", null ], + [ "SpaceAround", "group__dom.html#a1f99410fd0fc632a5bc2497b6a447420aa711fff5f720542ab104aab0805e2565", null ], + [ "SpaceEvenly", "group__dom.html#a1f99410fd0fc632a5bc2497b6a447420a34ad3eaf7ee60a45210ad60bd731e235", null ] + ] ], + [ "Set", "group__dom.html#ae47b5b0d793d0c2312e4805a1f40012a", null ], + [ "Set", "group__dom.html#a5afe52066ea76ddc7948b77ac155a011", null ], + [ "Set", "group__dom.html#a3de11197951ee3c9037ba7f2a2586a06", null ], + [ "Set", "group__dom.html#a07ef12f61272636369543b34932614f3", null ], + [ "Set", "group__dom.html#a6df4ec3da7d3d2cd0b216f5d2c72cbd6", null ], + [ "SetGap", "group__dom.html#a98d9a43033c09c7f967cdec791408bad", null ], + [ "direction", "group__dom.html#a53421c695d00016ab925777d423b4eb6", null ], + [ "wrap", "group__dom.html#a68b5470ece4f0a492cc1d2057c9bd5e0", null ], + [ "justify_content", "group__dom.html#ab3173252829e796ee1c100b447243748", null ], + [ "align_items", "group__dom.html#a1514fd3d64965c521555fdc2cf2002ce", null ], + [ "align_content", "group__dom.html#a103275cb09167852e469450cf8471256", null ], + [ "gap_x", "group__dom.html#a109ea05d5d6e08d052672465ff8dac61", null ], + [ "gap_y", "group__dom.html#ab01b75a8a9419ec5c47650772f342ba3", null ] +]; \ No newline at end of file diff --git a/group__dom_structftxui_1_1LinearGradient.js b/group__dom_structftxui_1_1LinearGradient.js new file mode 100644 index 000000000..49f75adfe --- /dev/null +++ b/group__dom_structftxui_1_1LinearGradient.js @@ -0,0 +1,12 @@ +var group__dom_structftxui_1_1LinearGradient = +[ + [ "Stop", "structftxui_1_1LinearGradient_1_1Stop.html", "structftxui_1_1LinearGradient_1_1Stop" ], + [ "LinearGradient", "group__dom.html#a5e989e4841fbba91e1714f977c5c58b9", null ], + [ "LinearGradient", "group__dom.html#ac57e39e64c79b5389f234eeaebfbb2fd", null ], + [ "LinearGradient", "group__dom.html#adbf0567cfc8e05051a4236d6541f63b8", null ], + [ "Angle", "group__dom.html#a251d447c54f49914a2cbf5dc16fc8b5b", null ], + [ "Stop", "group__dom.html#a03b10012f78e1c731616ce760d28df40", null ], + [ "Stop", "group__dom.html#ab85b009cd214d3bd1b3bb7f704af0da6", null ], + [ "angle", "group__dom.html#ab8ef1bf8a70cc07c6d55823c390a7e76", null ], + [ "stops", "group__dom.html#a9c56e5fb8075d8a48b1b0c3b4ea31831", null ] +]; \ No newline at end of file diff --git a/group__dom_structftxui_1_1Requirement.js b/group__dom_structftxui_1_1Requirement.js new file mode 100644 index 000000000..b7bf5e3f4 --- /dev/null +++ b/group__dom_structftxui_1_1Requirement.js @@ -0,0 +1,11 @@ +var group__dom_structftxui_1_1Requirement = +[ + [ "Focused", "structftxui_1_1Requirement_1_1Focused.html", "structftxui_1_1Requirement_1_1Focused" ], + [ "min_x", "group__dom.html#a9c8ab844b7e5b610b7a4ac433ea148a1", null ], + [ "min_y", "group__dom.html#a5fb18fec2bc2c10f230d683506bb5a8f", null ], + [ "flex_grow_x", "group__dom.html#a874ced28be7064feaaf97c70c2097bd6", null ], + [ "flex_grow_y", "group__dom.html#a13f6aa7165c63a4494fc2f1ed4428880", null ], + [ "flex_shrink_x", "group__dom.html#ad293f2488e260e36e72fd3da9c16df9a", null ], + [ "flex_shrink_y", "group__dom.html#ab4e07297a2a55de7158ef0115b6b46a9", null ], + [ "focused", "group__dom.html#aa4da656616dd87d4e82a4ee718db6b3c", null ] +]; \ No newline at end of file diff --git a/group__screen.html b/group__screen.html new file mode 100644 index 000000000..a73300520 --- /dev/null +++ b/group__screen.html @@ -0,0 +1,3857 @@ + + + + + + + + +FTXUI: ftxui/screen + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
ftxui/screen
+
+
+

Detailed Description

+

Please check the tutorial of the ftxui/screen module.

+ + + + + +

+Namespaces

namespace  ftxui::Dimension
 Define how the Screen's dimensions should look like.
 
+ + + + + + + + + + + + + + + + + + + + + + +

+Classes

struct  Box
 Box is a structure that represents a rectangular area in a 2D space. More...
 
class  Color
 Color is a class that represents a color in the terminal user interface. More...
 
struct  ColorInfo
 ColorInfo is a structure that contains information about the terminal color palette. More...
 
class  Image
 A rectangular grid of Pixel. More...
 
struct  Pixel
 A Unicode character and its associated style. More...
 
class  Screen
 A rectangular grid of Pixel. More...
 
struct  Dimensions
 Dimensions is a structure that represents the size of the terminal. More...
 
+ + + + +

+Enumerations

enum  Color {
+  Palette1 +,
+  Palette16 +,
+  Palette256 +,
+  TrueColor +
+ }
 Color is an enumeration that represents the color support of the terminal. More...
 
+ + + + + + + +

+Functions

Dimensions Size ()
 Get the terminal size.
 
Color ColorSupport ()
 Get the color support of the terminal.
 
+

Class Documentation

+ +

◆ ftxui::Box

+ +
+
+ + + + +
struct ftxui::Box
+
+

Box is a structure that represents a rectangular area in a 2D space.

+

It is defined by its minimum and maximum coordinates along the x and y axes. Note that the coordinates are inclusive, meaning that the box includes both the minimum and maximum values.

+ +

Definition at line 16 of file box.hpp.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

void Shift (int x, int y)
 
bool Contain (int x, int y) const
 
bool IsEmpty () const
 
bool operator== (const Box &other) const
 
bool operator!= (const Box &other) const
 

Static Public Member Functions

static auto Intersection (Box a, Box b) -> Box
 
static auto Union (Box a, Box b) -> Box
 

Public Attributes

int x_min = 0
 
int x_max = 0
 
int y_min = 0
 
int y_max = 0
 
+

Member Function Documentation

+ +

◆ Intersection()

+ +
+
+ + + + + +
+ + + + + + + + + + + +
Box Intersection (Box a,
Box b ) -> Box
+
+static
+
+
Returns
the biggest Box contained in both |a| and |b|.
+ +

Definition at line 11 of file box.cpp.

+ +
+
+ +

◆ Union()

+ +
+
+ + + + + +
+ + + + + + + + + + + +
Box Union (Box a,
Box b ) -> Box
+
+static
+
+
Returns
the smallest Box containing both |a| and |b|.
+ +

Definition at line 22 of file box.cpp.

+ +
+
+ +

◆ Shift()

+ +
+
+ + + + + + + + + + + +
void Shift (int x,
int y )
+
+

Shift the box by (x,y).

Parameters
+ + + +
xhorizontal shift.
yvertical shift.
+
+
+ +

Definition at line 34 of file box.cpp.

+ +
+
+ +

◆ Contain()

+ +
+
+ + + + + + + + + + + +
bool Contain (int x,
int y ) const
+
+
Returns
whether (x,y) is contained inside the box.
+ +

Definition at line 42 of file box.cpp.

+ +
+
+ +

◆ IsEmpty()

+ +
+
+ + + + + + + +
bool IsEmpty () const
+
+
Returns
whether the box is empty.
+ +

Definition at line 50 of file box.cpp.

+ +
+
+ +

◆ operator==()

+ +
+
+ + + + + + + +
bool operator== (const Box & other) const
+
+
Returns
whether |other| is the same as |this|
+ +

Definition at line 55 of file box.cpp.

+ +
+
+ +

◆ operator!=()

+ +
+
+ + + + + + + +
bool operator!= (const Box & other) const
+
+
Returns
whether |other| and |this| are different.
+ +

Definition at line 61 of file box.cpp.

+ +
+
+

Member Data Documentation

+ +

◆ x_min

+ +
+
+ + + + +
int x_min = 0
+
+ +

Definition at line 17 of file box.hpp.

+ +
+
+ +

◆ x_max

+ +
+
+ + + + +
int x_max = 0
+
+ +

Definition at line 18 of file box.hpp.

+ +
+
+ +

◆ y_min

+ +
+
+ + + + +
int y_min = 0
+
+ +

Definition at line 19 of file box.hpp.

+ +
+
+ +

◆ y_max

+ +
+
+ + + + +
int y_max = 0
+
+ +

Definition at line 20 of file box.hpp.

+ +
+
+ +
+
+ +

◆ ftxui::Color

+ +
+
+ + + + +
class ftxui::Color
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Types

enum  Palette1 : uint8_t { Default + }
 
enum  Palette16 : uint8_t {
+  Black = 0 +,
+  Red = 1 +,
+  Green = 2 +,
+  Yellow = 3 +,
+  Blue = 4 +,
+  Magenta = 5 +,
+  Cyan = 6 +,
+  GrayLight = 7 +,
+  GrayDark = 8 +,
+  RedLight = 9 +,
+  GreenLight = 10 +,
+  YellowLight = 11 +,
+  BlueLight = 12 +,
+  MagentaLight = 13 +,
+  CyanLight = 14 +,
+  White = 15 +
+ }
 
enum  Palette256 : uint8_t {
+  Aquamarine1 = 122 +,
+  Aquamarine1Bis = 86 +,
+  Aquamarine3 = 79 +,
+  Blue1 = 21 +,
+  Blue3 = 19 +,
+  Blue3Bis = 20 +,
+  BlueViolet = 57 +,
+  CadetBlue = 72 +,
+  CadetBlueBis = 73 +,
+  Chartreuse1 = 118 +,
+  Chartreuse2 = 112 +,
+  Chartreuse2Bis = 82 +,
+  Chartreuse3 = 70 +,
+  Chartreuse3Bis = 76 +,
+  Chartreuse4 = 64 +,
+  CornflowerBlue = 69 +,
+  Cornsilk1 = 230 +,
+  Cyan1 = 51 +,
+  Cyan2 = 50 +,
+  Cyan3 = 43 +,
+  DarkBlue = 18 +,
+  DarkCyan = 36 +,
+  DarkGoldenrod = 136 +,
+  DarkGreen = 22 +,
+  DarkKhaki = 143 +,
+  DarkMagenta = 90 +,
+  DarkMagentaBis = 91 +,
+  DarkOliveGreen1 = 191 +,
+  DarkOliveGreen1Bis = 192 +,
+  DarkOliveGreen2 = 155 +,
+  DarkOliveGreen3 = 107 +,
+  DarkOliveGreen3Bis = 113 +,
+  DarkOliveGreen3Ter = 149 +,
+  DarkOrange = 208 +,
+  DarkOrange3 = 130 +,
+  DarkOrange3Bis = 166 +,
+  DarkRed = 52 +,
+  DarkRedBis = 88 +,
+  DarkSeaGreen = 108 +,
+  DarkSeaGreen1 = 158 +,
+  DarkSeaGreen1Bis = 193 +,
+  DarkSeaGreen2 = 151 +,
+  DarkSeaGreen2Bis = 157 +,
+  DarkSeaGreen3 = 115 +,
+  DarkSeaGreen3Bis = 150 +,
+  DarkSeaGreen4 = 65 +,
+  DarkSeaGreen4Bis = 71 +,
+  DarkSlateGray1 = 123 +,
+  DarkSlateGray2 = 87 +,
+  DarkSlateGray3 = 116 +,
+  DarkTurquoise = 44 +,
+  DarkViolet = 128 +,
+  DarkVioletBis = 92 +,
+  DeepPink1 = 198 +,
+  DeepPink1Bis = 199 +,
+  DeepPink2 = 197 +,
+  DeepPink3 = 161 +,
+  DeepPink3Bis = 162 +,
+  DeepPink4 = 125 +,
+  DeepPink4Bis = 89 +,
+  DeepPink4Ter = 53 +,
+  DeepSkyBlue1 = 39 +,
+  DeepSkyBlue2 = 38 +,
+  DeepSkyBlue3 = 31 +,
+  DeepSkyBlue3Bis = 32 +,
+  DeepSkyBlue4 = 23 +,
+  DeepSkyBlue4Bis = 24 +,
+  DeepSkyBlue4Ter = 25 +,
+  DodgerBlue1 = 33 +,
+  DodgerBlue2 = 27 +,
+  DodgerBlue3 = 26 +,
+  Gold1 = 220 +,
+  Gold3 = 142 +,
+  Gold3Bis = 178 +,
+  Green1 = 46 +,
+  Green3 = 34 +,
+  Green3Bis = 40 +,
+  Green4 = 28 +,
+  GreenYellow = 154 +,
+  Grey0 = 16 +,
+  Grey100 = 231 +,
+  Grey11 = 234 +,
+  Grey15 = 235 +,
+  Grey19 = 236 +,
+  Grey23 = 237 +,
+  Grey27 = 238 +,
+  Grey3 = 232 +,
+  Grey30 = 239 +,
+  Grey35 = 240 +,
+  Grey37 = 59 +,
+  Grey39 = 241 +,
+  Grey42 = 242 +,
+  Grey46 = 243 +,
+  Grey50 = 244 +,
+  Grey53 = 102 +,
+  Grey54 = 245 +,
+  Grey58 = 246 +,
+  Grey62 = 247 +,
+  Grey63 = 139 +,
+  Grey66 = 248 +,
+  Grey69 = 145 +,
+  Grey7 = 233 +,
+  Grey70 = 249 +,
+  Grey74 = 250 +,
+  Grey78 = 251 +,
+  Grey82 = 252 +,
+  Grey84 = 188 +,
+  Grey85 = 253 +,
+  Grey89 = 254 +,
+  Grey93 = 255 +,
+  Honeydew2 = 194 +,
+  HotPink = 205 +,
+  HotPink2 = 169 +,
+  HotPink3 = 132 +,
+  HotPink3Bis = 168 +,
+  HotPinkBis = 206 +,
+  IndianRed = 131 +,
+  IndianRed1 = 203 +,
+  IndianRed1Bis = 204 +,
+  IndianRedBis = 167 +,
+  Khaki1 = 228 +,
+  Khaki3 = 185 +,
+  LightCoral = 210 +,
+  LightCyan1Bis = 195 +,
+  LightCyan3 = 152 +,
+  LightGoldenrod1 = 227 +,
+  LightGoldenrod2 = 186 +,
+  LightGoldenrod2Bis = 221 +,
+  LightGoldenrod2Ter = 222 +,
+  LightGoldenrod3 = 179 +,
+  LightGreen = 119 +,
+  LightGreenBis = 120 +,
+  LightPink1 = 217 +,
+  LightPink3 = 174 +,
+  LightPink4 = 95 +,
+  LightSalmon1 = 216 +,
+  LightSalmon3 = 137 +,
+  LightSalmon3Bis = 173 +,
+  LightSeaGreen = 37 +,
+  LightSkyBlue1 = 153 +,
+  LightSkyBlue3 = 109 +,
+  LightSkyBlue3Bis = 110 +,
+  LightSlateBlue = 105 +,
+  LightSlateGrey = 103 +,
+  LightSteelBlue = 147 +,
+  LightSteelBlue1 = 189 +,
+  LightSteelBlue3 = 146 +,
+  LightYellow3 = 187 +,
+  Magenta1 = 201 +,
+  Magenta2 = 165 +,
+  Magenta2Bis = 200 +,
+  Magenta3 = 127 +,
+  Magenta3Bis = 163 +,
+  Magenta3Ter = 164 +,
+  MediumOrchid = 134 +,
+  MediumOrchid1 = 171 +,
+  MediumOrchid1Bis = 207 +,
+  MediumOrchid3 = 133 +,
+  MediumPurple = 104 +,
+  MediumPurple1 = 141 +,
+  MediumPurple2 = 135 +,
+  MediumPurple2Bis = 140 +,
+  MediumPurple3 = 97 +,
+  MediumPurple3Bis = 98 +,
+  MediumPurple4 = 60 +,
+  MediumSpringGreen = 49 +,
+  MediumTurquoise = 80 +,
+  MediumVioletRed = 126 +,
+  MistyRose1 = 224 +,
+  MistyRose3 = 181 +,
+  NavajoWhite1 = 223 +,
+  NavajoWhite3 = 144 +,
+  NavyBlue = 17 +,
+  Orange1 = 214 +,
+  Orange3 = 172 +,
+  Orange4 = 58 +,
+  Orange4Bis = 94 +,
+  OrangeRed1 = 202 +,
+  Orchid = 170 +,
+  Orchid1 = 213 +,
+  Orchid2 = 212 +,
+  PaleGreen1 = 121 +,
+  PaleGreen1Bis = 156 +,
+  PaleGreen3 = 114 +,
+  PaleGreen3Bis = 77 +,
+  PaleTurquoise1 = 159 +,
+  PaleTurquoise4 = 66 +,
+  PaleVioletRed1 = 211 +,
+  Pink1 = 218 +,
+  Pink3 = 175 +,
+  Plum1 = 219 +,
+  Plum2 = 183 +,
+  Plum3 = 176 +,
+  Plum4 = 96 +,
+  Purple = 129 +,
+  Purple3 = 56 +,
+  Purple4 = 54 +,
+  Purple4Bis = 55 +,
+  PurpleBis = 93 +,
+  Red1 = 196 +,
+  Red3 = 124 +,
+  Red3Bis = 160 +,
+  RosyBrown = 138 +,
+  RoyalBlue1 = 63 +,
+  Salmon1 = 209 +,
+  SandyBrown = 215 +,
+  SeaGreen1 = 84 +,
+  SeaGreen1Bis = 85 +,
+  SeaGreen2 = 83 +,
+  SeaGreen3 = 78 +,
+  SkyBlue1 = 117 +,
+  SkyBlue2 = 111 +,
+  SkyBlue3 = 74 +,
+  SlateBlue1 = 99 +,
+  SlateBlue3 = 61 +,
+  SlateBlue3Bis = 62 +,
+  SpringGreen1 = 48 +,
+  SpringGreen2 = 42 +,
+  SpringGreen2Bis = 47 +,
+  SpringGreen3 = 35 +,
+  SpringGreen3Bis = 41 +,
+  SpringGreen4 = 29 +,
+  SteelBlue = 67 +,
+  SteelBlue1 = 75 +,
+  SteelBlue1Bis = 81 +,
+  SteelBlue3 = 68 +,
+  Tan = 180 +,
+  Thistle1 = 225 +,
+  Thistle3 = 182 +,
+  Turquoise2 = 45 +,
+  Turquoise4 = 30 +,
+  Violet = 177 +,
+  Wheat1 = 229 +,
+  Wheat4 = 101 +,
+  Yellow1 = 226 +,
+  Yellow2 = 190 +,
+  Yellow3 = 148 +,
+  Yellow3Bis = 184 +,
+  Yellow4 = 100 +,
+  Yellow4Bis = 106 +
+ }
 

Public Member Functions

 Color ()
 Build a transparent color.
 
 Color (Palette1 index)
 Build a transparent color.
 
 Color (Palette16 index)
 Build a color using the Palette16 colors.
 
 Color (Palette256 index)
 Build a color using Palette256 colors.
 
 Color (uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha=255)
 Build a Color from its RGB representation. https://en.wikipedia.org/wiki/RGB_color_model.
 
bool operator== (const Color &rhs) const
 
bool operator!= (const Color &rhs) const
 
std::string Print (bool is_background_color) const
 
bool IsOpaque () const
 

Static Public Member Functions

static Color RGB (uint8_t red, uint8_t green, uint8_t blue)
 Build a Color from its RGB representation. https://en.wikipedia.org/wiki/RGB_color_model.
 
static Color HSV (uint8_t hue, uint8_t saturation, uint8_t value)
 Build a Color from its HSV representation. https://en.wikipedia.org/wiki/HSL_and_HSV.
 
static Color RGBA (uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha)
 Build a Color from its RGBA representation. https://en.wikipedia.org/wiki/RGB_color_model.
 
static Color HSVA (uint8_t hue, uint8_t saturation, uint8_t value, uint8_t alpha)
 Build a Color from its HSV representation. https://en.wikipedia.org/wiki/HSL_and_HSV.
 
static Color Interpolate (float t, const Color &a, const Color &b)
 
static Color Blend (const Color &lhs, const Color &rhs)
 Blend two colors together using the alpha channel.
 
+

Member Enumeration Documentation

+ +

◆ Palette1

+ +
+
+ + + + +
enum Palette1 : uint8_t
+
+ + +
Enumerator
Default 
+ +

Definition at line 49 of file color.hpp.

+ +
+
+ +

◆ Palette16

+ +
+
+ + + + +
enum Palette16 : uint8_t
+
+ + + + + + + + + + + + + + + + + +
Enumerator
Black 
Red 
Green 
Yellow 
Blue 
Magenta 
Cyan 
GrayLight 
GrayDark 
RedLight 
GreenLight 
YellowLight 
BlueLight 
MagentaLight 
CyanLight 
White 
+ +

Definition at line 53 of file color.hpp.

+ +
+
+ +

◆ Palette256

+ +
+
+ + + + +
enum Palette256 : uint8_t
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Enumerator
Aquamarine1 
Aquamarine1Bis 
Aquamarine3 
Blue1 
Blue3 
Blue3Bis 
BlueViolet 
CadetBlue 
CadetBlueBis 
Chartreuse1 
Chartreuse2 
Chartreuse2Bis 
Chartreuse3 
Chartreuse3Bis 
Chartreuse4 
CornflowerBlue 
Cornsilk1 
Cyan1 
Cyan2 
Cyan3 
DarkBlue 
DarkCyan 
DarkGoldenrod 
DarkGreen 
DarkKhaki 
DarkMagenta 
DarkMagentaBis 
DarkOliveGreen1 
DarkOliveGreen1Bis 
DarkOliveGreen2 
DarkOliveGreen3 
DarkOliveGreen3Bis 
DarkOliveGreen3Ter 
DarkOrange 
DarkOrange3 
DarkOrange3Bis 
DarkRed 
DarkRedBis 
DarkSeaGreen 
DarkSeaGreen1 
DarkSeaGreen1Bis 
DarkSeaGreen2 
DarkSeaGreen2Bis 
DarkSeaGreen3 
DarkSeaGreen3Bis 
DarkSeaGreen4 
DarkSeaGreen4Bis 
DarkSlateGray1 
DarkSlateGray2 
DarkSlateGray3 
DarkTurquoise 
DarkViolet 
DarkVioletBis 
DeepPink1 
DeepPink1Bis 
DeepPink2 
DeepPink3 
DeepPink3Bis 
DeepPink4 
DeepPink4Bis 
DeepPink4Ter 
DeepSkyBlue1 
DeepSkyBlue2 
DeepSkyBlue3 
DeepSkyBlue3Bis 
DeepSkyBlue4 
DeepSkyBlue4Bis 
DeepSkyBlue4Ter 
DodgerBlue1 
DodgerBlue2 
DodgerBlue3 
Gold1 
Gold3 
Gold3Bis 
Green1 
Green3 
Green3Bis 
Green4 
GreenYellow 
Grey0 
Grey100 
Grey11 
Grey15 
Grey19 
Grey23 
Grey27 
Grey3 
Grey30 
Grey35 
Grey37 
Grey39 
Grey42 
Grey46 
Grey50 
Grey53 
Grey54 
Grey58 
Grey62 
Grey63 
Grey66 
Grey69 
Grey7 
Grey70 
Grey74 
Grey78 
Grey82 
Grey84 
Grey85 
Grey89 
Grey93 
Honeydew2 
HotPink 
HotPink2 
HotPink3 
HotPink3Bis 
HotPinkBis 
IndianRed 
IndianRed1 
IndianRed1Bis 
IndianRedBis 
Khaki1 
Khaki3 
LightCoral 
LightCyan1Bis 
LightCyan3 
LightGoldenrod1 
LightGoldenrod2 
LightGoldenrod2Bis 
LightGoldenrod2Ter 
LightGoldenrod3 
LightGreen 
LightGreenBis 
LightPink1 
LightPink3 
LightPink4 
LightSalmon1 
LightSalmon3 
LightSalmon3Bis 
LightSeaGreen 
LightSkyBlue1 
LightSkyBlue3 
LightSkyBlue3Bis 
LightSlateBlue 
LightSlateGrey 
LightSteelBlue 
LightSteelBlue1 
LightSteelBlue3 
LightYellow3 
Magenta1 
Magenta2 
Magenta2Bis 
Magenta3 
Magenta3Bis 
Magenta3Ter 
MediumOrchid 
MediumOrchid1 
MediumOrchid1Bis 
MediumOrchid3 
MediumPurple 
MediumPurple1 
MediumPurple2 
MediumPurple2Bis 
MediumPurple3 
MediumPurple3Bis 
MediumPurple4 
MediumSpringGreen 
MediumTurquoise 
MediumVioletRed 
MistyRose1 
MistyRose3 
NavajoWhite1 
NavajoWhite3 
NavyBlue 
Orange1 
Orange3 
Orange4 
Orange4Bis 
OrangeRed1 
Orchid 
Orchid1 
Orchid2 
PaleGreen1 
PaleGreen1Bis 
PaleGreen3 
PaleGreen3Bis 
PaleTurquoise1 
PaleTurquoise4 
PaleVioletRed1 
Pink1 
Pink3 
Plum1 
Plum2 
Plum3 
Plum4 
Purple 
Purple3 
Purple4 
Purple4Bis 
PurpleBis 
Red1 
Red3 
Red3Bis 
RosyBrown 
RoyalBlue1 
Salmon1 
SandyBrown 
SeaGreen1 
SeaGreen1Bis 
SeaGreen2 
SeaGreen3 
SkyBlue1 
SkyBlue2 
SkyBlue3 
SlateBlue1 
SlateBlue3 
SlateBlue3Bis 
SpringGreen1 
SpringGreen2 
SpringGreen2Bis 
SpringGreen3 
SpringGreen3Bis 
SpringGreen4 
SteelBlue 
SteelBlue1 
SteelBlue1Bis 
SteelBlue3 
Tan 
Thistle1 
Thistle3 
Turquoise2 
Turquoise4 
Violet 
Wheat1 
Wheat4 
Yellow1 
Yellow2 
Yellow3 
Yellow3Bis 
Yellow4 
Yellow4Bis 
+ +

Definition at line 72 of file color.hpp.

+ +
+
+

Constructor & Destructor Documentation

+ +

◆ Color() [1/5]

+ +
+
+ + + + + +
+ + + + + + + +
Color ()
+
+default
+
+ +

Build a transparent color.

+ +
+
+ +

◆ Color() [2/5]

+ +
+
+ + + + + + + +
Color (Palette1 index)
+
+ +

Build a transparent color.

+ +

Definition at line 80 of file screen/color.cpp.

+ +
+
+ +

◆ Color() [3/5]

+ +
+
+ + + + + + + +
Color (Palette16 index)
+
+ +

Build a color using the Palette16 colors.

+ +

Definition at line 83 of file screen/color.cpp.

+ +
+
+ +

◆ Color() [4/5]

+ +
+
+ + + + + + + +
Color (Palette256 index)
+
+ +

Build a color using Palette256 colors.

+ +

Definition at line 87 of file screen/color.cpp.

+ +
+
+ +

◆ Color() [5/5]

+ +
+
+ + + + + + + + + + + + + + + + + + + + + +
Color (uint8_t red,
uint8_t green,
uint8_t blue,
uint8_t alpha = 255 )
+
+ +

Build a Color from its RGB representation. https://en.wikipedia.org/wiki/RGB_color_model.

+
Parameters
+ + + + + +
redThe quantity of red [0,255]
greenThe quantity of green [0,255]
blueThe quantity of blue [0,255]
alphaThe quantity of alpha [0,255]
+
+
+ +

Definition at line 103 of file screen/color.cpp.

+ +
+
+

Member Function Documentation

+ +

◆ RGB()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + +
Color RGB (uint8_t red,
uint8_t green,
uint8_t blue )
+
+static
+
+ +

Build a Color from its RGB representation. https://en.wikipedia.org/wiki/RGB_color_model.

+
Parameters
+ + + + +
redThe quantity of red [0,255]
greenThe quantity of green [0,255]
blueThe quantity of blue [0,255]
+
+
+ +

Definition at line 147 of file screen/color.cpp.

+ +
+
+ +

◆ HSV()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + +
Color HSV (uint8_t h,
uint8_t s,
uint8_t v )
+
+static
+
+ +

Build a Color from its HSV representation. https://en.wikipedia.org/wiki/HSL_and_HSV.

+
Parameters
+ + + + +
hThe hue of the color [0,255]
sThe "colorfulness" [0,255].
vThe "Lightness" [0,255]
+
+
+ +

Definition at line 198 of file screen/color.cpp.

+ +
+
+ +

◆ RGBA()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
Color RGBA (uint8_t red,
uint8_t green,
uint8_t blue,
uint8_t alpha )
+
+static
+
+ +

Build a Color from its RGBA representation. https://en.wikipedia.org/wiki/RGB_color_model.

+
Parameters
+ + + + + +
redThe quantity of red [0,255]
greenThe quantity of green [0,255]
blueThe quantity of blue [0,255]
alphaThe quantity of alpha [0,255]
+
+
+
See also
Color::RGB
+ +

Definition at line 159 of file screen/color.cpp.

+ +
+
+ +

◆ HSVA()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
Color HSVA (uint8_t h,
uint8_t s,
uint8_t v,
uint8_t alpha )
+
+static
+
+ +

Build a Color from its HSV representation. https://en.wikipedia.org/wiki/HSL_and_HSV.

+
Parameters
+ + + + + +
hThe hue of the color [0,255]
sThe "colorfulness" [0,255].
vThe "Lightness" [0,255]
alphaThe quantity of alpha [0,255]
+
+
+ +

Definition at line 171 of file screen/color.cpp.

+ +
+
+ +

◆ Interpolate()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + +
Color Interpolate (float t,
const Color & a,
const Color & b )
+
+static
+
+ +

Definition at line 203 of file screen/color.cpp.

+ +
+
+ +

◆ Blend()

+ +
+
+ + + + + +
+ + + + + + + + + + + +
Color Blend (const Color & lhs,
const Color & rhs )
+
+static
+
+ +

Blend two colors together using the alpha channel.

+ +

Definition at line 272 of file screen/color.cpp.

+ +
+
+ +

◆ operator==()

+ +
+
+ + + + + + + +
bool operator== (const Color & rhs) const
+
+ +

Definition at line 37 of file screen/color.cpp.

+ +
+
+ +

◆ operator!=()

+ +
+
+ + + + + + + +
bool operator!= (const Color & rhs) const
+
+ +

Definition at line 42 of file screen/color.cpp.

+ +
+
+ +

◆ Print()

+ +
+
+ + + + + + + +
std::string Print (bool is_background_color) const
+
+ +

Definition at line 46 of file screen/color.cpp.

+ +
+
+ +

◆ IsOpaque()

+ +
+
+ + + + + +
+ + + + + + + +
bool IsOpaque () const
+
+inline
+
+ +

Definition at line 321 of file color.hpp.

+ +
+
+ +
+
+ +

◆ ftxui::ColorInfo

+ +
+
+ + + + +
struct ftxui::ColorInfo
+
+

ColorInfo is a structure that contains information about the terminal color palette.

+ +

Definition at line 16 of file color_info.hpp.

+
+ + + + + + + + + + + + + + + + + + + +

Public Attributes

const char * name
 
uint8_t index_256
 
uint8_t index_16
 
uint8_t red
 
uint8_t green
 
uint8_t blue
 
uint8_t hue
 
uint8_t saturation
 
uint8_t value
 
+

Member Data Documentation

+ +

◆ name

+ +
+
+ + + + +
const char* name
+
+ +

Definition at line 17 of file color_info.hpp.

+ +
+
+ +

◆ index_256

+ +
+
+ + + + +
uint8_t index_256
+
+ +

Definition at line 18 of file color_info.hpp.

+ +
+
+ +

◆ index_16

+ +
+
+ + + + +
uint8_t index_16
+
+ +

Definition at line 19 of file color_info.hpp.

+ +
+
+ +

◆ red

+ +
+
+ + + + +
uint8_t red
+
+ +

Definition at line 20 of file color_info.hpp.

+ +
+
+ +

◆ green

+ +
+
+ + + + +
uint8_t green
+
+ +

Definition at line 21 of file color_info.hpp.

+ +
+
+ +

◆ blue

+ +
+
+ + + + +
uint8_t blue
+
+ +

Definition at line 22 of file color_info.hpp.

+ +
+
+ +

◆ hue

+ +
+
+ + + + +
uint8_t hue
+
+ +

Definition at line 23 of file color_info.hpp.

+ +
+
+ +

◆ saturation

+ +
+
+ + + + +
uint8_t saturation
+
+ +

Definition at line 24 of file color_info.hpp.

+ +
+
+ +

◆ value

+ +
+
+ + + + +
uint8_t value
+
+ +

Definition at line 25 of file color_info.hpp.

+ +
+
+ +
+
+ +

◆ ftxui::Image

+ +
+
+ + + + +
class ftxui::Image
+
+

A rectangular grid of Pixel.

+ +

Definition at line 17 of file image.hpp.

+
+ + Inheritance diagram for Image:
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

 Image ()=delete
 
 Image (int dimx, int dimy)
 
virtual ~Image ()=default
 
std::string & at (int x, int y)
 Access a character in a cell at a given position.
 
const std::string & at (int x, int y) const
 Access a character in a cell at a given position.
 
PixelPixelAt (int x, int y)
 Access a cell (Pixel) at a given position.
 
const PixelPixelAt (int x, int y) const
 Access a cell (Pixel) at a given position.
 
int dimx () const
 
int dimy () const
 
void Clear ()
 Clear all the pixel from the screen.
 

Public Attributes

Box stencil
 

Protected Attributes

int dimx_
 
int dimy_
 
std::vector< std::vector< Pixel > > pixels_
 
+

Constructor & Destructor Documentation

+ +

◆ Image() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
Image ()
+
+delete
+
+ +
+
+ +

◆ Image() [2/2]

+ +
+
+ + + + + + + + + + + +
Image (int dimx,
int dimy )
+
+ +

Definition at line 20 of file image.cpp.

+ +
+
+ +

◆ ~Image()

+ +
+
+ + + + + +
+ + + + + + + +
virtual ~Image ()
+
+virtualdefault
+
+ +
+
+

Member Function Documentation

+ +

◆ at() [1/2]

+ +
+
+ + + + + + + + + + + +
std::string & at (int x,
int y )
+
+ +

Access a character in a cell at a given position.

+
Parameters
+ + + +
xThe cell position along the x-axis.
yThe cell position along the y-axis.
+
+
+ +

Definition at line 29 of file image.cpp.

+ +
+
+ +

◆ at() [2/2]

+ +
+
+ + + + + + + + + + + +
const std::string & at (int x,
int y ) const
+
+ +

Access a character in a cell at a given position.

+
Parameters
+ + + +
xThe cell position along the x-axis.
yThe cell position along the y-axis.
+
+
+ +

Definition at line 36 of file image.cpp.

+ +
+
+ +

◆ PixelAt() [1/2]

+ +
+
+ + + + + + + + + + + +
Pixel & PixelAt (int x,
int y )
+
+ +

Access a cell (Pixel) at a given position.

+
Parameters
+ + + +
xThe cell position along the x-axis.
yThe cell position along the y-axis.
+
+
+ +

Definition at line 43 of file image.cpp.

+ +
+
+ +

◆ PixelAt() [2/2]

+ +
+
+ + + + + + + + + + + +
const Pixel & PixelAt (int x,
int y ) const
+
+ +

Access a cell (Pixel) at a given position.

+
Parameters
+ + + +
xThe cell position along the x-axis.
yThe cell position along the y-axis.
+
+
+ +

Definition at line 50 of file image.cpp.

+ +
+
+ +

◆ dimx()

+ +
+
+ + + + + +
+ + + + + + + +
int dimx () const
+
+inline
+
+ +

Definition at line 35 of file image.hpp.

+ +
+
+ +

◆ dimy()

+ +
+
+ + + + + +
+ + + + + + + +
int dimy () const
+
+inline
+
+ +

Definition at line 36 of file image.hpp.

+ +
+
+ +

◆ Clear()

+ +
+
+ + + + + + + +
void Clear ()
+
+ +

Clear all the pixel from the screen.

+ +

Definition at line 55 of file image.cpp.

+ +
+
+

Member Data Documentation

+ +

◆ stencil

+ +
+
+ + + + +
Box stencil
+
+ +

Definition at line 41 of file image.hpp.

+ +
+
+ +

◆ dimx_

+ +
+
+ + + + + +
+ + + + +
int dimx_
+
+protected
+
+ +

Definition at line 44 of file image.hpp.

+ +
+
+ +

◆ dimy_

+ +
+
+ + + + + +
+ + + + +
int dimy_
+
+protected
+
+ +

Definition at line 45 of file image.hpp.

+ +
+
+ +

◆ pixels_

+ +
+
+ + + + + +
+ + + + +
std::vector<std::vector<Pixel> > pixels_
+
+protected
+
+ +

Definition at line 46 of file image.hpp.

+ +
+
+ +
+
+ +

◆ ftxui::Pixel

+ +
+
+ + + + +
struct ftxui::Pixel
+
+

A Unicode character and its associated style.

+
Examples
examples/component/canvas_animated.cpp, examples/component/selection.cpp, and examples/dom/canvas.cpp.
+
+ +

Definition at line 15 of file pixel.hpp.

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Member Functions

 Pixel ()
 

Public Attributes

bool blink: 1
 
bool bold: 1
 
bool dim: 1
 
bool italic: 1
 
bool inverted: 1
 
bool underlined: 1
 
bool underlined_double: 1
 
bool strikethrough: 1
 
bool automerge: 1
 
uint8_t hyperlink = 0
 
std::string character = ""
 
Color background_color = Color::Default
 
Color foreground_color = Color::Default
 
+

Constructor & Destructor Documentation

+ +

◆ Pixel()

+ +
+
+ + + + + +
+ + + + + + + +
Pixel ()
+
+inline
+
+ +

Definition at line 16 of file pixel.hpp.

+ +
+
+

Member Data Documentation

+ +

◆ blink

+ +
+
+ + + + +
bool blink
+
+ +

Definition at line 28 of file pixel.hpp.

+ +
+
+ +

◆ bold

+ +
+
+ + + + +
bool bold
+
+
Examples
examples/component/canvas_animated.cpp.
+
+ +

Definition at line 29 of file pixel.hpp.

+ +
+
+ +

◆ dim

+ +
+
+ + + + +
bool dim
+
+ +

Definition at line 30 of file pixel.hpp.

+ +
+
+ +

◆ italic

+ +
+
+ + + + +
bool italic
+
+ +

Definition at line 31 of file pixel.hpp.

+ +
+
+ +

◆ inverted

+ +
+
+ + + + +
bool inverted
+
+ +

Definition at line 32 of file pixel.hpp.

+ +
+
+ +

◆ underlined

+ +
+
+ + + + +
bool underlined
+
+
Examples
examples/component/canvas_animated.cpp, and examples/dom/canvas.cpp.
+
+ +

Definition at line 33 of file pixel.hpp.

+ +
+
+ +

◆ underlined_double

+ +
+
+ + + + +
bool underlined_double
+
+
Examples
examples/component/selection.cpp.
+
+ +

Definition at line 34 of file pixel.hpp.

+ +
+
+ +

◆ strikethrough

+ +
+
+ + + + +
bool strikethrough
+
+ +

Definition at line 35 of file pixel.hpp.

+ +
+
+ +

◆ automerge

+ +
+
+ + + + +
bool automerge
+
+ +

Definition at line 36 of file pixel.hpp.

+ +
+
+ +

◆ hyperlink

+ +
+
+ + + + +
uint8_t hyperlink = 0
+
+ +

Definition at line 41 of file pixel.hpp.

+ +
+
+ +

◆ character

+ +
+
+ + + + +
std::string character = ""
+
+ +

Definition at line 45 of file pixel.hpp.

+ +
+
+ +

◆ background_color

+ +
+
+ + + + +
Color background_color = Color::Default
+
+ +

Definition at line 48 of file pixel.hpp.

+ +
+
+ +

◆ foreground_color

+ +
+
+ + + + +
Color foreground_color = Color::Default
+
+
Examples
examples/component/canvas_animated.cpp, and examples/dom/canvas.cpp.
+
+ +

Definition at line 49 of file pixel.hpp.

+ +
+
+ +
+
+ +

◆ ftxui::Screen

+ +
+
+ + + + +
class ftxui::Screen
+
+

A rectangular grid of Pixel.

+
Examples
examples/dom/gauge.cpp, and examples/dom/gauge_direction.cpp.
+
+ +

Definition at line 26 of file screen.hpp.

+
+ + Inheritance diagram for Screen:
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

Public Types

using SelectionStyle = std::function<void(Pixel&)>
 

Public Member Functions

 Screen (int dimx, int dimy)
 
 ~Screen () override=default
 
std::string ToString () const
 
void Print () const
 
void Clear ()
 Clear all the pixel from the screen.
 
std::string ResetPosition (bool clear=false) const
 Return a string to be printed in order to reset the cursor position to the beginning of the screen.
 
void ApplyShader ()
 
Cursor cursor () const
 
void SetCursor (Cursor cursor)
 
uint8_t RegisterHyperlink (const std::string &link)
 
const std::string & Hyperlink (uint8_t id) const
 
const SelectionStyleGetSelectionStyle () const
 Return the current selection style.
 
void SetSelectionStyle (SelectionStyle decorator)
 Set the current selection style.
 
std::string & at (int x, int y)
 Access a character in a cell at a given position.
 
const std::string & at (int x, int y) const
 Access a character in a cell at a given position.
 
PixelPixelAt (int x, int y)
 Access a cell (Pixel) at a given position.
 
const PixelPixelAt (int x, int y) const
 Access a cell (Pixel) at a given position.
 
int dimx () const
 
int dimy () const
 

Static Public Member Functions

static Screen Create (Dimensions dimension)
 Create a screen with the given dimension.
 
static Screen Create (Dimensions width, Dimensions height)
 Create a screen with the given dimension along the x-axis and y-axis.
 

Public Attributes

Box stencil
 

Protected Attributes

Cursor cursor_
 
std::vector< std::string > hyperlinks_ = {""}
 
SelectionStyle selection_style_
 
int dimx_
 
int dimy_
 
std::vector< std::vector< Pixel > > pixels_
 
+

Member Typedef Documentation

+ +

◆ SelectionStyle

+ +
+
+ + + + +
using SelectionStyle = std::function<void(Pixel&)>
+
+ +

Definition at line 74 of file screen.hpp.

+ +
+
+

Constructor & Destructor Documentation

+ +

◆ Screen()

+ +
+
+ + + + + + + + + + + +
Screen (int dimx,
int dimy )
+
+ +

Definition at line 399 of file screen.cpp.

+ +
+
+ +

◆ ~Screen()

+ +
+
+ + + + + +
+ + + + + + + +
~Screen ()
+
+overridedefault
+
+ +
+
+

Member Function Documentation

+ +

◆ Create() [1/2]

+ +
+
+ + + + + +
+ + + + + + + +
Screen Create (Dimensions dimension)
+
+static
+
+ +

Create a screen with the given dimension.

+ +

Definition at line 395 of file screen.cpp.

+ +
+
+ +

◆ Create() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + +
Screen Create (Dimensions width,
Dimensions height )
+
+static
+
+ +

Create a screen with the given dimension along the x-axis and y-axis.

+ +

Definition at line 389 of file screen.cpp.

+ +
+
+ +

◆ ToString()

+ +
+
+ + + + + + + +
std::string ToString () const
+
+

Produce a std::string that can be used to print the Screen on the terminal.

Note
Don't forget to flush stdout. Alternatively, you can use Screen::Print();
+ +

Definition at line 416 of file screen.cpp.

+ +
+
+ +

◆ Print()

+ +
+
+ + + + + + + +
void Print () const
+
+ +

Definition at line 453 of file screen.cpp.

+ +
+
+ +

◆ Clear()

+ +
+
+ + + + + + + +
void Clear ()
+
+ +

Clear all the pixel from the screen.

+ +

Definition at line 495 of file screen.cpp.

+ +
+
+ +

◆ ResetPosition()

+ +
+
+ + + + + + + +
std::string ResetPosition (bool clear = false) const
+
+ +

Return a string to be printed in order to reset the cursor position to the beginning of the screen.

+
std::string reset_position;
+
while(true) {
+
auto document = render();
+
auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
Render(screen, document);
+
std::cout << reset_position << screen.ToString() << std::flush;
+
reset_position = screen.ResetPosition();
+
+
using namespace std::chrono_literals;
+
std::this_thread::sleep_for(0.01s);
+
}
+
void Render(Screen &screen, const Element &element)
Display an element on a ftxui::Screen.
Definition node.cpp:84
+
static Screen Create(Dimensions dimension)
Create a screen with the given dimension.
Definition screen.cpp:395
+
Returns
The string to print in order to reset the cursor position to the beginning.
+ +

Definition at line 476 of file screen.cpp.

+ +
+
+ +

◆ ApplyShader()

+ +
+
+ + + + + + + +
void ApplyShader ()
+
+ +

Definition at line 507 of file screen.cpp.

+ +
+
+ +

◆ cursor()

+ +
+
+ + + + + +
+ + + + + + + +
Cursor cursor () const
+
+inline
+
+ +

Definition at line 66 of file screen.hpp.

+ +
+
+ +

◆ SetCursor()

+ +
+
+ + + + + +
+ + + + + + + +
void SetCursor (Cursor cursor)
+
+inline
+
+ +

Definition at line 67 of file screen.hpp.

+ +
+
+ +

◆ RegisterHyperlink()

+ +
+
+ + + + + + + +
std::uint8_t RegisterHyperlink (const std::string & link)
+
+ +

Definition at line 534 of file screen.cpp.

+ +
+
+ +

◆ Hyperlink()

+ +
+
+ + + + + + + +
const std::string & Hyperlink (uint8_t id) const
+
+ +

Definition at line 547 of file screen.cpp.

+ +
+
+ +

◆ GetSelectionStyle()

+ +
+
+ + + + + + + +
const Screen::SelectionStyle & GetSelectionStyle () const
+
+ +

Return the current selection style.

+
See also
SetSelectionStyle
+ +

Definition at line 556 of file screen.cpp.

+ +
+
+ +

◆ SetSelectionStyle()

+ +
+
+ + + + + + + +
void SetSelectionStyle (SelectionStyle decorator)
+
+ +

Set the current selection style.

+
See also
GetSelectionStyle
+ +

Definition at line 562 of file screen.cpp.

+ +
+
+ +

◆ at() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + +
std::string & at (int x,
int y )
+
+inherited
+
+ +

Access a character in a cell at a given position.

+
Parameters
+ + + +
xThe cell position along the x-axis.
yThe cell position along the y-axis.
+
+
+ +

Definition at line 29 of file image.cpp.

+ +
+
+ +

◆ at() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + +
const std::string & at (int x,
int y ) const
+
+inherited
+
+ +

Access a character in a cell at a given position.

+
Parameters
+ + + +
xThe cell position along the x-axis.
yThe cell position along the y-axis.
+
+
+ +

Definition at line 36 of file image.cpp.

+ +
+
+ +

◆ PixelAt() [1/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + +
Pixel & PixelAt (int x,
int y )
+
+inherited
+
+ +

Access a cell (Pixel) at a given position.

+
Parameters
+ + + +
xThe cell position along the x-axis.
yThe cell position along the y-axis.
+
+
+ +

Definition at line 43 of file image.cpp.

+ +
+
+ +

◆ PixelAt() [2/2]

+ +
+
+ + + + + +
+ + + + + + + + + + + +
const Pixel & PixelAt (int x,
int y ) const
+
+inherited
+
+ +

Access a cell (Pixel) at a given position.

+
Parameters
+ + + +
xThe cell position along the x-axis.
yThe cell position along the y-axis.
+
+
+ +

Definition at line 50 of file image.cpp.

+ +
+
+ +

◆ dimx()

+ +
+
+ + + + + +
+ + + + + + + +
int dimx () const
+
+inlineinherited
+
+ +

Definition at line 35 of file image.hpp.

+ +
+
+ +

◆ dimy()

+ +
+
+ + + + + +
+ + + + + + + +
int dimy () const
+
+inlineinherited
+
+ +

Definition at line 36 of file image.hpp.

+ +
+
+

Member Data Documentation

+ +

◆ cursor_

+ +
+
+ + + + + +
+ + + + +
Cursor cursor_
+
+protected
+
+ +

Definition at line 79 of file screen.hpp.

+ +
+
+ +

◆ hyperlinks_

+ +
+
+ + + + + +
+ + + + +
std::vector<std::string> hyperlinks_ = {""}
+
+protected
+
+ +

Definition at line 80 of file screen.hpp.

+ +
+
+ +

◆ selection_style_

+ +
+
+ + + + + +
+ + + + +
SelectionStyle selection_style_
+
+protected
+
+Initial value:
= [](Pixel& pixel) {
+
pixel.inverted ^= true;
+
}
+
+

Definition at line 83 of file screen.hpp.

+ +
+
+ +

◆ stencil

+ +
+
+ + + + + +
+ + + + +
Box stencil
+
+inherited
+
+ +

Definition at line 41 of file image.hpp.

+ +
+
+ +

◆ dimx_

+ +
+
+ + + + + +
+ + + + +
int dimx_
+
+protectedinherited
+
+ +

Definition at line 44 of file image.hpp.

+ +
+
+ +

◆ dimy_

+ +
+
+ + + + + +
+ + + + +
int dimy_
+
+protectedinherited
+
+ +

Definition at line 45 of file image.hpp.

+ +
+
+ +

◆ pixels_

+ +
+
+ + + + + +
+ + + + +
std::vector<std::vector<Pixel> > pixels_
+
+protectedinherited
+
+ +

Definition at line 46 of file image.hpp.

+ +
+
+ +
+
+ +

◆ ftxui::Dimensions

+ +
+
+ + + + +
struct ftxui::Dimensions
+
+

Dimensions is a structure that represents the size of the terminal.

+ +

Definition at line 11 of file terminal.hpp.

+
+ + + + + +

Public Attributes

int dimx
 
int dimy
 
+

Member Data Documentation

+ +

◆ dimx

+ +
+
+ + + + +
int dimx
+
+ +

Definition at line 12 of file terminal.hpp.

+ +
+
+ +

◆ dimy

+ +
+
+ + + + +
int dimy
+
+ +

Definition at line 13 of file terminal.hpp.

+ +
+
+ +
+
+

Enumeration Type Documentation

+ +

◆ Color

+ +
+
+ + + + +
enum Color
+
+ +

Color is an enumeration that represents the color support of the terminal.

+ + + + + +
Enumerator
Palette1 
Palette16 
Palette256 
TrueColor 
+ +

Definition at line 23 of file terminal.hpp.

+ +
+
+

Function Documentation

+ +

◆ Size()

+ +
+
+ + + + + + + +
Dimensions Size ()
+
+ +

Get the terminal size.

+
Returns
The terminal size.
+ +

Definition at line 94 of file terminal.cpp.

+ +
+
+ +

◆ ColorSupport()

+ +
+
+ + + + + + + +
Color ColorSupport ()
+
+ +

Get the color support of the terminal.

+ +

Definition at line 130 of file terminal.cpp.

+ +
+
+
+
+ + + + + diff --git a/group__screen.js b/group__screen.js new file mode 100644 index 000000000..8e4c0b22f --- /dev/null +++ b/group__screen.js @@ -0,0 +1,386 @@ +var group__screen = +[ + [ "Box", "group__screen.html#structftxui_1_1Box", [ + [ "Shift", "group__screen.html#a507dad970b4732caab79e5922bdc5fb5", null ], + [ "Contain", "group__screen.html#a2f31c89738607b84e65992a7005d35a9", null ], + [ "IsEmpty", "group__screen.html#a8e12342fc420701fbffd97025421575a", null ], + [ "operator==", "group__screen.html#ad75c695cfa18e51d88a0984af5df2f69", null ], + [ "operator!=", "group__screen.html#a1ff481fa3b55fcc402c98c7564990c17", null ], + [ "x_min", "group__screen.html#ae0951dcafafdc96ac1d8361c672d47e2", null ], + [ "x_max", "group__screen.html#a5f0bb6d8a3e66525c3e6264cb8288e43", null ], + [ "y_min", "group__screen.html#a7941ddc7e35fffb8864af1e922814401", null ], + [ "y_max", "group__screen.html#ad033aea530fbbcf5bcd6cd98d882e3a5", null ] + ] ], + [ "Color", "group__screen.html#classftxui_1_1Color", [ + [ "Palette1", "group__screen.html#aa4be56f94fc180d7b070df23c235b0c7", [ + [ "Default", "group__screen.html#aa4be56f94fc180d7b070df23c235b0c7a79935518a3889663d8688b6b01fff051", null ] + ] ], + [ "Palette16", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802f", [ + [ "Black", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802fac1e9bce8242f443c54c7405223d616cd", null ], + [ "Red", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802fad3163c1fcda01965b692ec2c3122b743", null ], + [ "Green", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802fad0784a3f969fe736e8b271a5a161d106", null ], + [ "Yellow", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802fabf28513245738599d13e3ce36bd16c82", null ], + [ "Blue", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802faf5e09dd1da4088464f264b7a3118bff8", null ], + [ "Magenta", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802fab5059a620e2c7dc57556b1e275c2f9bc", null ], + [ "Cyan", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802fab0d4738f9c7f12049e52aa4e868bdc8b", null ], + [ "GrayLight", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802fadebf1805c024a5504872f795f83a6835", null ], + [ "GrayDark", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802fade3b52f7f38e412815092547cd6e8be7", null ], + [ "RedLight", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802fa0a04dda6f997cd48c0ca74203c501d27", null ], + [ "GreenLight", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802fa9827485e548095e18c65045bc8058ce7", null ], + [ "YellowLight", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802fa7948fe5f055329af04798409b7ac37b5", null ], + [ "BlueLight", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802faf7cc79a56a740e9c59a156b0b3b93cbd", null ], + [ "MagentaLight", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802fa9663f993a3affdf3526fa032cfe5b9f4", null ], + [ "CyanLight", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802fa61bd7f1290cc0a24e565539a61ba5839", null ], + [ "White", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802fab548046646b36c12aa6ba841de500094", null ] + ] ], + [ "Palette256", "group__screen.html#abd07c48f62cc507fafa2486a43130fcf", [ + [ "Aquamarine1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf54d1112226e67ee67339a050ae1b352", null ], + [ "Aquamarine1Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa4db1324d99372274e2414031d1773151", null ], + [ "Aquamarine3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfadc172e17e6f05d6e2b0e48c85803a85a", null ], + [ "Blue1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9eafa8db807f9452108cd02b80cd4adc", null ], + [ "Blue3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa910d98e6c6282c1c8133f53438beb7ca", null ], + [ "Blue3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfabb8f8ef3f352a8a9c884fadff1576b13", null ], + [ "BlueViolet", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfabcd3fa02524f2597996333516267c773", null ], + [ "CadetBlue", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa76906c6e4ac2ee22b81bda5a59e335f1", null ], + [ "CadetBlueBis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfacb5d4e2aebcd3abba4c91d055f07513b", null ], + [ "Chartreuse1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7d2d4cc3af6756a4eac7d12fbe4775d4", null ], + [ "Chartreuse2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa353575e36d1260652eb3d18e73f04cfe", null ], + [ "Chartreuse2Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6338086ae05e58041188d89165d87c1a", null ], + [ "Chartreuse3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2f3df27b5ed05a3e040deec31c684003", null ], + [ "Chartreuse3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2087d90de0840d3f15fad878ba4b4fc4", null ], + [ "Chartreuse4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa734cd2fab3e94385552fc745665bcc98", null ], + [ "CornflowerBlue", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfab4dcc712554f602559b3f9b7662ea4dd", null ], + [ "Cornsilk1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9d7dd269922a0e2fac6366c623ed3d45", null ], + [ "Cyan1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa35e9559f51c82a7adda45276bbedb0f4", null ], + [ "Cyan2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfacc49853d1836ecf3b66c4b8c568aba3f", null ], + [ "Cyan3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7a36fc7d64942362d706fad5544517d1", null ], + [ "DarkBlue", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa4d5c4dd6c3cf0fe617dec801025bd76", null ], + [ "DarkCyan", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa180097c82c1863b9c2f94b41d341c529", null ], + [ "DarkGoldenrod", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfab5d8a9760923e3357c167fc19de8a914", null ], + [ "DarkGreen", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6c1a381d726d9c383c05b9ca12682e4f", null ], + [ "DarkKhaki", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa480194578592f6fc90b8b6a1a1f66e8b", null ], + [ "DarkMagenta", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2ba5febce0999080bcfe1ef92192fe12", null ], + [ "DarkMagentaBis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0e32b2f735ea792ab1d5253d3e631241", null ], + [ "DarkOliveGreen1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa4a1641f09fbb37751ade39859adbcfaa", null ], + [ "DarkOliveGreen1Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa4e0500dd80f0e6f0a2a1a93de953cf86", null ], + [ "DarkOliveGreen2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaad55a68e83744f717a7f83f7a8fd265f", null ], + [ "DarkOliveGreen3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaeca91c2f996796b37a2123515356ded3", null ], + [ "DarkOliveGreen3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfad6dc23b32b2396e59cfc48238fd05bd8", null ], + [ "DarkOliveGreen3Ter", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7a607c03adbcbd4b210fc095272a76a0", null ], + [ "DarkOrange", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2458c6f4cddf4f28bf1285975975b987", null ], + [ "DarkOrange3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa08efc0d59d20277a3c2f01473250108c", null ], + [ "DarkOrange3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa3def467cbbb99502637734c3bd2ce456", null ], + [ "DarkRed", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa556650aa9f007ea0239e66d3ddf26759", null ], + [ "DarkRedBis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa3bcdc58abc2165b0032a207e9d6883d", null ], + [ "DarkSeaGreen", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa380e1f43f086bd475d720c459fcff2a8", null ], + [ "DarkSeaGreen1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaded95d3c0d616d9658b034e9ae705bf5", null ], + [ "DarkSeaGreen1Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa691f28c053f9d2a12db86b8aa396374b", null ], + [ "DarkSeaGreen2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfad5089e0939bbe16ed485053e771e8a68", null ], + [ "DarkSeaGreen2Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfac388011f4493d875983a3c7264e7ded5", null ], + [ "DarkSeaGreen3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa02af538b8573bc9c037822273620864f", null ], + [ "DarkSeaGreen3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7b2765271febec45b933598f18a7ca98", null ], + [ "DarkSeaGreen4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfabda195126fea1b4f0aa6d25513820ca0", null ], + [ "DarkSeaGreen4Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa393410b62bd90565aa0c25e61c92d999", null ], + [ "DarkSlateGray1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfafb40765294d1d25a5ec1ec17d3ee4ae8", null ], + [ "DarkSlateGray2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa29221856aecf72cfe57d5ca2e6d41b42", null ], + [ "DarkSlateGray3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0621f3f774389bc57973bbed3c78b9f7", null ], + [ "DarkTurquoise", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6a5df4f33663381387285b54ee22ab78", null ], + [ "DarkViolet", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0c92c7e17edeca09b7c63c8a783a562f", null ], + [ "DarkVioletBis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9870a3dcf46498ca4a10be946521097d", null ], + [ "DeepPink1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfad05d6a1937a822876238056c449d358a", null ], + [ "DeepPink1Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa65e73df447238ae75a0d07efb65dbe9e", null ], + [ "DeepPink2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaeef51aafc2cd821d225e0da0c53f8e20", null ], + [ "DeepPink3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfafe2c78801538b191a773d879ce8ef205", null ], + [ "DeepPink3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfabff5bbcace3282974cfa06467832cb79", null ], + [ "DeepPink4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf13fb129c07396292da1f7530914f07d", null ], + [ "DeepPink4Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa26e5234f400791a8e9e7850ba7cf6df8", null ], + [ "DeepPink4Ter", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfac8deabe72bda5e1baf1db1ffc1edf966", null ], + [ "DeepSkyBlue1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa601eba969cf1007265ed79e626d49be7", null ], + [ "DeepSkyBlue2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa932fa24051e9217b181a71e7491bb214", null ], + [ "DeepSkyBlue3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa99066355a2c8a3d09741cc7318a41dbc", null ], + [ "DeepSkyBlue3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa8986a4db4b9a9e78822a35345484d23a", null ], + [ "DeepSkyBlue4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0bedec2878fd084bb46dcd7f7dd3b9aa", null ], + [ "DeepSkyBlue4Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfad0cc3282e3ba7e9d833052832a54fdc3", null ], + [ "DeepSkyBlue4Ter", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa98b88c697db6fc8899bee87fa24e86dd", null ], + [ "DodgerBlue1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6902167c73e03c1214dae9265c9a9523", null ], + [ "DodgerBlue2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa4bfe8de454eabc37639b32813912000e", null ], + [ "DodgerBlue3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf82b272abcc583f2c0ac11d6b22c45ca", null ], + [ "Gold1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf02f1d575ceca96dc56df1295a73c007", null ], + [ "Gold3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa96bebc8d90d9444dd8fe563037cc2be2", null ], + [ "Gold3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa7e5b2921c53d39581597da20ce2f338", null ], + [ "Green1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa8db72e307df54b6fd021fd0eff7d5a5f", null ], + [ "Green3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa061b2388532ed2cf150f5ef83646ae2", null ], + [ "Green3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9b41b1aeadc19f83c8292978c1e40af1", null ], + [ "Green4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa36b7f9cbbb6e3d6d5e9df9abcbf348c3", null ], + [ "GreenYellow", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfacd28fdc2094a8c7b0d90e51b38b85533", null ], + [ "Grey0", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2c49667d6b3e650b346c88d7e3fd5590", null ], + [ "Grey100", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa6cbc92ab0733f3e33cf31563dc865c4", null ], + [ "Grey11", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfac449ae3543129be859f6e1f2ea29c8be", null ], + [ "Grey15", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa461a25896feac74f19be7117ae19fefe", null ], + [ "Grey19", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0250546ff32c86258542b95876090e28", null ], + [ "Grey23", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfad715d2046e5e2d3b6bb6e2127834c485", null ], + [ "Grey27", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9306e0c6a01240c9fdfab25f3eaa0634", null ], + [ "Grey3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa81c7178d2e73d4fd43861817b9b32c9d", null ], + [ "Grey30", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa2991b68c782e1ce0b7e701e2a8a8298", null ], + [ "Grey35", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa94bb0f2f713f3ab31a7bfd224fe33e7", null ], + [ "Grey37", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa67645d98e45108256aac9234935510e3", null ], + [ "Grey39", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfae50ed802592da7fedcbd76ca96341d89", null ], + [ "Grey42", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa1cb673228bc4530517e8813bec443e7d", null ], + [ "Grey46", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7310f159106d0f63cca0ddf0c1962ff7", null ], + [ "Grey50", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa1228fc714bdb452c1efc4b9754751de7", null ], + [ "Grey53", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7a56c10be7ecd80795860dcdc6eff354", null ], + [ "Grey54", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa660a7e64726c75510f4e1cd1f63ccb09", null ], + [ "Grey58", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa3aaa86564267b4c90a2d6bb966c35f90", null ], + [ "Grey62", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa64ccec5866654552e080a406314c2b0c", null ], + [ "Grey63", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa084969e9df558ecd204bcec54bc9b03", null ], + [ "Grey66", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa1cccb7d918d79a0240c135479d58b2ec", null ], + [ "Grey69", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2ddd20c7af3e7519c138e5dfd06f188c", null ], + [ "Grey7", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9918508956b5ace54699264567757916", null ], + [ "Grey70", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfae828b663bd8be2f7efd8b2f343a06444", null ], + [ "Grey74", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7a54ca8cbf5ee4d7af93f4d08d12c9e3", null ], + [ "Grey78", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa310ea068000acabef43ec4a4b65c3121", null ], + [ "Grey82", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfab890ade13f8f5bff23c313dd9035f7f6", null ], + [ "Grey84", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6539b5d08bbd9bd011bd67aea17cd04f", null ], + [ "Grey85", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa812849e32b590f8a114804f6b8dde0e8", null ], + [ "Grey89", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa3b4692eb62f7c5065c28134769615e0", null ], + [ "Grey93", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa14181b363496871a7c2f91555a6d8a68", null ], + [ "Honeydew2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfacfd861941ef13f197407b7d02deaf617", null ], + [ "HotPink", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfad886c67902578a7336b821b1cb279c4e", null ], + [ "HotPink2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa1b701a7828d1930b59b76d091913e7d1", null ], + [ "HotPink3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa5b9fcd5ea12531a4fb1273743063f49f", null ], + [ "HotPink3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa073af5071fd22b51b77f43766b86d6a5", null ], + [ "HotPinkBis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfac178a78c367fd250556adaa1b9ad4730", null ], + [ "IndianRed", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaddee00c86a353e58b10fb84a0b52481c", null ], + [ "IndianRed1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa46aed3d2538a5e3a7d6ae0f6b116a61a", null ], + [ "IndianRed1Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa4a04ff1096e80fe3d85a78e2ab155873", null ], + [ "IndianRedBis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa8bc829f77e4ff418dcf2efa85a87e329", null ], + [ "Khaki1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa1ee17e1e2f41c0175bd6202e1c345a82", null ], + [ "Khaki3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa3d0d766baf12a67f81a152cabf151f6a", null ], + [ "LightCoral", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa1b3ec93b81f5cfafd6fd2328904ced8", null ], + [ "LightCyan1Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfac98b5a34ad5c17b3544e5c29521adb6a", null ], + [ "LightCyan3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6d6da936c52e5dadcd790ecb07dcbb1a", null ], + [ "LightGoldenrod1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa25d536c972c837da1a4698982d12df00", null ], + [ "LightGoldenrod2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa03fd8d3402a3b6314c737b8d00f65f4b", null ], + [ "LightGoldenrod2Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfabcd883ae7f03e4115b274fba499ce91a", null ], + [ "LightGoldenrod2Ter", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa96e9b3fdf30a2f143cb4bfd844742d71", null ], + [ "LightGoldenrod3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa32e50d1fe92fabe310b25b9400c25cd7", null ], + [ "LightGreen", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6f3bae902f4a1a3b69152ad13382ab18", null ], + [ "LightGreenBis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa33510b83ef8df69f709f38f77e375193", null ], + [ "LightPink1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa07f3153f6b04f8aeb0925d789d79660c", null ], + [ "LightPink3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa253e182f6f26ad7cfae773feb6493c57", null ], + [ "LightPink4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0956f6a62142bbfdf7915d1d9abacb81", null ], + [ "LightSalmon1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa523f5d7969774dd37e38382a9d05e3a4", null ], + [ "LightSalmon3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9b742f7ba68078b409a6fc2bf76de5c4", null ], + [ "LightSalmon3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfacb0ea3d16e515f91b1071099413a36c7", null ], + [ "LightSeaGreen", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6ff417c700a8e53aeb7fe424e89a1cbd", null ], + [ "LightSkyBlue1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa2290ccd3da3d1ea3e508923148ae824", null ], + [ "LightSkyBlue3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa267e864d226cfe79c1a1d3e78fdd7eb5", null ], + [ "LightSkyBlue3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa3a8990dd2aee1e219cc7222528ee8e0c", null ], + [ "LightSlateBlue", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfab7c34cf2bc4382faf2477db06ce68875", null ], + [ "LightSlateGrey", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0789c7e5fa07674a45db810280aac1bb", null ], + [ "LightSteelBlue", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfadf56a107dda30539c38643b744c312bb", null ], + [ "LightSteelBlue1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7daff90c932ad36e146923fced98cb4d", null ], + [ "LightSteelBlue3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf66424457d48a1e9f30467a6b4d9f735", null ], + [ "LightYellow3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa602cbd76a18ddce2b63afa9dcbba0f8e", null ], + [ "Magenta1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa314daa7c2027494055655d34677458b1", null ], + [ "Magenta2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa0270d909214e1a221e1937b3cf406ba", null ], + [ "Magenta2Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfabe530bee1037e2b3a133e8dbc5ffa585", null ], + [ "Magenta3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfad8a4fa649974fb5c836a14496827fdd5", null ], + [ "Magenta3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaef7480a93b72c17e8023e9f7c7944b38", null ], + [ "Magenta3Ter", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfac6ab7a76048a843b6eb86c062c216cab", null ], + [ "MediumOrchid", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9c685ae3aad1eaad70ff070436be85b3", null ], + [ "MediumOrchid1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa13a18f95c27e724ea9a1e7286f42c473", null ], + [ "MediumOrchid1Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa049a7bc19d9cacd4e00232d01f9680e6", null ], + [ "MediumOrchid3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa5d8f598938ed69b4f04b843abfadc88b", null ], + [ "MediumPurple", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa99b482dd24e473ef7ddcbddece67e041", null ], + [ "MediumPurple1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf5552cc28a449506e131c050fef88e89", null ], + [ "MediumPurple2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfac3210de935f096669b79a8575e9c4578", null ], + [ "MediumPurple2Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa50222fd671c2f6a5f81108f8e4b05aa9", null ], + [ "MediumPurple3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6d22ae8ac2c4e98b291f40225a8874e8", null ], + [ "MediumPurple3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2d0fa96a55bf3d9763b465ecbd72566d", null ], + [ "MediumPurple4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfae90010fe78fb7605fc25e5e08f07e596", null ], + [ "MediumSpringGreen", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfae4e73e4c0464a9ded093be857551d290", null ], + [ "MediumTurquoise", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7875d2ea24878490b89176952e9db784", null ], + [ "MediumVioletRed", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa8ca5789305e4c75d51a3acc1f1b8c0a9", null ], + [ "MistyRose1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa11d00787c0df60110d76fc3d098b2c1b", null ], + [ "MistyRose3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfab7afa85f412a5bcede9674099b956a78", null ], + [ "NavajoWhite1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa78e7bd911b2b1619237ec497cd3727a7", null ], + [ "NavajoWhite3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa345621aa87c50e806627e1f4a1e50a2", null ], + [ "NavyBlue", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0358bb70d298b289263c397f49820844", null ], + [ "Orange1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa204b0d328d6009cf3947fee021fd8f9e", null ], + [ "Orange3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa00cd573911b5b30d18a11a33c6fc522b", null ], + [ "Orange4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa89cffa8b9f4fee6609397ae4070f9d6d", null ], + [ "Orange4Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfad2e88ff3a0d3feeec0b894602de2bdf8", null ], + [ "OrangeRed1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa38540818f938e6576a3444b70118dbae", null ], + [ "Orchid", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2a4b392d52ff5f8074a7ddded3984e75", null ], + [ "Orchid1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa8c9438fb930107e9c02fc9418fe1d24a", null ], + [ "Orchid2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfadbf13507a7e98310795b8c59c3ec2f92", null ], + [ "PaleGreen1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa37e5d9f46ab5a7952f9cdf0a3cc8925", null ], + [ "PaleGreen1Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa115628c4a676f43dc9a5791c927e7048", null ], + [ "PaleGreen3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa73f2e82908260a1c80e9cdffd7c80b05", null ], + [ "PaleGreen3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa05657d514246de9444d35bfd78da177d", null ], + [ "PaleTurquoise1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2c1b8b84117604af63923758665c0762", null ], + [ "PaleTurquoise4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfafebf48dd9c5efb72a880db1800b70cb4", null ], + [ "PaleVioletRed1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7b52566a531a122cc807cd5698659f6f", null ], + [ "Pink1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfab1b14b4665532f810353fbd89ba7bf69", null ], + [ "Pink3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa18d97cfab35116e2049378e4410b0563", null ], + [ "Plum1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa3c254e3ced4cbe2836a246270317ac1", null ], + [ "Plum2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa383cc742bb6efae64c17af4b0159f2f1", null ], + [ "Plum3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfab2b302d3a548112c82dbe295f1cace40", null ], + [ "Plum4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa69b6a24bf00f2a9278f12241e176106c", null ], + [ "Purple", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0102772e56e7f068bdb57bf2905f7c09", null ], + [ "Purple3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa3ba6254f6df4ad7c05ee0be4ccd4bce0", null ], + [ "Purple4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfacb508ce5a099dbfa4e04cd59530f7f0c", null ], + [ "Purple4Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa1dfe93e583d4f1a3538c40ce29208e64", null ], + [ "PurpleBis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfae855e26440338753abef27e7b999ce5b", null ], + [ "Red1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa62acd44726f02a17ba2a17c1cf253639", null ], + [ "Red3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa37bd25cf1e1fe1eeb8e4840dbc863dac", null ], + [ "Red3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2925c3081d309e0d11612a0dcd564379", null ], + [ "RosyBrown", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa5104c5c0a54bc5ac1dc83e20c75dbea", null ], + [ "RoyalBlue1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0dbe4adc6031521d77fc91e09f8d3fbf", null ], + [ "Salmon1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa664067df16558f65cc3d46609a03dfab", null ], + [ "SandyBrown", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa64269c060a2fc56cb77c12360cd3a28e", null ], + [ "SeaGreen1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa8e2c9e620d6245638b27d9c1fa2d0545", null ], + [ "SeaGreen1Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7819209c8bfe13fbfcb2cde9a296f7b6", null ], + [ "SeaGreen2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa1b69dc4c281a32346b8d2bab20dd1aef", null ], + [ "SeaGreen3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa5b862c5164d4597b28fba03335a834cf", null ], + [ "SkyBlue1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfac47bacbed84298fdf72215fe2312ce64", null ], + [ "SkyBlue2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa1172e54ed7e62aa4ebcea4b453f5dcc", null ], + [ "SkyBlue3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2dfa52861bc8b2a870e5166e969db2c7", null ], + [ "SlateBlue1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa97807edc577e1d5d3bc271c3a4ced7f4", null ], + [ "SlateBlue3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfae53ce2149f6b9e7da24472b5112f7963", null ], + [ "SlateBlue3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfad477f91096f698a2b266a1bf26cd456b", null ], + [ "SpringGreen1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa8e70ae2a69a90e87e679685d6461b6e8", null ], + [ "SpringGreen2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfac85363887f660b5879e353bac03dab49", null ], + [ "SpringGreen2Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfad038ac30c015021853f183054c51c0c5", null ], + [ "SpringGreen3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa5a87a3e9a8af9561a373ff63e740223e", null ], + [ "SpringGreen3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf19e26246ad6f4e4de44efb6d2b4e1c6", null ], + [ "SpringGreen4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf3817720cb5b18b16b8d6c520a61748e", null ], + [ "SteelBlue", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9224e340e6d918555c68ac2f1dc80b04", null ], + [ "SteelBlue1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa050bb4a5d79a1dac6aae25ce8734c973", null ], + [ "SteelBlue1Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf400af64197a052be4d59c521104cb2a", null ], + [ "SteelBlue3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0a49900e5a03f7545262d90592bfba92", null ], + [ "Tan", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfab492a96cd2b9bb37c81b8451a42889d9", null ], + [ "Thistle1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaaa1937f76b1f6c26f042a5cea129d661", null ], + [ "Thistle3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7e48d71618f8e50aed23876c3103859b", null ], + [ "Turquoise2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0514acacf99b53570d7a2ee25dde1f5a", null ], + [ "Turquoise4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfac0d913fe38afad9dad5a51083ebc1e86", null ], + [ "Violet", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa94a3ee3884eb2af70a2d764a4f06e79d", null ], + [ "Wheat1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2919dbb2ef2f19e560ee2a4f21874373", null ], + [ "Wheat4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa3fee165b16150ce4df5f4fcecca7407", null ], + [ "Yellow1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa18f6dad40423c7708a467fb630f59048", null ], + [ "Yellow2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfac571c9dd674c4e7301b11cee12715bdf", null ], + [ "Yellow3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa64545058cba31bf28f7cc75072664ec2", null ], + [ "Yellow3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa67ae91aade6999e17c552ebe197c3a7f", null ], + [ "Yellow4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfab60ac0c6b49456d0de7ca3388f19862a", null ], + [ "Yellow4Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaaf28e9bd6542c570b963f36620b181f7", null ] + ] ], + [ "Color", "group__screen.html#a1589b83974b42a2f3315624f14c3c92c", null ], + [ "Color", "group__screen.html#a3c93cb793b88256235f17235c9359b35", null ], + [ "Color", "group__screen.html#a55decaa0b2ab846729582f5f7b6acb49", null ], + [ "Color", "group__screen.html#a4f2602aacaf27a6482580fea0f7de0d2", null ], + [ "Color", "group__screen.html#a92d70d7572b7a07d2af4ff650e272e08", null ], + [ "operator==", "group__screen.html#a66275ebe4681464e082660fa6be9ba28", null ], + [ "operator!=", "group__screen.html#a5db052159bd2c738ea453d9b9600513a", null ], + [ "Print", "group__screen.html#acfe358aa128835387b6c2b7ffe22bab5", null ], + [ "IsOpaque", "group__screen.html#a74deffc6b6c7e07b3ec67766ff35abba", null ] + ] ], + [ "ColorInfo", "group__screen.html#structftxui_1_1ColorInfo", [ + [ "name", "group__screen.html#a8f8f80d37794cde9472343e4487ba3eb", null ], + [ "index_256", "group__screen.html#aacf9c9496e5d01c2fe30337791f33840", null ], + [ "index_16", "group__screen.html#a6259df4cdd9a7cae286f46a471e9afa5", null ], + [ "red", "group__screen.html#ad47d918910aaa51c73160ac85999d09c", null ], + [ "green", "group__screen.html#a90d21fa503b626c00cdc8d94863d5877", null ], + [ "blue", "group__screen.html#a287b397e90d7b995c81ff54e741f96b2", null ], + [ "hue", "group__screen.html#ad7b7eb0b3e04af91bdd64715226c3c68", null ], + [ "saturation", "group__screen.html#a4769b22557e2bcd3edbc69f2caaf691f", null ], + [ "value", "group__screen.html#a638e4503e0ae6ce655b7ad2e17e8f0ad", null ] + ] ], + [ "Image", "group__screen.html#classftxui_1_1Image", [ + [ "Image", "group__screen.html#a7c483c751b9c859ef08cecb32f1d1994", null ], + [ "Image", "group__screen.html#aecbd97261c37fa89ea6df7ccaba216c3", null ], + [ "~Image", "group__screen.html#af7348fef7a61244855ed83dfb1fcbfa1", null ], + [ "at", "group__screen.html#a55b0a995463c6936efb33391f29565bc", null ], + [ "at", "group__screen.html#a0882d58bb8ca1be9953135338456cf9e", null ], + [ "PixelAt", "group__screen.html#a483f8ee1967e200cfc9e277b3ce00174", null ], + [ "PixelAt", "group__screen.html#a03b2b39bb8f4d72068744776093125b3", null ], + [ "dimx", "group__screen.html#ae7a460c9dacd70ed81b1adfea46b492e", null ], + [ "dimy", "group__screen.html#a0d283cfb1ec16b3fc13d344ebfea93d4", null ], + [ "Clear", "group__screen.html#aa71d36872f416feaa853788a7a7a7ef8", null ], + [ "stencil", "group__screen.html#a92cacd07ba30909855f19edc01192ff0", null ], + [ "dimx_", "group__screen.html#a1b254c3faacd432c325efff4268ca683", null ], + [ "dimy_", "group__screen.html#a9e9d5df4b41aaa5eca27cdcaca6d4574", null ], + [ "pixels_", "group__screen.html#aeab8c1788b3f2c7403749c3be95a68ae", null ] + ] ], + [ "Pixel", "group__screen.html#structftxui_1_1Pixel", [ + [ "Pixel", "group__screen.html#a3d22dc2630f1c1c69ec973cd4648b5d5", null ], + [ "blink", "group__screen.html#a399ff0c757d88aeaa2439212f073f380", null ], + [ "bold", "group__screen.html#a7a210a24d67146bd143c013d1da0f2dd", null ], + [ "dim", "group__screen.html#a3cecb006e0ca185024cd89f9ea2ea69a", null ], + [ "italic", "group__screen.html#ad3c22ba2f55e1f2b3087e9ad2d1ea36e", null ], + [ "inverted", "group__screen.html#a19bbb3c355941d56eccf70be7f7ed9e1", null ], + [ "underlined", "group__screen.html#a7c8849e8321ea248cd4991ea8ef198eb", null ], + [ "underlined_double", "group__screen.html#afe0ea73f380e746092213b879003afd6", null ], + [ "strikethrough", "group__screen.html#a21fbeba389ccf8f76447c7a73ead8db2", null ], + [ "automerge", "group__screen.html#ada8b6dbd466ba5b6c4b240f229bd627f", null ], + [ "hyperlink", "group__screen.html#a071ab11cf7706c7800281716177c88e3", null ], + [ "character", "group__screen.html#a3bbcd6a381555ea201dbe4251a9aafb3", null ], + [ "background_color", "group__screen.html#a3af4612678da78558adccf47e17164bb", null ], + [ "foreground_color", "group__screen.html#a2ce82adc1d02baf22df658b903dcb351", null ] + ] ], + [ "Screen", "group__screen.html#classftxui_1_1Screen", [ + [ "Cursor", "structftxui_1_1Screen_1_1Cursor.html", [ + [ "Shape", "structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37c", [ + [ "Hidden", "structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37cacf46e529658ebc6532c204f3246929f4", null ], + [ "BlockBlinking", "structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37ca2f4a0b3cacb4468d8467dc0746ea23aa", null ], + [ "Block", "structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37caa00f801460e81f86eab56d86fe627551", null ], + [ "UnderlineBlinking", "structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37cad7df11ee39d53d4ee2da1b22b2238abc", null ], + [ "Underline", "structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37caa909c5f2b588ba35fcc40b3b504ad2ed", null ], + [ "BarBlinking", "structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37cae7dfc08d4e90b88e0cb1cea7a54796c1", null ], + [ "Bar", "structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37ca6424dbda22da2f105580d1c8095600d3", null ] + ] ], + [ "x", "structftxui_1_1Screen_1_1Cursor.html#a6150e0515f7202e2fb518f7206ed97dc", null ], + [ "y", "structftxui_1_1Screen_1_1Cursor.html#a0a2f84ed7838f07779ae24c5a9086d33", null ], + [ "shape", "structftxui_1_1Screen_1_1Cursor.html#a8b9f7758a8bd2bef680aeecc40bcfe04", null ] + ] ], + [ "SelectionStyle", "group__screen.html#a0424ec9a980000671f12bfa39fc32273", null ], + [ "Screen", "group__screen.html#a7ecf7c5fb3d90a1620098a60cfafc215", null ], + [ "~Screen", "group__screen.html#a20d80448fe5bd4ce01dcd821d4d67a5b", null ], + [ "ToString", "group__screen.html#a19c380b03cea21d7ac7325136a131ff0", null ], + [ "Print", "group__screen.html#ad93edbe885499a712129356f1ffd506b", null ], + [ "Clear", "group__screen.html#aa71d36872f416feaa853788a7a7a7ef8", null ], + [ "ResetPosition", "group__screen.html#a9677c078c4270afdb7451cdc0b0871d4", null ], + [ "ApplyShader", "group__screen.html#a04d18c0cb0df3ed7a01ca5c3b8711ff7", null ], + [ "cursor", "group__screen.html#a94febaac347b83267ff6a10b7837d612", null ], + [ "SetCursor", "group__screen.html#a1aa24862a3d050b3aea2ade1300d51a7", null ], + [ "RegisterHyperlink", "group__screen.html#a38015a8bc3dda474354ec8a374a6e2de", null ], + [ "Hyperlink", "group__screen.html#a0b55b16969dfccc79195fe61c5ba6d1a", null ], + [ "GetSelectionStyle", "group__screen.html#a056c2ad43affdac744b6907e9ea81463", null ], + [ "SetSelectionStyle", "group__screen.html#aba0d30b90db17d6b7561f704ed63b5e6", null ], + [ "at", "group__screen.html#a55b0a995463c6936efb33391f29565bc", null ], + [ "at", "group__screen.html#a0882d58bb8ca1be9953135338456cf9e", null ], + [ "PixelAt", "group__screen.html#a483f8ee1967e200cfc9e277b3ce00174", null ], + [ "PixelAt", "group__screen.html#a03b2b39bb8f4d72068744776093125b3", null ], + [ "dimx", "group__screen.html#ae7a460c9dacd70ed81b1adfea46b492e", null ], + [ "dimy", "group__screen.html#a0d283cfb1ec16b3fc13d344ebfea93d4", null ], + [ "cursor_", "group__screen.html#a9df9d1ae7ed66857ca987963b2365904", null ], + [ "hyperlinks_", "group__screen.html#acff83d382ef60ad2a0fca3ba68e9397f", null ], + [ "selection_style_", "group__screen.html#ab9f757d5d67255f61e27950be4131be1", null ], + [ "stencil", "group__screen.html#a92cacd07ba30909855f19edc01192ff0", null ], + [ "dimx_", "group__screen.html#a1b254c3faacd432c325efff4268ca683", null ], + [ "dimy_", "group__screen.html#a9e9d5df4b41aaa5eca27cdcaca6d4574", null ], + [ "pixels_", "group__screen.html#aeab8c1788b3f2c7403749c3be95a68ae", null ] + ] ], + [ "Dimensions", "group__screen.html#structftxui_1_1Dimensions", [ + [ "dimx", "group__screen.html#a8b0f6ae031a507c3ffb7bf0eec290d46", null ], + [ "dimy", "group__screen.html#a3a072d6ef9c51d085b44eac70f2edff6", null ] + ] ], + [ "Color", "group__screen.html#gab87bacfdad76e61b9412d7124be44c1c", [ + [ "Palette1", "group__screen.html#ggab87bacfdad76e61b9412d7124be44c1caf8fee1420fe204b3dafbacf27a545c41", null ], + [ "Palette16", "group__screen.html#ggab87bacfdad76e61b9412d7124be44c1cae5a76102d821ec8233fee04273c60349", null ], + [ "Palette256", "group__screen.html#ggab87bacfdad76e61b9412d7124be44c1ca7b88ab2a5c8fe8866c96ea4acb623876", null ], + [ "TrueColor", "group__screen.html#ggab87bacfdad76e61b9412d7124be44c1ca7afd9568e82d523c91b2bfe0cc47be29", null ] + ] ], + [ "Size", "group__screen.html#gad890c37601448c82ed0d5051c29e2f0c", null ], + [ "ColorSupport", "group__screen.html#gae6e034f37aa66cfe4458a8cb6e8fc526", null ] +]; \ No newline at end of file diff --git a/group__screen_classftxui_1_1Color.js b/group__screen_classftxui_1_1Color.js new file mode 100644 index 000000000..b4c2271e0 --- /dev/null +++ b/group__screen_classftxui_1_1Color.js @@ -0,0 +1,275 @@ +var group__screen_classftxui_1_1Color = +[ + [ "Palette1", "group__screen.html#aa4be56f94fc180d7b070df23c235b0c7", [ + [ "Default", "group__screen.html#aa4be56f94fc180d7b070df23c235b0c7a79935518a3889663d8688b6b01fff051", null ] + ] ], + [ "Palette16", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802f", [ + [ "Black", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802fac1e9bce8242f443c54c7405223d616cd", null ], + [ "Red", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802fad3163c1fcda01965b692ec2c3122b743", null ], + [ "Green", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802fad0784a3f969fe736e8b271a5a161d106", null ], + [ "Yellow", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802fabf28513245738599d13e3ce36bd16c82", null ], + [ "Blue", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802faf5e09dd1da4088464f264b7a3118bff8", null ], + [ "Magenta", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802fab5059a620e2c7dc57556b1e275c2f9bc", null ], + [ "Cyan", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802fab0d4738f9c7f12049e52aa4e868bdc8b", null ], + [ "GrayLight", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802fadebf1805c024a5504872f795f83a6835", null ], + [ "GrayDark", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802fade3b52f7f38e412815092547cd6e8be7", null ], + [ "RedLight", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802fa0a04dda6f997cd48c0ca74203c501d27", null ], + [ "GreenLight", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802fa9827485e548095e18c65045bc8058ce7", null ], + [ "YellowLight", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802fa7948fe5f055329af04798409b7ac37b5", null ], + [ "BlueLight", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802faf7cc79a56a740e9c59a156b0b3b93cbd", null ], + [ "MagentaLight", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802fa9663f993a3affdf3526fa032cfe5b9f4", null ], + [ "CyanLight", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802fa61bd7f1290cc0a24e565539a61ba5839", null ], + [ "White", "group__screen.html#ae2b6d9670960e89c66d7b76167a0802fab548046646b36c12aa6ba841de500094", null ] + ] ], + [ "Palette256", "group__screen.html#abd07c48f62cc507fafa2486a43130fcf", [ + [ "Aquamarine1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf54d1112226e67ee67339a050ae1b352", null ], + [ "Aquamarine1Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa4db1324d99372274e2414031d1773151", null ], + [ "Aquamarine3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfadc172e17e6f05d6e2b0e48c85803a85a", null ], + [ "Blue1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9eafa8db807f9452108cd02b80cd4adc", null ], + [ "Blue3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa910d98e6c6282c1c8133f53438beb7ca", null ], + [ "Blue3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfabb8f8ef3f352a8a9c884fadff1576b13", null ], + [ "BlueViolet", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfabcd3fa02524f2597996333516267c773", null ], + [ "CadetBlue", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa76906c6e4ac2ee22b81bda5a59e335f1", null ], + [ "CadetBlueBis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfacb5d4e2aebcd3abba4c91d055f07513b", null ], + [ "Chartreuse1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7d2d4cc3af6756a4eac7d12fbe4775d4", null ], + [ "Chartreuse2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa353575e36d1260652eb3d18e73f04cfe", null ], + [ "Chartreuse2Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6338086ae05e58041188d89165d87c1a", null ], + [ "Chartreuse3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2f3df27b5ed05a3e040deec31c684003", null ], + [ "Chartreuse3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2087d90de0840d3f15fad878ba4b4fc4", null ], + [ "Chartreuse4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa734cd2fab3e94385552fc745665bcc98", null ], + [ "CornflowerBlue", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfab4dcc712554f602559b3f9b7662ea4dd", null ], + [ "Cornsilk1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9d7dd269922a0e2fac6366c623ed3d45", null ], + [ "Cyan1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa35e9559f51c82a7adda45276bbedb0f4", null ], + [ "Cyan2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfacc49853d1836ecf3b66c4b8c568aba3f", null ], + [ "Cyan3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7a36fc7d64942362d706fad5544517d1", null ], + [ "DarkBlue", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa4d5c4dd6c3cf0fe617dec801025bd76", null ], + [ "DarkCyan", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa180097c82c1863b9c2f94b41d341c529", null ], + [ "DarkGoldenrod", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfab5d8a9760923e3357c167fc19de8a914", null ], + [ "DarkGreen", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6c1a381d726d9c383c05b9ca12682e4f", null ], + [ "DarkKhaki", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa480194578592f6fc90b8b6a1a1f66e8b", null ], + [ "DarkMagenta", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2ba5febce0999080bcfe1ef92192fe12", null ], + [ "DarkMagentaBis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0e32b2f735ea792ab1d5253d3e631241", null ], + [ "DarkOliveGreen1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa4a1641f09fbb37751ade39859adbcfaa", null ], + [ "DarkOliveGreen1Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa4e0500dd80f0e6f0a2a1a93de953cf86", null ], + [ "DarkOliveGreen2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaad55a68e83744f717a7f83f7a8fd265f", null ], + [ "DarkOliveGreen3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaeca91c2f996796b37a2123515356ded3", null ], + [ "DarkOliveGreen3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfad6dc23b32b2396e59cfc48238fd05bd8", null ], + [ "DarkOliveGreen3Ter", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7a607c03adbcbd4b210fc095272a76a0", null ], + [ "DarkOrange", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2458c6f4cddf4f28bf1285975975b987", null ], + [ "DarkOrange3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa08efc0d59d20277a3c2f01473250108c", null ], + [ "DarkOrange3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa3def467cbbb99502637734c3bd2ce456", null ], + [ "DarkRed", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa556650aa9f007ea0239e66d3ddf26759", null ], + [ "DarkRedBis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa3bcdc58abc2165b0032a207e9d6883d", null ], + [ "DarkSeaGreen", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa380e1f43f086bd475d720c459fcff2a8", null ], + [ "DarkSeaGreen1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaded95d3c0d616d9658b034e9ae705bf5", null ], + [ "DarkSeaGreen1Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa691f28c053f9d2a12db86b8aa396374b", null ], + [ "DarkSeaGreen2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfad5089e0939bbe16ed485053e771e8a68", null ], + [ "DarkSeaGreen2Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfac388011f4493d875983a3c7264e7ded5", null ], + [ "DarkSeaGreen3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa02af538b8573bc9c037822273620864f", null ], + [ "DarkSeaGreen3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7b2765271febec45b933598f18a7ca98", null ], + [ "DarkSeaGreen4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfabda195126fea1b4f0aa6d25513820ca0", null ], + [ "DarkSeaGreen4Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa393410b62bd90565aa0c25e61c92d999", null ], + [ "DarkSlateGray1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfafb40765294d1d25a5ec1ec17d3ee4ae8", null ], + [ "DarkSlateGray2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa29221856aecf72cfe57d5ca2e6d41b42", null ], + [ "DarkSlateGray3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0621f3f774389bc57973bbed3c78b9f7", null ], + [ "DarkTurquoise", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6a5df4f33663381387285b54ee22ab78", null ], + [ "DarkViolet", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0c92c7e17edeca09b7c63c8a783a562f", null ], + [ "DarkVioletBis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9870a3dcf46498ca4a10be946521097d", null ], + [ "DeepPink1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfad05d6a1937a822876238056c449d358a", null ], + [ "DeepPink1Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa65e73df447238ae75a0d07efb65dbe9e", null ], + [ "DeepPink2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaeef51aafc2cd821d225e0da0c53f8e20", null ], + [ "DeepPink3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfafe2c78801538b191a773d879ce8ef205", null ], + [ "DeepPink3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfabff5bbcace3282974cfa06467832cb79", null ], + [ "DeepPink4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf13fb129c07396292da1f7530914f07d", null ], + [ "DeepPink4Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa26e5234f400791a8e9e7850ba7cf6df8", null ], + [ "DeepPink4Ter", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfac8deabe72bda5e1baf1db1ffc1edf966", null ], + [ "DeepSkyBlue1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa601eba969cf1007265ed79e626d49be7", null ], + [ "DeepSkyBlue2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa932fa24051e9217b181a71e7491bb214", null ], + [ "DeepSkyBlue3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa99066355a2c8a3d09741cc7318a41dbc", null ], + [ "DeepSkyBlue3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa8986a4db4b9a9e78822a35345484d23a", null ], + [ "DeepSkyBlue4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0bedec2878fd084bb46dcd7f7dd3b9aa", null ], + [ "DeepSkyBlue4Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfad0cc3282e3ba7e9d833052832a54fdc3", null ], + [ "DeepSkyBlue4Ter", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa98b88c697db6fc8899bee87fa24e86dd", null ], + [ "DodgerBlue1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6902167c73e03c1214dae9265c9a9523", null ], + [ "DodgerBlue2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa4bfe8de454eabc37639b32813912000e", null ], + [ "DodgerBlue3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf82b272abcc583f2c0ac11d6b22c45ca", null ], + [ "Gold1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf02f1d575ceca96dc56df1295a73c007", null ], + [ "Gold3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa96bebc8d90d9444dd8fe563037cc2be2", null ], + [ "Gold3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa7e5b2921c53d39581597da20ce2f338", null ], + [ "Green1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa8db72e307df54b6fd021fd0eff7d5a5f", null ], + [ "Green3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa061b2388532ed2cf150f5ef83646ae2", null ], + [ "Green3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9b41b1aeadc19f83c8292978c1e40af1", null ], + [ "Green4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa36b7f9cbbb6e3d6d5e9df9abcbf348c3", null ], + [ "GreenYellow", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfacd28fdc2094a8c7b0d90e51b38b85533", null ], + [ "Grey0", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2c49667d6b3e650b346c88d7e3fd5590", null ], + [ "Grey100", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa6cbc92ab0733f3e33cf31563dc865c4", null ], + [ "Grey11", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfac449ae3543129be859f6e1f2ea29c8be", null ], + [ "Grey15", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa461a25896feac74f19be7117ae19fefe", null ], + [ "Grey19", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0250546ff32c86258542b95876090e28", null ], + [ "Grey23", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfad715d2046e5e2d3b6bb6e2127834c485", null ], + [ "Grey27", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9306e0c6a01240c9fdfab25f3eaa0634", null ], + [ "Grey3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa81c7178d2e73d4fd43861817b9b32c9d", null ], + [ "Grey30", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa2991b68c782e1ce0b7e701e2a8a8298", null ], + [ "Grey35", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa94bb0f2f713f3ab31a7bfd224fe33e7", null ], + [ "Grey37", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa67645d98e45108256aac9234935510e3", null ], + [ "Grey39", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfae50ed802592da7fedcbd76ca96341d89", null ], + [ "Grey42", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa1cb673228bc4530517e8813bec443e7d", null ], + [ "Grey46", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7310f159106d0f63cca0ddf0c1962ff7", null ], + [ "Grey50", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa1228fc714bdb452c1efc4b9754751de7", null ], + [ "Grey53", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7a56c10be7ecd80795860dcdc6eff354", null ], + [ "Grey54", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa660a7e64726c75510f4e1cd1f63ccb09", null ], + [ "Grey58", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa3aaa86564267b4c90a2d6bb966c35f90", null ], + [ "Grey62", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa64ccec5866654552e080a406314c2b0c", null ], + [ "Grey63", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa084969e9df558ecd204bcec54bc9b03", null ], + [ "Grey66", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa1cccb7d918d79a0240c135479d58b2ec", null ], + [ "Grey69", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2ddd20c7af3e7519c138e5dfd06f188c", null ], + [ "Grey7", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9918508956b5ace54699264567757916", null ], + [ "Grey70", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfae828b663bd8be2f7efd8b2f343a06444", null ], + [ "Grey74", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7a54ca8cbf5ee4d7af93f4d08d12c9e3", null ], + [ "Grey78", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa310ea068000acabef43ec4a4b65c3121", null ], + [ "Grey82", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfab890ade13f8f5bff23c313dd9035f7f6", null ], + [ "Grey84", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6539b5d08bbd9bd011bd67aea17cd04f", null ], + [ "Grey85", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa812849e32b590f8a114804f6b8dde0e8", null ], + [ "Grey89", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa3b4692eb62f7c5065c28134769615e0", null ], + [ "Grey93", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa14181b363496871a7c2f91555a6d8a68", null ], + [ "Honeydew2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfacfd861941ef13f197407b7d02deaf617", null ], + [ "HotPink", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfad886c67902578a7336b821b1cb279c4e", null ], + [ "HotPink2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa1b701a7828d1930b59b76d091913e7d1", null ], + [ "HotPink3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa5b9fcd5ea12531a4fb1273743063f49f", null ], + [ "HotPink3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa073af5071fd22b51b77f43766b86d6a5", null ], + [ "HotPinkBis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfac178a78c367fd250556adaa1b9ad4730", null ], + [ "IndianRed", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaddee00c86a353e58b10fb84a0b52481c", null ], + [ "IndianRed1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa46aed3d2538a5e3a7d6ae0f6b116a61a", null ], + [ "IndianRed1Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa4a04ff1096e80fe3d85a78e2ab155873", null ], + [ "IndianRedBis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa8bc829f77e4ff418dcf2efa85a87e329", null ], + [ "Khaki1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa1ee17e1e2f41c0175bd6202e1c345a82", null ], + [ "Khaki3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa3d0d766baf12a67f81a152cabf151f6a", null ], + [ "LightCoral", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa1b3ec93b81f5cfafd6fd2328904ced8", null ], + [ "LightCyan1Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfac98b5a34ad5c17b3544e5c29521adb6a", null ], + [ "LightCyan3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6d6da936c52e5dadcd790ecb07dcbb1a", null ], + [ "LightGoldenrod1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa25d536c972c837da1a4698982d12df00", null ], + [ "LightGoldenrod2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa03fd8d3402a3b6314c737b8d00f65f4b", null ], + [ "LightGoldenrod2Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfabcd883ae7f03e4115b274fba499ce91a", null ], + [ "LightGoldenrod2Ter", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa96e9b3fdf30a2f143cb4bfd844742d71", null ], + [ "LightGoldenrod3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa32e50d1fe92fabe310b25b9400c25cd7", null ], + [ "LightGreen", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6f3bae902f4a1a3b69152ad13382ab18", null ], + [ "LightGreenBis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa33510b83ef8df69f709f38f77e375193", null ], + [ "LightPink1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa07f3153f6b04f8aeb0925d789d79660c", null ], + [ "LightPink3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa253e182f6f26ad7cfae773feb6493c57", null ], + [ "LightPink4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0956f6a62142bbfdf7915d1d9abacb81", null ], + [ "LightSalmon1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa523f5d7969774dd37e38382a9d05e3a4", null ], + [ "LightSalmon3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9b742f7ba68078b409a6fc2bf76de5c4", null ], + [ "LightSalmon3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfacb0ea3d16e515f91b1071099413a36c7", null ], + [ "LightSeaGreen", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6ff417c700a8e53aeb7fe424e89a1cbd", null ], + [ "LightSkyBlue1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa2290ccd3da3d1ea3e508923148ae824", null ], + [ "LightSkyBlue3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa267e864d226cfe79c1a1d3e78fdd7eb5", null ], + [ "LightSkyBlue3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa3a8990dd2aee1e219cc7222528ee8e0c", null ], + [ "LightSlateBlue", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfab7c34cf2bc4382faf2477db06ce68875", null ], + [ "LightSlateGrey", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0789c7e5fa07674a45db810280aac1bb", null ], + [ "LightSteelBlue", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfadf56a107dda30539c38643b744c312bb", null ], + [ "LightSteelBlue1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7daff90c932ad36e146923fced98cb4d", null ], + [ "LightSteelBlue3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf66424457d48a1e9f30467a6b4d9f735", null ], + [ "LightYellow3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa602cbd76a18ddce2b63afa9dcbba0f8e", null ], + [ "Magenta1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa314daa7c2027494055655d34677458b1", null ], + [ "Magenta2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa0270d909214e1a221e1937b3cf406ba", null ], + [ "Magenta2Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfabe530bee1037e2b3a133e8dbc5ffa585", null ], + [ "Magenta3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfad8a4fa649974fb5c836a14496827fdd5", null ], + [ "Magenta3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaef7480a93b72c17e8023e9f7c7944b38", null ], + [ "Magenta3Ter", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfac6ab7a76048a843b6eb86c062c216cab", null ], + [ "MediumOrchid", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9c685ae3aad1eaad70ff070436be85b3", null ], + [ "MediumOrchid1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa13a18f95c27e724ea9a1e7286f42c473", null ], + [ "MediumOrchid1Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa049a7bc19d9cacd4e00232d01f9680e6", null ], + [ "MediumOrchid3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa5d8f598938ed69b4f04b843abfadc88b", null ], + [ "MediumPurple", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa99b482dd24e473ef7ddcbddece67e041", null ], + [ "MediumPurple1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf5552cc28a449506e131c050fef88e89", null ], + [ "MediumPurple2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfac3210de935f096669b79a8575e9c4578", null ], + [ "MediumPurple2Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa50222fd671c2f6a5f81108f8e4b05aa9", null ], + [ "MediumPurple3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6d22ae8ac2c4e98b291f40225a8874e8", null ], + [ "MediumPurple3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2d0fa96a55bf3d9763b465ecbd72566d", null ], + [ "MediumPurple4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfae90010fe78fb7605fc25e5e08f07e596", null ], + [ "MediumSpringGreen", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfae4e73e4c0464a9ded093be857551d290", null ], + [ "MediumTurquoise", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7875d2ea24878490b89176952e9db784", null ], + [ "MediumVioletRed", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa8ca5789305e4c75d51a3acc1f1b8c0a9", null ], + [ "MistyRose1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa11d00787c0df60110d76fc3d098b2c1b", null ], + [ "MistyRose3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfab7afa85f412a5bcede9674099b956a78", null ], + [ "NavajoWhite1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa78e7bd911b2b1619237ec497cd3727a7", null ], + [ "NavajoWhite3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa345621aa87c50e806627e1f4a1e50a2", null ], + [ "NavyBlue", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0358bb70d298b289263c397f49820844", null ], + [ "Orange1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa204b0d328d6009cf3947fee021fd8f9e", null ], + [ "Orange3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa00cd573911b5b30d18a11a33c6fc522b", null ], + [ "Orange4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa89cffa8b9f4fee6609397ae4070f9d6d", null ], + [ "Orange4Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfad2e88ff3a0d3feeec0b894602de2bdf8", null ], + [ "OrangeRed1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa38540818f938e6576a3444b70118dbae", null ], + [ "Orchid", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2a4b392d52ff5f8074a7ddded3984e75", null ], + [ "Orchid1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa8c9438fb930107e9c02fc9418fe1d24a", null ], + [ "Orchid2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfadbf13507a7e98310795b8c59c3ec2f92", null ], + [ "PaleGreen1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa37e5d9f46ab5a7952f9cdf0a3cc8925", null ], + [ "PaleGreen1Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa115628c4a676f43dc9a5791c927e7048", null ], + [ "PaleGreen3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa73f2e82908260a1c80e9cdffd7c80b05", null ], + [ "PaleGreen3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa05657d514246de9444d35bfd78da177d", null ], + [ "PaleTurquoise1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2c1b8b84117604af63923758665c0762", null ], + [ "PaleTurquoise4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfafebf48dd9c5efb72a880db1800b70cb4", null ], + [ "PaleVioletRed1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7b52566a531a122cc807cd5698659f6f", null ], + [ "Pink1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfab1b14b4665532f810353fbd89ba7bf69", null ], + [ "Pink3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa18d97cfab35116e2049378e4410b0563", null ], + [ "Plum1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa3c254e3ced4cbe2836a246270317ac1", null ], + [ "Plum2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa383cc742bb6efae64c17af4b0159f2f1", null ], + [ "Plum3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfab2b302d3a548112c82dbe295f1cace40", null ], + [ "Plum4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa69b6a24bf00f2a9278f12241e176106c", null ], + [ "Purple", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0102772e56e7f068bdb57bf2905f7c09", null ], + [ "Purple3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa3ba6254f6df4ad7c05ee0be4ccd4bce0", null ], + [ "Purple4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfacb508ce5a099dbfa4e04cd59530f7f0c", null ], + [ "Purple4Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa1dfe93e583d4f1a3538c40ce29208e64", null ], + [ "PurpleBis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfae855e26440338753abef27e7b999ce5b", null ], + [ "Red1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa62acd44726f02a17ba2a17c1cf253639", null ], + [ "Red3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa37bd25cf1e1fe1eeb8e4840dbc863dac", null ], + [ "Red3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2925c3081d309e0d11612a0dcd564379", null ], + [ "RosyBrown", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa5104c5c0a54bc5ac1dc83e20c75dbea", null ], + [ "RoyalBlue1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0dbe4adc6031521d77fc91e09f8d3fbf", null ], + [ "Salmon1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa664067df16558f65cc3d46609a03dfab", null ], + [ "SandyBrown", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa64269c060a2fc56cb77c12360cd3a28e", null ], + [ "SeaGreen1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa8e2c9e620d6245638b27d9c1fa2d0545", null ], + [ "SeaGreen1Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7819209c8bfe13fbfcb2cde9a296f7b6", null ], + [ "SeaGreen2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa1b69dc4c281a32346b8d2bab20dd1aef", null ], + [ "SeaGreen3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa5b862c5164d4597b28fba03335a834cf", null ], + [ "SkyBlue1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfac47bacbed84298fdf72215fe2312ce64", null ], + [ "SkyBlue2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa1172e54ed7e62aa4ebcea4b453f5dcc", null ], + [ "SkyBlue3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2dfa52861bc8b2a870e5166e969db2c7", null ], + [ "SlateBlue1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa97807edc577e1d5d3bc271c3a4ced7f4", null ], + [ "SlateBlue3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfae53ce2149f6b9e7da24472b5112f7963", null ], + [ "SlateBlue3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfad477f91096f698a2b266a1bf26cd456b", null ], + [ "SpringGreen1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa8e70ae2a69a90e87e679685d6461b6e8", null ], + [ "SpringGreen2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfac85363887f660b5879e353bac03dab49", null ], + [ "SpringGreen2Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfad038ac30c015021853f183054c51c0c5", null ], + [ "SpringGreen3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa5a87a3e9a8af9561a373ff63e740223e", null ], + [ "SpringGreen3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf19e26246ad6f4e4de44efb6d2b4e1c6", null ], + [ "SpringGreen4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf3817720cb5b18b16b8d6c520a61748e", null ], + [ "SteelBlue", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9224e340e6d918555c68ac2f1dc80b04", null ], + [ "SteelBlue1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa050bb4a5d79a1dac6aae25ce8734c973", null ], + [ "SteelBlue1Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf400af64197a052be4d59c521104cb2a", null ], + [ "SteelBlue3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0a49900e5a03f7545262d90592bfba92", null ], + [ "Tan", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfab492a96cd2b9bb37c81b8451a42889d9", null ], + [ "Thistle1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaaa1937f76b1f6c26f042a5cea129d661", null ], + [ "Thistle3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7e48d71618f8e50aed23876c3103859b", null ], + [ "Turquoise2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0514acacf99b53570d7a2ee25dde1f5a", null ], + [ "Turquoise4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfac0d913fe38afad9dad5a51083ebc1e86", null ], + [ "Violet", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa94a3ee3884eb2af70a2d764a4f06e79d", null ], + [ "Wheat1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2919dbb2ef2f19e560ee2a4f21874373", null ], + [ "Wheat4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa3fee165b16150ce4df5f4fcecca7407", null ], + [ "Yellow1", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa18f6dad40423c7708a467fb630f59048", null ], + [ "Yellow2", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfac571c9dd674c4e7301b11cee12715bdf", null ], + [ "Yellow3", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa64545058cba31bf28f7cc75072664ec2", null ], + [ "Yellow3Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfa67ae91aade6999e17c552ebe197c3a7f", null ], + [ "Yellow4", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfab60ac0c6b49456d0de7ca3388f19862a", null ], + [ "Yellow4Bis", "group__screen.html#abd07c48f62cc507fafa2486a43130fcfaaf28e9bd6542c570b963f36620b181f7", null ] + ] ], + [ "Color", "group__screen.html#a1589b83974b42a2f3315624f14c3c92c", null ], + [ "Color", "group__screen.html#a3c93cb793b88256235f17235c9359b35", null ], + [ "Color", "group__screen.html#a55decaa0b2ab846729582f5f7b6acb49", null ], + [ "Color", "group__screen.html#a4f2602aacaf27a6482580fea0f7de0d2", null ], + [ "Color", "group__screen.html#a92d70d7572b7a07d2af4ff650e272e08", null ], + [ "operator==", "group__screen.html#a66275ebe4681464e082660fa6be9ba28", null ], + [ "operator!=", "group__screen.html#a5db052159bd2c738ea453d9b9600513a", null ], + [ "Print", "group__screen.html#acfe358aa128835387b6c2b7ffe22bab5", null ], + [ "IsOpaque", "group__screen.html#a74deffc6b6c7e07b3ec67766ff35abba", null ] +]; \ No newline at end of file diff --git a/group__screen_classftxui_1_1Image.js b/group__screen_classftxui_1_1Image.js new file mode 100644 index 000000000..7b4e1cc6d --- /dev/null +++ b/group__screen_classftxui_1_1Image.js @@ -0,0 +1,17 @@ +var group__screen_classftxui_1_1Image = +[ + [ "Image", "group__screen.html#a7c483c751b9c859ef08cecb32f1d1994", null ], + [ "Image", "group__screen.html#aecbd97261c37fa89ea6df7ccaba216c3", null ], + [ "~Image", "group__screen.html#af7348fef7a61244855ed83dfb1fcbfa1", null ], + [ "at", "group__screen.html#a55b0a995463c6936efb33391f29565bc", null ], + [ "at", "group__screen.html#a0882d58bb8ca1be9953135338456cf9e", null ], + [ "PixelAt", "group__screen.html#a483f8ee1967e200cfc9e277b3ce00174", null ], + [ "PixelAt", "group__screen.html#a03b2b39bb8f4d72068744776093125b3", null ], + [ "dimx", "group__screen.html#ae7a460c9dacd70ed81b1adfea46b492e", null ], + [ "dimy", "group__screen.html#a0d283cfb1ec16b3fc13d344ebfea93d4", null ], + [ "Clear", "group__screen.html#aa71d36872f416feaa853788a7a7a7ef8", null ], + [ "stencil", "group__screen.html#a92cacd07ba30909855f19edc01192ff0", null ], + [ "dimx_", "group__screen.html#a1b254c3faacd432c325efff4268ca683", null ], + [ "dimy_", "group__screen.html#a9e9d5df4b41aaa5eca27cdcaca6d4574", null ], + [ "pixels_", "group__screen.html#aeab8c1788b3f2c7403749c3be95a68ae", null ] +]; \ No newline at end of file diff --git a/group__screen_classftxui_1_1Screen.js b/group__screen_classftxui_1_1Screen.js new file mode 100644 index 000000000..c3e0d5d75 --- /dev/null +++ b/group__screen_classftxui_1_1Screen.js @@ -0,0 +1,31 @@ +var group__screen_classftxui_1_1Screen = +[ + [ "Cursor", "structftxui_1_1Screen_1_1Cursor.html", "structftxui_1_1Screen_1_1Cursor" ], + [ "SelectionStyle", "group__screen.html#a0424ec9a980000671f12bfa39fc32273", null ], + [ "Screen", "group__screen.html#a7ecf7c5fb3d90a1620098a60cfafc215", null ], + [ "~Screen", "group__screen.html#a20d80448fe5bd4ce01dcd821d4d67a5b", null ], + [ "ToString", "group__screen.html#a19c380b03cea21d7ac7325136a131ff0", null ], + [ "Print", "group__screen.html#ad93edbe885499a712129356f1ffd506b", null ], + [ "Clear", "group__screen.html#aa71d36872f416feaa853788a7a7a7ef8", null ], + [ "ResetPosition", "group__screen.html#a9677c078c4270afdb7451cdc0b0871d4", null ], + [ "ApplyShader", "group__screen.html#a04d18c0cb0df3ed7a01ca5c3b8711ff7", null ], + [ "cursor", "group__screen.html#a94febaac347b83267ff6a10b7837d612", null ], + [ "SetCursor", "group__screen.html#a1aa24862a3d050b3aea2ade1300d51a7", null ], + [ "RegisterHyperlink", "group__screen.html#a38015a8bc3dda474354ec8a374a6e2de", null ], + [ "Hyperlink", "group__screen.html#a0b55b16969dfccc79195fe61c5ba6d1a", null ], + [ "GetSelectionStyle", "group__screen.html#a056c2ad43affdac744b6907e9ea81463", null ], + [ "SetSelectionStyle", "group__screen.html#aba0d30b90db17d6b7561f704ed63b5e6", null ], + [ "at", "group__screen.html#a55b0a995463c6936efb33391f29565bc", null ], + [ "at", "group__screen.html#a0882d58bb8ca1be9953135338456cf9e", null ], + [ "PixelAt", "group__screen.html#a483f8ee1967e200cfc9e277b3ce00174", null ], + [ "PixelAt", "group__screen.html#a03b2b39bb8f4d72068744776093125b3", null ], + [ "dimx", "group__screen.html#ae7a460c9dacd70ed81b1adfea46b492e", null ], + [ "dimy", "group__screen.html#a0d283cfb1ec16b3fc13d344ebfea93d4", null ], + [ "cursor_", "group__screen.html#a9df9d1ae7ed66857ca987963b2365904", null ], + [ "hyperlinks_", "group__screen.html#acff83d382ef60ad2a0fca3ba68e9397f", null ], + [ "selection_style_", "group__screen.html#ab9f757d5d67255f61e27950be4131be1", null ], + [ "stencil", "group__screen.html#a92cacd07ba30909855f19edc01192ff0", null ], + [ "dimx_", "group__screen.html#a1b254c3faacd432c325efff4268ca683", null ], + [ "dimy_", "group__screen.html#a9e9d5df4b41aaa5eca27cdcaca6d4574", null ], + [ "pixels_", "group__screen.html#aeab8c1788b3f2c7403749c3be95a68ae", null ] +]; \ No newline at end of file diff --git a/group__screen_structftxui_1_1Box.js b/group__screen_structftxui_1_1Box.js new file mode 100644 index 000000000..2c152aa85 --- /dev/null +++ b/group__screen_structftxui_1_1Box.js @@ -0,0 +1,12 @@ +var group__screen_structftxui_1_1Box = +[ + [ "Shift", "group__screen.html#a507dad970b4732caab79e5922bdc5fb5", null ], + [ "Contain", "group__screen.html#a2f31c89738607b84e65992a7005d35a9", null ], + [ "IsEmpty", "group__screen.html#a8e12342fc420701fbffd97025421575a", null ], + [ "operator==", "group__screen.html#ad75c695cfa18e51d88a0984af5df2f69", null ], + [ "operator!=", "group__screen.html#a1ff481fa3b55fcc402c98c7564990c17", null ], + [ "x_min", "group__screen.html#ae0951dcafafdc96ac1d8361c672d47e2", null ], + [ "x_max", "group__screen.html#a5f0bb6d8a3e66525c3e6264cb8288e43", null ], + [ "y_min", "group__screen.html#a7941ddc7e35fffb8864af1e922814401", null ], + [ "y_max", "group__screen.html#ad033aea530fbbcf5bcd6cd98d882e3a5", null ] +]; \ No newline at end of file diff --git a/group__screen_structftxui_1_1ColorInfo.js b/group__screen_structftxui_1_1ColorInfo.js new file mode 100644 index 000000000..9f7d2d883 --- /dev/null +++ b/group__screen_structftxui_1_1ColorInfo.js @@ -0,0 +1,12 @@ +var group__screen_structftxui_1_1ColorInfo = +[ + [ "name", "group__screen.html#a8f8f80d37794cde9472343e4487ba3eb", null ], + [ "index_256", "group__screen.html#aacf9c9496e5d01c2fe30337791f33840", null ], + [ "index_16", "group__screen.html#a6259df4cdd9a7cae286f46a471e9afa5", null ], + [ "red", "group__screen.html#ad47d918910aaa51c73160ac85999d09c", null ], + [ "green", "group__screen.html#a90d21fa503b626c00cdc8d94863d5877", null ], + [ "blue", "group__screen.html#a287b397e90d7b995c81ff54e741f96b2", null ], + [ "hue", "group__screen.html#ad7b7eb0b3e04af91bdd64715226c3c68", null ], + [ "saturation", "group__screen.html#a4769b22557e2bcd3edbc69f2caaf691f", null ], + [ "value", "group__screen.html#a638e4503e0ae6ce655b7ad2e17e8f0ad", null ] +]; \ No newline at end of file diff --git a/group__screen_structftxui_1_1Dimensions.js b/group__screen_structftxui_1_1Dimensions.js new file mode 100644 index 000000000..a4d8545be --- /dev/null +++ b/group__screen_structftxui_1_1Dimensions.js @@ -0,0 +1,5 @@ +var group__screen_structftxui_1_1Dimensions = +[ + [ "dimx", "group__screen.html#a8b0f6ae031a507c3ffb7bf0eec290d46", null ], + [ "dimy", "group__screen.html#a3a072d6ef9c51d085b44eac70f2edff6", null ] +]; \ No newline at end of file diff --git a/group__screen_structftxui_1_1Pixel.js b/group__screen_structftxui_1_1Pixel.js new file mode 100644 index 000000000..071564bd9 --- /dev/null +++ b/group__screen_structftxui_1_1Pixel.js @@ -0,0 +1,17 @@ +var group__screen_structftxui_1_1Pixel = +[ + [ "Pixel", "group__screen.html#a3d22dc2630f1c1c69ec973cd4648b5d5", null ], + [ "blink", "group__screen.html#a399ff0c757d88aeaa2439212f073f380", null ], + [ "bold", "group__screen.html#a7a210a24d67146bd143c013d1da0f2dd", null ], + [ "dim", "group__screen.html#a3cecb006e0ca185024cd89f9ea2ea69a", null ], + [ "italic", "group__screen.html#ad3c22ba2f55e1f2b3087e9ad2d1ea36e", null ], + [ "inverted", "group__screen.html#a19bbb3c355941d56eccf70be7f7ed9e1", null ], + [ "underlined", "group__screen.html#a7c8849e8321ea248cd4991ea8ef198eb", null ], + [ "underlined_double", "group__screen.html#afe0ea73f380e746092213b879003afd6", null ], + [ "strikethrough", "group__screen.html#a21fbeba389ccf8f76447c7a73ead8db2", null ], + [ "automerge", "group__screen.html#ada8b6dbd466ba5b6c4b240f229bd627f", null ], + [ "hyperlink", "group__screen.html#a071ab11cf7706c7800281716177c88e3", null ], + [ "character", "group__screen.html#a3bbcd6a381555ea201dbe4251a9aafb3", null ], + [ "background_color", "group__screen.html#a3af4612678da78558adccf47e17164bb", null ], + [ "foreground_color", "group__screen.html#a2ce82adc1d02baf22df658b903dcb351", null ] +]; \ No newline at end of file diff --git a/hbox_8cpp.html b/hbox_8cpp.html new file mode 100644 index 000000000..a39976ddb --- /dev/null +++ b/hbox_8cpp.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: hbox.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
hbox.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+ + + + +

+Functions

Element hbox (Elements children)
 A container displaying elements horizontally one by one.
 
+
+
+ + + + + diff --git a/hbox_8cpp.js b/hbox_8cpp.js new file mode 100644 index 000000000..2d278bbf0 --- /dev/null +++ b/hbox_8cpp.js @@ -0,0 +1,4 @@ +var hbox_8cpp = +[ + [ "hbox", "hbox_8cpp.html#a552ba6d33b3c9bec586b99fba4c243ac", null ] +]; \ No newline at end of file diff --git a/hbox_8cpp_source.html b/hbox_8cpp_source.html new file mode 100644 index 000000000..fb349b5b9 --- /dev/null +++ b/hbox_8cpp_source.html @@ -0,0 +1,322 @@ + + + + + + + + +FTXUI: hbox.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
hbox.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <algorithm> // for max
+
5#include <cstddef> // for size_t
+
6#include <memory> // for __shared_ptr_access, shared_ptr, make_shared, allocator_traits<>::value_type
+
7#include <utility> // for move
+
8#include <vector> // for vector, __alloc_traits<>::value_type
+
9
+
10#include "ftxui/dom/box_helper.hpp" // for Element, Compute
+
11#include "ftxui/dom/elements.hpp" // for Element, Elements, hbox
+
12#include "ftxui/dom/node.hpp" // for Node, Elements
+
13#include "ftxui/dom/requirement.hpp" // for Requirement
+
14#include "ftxui/dom/selection.hpp" // for Selection
+
15#include "ftxui/screen/box.hpp" // for Box
+
16namespace ftxui {
+
17
+
18namespace {
+
19class HBox : public Node {
+
20 public:
+
21 explicit HBox(Elements children) : Node(std::move(children)) {}
+
22
+
23 private:
+
24 void ComputeRequirement() override {
+
25 requirement_ = Requirement{};
+
26
+
27 for (auto& child : children_) {
+
28 child->ComputeRequirement();
+
29
+
30 // Propagate the focused requirement.
+
31 if (requirement_.focused.Prefer(child->requirement().focused)) {
+
32 requirement_.focused = child->requirement().focused;
+
33 requirement_.focused.box.Shift(requirement_.min_x, 0);
+
34 }
+
35
+
36 // Extend the min_x and min_y to contain all the children
+
37 requirement_.min_x += child->requirement().min_x;
+
38 requirement_.min_y =
+
39 std::max(requirement_.min_y, child->requirement().min_y);
+
40 }
+
41 }
+
42
+
43 void SetBox(Box box) override {
+
44 Node::SetBox(box);
+
45
+
46 std::vector<box_helper::Element> elements(children_.size());
+
47 for (size_t i = 0; i < children_.size(); ++i) {
+
48 auto& element = elements[i];
+
49 const auto& requirement = children_[i]->requirement();
+
50 element.min_size = requirement.min_x;
+
51 element.flex_grow = requirement.flex_grow_x;
+
52 element.flex_shrink = requirement.flex_shrink_x;
+
53 }
+
54 const int target_size = box.x_max - box.x_min + 1;
+
55 box_helper::Compute(&elements, target_size);
+
56
+
57 int x = box.x_min;
+
58 for (size_t i = 0; i < children_.size(); ++i) {
+
59 box.x_min = x;
+
60 box.x_max = x + elements[i].size - 1;
+
61 children_[i]->SetBox(box);
+
62 x = box.x_max + 1;
+
63 }
+
64 }
+
65
+
66 void Select(Selection& selection) override {
+
67 // If this Node box_ doesn't intersect with the selection, then no
+
68 // selection.
+
69 if (Box::Intersection(selection.GetBox(), box_).IsEmpty()) {
+
70 return;
+
71 }
+
72
+
73 Selection selection_saturated = selection.SaturateHorizontal(box_);
+
74 for (auto& child : children_) {
+
75 child->Select(selection_saturated);
+
76 }
+
77 }
+
78};
+
79
+
80} // namespace
+
81
+
82/// @brief A container displaying elements horizontally one by one.
+
83/// @param children The elements in the container
+
84/// @return The container.
+
85///
+
86/// #### Example
+
87///
+
88/// ```cpp
+
89/// hbox({
+
90/// text("Left"),
+
91/// text("Right"),
+
92/// });
+
93/// ```
+
+ +
95 return std::make_shared<HBox>(std::move(children));
+
96}
+
+
97
+
98} // namespace ftxui
+ + + +
virtual void SetBox(Box box)
Assign a position and a dimension to an element for drawing.
Definition node.cpp:41
+
static auto Intersection(Box a, Box b) -> Box
Definition box.cpp:11
+
void Compute(std::vector< Element > *elements, int target_size)
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+
Element hbox(Elements)
A container displaying elements horizontally one by one.
Definition hbox.cpp:94
+
std::vector< Element > Elements
Definition elements.hpp:23
+ + + +
+
+ + + + + diff --git a/hflow_8cpp.html b/hflow_8cpp.html new file mode 100644 index 000000000..5c187c70c --- /dev/null +++ b/hflow_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: hflow.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
hflow.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 12 of file hflow.cpp.

+ +
+
+
+
+ + + + + diff --git a/hflow_8cpp.js b/hflow_8cpp.js new file mode 100644 index 000000000..3886a02db --- /dev/null +++ b/hflow_8cpp.js @@ -0,0 +1,4 @@ +var hflow_8cpp = +[ + [ "main", "hflow_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/hflow_8cpp_source.html b/hflow_8cpp_source.html new file mode 100644 index 000000000..ac913a032 --- /dev/null +++ b/hflow_8cpp_source.html @@ -0,0 +1,270 @@ + + + + + + + + +FTXUI: hflow.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
hflow.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <stdio.h> // for getchar
+
5#include <ftxui/dom/elements.hpp> // for operator|, size, Element, text, hcenter, Decorator, Fit, WIDTH, hflow, window, EQUAL, GREATER_THAN, HEIGHT, bold, border, dim, LESS_THAN
+
6#include <ftxui/screen/screen.hpp> // for Full, Screen
+
7#include <string> // for allocator, char_traits, operator+, to_string, string
+
8
+
9#include "ftxui/dom/node.hpp" // for Render
+
10#include "ftxui/screen/color.hpp" // for ftxui
+
11
+
+
12int main() {
+
13 using namespace ftxui;
+
14 auto make_box = [](int dimx, int dimy) {
+
15 std::string title = std::to_string(dimx) + "x" + std::to_string(dimy);
+
16 return window(text(title) | hcenter | bold,
+
17 text("content") | hcenter | dim) |
+
18 size(WIDTH, EQUAL, dimx) | size(HEIGHT, EQUAL, dimy);
+
19 };
+
20
+
21 auto style = size(WIDTH, GREATER_THAN, 20) | border |
+
22 size(HEIGHT, GREATER_THAN, 30) | size(WIDTH, LESS_THAN, 50);
+
23
+
24 auto document = hflow({
+
25 make_box(7, 7),
+
26 make_box(7, 5),
+
27 make_box(5, 7),
+
28 make_box(10, 4),
+
29 make_box(10, 4),
+
30 make_box(10, 4),
+
31 make_box(10, 4),
+
32 make_box(11, 4),
+
33 make_box(11, 4),
+
34 make_box(11, 4),
+
35 make_box(11, 4),
+
36 make_box(12, 4),
+
37 make_box(12, 5),
+
38 make_box(12, 4),
+
39 make_box(13, 4),
+
40 make_box(13, 3),
+
41 make_box(13, 3),
+
42 make_box(10, 3),
+
43 }) |
+
44 style;
+
45
+
46 auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
+
47 Render(screen, document);
+
48 screen.Print();
+
49 getchar();
+
50
+
51 return 0;
+
52}
+
+ + +
Element make_box(int x, int y)
+
int main()
Definition hflow.cpp:12
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/hierarchy.html b/hierarchy.html new file mode 100644 index 000000000..96b1bd990 --- /dev/null +++ b/hierarchy.html @@ -0,0 +1,282 @@ + + + + + + + + +FTXUI: Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Class Hierarchy
+
+
+
+

Go to the graphical class hierarchy

+This inheritance list is sorted roughly, but not completely, alphabetically:
+
[detail level 123]
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
 CConstStringListRef::Adapter
 CAnimatedColorOptionOption about a potentially animated color
 CAnimatedColorsOption
 CAnimationTask
 CAnimator
 CAutoReset< T >Assign a value to a variable, reset its old value when going out of scope
 CBlock
 CBoxBox is a structure that represents a rectangular area in a 2D space
 CButtonOptionOption for the AnimatedButton component
 CCanvasCanvas is a drawable buffer associated with drawing operations
 CCapturedMouseInterface
 CCheckboxOptionOption for the Checkbox component
 CColorColor is a class that represents a color in the terminal user interface
 CColorInfoColorInfo is a structure that contains information about the terminal color palette
 CComponentBaseIt implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ftxui::Event
 CConstRef< T >An adapter. Own or reference an immutable object
 CConstRef< std::string >
 CConstStringRefAn adapter. Own or reference a constant string. For convenience, this class convert multiple immutable string toward a shared representation
 CConstStringListRefAn adapter. Reference a list of strings
 CScreen::Cursor
 CDimensionsDimensions is a structure that represents the size of the terminal
 CDropdownOptionOption for the Dropdown component.A dropdown menu is a checkbox opening/closing a radiobox
 CElement
 CEntryStateArguments for transform from |ButtonOption|, |CheckboxOption|, |RadioboxOption|, |MenuEntryOption|, |MenuOption|
 CEventRepresent an event. It can be key press event, a terminal resize, or more ..
 CFlexboxConfigFlexboxConfig is a configuration structure that defines the layout properties for a flexbox container
 CRequirement::Focused
 CGlobal
 CImageA rectangular grid of Pixel
 CScreenA rectangular grid of Pixel
 CScreenInteractiveScreenInteractive is a Screen that can handle events, run a main loop, and manage components
 CInputOptionOption for the Input component
 CInputStateUsed to define style for the Input component
 CLine
 CLinearGradientA class representing the settings for linear-gradient color effect
 CLoopLoop is a class that manages the event loop for a component
 CMenuEntryOptionOption for the MenuEntry component
 CMenuOptionOption for the Menu component
 CMouseA mouse event. It contains the coordinate of the mouse, the button pressed and the modifier (shift, ctrl, meta)
 CNodeNode is the base class for all elements in the DOM tree
 CNodeDecorator
 CParams
 CPendingTask
 CPixelA Unicode character and its associated style
 CScreenInteractive::Private
 CRadioboxOptionOption for the Radiobox component
 CReceiverImpl< T >
 CRef< T >An adapter. Own or reference an mutable object
 CRef< bool >
 CRef< Direction >
 CRef< int >
 CRef< std::string >
 CStringRefAn adapter. Own or reference a constant string. For convenience, this class convert multiple mutable string toward a shared representation
 CRequirementRequirement is a structure that defines the layout requirements for a Node in the terminal user interface
 CResizableSplitOption
 CSelectionRepresents a selection in a terminal user interface
 CSenderImpl< T >
 CSliderOption< T >
 CNode::Status
 CLinearGradient::Stop
 CTableTable is a utility to draw tables
 CTableSelection
 CTaskQueue
 CTaskRunner
 CTerminalInputParser
 CUnderlineOptionOption for the underline effect
 CWindowOptions
 CWindowRenderStateState passed to the Window component's render function
+
+
+
+ + + + + diff --git a/hierarchy.js b/hierarchy.js new file mode 100644 index 000000000..c4a28023a --- /dev/null +++ b/hierarchy.js @@ -0,0 +1,76 @@ +var hierarchy = +[ + [ "Adapter", "classftxui_1_1ConstStringListRef_1_1Adapter.html", null ], + [ "AnimatedColorOption", "group__component.html#structftxui_1_1AnimatedColorOption", null ], + [ "AnimatedColorsOption", "structftxui_1_1AnimatedColorsOption.html", null ], + [ "AnimationTask", "classftxui_1_1AnimationTask.html", null ], + [ "Animator", "classftxui_1_1animation_1_1Animator.html", null ], + [ "AutoReset< T >", "classftxui_1_1AutoReset.html", null ], + [ "Block", "structftxui_1_1flexbox__helper_1_1Block.html", null ], + [ "Box", "group__screen.html#structftxui_1_1Box", null ], + [ "ButtonOption", "group__component.html#structftxui_1_1ButtonOption", null ], + [ "Canvas", "group__dom.html#structftxui_1_1Canvas", null ], + [ "CapturedMouseInterface", "classftxui_1_1CapturedMouseInterface.html", null ], + [ "CheckboxOption", "group__component.html#structftxui_1_1CheckboxOption", null ], + [ "Color", "group__screen.html#classftxui_1_1Color", null ], + [ "ColorInfo", "group__screen.html#structftxui_1_1ColorInfo", null ], + [ "ComponentBase", "group__component.html#classftxui_1_1ComponentBase", null ], + [ "ConstRef< T >", "classftxui_1_1ConstRef.html", null ], + [ "ConstRef< std::string >", "classftxui_1_1ConstRef.html", [ + [ "ConstStringRef", "classftxui_1_1ConstStringRef.html", null ] + ] ], + [ "ConstStringListRef", "classftxui_1_1ConstStringListRef.html", null ], + [ "Cursor", "structftxui_1_1Screen_1_1Cursor.html", null ], + [ "Dimensions", "group__screen.html#structftxui_1_1Dimensions", null ], + [ "DropdownOption", "group__component.html#structftxui_1_1DropdownOption", null ], + [ "Element", "structftxui_1_1box__helper_1_1Element.html", null ], + [ "EntryState", "structftxui_1_1EntryState.html", null ], + [ "Event", "group__component.html#structftxui_1_1Event", null ], + [ "FlexboxConfig", "group__dom.html#structftxui_1_1FlexboxConfig", null ], + [ "Focused", "structftxui_1_1Requirement_1_1Focused.html", null ], + [ "Global", "structftxui_1_1flexbox__helper_1_1Global.html", null ], + [ "Image", "group__screen.html#classftxui_1_1Image", [ + [ "Screen", "group__screen.html#classftxui_1_1Screen", [ + [ "ScreenInteractive", "group__component.html#classftxui_1_1ScreenInteractive", null ] + ] ] + ] ], + [ "InputOption", "group__component.html#structftxui_1_1InputOption", null ], + [ "InputState", "structftxui_1_1InputState.html", null ], + [ "Line", "structftxui_1_1flexbox__helper_1_1Line.html", null ], + [ "LinearGradient", "group__dom.html#structftxui_1_1LinearGradient", null ], + [ "Loop", "group__component.html#classftxui_1_1Loop", null ], + [ "MenuEntryOption", "group__component.html#structftxui_1_1MenuEntryOption", null ], + [ "MenuOption", "group__component.html#structftxui_1_1MenuOption", null ], + [ "Mouse", "group__component.html#structftxui_1_1Mouse", null ], + [ "Node", "group__dom.html#classftxui_1_1Node", [ + [ "NodeDecorator", "classftxui_1_1NodeDecorator.html", null ] + ] ], + [ "Params", "classftxui_1_1animation_1_1Params.html", null ], + [ "PendingTask", "structftxui_1_1task_1_1PendingTask.html", null ], + [ "Pixel", "group__screen.html#structftxui_1_1Pixel", null ], + [ "Private", "classftxui_1_1ScreenInteractive_1_1Private.html", null ], + [ "RadioboxOption", "group__component.html#structftxui_1_1RadioboxOption", null ], + [ "ReceiverImpl< T >", "classftxui_1_1ReceiverImpl.html", null ], + [ "Ref< T >", "classftxui_1_1Ref.html", null ], + [ "Ref< bool >", "classftxui_1_1Ref.html", null ], + [ "Ref< Direction >", "classftxui_1_1Ref.html", null ], + [ "Ref< int >", "classftxui_1_1Ref.html", null ], + [ "Ref< std::string >", "classftxui_1_1Ref.html", [ + [ "StringRef", "classftxui_1_1StringRef.html", null ] + ] ], + [ "Requirement", "group__dom.html#structftxui_1_1Requirement", null ], + [ "ResizableSplitOption", "structftxui_1_1ResizableSplitOption.html", null ], + [ "Selection", "group__dom.html#classftxui_1_1Selection", null ], + [ "SenderImpl< T >", "classftxui_1_1SenderImpl.html", null ], + [ "SliderOption< T >", "structftxui_1_1SliderOption.html", null ], + [ "Status", "structftxui_1_1Node_1_1Status.html", null ], + [ "Stop", "structftxui_1_1LinearGradient_1_1Stop.html", null ], + [ "Table", "group__dom.html#classftxui_1_1Table", null ], + [ "TableSelection", "classftxui_1_1TableSelection.html", null ], + [ "TaskQueue", "structftxui_1_1task_1_1TaskQueue.html", null ], + [ "TaskRunner", "classftxui_1_1task_1_1TaskRunner.html", null ], + [ "TerminalInputParser", "classftxui_1_1TerminalInputParser.html", null ], + [ "UnderlineOption", "group__component.html#structftxui_1_1UnderlineOption", null ], + [ "WindowOptions", "structftxui_1_1WindowOptions.html", null ], + [ "WindowRenderState", "group__component.html#structftxui_1_1WindowRenderState", null ] +]; \ No newline at end of file diff --git a/homescreen_8cpp.html b/homescreen_8cpp.html new file mode 100644 index 000000000..bb644ec85 --- /dev/null +++ b/homescreen_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: homescreen.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
homescreen.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 31 of file homescreen.cpp.

+ +
+
+
+
+ + + + + diff --git a/homescreen_8cpp.js b/homescreen_8cpp.js new file mode 100644 index 000000000..701858efe --- /dev/null +++ b/homescreen_8cpp.js @@ -0,0 +1,4 @@ +var homescreen_8cpp = +[ + [ "main", "homescreen_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/homescreen_8cpp_source.html b/homescreen_8cpp_source.html new file mode 100644 index 000000000..7c10368a1 --- /dev/null +++ b/homescreen_8cpp_source.html @@ -0,0 +1,830 @@ + + + + + + + + +FTXUI: homescreen.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
homescreen.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <stddef.h> // for size_t
+
5#include <array> // for array
+
6#include <atomic> // for atomic
+
7#include <chrono> // for operator""s, chrono_literals
+
8#include <cmath> // for sin
+ +
10#include <functional> // for ref, reference_wrapper, function
+
11#include <memory> // for allocator, shared_ptr, __shared_ptr_access
+
12#include <string> // for string, basic_string, char_traits, operator+, to_string
+
13#include <thread> // for sleep_for, thread
+
14#include <utility> // for move
+
15#include <vector> // for vector
+
16
+
17#include "../dom/color_info_sorted_2d.ipp" // for ColorInfoSorted2D
+
18#include "ftxui/component/component.hpp" // for Checkbox, Renderer, Horizontal, Vertical, Input, Menu, Radiobox, ResizableSplitLeft, Tab
+
19#include "ftxui/component/component_base.hpp" // for ComponentBase, Component
+
20#include "ftxui/component/component_options.hpp" // for MenuOption, InputOption
+
21#include "ftxui/component/event.hpp" // for Event, Event::Custom
+
22#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
+
23#include "ftxui/dom/elements.hpp" // for text, color, operator|, bgcolor, filler, Element, vbox, size, hbox, separator, flex, window, graph, EQUAL, paragraph, WIDTH, hcenter, Elements, bold, vscroll_indicator, HEIGHT, flexbox, hflow, border, frame, flex_grow, gauge, paragraphAlignCenter, paragraphAlignJustify, paragraphAlignLeft, paragraphAlignRight, dim, spinner, LESS_THAN, center, yframe, GREATER_THAN
+
24#include "ftxui/dom/flexbox_config.hpp" // for FlexboxConfig
+
25#include "ftxui/screen/color.hpp" // for Color, Color::BlueLight, Color::RedLight, Color::Black, Color::Blue, Color::Cyan, Color::CyanLight, Color::GrayDark, Color::GrayLight, Color::Green, Color::GreenLight, Color::Magenta, Color::MagentaLight, Color::Red, Color::White, Color::Yellow, Color::YellowLight, Color::Default, Color::Palette256, ftxui
+
26#include "ftxui/screen/color_info.hpp" // for ColorInfo
+
27#include "ftxui/screen/terminal.hpp" // for Size, Dimensions
+
28
+
29using namespace ftxui;
+
30
+
+
31int main() {
+
32 auto screen = ScreenInteractive::Fullscreen();
+
33
+
34 // ---------------------------------------------------------------------------
+
35 // HTOP
+
36 // ---------------------------------------------------------------------------
+
37 int shift = 0;
+
38
+
39 auto my_graph = [&shift](int width, int height) {
+
40 std::vector<int> output(width);
+
41 for (int i = 0; i < width; ++i) {
+
42 float v = 0.5f;
+
43 v += 0.1f * sin((i + shift) * 0.1f);
+
44 v += 0.2f * sin((i + shift + 10) * 0.15f);
+
45 v += 0.1f * sin((i + shift) * 0.03f);
+
46 v *= height;
+
47 output[i] = (int)v;
+
48 }
+
49 return output;
+
50 };
+
51
+
52 auto htop = Renderer([&] {
+
53 auto frequency = vbox({
+
54 text("Frequency [Mhz]") | hcenter,
+
55 hbox({
+
56 vbox({
+
57 text("2400 "),
+
58 filler(),
+
59 text("1200 "),
+
60 filler(),
+
61 text("0 "),
+
62 }),
+
63 graph(std::ref(my_graph)) | flex,
+
64 }) | flex,
+
65 });
+
66
+
67 auto utilization = vbox({
+
68 text("Utilization [%]") | hcenter,
+
69 hbox({
+
70 vbox({
+
71 text("100 "),
+
72 filler(),
+
73 text("50 "),
+
74 filler(),
+
75 text("0 "),
+
76 }),
+
77 graph(std::ref(my_graph)) | color(Color::RedLight),
+
78 }) | flex,
+
79 });
+
80
+
81 auto ram = vbox({
+
82 text("Ram [Mo]") | hcenter,
+
83 hbox({
+
84 vbox({
+
85 text("8192"),
+
86 filler(),
+
87 text("4096 "),
+
88 filler(),
+
89 text("0 "),
+
90 }),
+
91 graph(std::ref(my_graph)) | color(Color::BlueLight),
+
92 }) | flex,
+
93 });
+
94
+
95 return hbox({
+
96 vbox({
+
97 frequency | flex,
+
98 separator(),
+
99 utilization | flex,
+
100 }) | flex,
+
101 separator(),
+
102 ram | flex,
+
103 }) |
+
104 flex;
+
105 });
+
106
+
107 // ---------------------------------------------------------------------------
+
108 // Compiler
+
109 // ---------------------------------------------------------------------------
+
110
+
111 const std::vector<std::string> compiler_entries = {
+
112 "gcc",
+
113 "clang",
+
114 "emcc",
+
115 "game_maker",
+
116 "Ada compilers",
+
117 "ALGOL 60 compilers",
+
118 "ALGOL 68 compilers",
+
119 "Assemblers (Intel *86)",
+
120 "Assemblers (Motorola 68*)",
+
121 "Assemblers (Zilog Z80)",
+
122 "Assemblers (other)",
+
123 "BASIC Compilers",
+
124 "BASIC interpreters",
+
125 "Batch compilers",
+
126 "C compilers",
+
127 "Source-to-source compilers",
+
128 "C++ compilers",
+
129 "C# compilers",
+
130 "COBOL compilers",
+
131 "Common Lisp compilers",
+
132 "D compilers",
+
133 "DIBOL/DBL compilers",
+
134 "ECMAScript interpreters",
+
135 "Eiffel compilers",
+
136 "Fortran compilers",
+
137 "Go compilers",
+
138 "Haskell compilers",
+
139 "Java compilers",
+
140 "Pascal compilers",
+
141 "Perl Interpreters",
+
142 "PHP compilers",
+
143 "PL/I compilers",
+
144 "Python compilers",
+
145 "Scheme compilers and interpreters",
+
146 "Smalltalk compilers",
+
147 "Tcl Interpreters",
+
148 "VMS Interpreters",
+
149 "Rexx Interpreters",
+
150 "CLI compilers",
+
151 };
+
152
+
153 int compiler_selected = 0;
+
154 Component compiler = Radiobox(&compiler_entries, &compiler_selected);
+
155
+
156 std::array<std::string, 8> options_label = {
+
157 "-Wall",
+
158 "-Werror",
+
159 "-lpthread",
+
160 "-O3",
+
161 "-Wabi-tag",
+
162 "-Wno-class-conversion",
+
163 "-Wcomma-subscript",
+
164 "-Wno-conversion-null",
+
165 };
+
166 std::array<bool, 8> options_state = {
+
167 false, false, false, false, false, false, false, false,
+
168 };
+
169
+
170 std::vector<std::string> input_entries;
+
171 int input_selected = 0;
+
172 Component input = Menu(&input_entries, &input_selected);
+
173
+
174 auto input_option = InputOption();
+
175 std::string input_add_content;
+
176 input_option.on_enter = [&] {
+
177 input_entries.push_back(input_add_content);
+
178 input_add_content = "";
+
179 };
+
180 Component input_add = Input(&input_add_content, "input files", input_option);
+
181
+
182 std::string executable_content_ = "";
+
183 Component executable_ = Input(&executable_content_, "executable");
+
184
+ +
186 Checkbox(&options_label[0], &options_state[0]),
+
187 Checkbox(&options_label[1], &options_state[1]),
+
188 Checkbox(&options_label[2], &options_state[2]),
+
189 Checkbox(&options_label[3], &options_state[3]),
+
190 Checkbox(&options_label[4], &options_state[4]),
+
191 Checkbox(&options_label[5], &options_state[5]),
+
192 Checkbox(&options_label[6], &options_state[6]),
+
193 Checkbox(&options_label[7], &options_state[7]),
+
194 });
+
195
+
196 auto compiler_component = Container::Horizontal({
+
197 compiler,
+
198 flags,
+ +
200 executable_,
+ +
202 input_add,
+
203 input,
+
204 }),
+
205 }),
+
206 });
+
207
+
208 auto render_command = [&] {
+
209 Elements line;
+
210 // Compiler
+
211 line.push_back(text(compiler_entries[compiler_selected]) | bold);
+
212 // flags
+
213 for (int i = 0; i < 8; ++i) {
+
214 if (options_state[i]) {
+
215 line.push_back(text(" "));
+
216 line.push_back(text(options_label[i]) | dim);
+
217 }
+
218 }
+
219 // Executable
+
220 if (!executable_content_.empty()) {
+
221 line.push_back(text(" -o ") | bold);
+
222 line.push_back(text(executable_content_) | color(Color::BlueLight) |
+
223 bold);
+
224 }
+
225 // Input
+
226 for (auto& it : input_entries) {
+
227 line.push_back(text(" " + it) | color(Color::RedLight));
+
228 }
+
229 return line;
+
230 };
+
231
+
232 auto compiler_renderer = Renderer(compiler_component, [&] {
+
233 auto compiler_win = window(text("Compiler"),
+
234 compiler->Render() | vscroll_indicator | frame);
+
235 auto flags_win =
+
236 window(text("Flags"), flags->Render() | vscroll_indicator | frame);
+
237 auto executable_win = window(text("Executable:"), executable_->Render());
+
238 auto input_win =
+
239 window(text("Input"), hbox({
+
240 vbox({
+
241 hbox({
+
242 text("Add: "),
+
243 input_add->Render(),
+
244 }) | size(WIDTH, EQUAL, 20) |
+
245 size(HEIGHT, EQUAL, 1),
+
246 filler(),
+
247 }),
+
248 separator(),
+
249 input->Render() | vscroll_indicator | frame |
+
250 size(HEIGHT, EQUAL, 3) | flex,
+
251 }));
+
252 return vbox({
+
253 hbox({
+
254 compiler_win,
+
255 flags_win,
+
256 vbox({
+
257 executable_win | size(WIDTH, EQUAL, 20),
+
258 input_win | size(WIDTH, EQUAL, 60),
+
259 }),
+
260 filler(),
+
261 }) | size(HEIGHT, LESS_THAN, 8),
+
262 hflow(render_command()) | flex_grow,
+
263 }) |
+
264 flex_grow;
+
265 });
+
266
+
267 // ---------------------------------------------------------------------------
+
268 // Spinner
+
269 // ---------------------------------------------------------------------------
+
270 auto spinner_tab_renderer = Renderer([&] {
+
271 Elements entries;
+
272 for (int i = 0; i < 22; ++i) {
+
273 entries.push_back(spinner(i, shift / 5) | bold |
+
274 size(WIDTH, GREATER_THAN, 2) | border);
+
275 }
+
276 return hflow(std::move(entries));
+
277 });
+
278
+
279 // ---------------------------------------------------------------------------
+
280 // Colors
+
281 // ---------------------------------------------------------------------------
+
282 auto color_tab_renderer = Renderer([] {
+
283 auto basic_color_display =
+
284 vbox({
+
285 text("16 color palette:"),
+
286 separator(),
+
287 hbox({
+
288 vbox({
+
289 color(Color::Default, text("Default")),
+
290 color(Color::Black, text("Black")),
+
291 color(Color::GrayDark, text("GrayDark")),
+
292 color(Color::GrayLight, text("GrayLight")),
+
293 color(Color::White, text("White")),
+
294 color(Color::Blue, text("Blue")),
+
295 color(Color::BlueLight, text("BlueLight")),
+
296 color(Color::Cyan, text("Cyan")),
+
297 color(Color::CyanLight, text("CyanLight")),
+
298 color(Color::Green, text("Green")),
+
299 color(Color::GreenLight, text("GreenLight")),
+
300 color(Color::Magenta, text("Magenta")),
+
301 color(Color::MagentaLight, text("MagentaLight")),
+
302 color(Color::Red, text("Red")),
+
303 color(Color::RedLight, text("RedLight")),
+
304 color(Color::Yellow, text("Yellow")),
+
305 color(Color::YellowLight, text("YellowLight")),
+
306 }),
+
307 vbox({
+
308 bgcolor(Color::Default, text("Default")),
+
309 bgcolor(Color::Black, text("Black")),
+
310 bgcolor(Color::GrayDark, text("GrayDark")),
+
311 bgcolor(Color::GrayLight, text("GrayLight")),
+
312 bgcolor(Color::White, text("White")),
+
313 bgcolor(Color::Blue, text("Blue")),
+
314 bgcolor(Color::BlueLight, text("BlueLight")),
+
315 bgcolor(Color::Cyan, text("Cyan")),
+
316 bgcolor(Color::CyanLight, text("CyanLight")),
+
317 bgcolor(Color::Green, text("Green")),
+
318 bgcolor(Color::GreenLight, text("GreenLight")),
+
319 bgcolor(Color::Magenta, text("Magenta")),
+
320 bgcolor(Color::MagentaLight, text("MagentaLight")),
+
321 bgcolor(Color::Red, text("Red")),
+
322 bgcolor(Color::RedLight, text("RedLight")),
+
323 bgcolor(Color::Yellow, text("Yellow")),
+
324 bgcolor(Color::YellowLight, text("YellowLight")),
+
325 }),
+
326 }),
+
327 }) |
+
328 border;
+
329
+
330 auto palette_256_color_display = text("256 colors palette:");
+
331 {
+
332 std::vector<std::vector<ColorInfo>> info_columns = ColorInfoSorted2D();
+
333 Elements columns;
+
334 for (auto& column : info_columns) {
+
335 Elements column_elements;
+
336 for (auto& it : column) {
+
337 column_elements.push_back(
+
338 text(" ") | bgcolor(Color(Color::Palette256(it.index_256))));
+
339 }
+
340 columns.push_back(hbox(std::move(column_elements)));
+
341 }
+
342 palette_256_color_display = vbox({
+
343 palette_256_color_display,
+
344 separator(),
+
345 vbox(columns),
+
346 }) |
+
347 border;
+
348 }
+
349
+
350 // True color display.
+
351 auto true_color_display = text("TrueColors: 24bits:");
+
352 {
+
353 int saturation = 255;
+
354 Elements array;
+
355 for (int value = 0; value < 255; value += 16) {
+
356 Elements line;
+
357 for (int hue = 0; hue < 255; hue += 6) {
+
358 line.push_back(text("▀") //
+
359 | color(Color::HSV(hue, saturation, value)) //
+
360 | bgcolor(Color::HSV(hue, saturation, value + 8)));
+
361 }
+
362 array.push_back(hbox(std::move(line)));
+
363 }
+
364 true_color_display = vbox({
+
365 true_color_display,
+
366 separator(),
+
367 vbox(std::move(array)),
+
368 }) |
+
369 border;
+
370 }
+
371
+
372 return flexbox(
+
373 {
+
374 basic_color_display,
+
375 palette_256_color_display,
+
376 true_color_display,
+
377 },
+
378 FlexboxConfig().SetGap(1, 1));
+
379 });
+
380
+
381 // ---------------------------------------------------------------------------
+
382 // Gauges
+
383 // ---------------------------------------------------------------------------
+
384 auto render_gauge = [&shift](int delta) {
+
385 float progress = (shift + delta) % 500 / 500.f;
+
386 return hbox({
+
387 text(std::to_string(int(progress * 100)) + "% ") |
+
388 size(WIDTH, EQUAL, 5),
+
389 gauge(progress),
+
390 });
+
391 };
+
392
+
393 auto gauge_component = Renderer([render_gauge] {
+
394 return vbox({
+
395 render_gauge(0) | color(Color::Black),
+
396 render_gauge(100) | color(Color::GrayDark),
+
397 render_gauge(50) | color(Color::GrayLight),
+
398 render_gauge(6894) | color(Color::White),
+
399 separator(),
+
400 render_gauge(6841) | color(Color::Blue),
+
401 render_gauge(9813) | color(Color::BlueLight),
+
402 render_gauge(98765) | color(Color::Cyan),
+
403 render_gauge(98) | color(Color::CyanLight),
+
404 render_gauge(9846) | color(Color::Green),
+
405 render_gauge(1122) | color(Color::GreenLight),
+
406 render_gauge(84) | color(Color::Magenta),
+
407 render_gauge(645) | color(Color::MagentaLight),
+
408 render_gauge(568) | color(Color::Red),
+
409 render_gauge(2222) | color(Color::RedLight),
+
410 render_gauge(220) | color(Color::Yellow),
+
411 render_gauge(348) | color(Color::YellowLight),
+
412 });
+
413 });
+
414
+
415 // ---------------------------------------------------------------------------
+
416 // Paragraph
+
417 // ---------------------------------------------------------------------------
+
418 auto make_box = [](size_t dimx, size_t dimy) {
+
419 std::string title = std::to_string(dimx) + "x" + std::to_string(dimy);
+
420 return window(text(title) | hcenter | bold,
+
421 text("content") | hcenter | dim) |
+
422 size(WIDTH, EQUAL, dimx) | size(HEIGHT, EQUAL, dimy);
+
423 };
+
424
+
425 auto paragraph_renderer_left = Renderer([&] {
+
426 std::string str =
+
427 "Lorem Ipsum is simply dummy text of the printing and typesetting "
+
428 "industry.\nLorem Ipsum has been the industry's standard dummy text "
+
429 "ever since the 1500s, when an unknown printer took a galley of type "
+
430 "and scrambled it to make a type specimen book.";
+
431 return vbox({
+
432 window(text("Align left:"), paragraphAlignLeft(str)),
+
433 window(text("Align center:"), paragraphAlignCenter(str)),
+
434 window(text("Align right:"), paragraphAlignRight(str)),
+
435 window(text("Align justify:"), paragraphAlignJustify(str)),
+
436 window(text("Side by side"), hbox({
+
437 paragraph(str),
+
438 separator(),
+
439 paragraph(str),
+
440 })),
+
441 window(text("Elements with different size:"),
+
442 flexbox({
+
443 make_box(10, 5),
+
444 make_box(9, 4),
+
445 make_box(8, 4),
+
446 make_box(6, 3),
+
447 make_box(10, 5),
+
448 make_box(9, 4),
+
449 make_box(8, 4),
+
450 make_box(6, 3),
+
451 make_box(10, 5),
+
452 make_box(9, 4),
+
453 make_box(8, 4),
+
454 make_box(6, 3),
+
455 })),
+
456 }) |
+
457 vscroll_indicator | yframe | flex;
+
458 });
+
459
+
460 auto paragraph_renderer_right = Renderer([] {
+
461 return paragraph("<--- This vertical bar is resizable using the mouse") |
+
462 center;
+
463 });
+
464
+
465 int paragraph_renderer_split_position = Terminal::Size().dimx / 2;
+
466 auto paragraph_renderer_group =
+
467 ResizableSplitLeft(paragraph_renderer_left, paragraph_renderer_right,
+
468 &paragraph_renderer_split_position);
+
469 auto paragraph_renderer_group_renderer =
+
470 Renderer(paragraph_renderer_group,
+
471 [&] { return paragraph_renderer_group->Render(); });
+
472
+
473 // ---------------------------------------------------------------------------
+
474 // Tabs
+
475 // ---------------------------------------------------------------------------
+
476
+
477 int tab_index = 0;
+
478 std::vector<std::string> tab_entries = {
+
479 "htop", "color", "spinner", "gauge", "compiler", "paragraph",
+
480 };
+
481 auto tab_selection =
+
482 Menu(&tab_entries, &tab_index, MenuOption::HorizontalAnimated());
+
483 auto tab_content = Container::Tab(
+
484 {
+
485 htop,
+
486 color_tab_renderer,
+
487 spinner_tab_renderer,
+
488 gauge_component,
+
489 compiler_renderer,
+
490 paragraph_renderer_group_renderer,
+
491 },
+
492 &tab_index);
+
493
+
494 auto exit_button =
+
495 Button("Exit", [&] { screen.Exit(); }, ButtonOption::Animated());
+
496
+
497 auto main_container = Container::Vertical({
+ +
499 tab_selection,
+
500 exit_button,
+
501 }),
+
502 tab_content,
+
503 });
+
504
+
505 auto main_renderer = Renderer(main_container, [&] {
+
506 return vbox({
+
507 text("FTXUI Demo") | bold | hcenter,
+
508 hbox({
+
509 tab_selection->Render() | flex,
+
510 exit_button->Render(),
+
511 }),
+
512 tab_content->Render() | flex,
+
513 });
+
514 });
+
515
+
516 Loop loop(&screen, main_renderer);
+
517 while (!loop.HasQuitted()) {
+
518 // Update the state of the application.
+
519 shift++;
+
520
+
521 // Request a new frame to be drawn.
+
522 screen.RequestAnimationFrame();
+
523
+
524 // Execute events, and draw the next frame.
+
525 loop.RunOnce();
+
526
+
527 // Sleep for a short duration to control the frame rate (60 FPS).
+
528 std::this_thread::sleep_for(std::chrono::milliseconds(1000 / 60));
+
529 }
+
530
+
531 return 0;
+
532}
+
+ + + +
std::vector< std::vector< ftxui::ColorInfo > > ColorInfoSorted2D()
+ + + + + +
Element make_box(int x, int y)
+ +
static ButtonOption Animated()
Create a ButtonOption, using animated colors.
+
Element Render()
Draw the component. Build a ftxui::Element to be drawn on the ftxui::Screen representing this ftxui::...
+
static ScreenInteractive Fullscreen()
+
static MenuOption HorizontalAnimated()
Standard options for an animated horizontal menu. This can be useful to implement a tab bar.
+
Loop is a class that manages the event loop for a component.
Definition loop.hpp:56
+
Component Horizontal(Components children)
A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow...
+
Component Menu(MenuOption options)
A list of text. The focused element is selected.
+
Component Radiobox(RadioboxOption options)
A list of element, where only one can be selected.
+
Component Button(ButtonOption options)
Draw a button. Execute a function when clicked.
+
Component Renderer(Component child, std::function< Element()>)
Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
+
Component Vertical(Components children)
A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
+
Component Input(InputOption options={})
An input box for editing text.
+
Component Checkbox(CheckboxOption options)
Draw checkable element.
+
Component ResizableSplitLeft(Component main, Component back, int *main_size)
An horizontal split in between two components, configurable using the mouse.
+
Component Tab(Components children, int *selector)
A list of components, where only one is drawn and interacted with at a time. The |selector| gives the...
+
Option for the Input component.
+
virtual void Render(Screen &screen)
Display an element on a ftxui::Screen.
Definition node.cpp:59
+
FlexboxConfig & SetGap(int gap_x, int gap_y)
Set the flexbox flex direction.
+
Decorator bgcolor(Color)
Decorate using a background color.
+
Element window(Element title, Element content, BorderStyle border=ROUNDED)
Draw window with a title and a border around the element.
+
Decorator size(WidthOrHeight, Constraint, int value)
Apply a constraint on the size of an element.
+
Element flex(Element)
Make a child element to expand proportionally to the space left in a container.
Definition flex.cpp:123
+
Element paragraphAlignRight(const std::string &text)
Return an element drawing the paragraph on multiple lines, aligned on the right.
+
Element spinner(int charset_index, size_t image_index)
Useful to represent the effect of time and/or events. This displays an ASCII art "video".
+
Element center(Element)
Center an element horizontally and vertically.
+
Element paragraphAlignCenter(const std::string &text)
Return an element drawing the paragraph on multiple lines, aligned on the center.
+
Element text(std::wstring text)
Display a piece of unicode text.
Definition text.cpp:160
+
Element flex_grow(Element)
Expand if possible.
Definition flex.cpp:141
+
Element paragraphAlignLeft(const std::string &text)
Return an element drawing the paragraph on multiple lines, aligned on the left.
+
Element separator()
Draw a vertical or horizontal separation in between two other elements.
+
Element filler()
An element that will take expand proportionally to the space left in a container.
Definition flex.cpp:98
+
Element gauge(float progress)
Draw a high definition progress bar.
+
Element paragraphAlignJustify(const std::string &text)
Return an element drawing the paragraph on multiple lines, aligned using a justified alignment....
+
Decorator color(Color)
Decorate using a foreground color.
+
Element hcenter(Element)
Center an element horizontally.
+
Element vbox(Elements)
A container displaying elements vertically one by one.
Definition vbox.cpp:96
+
FlexboxConfig is a configuration structure that defines the layout properties for a flexbox container...
+
static Color HSV(uint8_t hue, uint8_t saturation, uint8_t value)
Build a Color from its HSV representation. https://en.wikipedia.org/wiki/HSL_and_HSV.
+ + + + + + + + + + + + + + + + + + + +
Color is a class that represents a color in the terminal user interface.
Definition color.hpp:22
+
Dimensions Size()
Get the terminal size.
Definition terminal.cpp:94
+
int main()
+ +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
Element flexbox(Elements, FlexboxConfig config=FlexboxConfig())
A container displaying elements on row/columns and capable of wrapping on the next column/row when fu...
Definition flexbox.cpp:251
+
Element hflow(Elements)
A container displaying elements in rows from left to right. When filled, it starts on a new row below...
Definition flexbox.cpp:269
+
Element hbox(Elements)
A container displaying elements horizontally one by one.
Definition hbox.cpp:94
+
std::vector< Element > Elements
Definition elements.hpp:23
+
Elements paragraph(std::wstring text)
+
@ LESS_THAN
Definition elements.hpp:162
+ +
@ GREATER_THAN
Definition elements.hpp:162
+
Element graph(GraphFunction)
Draw a graph using a GraphFunction.
+
std::shared_ptr< ComponentBase > Component
+ + +
+
+ + + + + diff --git a/hoverable_8cpp.html b/hoverable_8cpp.html new file mode 100644 index 000000000..1a062da15 --- /dev/null +++ b/hoverable_8cpp.html @@ -0,0 +1,242 @@ + + + + + + + + +FTXUI: hoverable.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
hoverable.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+ + + + + + + + + + + + + + + + + + + +

+Functions

Component Hoverable (Component component, bool *hover)
 Wrap a component. Gives the ability to know if it is hovered by the mouse.
 
Component Hoverable (Component component, std::function< void()> on_enter, std::function< void()> on_leave)
 Wrap a component. Uses callbacks.
 
ComponentDecorator Hoverable (bool *hover)
 Wrap a component. Gives the ability to know if it is hovered by the mouse.
 
ComponentDecorator Hoverable (std::function< void()> on_enter, std::function< void()> on_leave)
 Wrap a component. Gives the ability to know if it is hovered by the mouse.
 
Component Hoverable (Component component, std::function< void(bool)> on_change)
 Wrap a component. Gives the ability to know if it is hovered by the mouse.
 
ComponentDecorator Hoverable (std::function< void(bool)> on_change)
 Wrap a component. Gives the ability to know if it is hovered by the mouse.
 
+
+
+ + + + + diff --git a/hoverable_8cpp.js b/hoverable_8cpp.js new file mode 100644 index 000000000..e779023d0 --- /dev/null +++ b/hoverable_8cpp.js @@ -0,0 +1,9 @@ +var hoverable_8cpp = +[ + [ "Hoverable", "hoverable_8cpp.html#ga562d984d3830d63285643565cd55d16f", null ], + [ "Hoverable", "hoverable_8cpp.html#ga92ec2f5ccb509da2e2c24ae6a1f6b12b", null ], + [ "Hoverable", "hoverable_8cpp.html#ga9d94b37352be13d3551a9d5785f75439", null ], + [ "Hoverable", "hoverable_8cpp.html#ga34adfc9c76cf3603156cba32ad5d7142", null ], + [ "Hoverable", "hoverable_8cpp.html#ga91cac81077c483efdb952268aee9a523", null ], + [ "Hoverable", "hoverable_8cpp.html#gafd7cbaef5378a907111a64ee69aed56a", null ] +]; \ No newline at end of file diff --git a/hoverable_8cpp_source.html b/hoverable_8cpp_source.html new file mode 100644 index 000000000..c1e3c00da --- /dev/null +++ b/hoverable_8cpp_source.html @@ -0,0 +1,457 @@ + + + + + + + + +FTXUI: hoverable.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
hoverable.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2022 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <functional> // for function
+
5#include <utility> // for move
+
6
+
7#include "ftxui/component/component.hpp" // for ComponentDecorator, Hoverable, Make
+
8#include "ftxui/component/component_base.hpp" // for ComponentBase
+
9#include "ftxui/component/event.hpp" // for Event
+
10#include "ftxui/component/mouse.hpp" // for Mouse
+
11#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
+
12#include "ftxui/dom/elements.hpp" // for operator|, reflect, Element
+
13#include "ftxui/screen/box.hpp" // for Box
+
14
+
15namespace ftxui {
+
16
+
17namespace {
+
18
+
19void Post(std::function<void()> f) {
+
20 if (auto* screen = ScreenInteractive::Active()) {
+
21 screen->Post(std::move(f));
+
22 return;
+
23 }
+
24 f();
+
25}
+
26
+
27} // namespace
+
28
+
29/// @brief Wrap a component. Gives the ability to know if it is hovered by the
+
30/// mouse.
+
31/// @param component The wrapped component.
+
32/// @param hover The value to reflect whether the component is hovered or not.
+
33/// @ingroup component
+
34///
+
35/// ### Example
+
36///
+
37/// ```cpp
+
38/// auto button = Button("exit", screen.ExitLoopClosure());
+
39/// bool hover = false;
+
40/// auto button_hover = Hoverable(button, &hover);
+
41/// ```
+
42// NOLINTNEXTLINE
+
+
43Component Hoverable(Component component, bool* hover) {
+
44 class Impl : public ComponentBase {
+
45 public:
+
46 Impl(Component component, bool* hover)
+
47 : component_(std::move(component)), hover_(hover) {
+
48 Add(component_);
+
49 }
+
50
+
51 private:
+
52 Element OnRender() override {
+
53 return ComponentBase::OnRender() | reflect(box_);
+
54 }
+
55
+
56 bool OnEvent(Event event) override {
+
57 if (event.is_mouse()) {
+
58 *hover_ = box_.Contain(event.mouse().x, event.mouse().y) &&
+
59 CaptureMouse(event);
+
60 }
+
61
+
62 return ComponentBase::OnEvent(event);
+
63 }
+
64
+
65 Component component_;
+
66 bool* hover_;
+
67 Box box_;
+
68 };
+
69
+
70 return Make<Impl>(component, hover);
+
71}
+
+
72
+
73/// @brief Wrap a component. Uses callbacks.
+
74/// @param component The wrapped component.
+
75/// @param on_enter Callback OnEnter
+
76/// @param on_leave Callback OnLeave
+
77/// @ingroup component
+
78///
+
79/// ### Example
+
80///
+
81/// ```cpp
+
82/// auto button = Button("exit", screen.ExitLoopClosure());
+
83/// bool hover = false;
+
84/// auto button_hover = Hoverable(button, &hover);
+
85/// ```
+
+ +
87 std::function<void()> on_enter,
+
88 std::function<void()> on_leave) {
+
89 class Impl : public ComponentBase {
+
90 public:
+
91 Impl(Component component,
+
92 std::function<void()> on_enter,
+
93 std::function<void()> on_leave)
+
94 : component_(std::move(component)),
+
95 on_enter_(std::move(on_enter)),
+
96 on_leave_(std::move(on_leave)) {
+
97 Add(component_);
+
98 }
+
99
+
100 private:
+
101 Element OnRender() override {
+
102 return ComponentBase::OnRender() | reflect(box_);
+
103 }
+
104
+
105 bool OnEvent(Event event) override {
+
106 if (event.is_mouse()) {
+
107 const bool hover = box_.Contain(event.mouse().x, event.mouse().y) &&
+
108 CaptureMouse(event);
+
109 if (hover != hover_) {
+
110 Post(hover ? on_enter_ : on_leave_);
+
111 }
+
112 hover_ = hover;
+
113 }
+
114
+
115 return ComponentBase::OnEvent(event);
+
116 }
+
117
+
118 Component component_;
+
119 Box box_;
+
120 bool hover_ = false;
+
121 std::function<void()> on_enter_;
+
122 std::function<void()> on_leave_;
+
123 };
+
124
+
125 return Make<Impl>(std::move(component), std::move(on_enter),
+
126 std::move(on_leave));
+
127}
+
+
128
+
129/// @brief Wrap a component. Gives the ability to know if it is hovered by the
+
130/// mouse.
+
131/// @param hover The value to reflect whether the component is hovered or not.
+
132/// @ingroup component
+
133///
+
134/// ### Example
+
135///
+
136/// ```cpp
+
137/// bool hover = false;
+
138/// auto button = Button("exit", screen.ExitLoopClosure());
+
139/// button |= Hoverable(&hover);
+
140/// ```
+
+ +
142 return [hover](Component component) {
+
143 return Hoverable(std::move(component), hover);
+
144 };
+
145}
+
+
146
+
147/// @brief Wrap a component. Gives the ability to know if it is hovered by the
+
148/// mouse.
+
149/// @param on_enter is called when the mouse hover the component.
+
150/// @param on_leave is called when the mouse leave the component.
+
151/// @ingroup component
+
152///
+
153/// ### Example
+
154///
+
155/// ```cpp
+
156/// auto button = Button("exit", screen.ExitLoopClosure());
+
157/// int on_enter_cnt = 0;
+
158/// int on_leave_cnt = 0;
+
159/// button |= Hoverable(
+
160/// [&]{ on_enter_cnt++; },
+
161/// [&]{ on_leave_cnt++; }
+
162/// );
+
163/// ```
+
164// NOLINTNEXTLINE
+
+
165ComponentDecorator Hoverable(std::function<void()> on_enter,
+
166 // NOLINTNEXTLINE
+
167 std::function<void()> on_leave) {
+
168 return [on_enter, on_leave](Component component) {
+
169 return Hoverable(std::move(component), on_enter, on_leave);
+
170 };
+
171}
+
+
172
+
173/// @brief Wrap a component. Gives the ability to know if it is hovered by the
+
174/// mouse.
+
175/// @param component the wrapped component.
+
176/// @param on_change is called when the mouse enter or leave the component.
+
177/// @ingroup component
+
178///
+
179/// ### Example
+
180///
+
181/// ```cpp
+
182/// auto button = Button("exit", screen.ExitLoopClosure());
+
183/// bool hovered = false;
+
184/// auto button_hoverable = Hoverable(button,
+
185/// [&](bool hover) { hovered = hover;});
+
186/// ```
+
187// NOLINTNEXTLINE
+
+
188Component Hoverable(Component component, std::function<void(bool)> on_change) {
+
189 return Hoverable(
+
190 std::move(component), //
+
191 [on_change] { on_change(true); }, //
+
192 [on_change] { on_change(false); } //
+
193 );
+
194}
+
+
195
+
196/// @brief Wrap a component. Gives the ability to know if it is hovered by the
+
197/// mouse.
+
198/// @param on_change is called when the mouse enter or leave the component.
+
199/// @ingroup component
+
200///
+
201/// ### Example
+
202///
+
203/// ```cpp
+
204/// auto button = Button("exit", screen.ExitLoopClosure());
+
205/// bool hovered = false;
+
206/// button |= Hoverable([&](bool hover) { hovered = hover;});
+
207/// ```
+
208// NOLINTNEXTLINE
+
+
209ComponentDecorator Hoverable(std::function<void(bool)> on_change) {
+
210 return [on_change](Component component) {
+
211 return Hoverable(std::move(component), on_change);
+
212 };
+
213}
+
+
214
+
215} // namespace ftxui
+ + + + + + +
bool is_mouse() const
Definition event.hpp:109
+ +
struct Mouse mouse
Definition event.hpp:144
+
static ScreenInteractive * Active()
Return the currently active screen, or null if none.
+
It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ft...
+
Component Hoverable(Component component, bool *hover)
Wrap a component. Gives the ability to know if it is hovered by the mouse.
Definition hoverable.cpp:43
+
Represent an event. It can be key press event, a terminal resize, or more ...
Definition event.hpp:29
+
Box is a structure that represents a rectangular area in a 2D space.
Definition box.hpp:16
+ +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< T > Make(Args &&... args)
Definition component.hpp:27
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+
std::function< Component(Component)> ComponentDecorator
Definition component.hpp:32
+
std::shared_ptr< ComponentBase > Component
+ +
+
+ + + + + diff --git a/html__like_8cpp.html b/html__like_8cpp.html new file mode 100644 index 000000000..f00453198 --- /dev/null +++ b/html__like_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: html_like.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
html_like.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 15 of file html_like.cpp.

+ +
+
+
+
+ + + + + diff --git a/html__like_8cpp.js b/html__like_8cpp.js new file mode 100644 index 000000000..0b2b1cefc --- /dev/null +++ b/html__like_8cpp.js @@ -0,0 +1,4 @@ +var html__like_8cpp = +[ + [ "main", "html__like_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/html__like_8cpp_source.html b/html__like_8cpp_source.html new file mode 100644 index 000000000..b70a90b1f --- /dev/null +++ b/html__like_8cpp_source.html @@ -0,0 +1,277 @@ + + + + + + + + +FTXUI: html_like.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
html_like.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <chrono> // for operator""s, chrono_literals
+
5#include <ftxui/screen/screen.hpp> // for Screen
+
6#include <iostream> // for cout, ostream
+
7#include <string> // for allocator, operator<<, string
+
8#include <thread> // for sleep_for
+
9
+
10#include "ftxui/dom/elements.hpp" // for paragraph, text, operator|, Element, border, Fit, color, hflow, spinner, vbox, bold, dim, underlined
+
11#include "ftxui/dom/node.hpp" // for Render
+
12#include "ftxui/screen/box.hpp" // for ftxui
+
13#include "ftxui/screen/color.hpp" // for Color, Color::Red
+
14
+
+
15int main() {
+
16 using namespace ftxui;
+
17 using namespace std::chrono_literals;
+
18
+
19 auto img1 = []() { return text("img") | border; };
+
20 auto img2 = []() { return vbox({text("big"), text("image")}) | border; };
+
21
+
22 std::string reset_position;
+
23 for (int i = 0;; ++i) {
+
24 auto document = //
+
25 hflow(
+
26 paragraph("Hello world! Here is an image:"), img1(),
+
27 paragraph(" Here is a text "), text("underlined ") | underlined,
+
28 paragraph(" Here is a text "), text("bold ") | bold,
+
29 paragraph("Hello world! Here is an image:"), img2(),
+
30 paragraph(
+
31 "Le Lorem Ipsum est simplement du faux texte employé dans la "
+
32 "composition et la mise en page avant impression. Le Lorem "
+
33 "Ipsum est le faux texte standard de l'imprimerie depuis les "
+
34 "années 1500, quand un imprimeur anonyme assembla ensemble "
+
35 "des morceaux de texte pour réaliser un livre spécimen de "
+
36 "polices de texte. Il n'a pas fait que survivre cinq siècles, "
+
37 "mais s'est aussi adapté à la bureautique informatique, sans "
+
38 "que son contenu n'en soit modifié. Il a été popularisé dans "
+
39 "les années 1960 grâce à la vente de feuilles Letraset "
+
40 "contenant des passages du Lorem Ipsum, et, plus récemment, "
+
41 "par son inclusion dans des applications de mise en page de "
+
42 "texte, comme Aldus PageMaker."),
+
43 paragraph(" Here is a text "), text("dim ") | dim,
+
44 paragraph("Hello world! Here is an image:"), img1(),
+
45 paragraph(" Here is a text "), text("red ") | color(Color::Red),
+
46 paragraph(" A spinner "), spinner(6, i / 10)) |
+
47 border;
+
48
+
49 auto screen = Screen::Create(Dimension::Fit(document));
+
50 Render(screen, document);
+
51 std::cout << reset_position;
+
52 screen.Print();
+
53 reset_position = screen.ResetPosition();
+
54
+
55 std::this_thread::sleep_for(0.01s);
+
56 }
+
57
+
58 return 0;
+
59}
+
+ + + +
int main()
Definition html_like.cpp:15
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/hyperlink_8cpp.html b/hyperlink_8cpp.html new file mode 100644 index 000000000..95c7048ef --- /dev/null +++ b/hyperlink_8cpp.html @@ -0,0 +1,247 @@ + + + + + + + + +FTXUI: hyperlink.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
hyperlink.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+ + + + + + + +

+Functions

Element hyperlink (std::string link, Element child)
 Make the rendered area clickable using a web browser. The link will be opened when the user clicks on it. This is supported only on a limited set of terminal emulators. List: https://github.com/Alhadis/OSC8-Adoption/.
 
Decorator hyperlink (std::string link)
 Decorate using a hyperlink. The link will be opened when the user clicks on it. This is supported only on a limited set of terminal emulators. List: https://github.com/Alhadis/OSC8-Adoption/.
 
+

Variable Documentation

+ +

◆ link_

+ +
+
+ + + + +
std::string link_
+
+ +

Definition at line 32 of file hyperlink.cpp.

+ +
+
+
+
+ + + + + diff --git a/hyperlink_8cpp.js b/hyperlink_8cpp.js new file mode 100644 index 000000000..a0af4e9fc --- /dev/null +++ b/hyperlink_8cpp.js @@ -0,0 +1,6 @@ +var hyperlink_8cpp = +[ + [ "hyperlink", "hyperlink_8cpp.html#ga8bacc04e0cbde663ccc4a4891e8b50d5", null ], + [ "hyperlink", "hyperlink_8cpp.html#gad0eac58eac9e6cd9a04879b20f8e123b", null ], + [ "link_", "hyperlink_8cpp.html#a42544edd174cb953c823c19cdec44b86", null ] +]; \ No newline at end of file diff --git a/hyperlink_8cpp_source.html b/hyperlink_8cpp_source.html new file mode 100644 index 000000000..08c3a635f --- /dev/null +++ b/hyperlink_8cpp_source.html @@ -0,0 +1,298 @@ + + + + + + + + +FTXUI: hyperlink.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
hyperlink.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2023 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <cstdint> // for uint8_t
+
5#include <memory> // for make_shared
+
6#include <string> // for string
+
7#include <utility> // for move
+
8
+
9#include "ftxui/dom/elements.hpp" // for Element, Decorator, hyperlink
+
10#include "ftxui/dom/node_decorator.hpp" // for NodeDecorator
+
11#include "ftxui/screen/box.hpp" // for Box
+
12#include "ftxui/screen/screen.hpp" // for Screen, Pixel
+
13
+
14namespace ftxui {
+
15
+
16namespace {
+
17class Hyperlink : public NodeDecorator {
+
18 public:
+
19 Hyperlink(Element child, std::string link)
+
20 : NodeDecorator(std::move(child)), link_(std::move(link)) {}
+
21
+
22 void Render(Screen& screen) override {
+
23 const uint8_t hyperlink_id = screen.RegisterHyperlink(link_);
+
24 for (int y = box_.y_min; y <= box_.y_max; ++y) {
+
25 for (int x = box_.x_min; x <= box_.x_max; ++x) {
+
26 screen.PixelAt(x, y).hyperlink = hyperlink_id;
+
27 }
+
28 }
+ +
30 }
+
31
+
32 std::string link_;
+
33};
+
34} // namespace
+
35
+
36/// @brief Make the rendered area clickable using a web browser.
+
37/// The link will be opened when the user clicks on it.
+
38/// This is supported only on a limited set of terminal emulators.
+
39/// List: https://github.com/Alhadis/OSC8-Adoption/
+
40/// @param link The link
+
41/// @param child The input element.
+
42/// @return The output element with the link.
+
43/// @ingroup dom
+
44///
+
45/// ### Example
+
46///
+
47/// ```cpp
+
48/// Element document =
+
49/// hyperlink("https://github.com/ArthurSonzogni/FTXUI", "link");
+
50/// ```
+
+
51Element hyperlink(std::string link, Element child) {
+
52 return std::make_shared<Hyperlink>(std::move(child), std::move(link));
+
53}
+
+
54
+
55/// @brief Decorate using a hyperlink.
+
56/// The link will be opened when the user clicks on it.
+
57/// This is supported only on a limited set of terminal emulators.
+
58/// List: https://github.com/Alhadis/OSC8-Adoption/
+
59/// @param link The link to redirect the users to.
+
60/// @return The Decorator applying the hyperlink.
+
61/// @ingroup dom
+
62///
+
63/// ### Example
+
64///
+
65/// ```cpp
+
66/// Element document =
+
67/// text("red") | hyperlink("https://github.com/Arthursonzogni/FTXUI");
+
68/// ```
+
69// NOLINTNEXTLINE
+
+
70Decorator hyperlink(std::string link) {
+
71 return [link](Element child) { return hyperlink(link, std::move(child)); };
+
72}
+
+
73
+
74} // namespace ftxui
+ + +
friend void Render(Screen &screen, Node *node, Selection &selection)
Definition node.cpp:96
+
Decorator hyperlink(std::string link)
Decorate using a hyperlink. The link will be opened when the user clicks on it. This is supported onl...
Definition hyperlink.cpp:70
+
void Render(Screen &screen, const Element &element)
Display an element on a ftxui::Screen.
Definition node.cpp:84
+ +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::function< Element(Element)> Decorator
Definition elements.hpp:24
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+ + +
+
+ + + + + diff --git a/image_8cpp.html b/image_8cpp.html new file mode 100644 index 000000000..4fa40f94a --- /dev/null +++ b/image_8cpp.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: image.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
image.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+
+
+ + + + + diff --git a/image_8cpp_source.html b/image_8cpp_source.html new file mode 100644 index 000000000..fb968b4ef --- /dev/null +++ b/image_8cpp_source.html @@ -0,0 +1,296 @@ + + + + + + + + +FTXUI: image.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
image.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <sstream> // IWYU pragma: keep
+
5#include <string>
+
6#include <vector>
+
7
+ + +
10
+
11namespace ftxui {
+
12
+
13namespace {
+
14Pixel& dev_null_pixel() {
+
15 static Pixel pixel;
+
16 return pixel;
+
17}
+
18} // namespace
+
19
+
+
20Image::Image(int dimx, int dimy)
+
21 : stencil{0, dimx - 1, 0, dimy - 1},
+
22 dimx_(dimx),
+
23 dimy_(dimy),
+
24 pixels_(dimy, std::vector<Pixel>(dimx)) {}
+
+
25
+
26/// @brief Access a character in a cell at a given position.
+
27/// @param x The cell position along the x-axis.
+
28/// @param y The cell position along the y-axis.
+
+
29std::string& Image::at(int x, int y) {
+
30 return PixelAt(x, y).character;
+
31}
+
+
32
+
33/// @brief Access a character in a cell at a given position.
+
34/// @param x The cell position along the x-axis.
+
35/// @param y The cell position along the y-axis.
+
+
36const std::string& Image::at(int x, int y) const {
+
37 return PixelAt(x, y).character;
+
38}
+
+
39
+
40/// @brief Access a cell (Pixel) at a given position.
+
41/// @param x The cell position along the x-axis.
+
42/// @param y The cell position along the y-axis.
+
+
43Pixel& Image::PixelAt(int x, int y) {
+
44 return stencil.Contain(x, y) ? pixels_[y][x] : dev_null_pixel();
+
45}
+
+
46
+
47/// @brief Access a cell (Pixel) at a given position.
+
48/// @param x The cell position along the x-axis.
+
49/// @param y The cell position along the y-axis.
+
+
50const Pixel& Image::PixelAt(int x, int y) const {
+
51 return stencil.Contain(x, y) ? pixels_[y][x] : dev_null_pixel();
+
52}
+
+
53
+
54/// @brief Clear all the pixel from the screen.
+
+ +
56 for (auto& line : pixels_) {
+
57 for (auto& cell : line) {
+
58 cell = Pixel();
+
59 }
+
60 }
+
61}
+
+
62
+
63} // namespace ftxui
+
bool Contain(int x, int y) const
Definition box.cpp:42
+
std::string character
Definition pixel.hpp:45
+
Pixel & PixelAt(int x, int y)
Access a cell (Pixel) at a given position.
Definition image.cpp:43
+
std::string & at(int x, int y)
Access a character in a cell at a given position.
Definition image.cpp:29
+
Image()=delete
+
Box stencil
Definition image.hpp:41
+
void Clear()
Clear all the pixel from the screen.
Definition image.cpp:55
+
std::vector< std::vector< Pixel > > pixels_
Definition image.hpp:46
+
A Unicode character and its associated style.
Definition pixel.hpp:15
+ +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/image_8cppm.html b/image_8cppm.html new file mode 100644 index 000000000..5a4fca1cb --- /dev/null +++ b/image_8cppm.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: image.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
image.cppm File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+
+
+ + + + + diff --git a/image_8cppm_source.html b/image_8cppm_source.html new file mode 100644 index 000000000..e43fc1a94 --- /dev/null +++ b/image_8cppm_source.html @@ -0,0 +1,229 @@ + + + + + + + + +FTXUI: image.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
image.cppm
+
+
+Go to the documentation of this file.
1/// @module ftxui.screen.image
+
2/// @brief Module file for the Image class of the Screen module
+
3
+
4module;
+
5
+ +
7
+
8export module ftxui.screen.image;
+
9
+
10/**
+
11 * @namespace ftxui
+
12 * @brief The FTXUI ftxui:: namespace
+
13 */
+
14export namespace ftxui {
+
15 using ftxui::Image;
+
16}
+
A rectangular grid of Pixel.
Definition image.hpp:17
+ +
Module file for the Image class of the Screen module.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
+
+ + + + + diff --git a/image_8hpp.html b/image_8hpp.html new file mode 100644 index 000000000..c958e4ee5 --- /dev/null +++ b/image_8hpp.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: image.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
image.hpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Classes

class  Image
 A rectangular grid of Pixel. More...
 
+ + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+
+
+ + + + + diff --git a/image_8hpp_source.html b/image_8hpp_source.html new file mode 100644 index 000000000..63a743fc3 --- /dev/null +++ b/image_8hpp_source.html @@ -0,0 +1,279 @@ + + + + + + + + +FTXUI: image.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
image.hpp
+
+
+Go to the documentation of this file.
1// Copyright 2024 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#ifndef FTXUI_SCREEN_IMAGE_HPP
+
5#define FTXUI_SCREEN_IMAGE_HPP
+
6
+
7#include <string> // for string, basic_string, allocator
+
8#include <vector> // for vector
+
9
+
10#include "ftxui/screen/box.hpp" // for Box
+
11#include "ftxui/screen/pixel.hpp" // for Pixel
+
12
+
13namespace ftxui {
+
14
+
15/// @brief A rectangular grid of Pixel.
+
16/// @ingroup screen
+
+
17class Image {
+
18 public:
+
19 // Constructors:
+
20 Image() = delete;
+
21 Image(int dimx, int dimy);
+
22
+
23 // Destructor:
+
24 virtual ~Image() = default;
+
25
+
26 // Access a character in the grid at a given position.
+
27 std::string& at(int x, int y);
+
28 const std::string& at(int x, int y) const;
+
29
+
30 // Access a cell (Pixel) in the grid at a given position.
+
31 Pixel& PixelAt(int x, int y);
+
32 const Pixel& PixelAt(int x, int y) const;
+
33
+
34 // Get screen dimensions.
+
35 int dimx() const { return dimx_; }
+
36 int dimy() const { return dimy_; }
+
37
+
38 // Fill the image with space and default style
+
39 void Clear();
+
40
+ +
42
+
43 protected:
+
44 int dimx_;
+
45 int dimy_;
+
46 std::vector<std::vector<Pixel>> pixels_;
+
47};
+
+
48
+
49} // namespace ftxui
+
50
+
51#endif // FTXUI_SCREEN_IMAGE_HPP
+ +
int dimy() const
Definition image.hpp:36
+ +
Pixel & PixelAt(int x, int y)
Access a cell (Pixel) at a given position.
Definition image.cpp:43
+
std::string & at(int x, int y)
Access a character in a cell at a given position.
Definition image.cpp:29
+
Image()=delete
+
Box stencil
Definition image.hpp:41
+ +
void Clear()
Clear all the pixel from the screen.
Definition image.cpp:55
+
int dimx() const
Definition image.hpp:35
+
std::vector< std::vector< Pixel > > pixels_
Definition image.hpp:46
+
virtual ~Image()=default
+
A rectangular grid of Pixel.
Definition image.hpp:17
+
Box is a structure that represents a rectangular area in a 2D space.
Definition box.hpp:16
+
A Unicode character and its associated style.
Definition pixel.hpp:15
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
+
+ + + + + diff --git a/index.html b/index.html new file mode 100644 index 000000000..f5a8f38d7 --- /dev/null +++ b/index.html @@ -0,0 +1,291 @@ + + + + + + + + +FTXUI: Introduction + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Introduction
+
+
+

Table of Contents

+ +
+

Demo image

+

FTXUI is simple cross-platform C++ library for terminal based user interfaces!

+

+Feature

+
    +
  • Functional style. Inspired by 1 and React
  • +
  • No dependencies
  • +
  • Cross platform.
  • +
  • Simple and elegant syntax (in my opinion)
  • +
  • Keyboard & mouse navigation.
  • +
  • Support for UTF8 and fullwidth chars (→ 测试)
  • +
  • Support for animations. Demo 1, Demo 2
  • +
  • Support for drawing. Demo
  • +
  • Learn by examples, and tutorials
  • +
  • Multiple build system and packages:
  • +
  • Good practices: documentation, tests, fuzzers, performance tests, automated CI, automated packaging, etc...
  • +
+

+Example

+
+ +
#include <iostream>
+
+
int main() {
+
using namespace ftxui;
+
+
// Create a simple document with three text elements.
+
Element document = hbox({
+
text("left") | border,
+
text("middle") | border | flex,
+
text("right") | border,
+
});
+
+
// Create a screen with full width and height fitting the document.
+
auto screen = Screen::Create(
+
Dimension::Full(), // Width
+
Dimension::Fit(document) // Height
+
);
+
+
// Render the document onto the screen.
+
Render(screen, document);
+
+
// Print the screen to the console.
+
screen.Print();
+
}
+ + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+ +

Expected output:

+
┌────┐┌────────────────────────────────────┐┌─────┐
+
│left││middle ││right│
+
└────┘└────────────────────────────────────┘└─────┘
+

+Supported Platforms

+
    +
  • Linux
  • +
  • MacOS
  • +
  • Windows
  • +
  • WebAssembly
  • +
+
+ + + + +
Next
Getting Started
+
+ +
+
+ + + + + diff --git a/index.js b/index.js new file mode 100644 index 000000000..b25d83f17 --- /dev/null +++ b/index.js @@ -0,0 +1,6 @@ +var index = +[ + [ "Feature", "index.html#feature", null ], + [ "Example", "index.html#example", null ], + [ "Supported Platforms", "index.html#supported-platforms", null ] +]; \ No newline at end of file diff --git a/inherit_graph_0.map b/inherit_graph_0.map new file mode 100644 index 000000000..cd28c1461 --- /dev/null +++ b/inherit_graph_0.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_0.md5 b/inherit_graph_0.md5 new file mode 100644 index 000000000..e465a6ae5 --- /dev/null +++ b/inherit_graph_0.md5 @@ -0,0 +1 @@ +4435ee1ac918b3aab7fd083634e537f5 \ No newline at end of file diff --git a/inherit_graph_0.png b/inherit_graph_0.png new file mode 100644 index 000000000..f1878684b Binary files /dev/null and b/inherit_graph_0.png differ diff --git a/inherit_graph_1.map b/inherit_graph_1.map new file mode 100644 index 000000000..36295bb24 --- /dev/null +++ b/inherit_graph_1.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_1.md5 b/inherit_graph_1.md5 new file mode 100644 index 000000000..3f90fdd61 --- /dev/null +++ b/inherit_graph_1.md5 @@ -0,0 +1 @@ +0cdfa615b50845127a49e6654d0b8ede \ No newline at end of file diff --git a/inherit_graph_1.png b/inherit_graph_1.png new file mode 100644 index 000000000..f5b6caf22 Binary files /dev/null and b/inherit_graph_1.png differ diff --git a/inherit_graph_10.map b/inherit_graph_10.map new file mode 100644 index 000000000..ababa69e1 --- /dev/null +++ b/inherit_graph_10.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_10.md5 b/inherit_graph_10.md5 new file mode 100644 index 000000000..86c6718bf --- /dev/null +++ b/inherit_graph_10.md5 @@ -0,0 +1 @@ +1dc11581f1d425c42bb41c33e9cab80f \ No newline at end of file diff --git a/inherit_graph_10.png b/inherit_graph_10.png new file mode 100644 index 000000000..3f87fc1ee Binary files /dev/null and b/inherit_graph_10.png differ diff --git a/inherit_graph_11.map b/inherit_graph_11.map new file mode 100644 index 000000000..6581f4920 --- /dev/null +++ b/inherit_graph_11.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_11.md5 b/inherit_graph_11.md5 new file mode 100644 index 000000000..5f3f7aa7d --- /dev/null +++ b/inherit_graph_11.md5 @@ -0,0 +1 @@ +1fb22836cd55800cc14ab99e29faabd5 \ No newline at end of file diff --git a/inherit_graph_11.png b/inherit_graph_11.png new file mode 100644 index 000000000..dc7cd9eb4 Binary files /dev/null and b/inherit_graph_11.png differ diff --git a/inherit_graph_12.map b/inherit_graph_12.map new file mode 100644 index 000000000..9680e80a8 --- /dev/null +++ b/inherit_graph_12.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_12.md5 b/inherit_graph_12.md5 new file mode 100644 index 000000000..43db80328 --- /dev/null +++ b/inherit_graph_12.md5 @@ -0,0 +1 @@ +a240cf39d68380b0d161fb8e742cd024 \ No newline at end of file diff --git a/inherit_graph_12.png b/inherit_graph_12.png new file mode 100644 index 000000000..97f05eeda Binary files /dev/null and b/inherit_graph_12.png differ diff --git a/inherit_graph_13.map b/inherit_graph_13.map new file mode 100644 index 000000000..1bfd137a0 --- /dev/null +++ b/inherit_graph_13.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_13.md5 b/inherit_graph_13.md5 new file mode 100644 index 000000000..b49cfaa7f --- /dev/null +++ b/inherit_graph_13.md5 @@ -0,0 +1 @@ +a28ec29e0629ac7b75953a397ef4f71e \ No newline at end of file diff --git a/inherit_graph_13.png b/inherit_graph_13.png new file mode 100644 index 000000000..bf7ea5210 Binary files /dev/null and b/inherit_graph_13.png differ diff --git a/inherit_graph_14.map b/inherit_graph_14.map new file mode 100644 index 000000000..d1014cc0b --- /dev/null +++ b/inherit_graph_14.map @@ -0,0 +1,5 @@ + + + + + diff --git a/inherit_graph_14.md5 b/inherit_graph_14.md5 new file mode 100644 index 000000000..35ce6960a --- /dev/null +++ b/inherit_graph_14.md5 @@ -0,0 +1 @@ +c88db8570e1dbc1efadc332689b140fb \ No newline at end of file diff --git a/inherit_graph_14.png b/inherit_graph_14.png new file mode 100644 index 000000000..34a4c00b2 Binary files /dev/null and b/inherit_graph_14.png differ diff --git a/inherit_graph_15.map b/inherit_graph_15.map new file mode 100644 index 000000000..5ad07d584 --- /dev/null +++ b/inherit_graph_15.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_15.md5 b/inherit_graph_15.md5 new file mode 100644 index 000000000..127b20de0 --- /dev/null +++ b/inherit_graph_15.md5 @@ -0,0 +1 @@ +48fc1e6d7262d0be72e08601acaf863d \ No newline at end of file diff --git a/inherit_graph_15.png b/inherit_graph_15.png new file mode 100644 index 000000000..96184f979 Binary files /dev/null and b/inherit_graph_15.png differ diff --git a/inherit_graph_16.map b/inherit_graph_16.map new file mode 100644 index 000000000..59bfa10df --- /dev/null +++ b/inherit_graph_16.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_16.md5 b/inherit_graph_16.md5 new file mode 100644 index 000000000..dddd20227 --- /dev/null +++ b/inherit_graph_16.md5 @@ -0,0 +1 @@ +633ea83b34800cd28bd24a91ad5406ba \ No newline at end of file diff --git a/inherit_graph_16.png b/inherit_graph_16.png new file mode 100644 index 000000000..a877835fc Binary files /dev/null and b/inherit_graph_16.png differ diff --git a/inherit_graph_17.map b/inherit_graph_17.map new file mode 100644 index 000000000..35cf3509b --- /dev/null +++ b/inherit_graph_17.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_17.md5 b/inherit_graph_17.md5 new file mode 100644 index 000000000..8788d8924 --- /dev/null +++ b/inherit_graph_17.md5 @@ -0,0 +1 @@ +6e5fd3462277b12bb32baabce9801615 \ No newline at end of file diff --git a/inherit_graph_17.png b/inherit_graph_17.png new file mode 100644 index 000000000..6306ac9ea Binary files /dev/null and b/inherit_graph_17.png differ diff --git a/inherit_graph_18.map b/inherit_graph_18.map new file mode 100644 index 000000000..d8835db7e --- /dev/null +++ b/inherit_graph_18.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_18.md5 b/inherit_graph_18.md5 new file mode 100644 index 000000000..965e183eb --- /dev/null +++ b/inherit_graph_18.md5 @@ -0,0 +1 @@ +1ab5a803c7370e815f7ba96768e9992a \ No newline at end of file diff --git a/inherit_graph_18.png b/inherit_graph_18.png new file mode 100644 index 000000000..4e4a947d4 Binary files /dev/null and b/inherit_graph_18.png differ diff --git a/inherit_graph_19.map b/inherit_graph_19.map new file mode 100644 index 000000000..280421428 --- /dev/null +++ b/inherit_graph_19.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_19.md5 b/inherit_graph_19.md5 new file mode 100644 index 000000000..662071af7 --- /dev/null +++ b/inherit_graph_19.md5 @@ -0,0 +1 @@ +a8224a5cdbc07bcdf21e2afdd3d2a6df \ No newline at end of file diff --git a/inherit_graph_19.png b/inherit_graph_19.png new file mode 100644 index 000000000..29ace4807 Binary files /dev/null and b/inherit_graph_19.png differ diff --git a/inherit_graph_2.map b/inherit_graph_2.map new file mode 100644 index 000000000..6fe496793 --- /dev/null +++ b/inherit_graph_2.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_2.md5 b/inherit_graph_2.md5 new file mode 100644 index 000000000..23ec30ee5 --- /dev/null +++ b/inherit_graph_2.md5 @@ -0,0 +1 @@ +53fc201c4075da0acd9890762c28d764 \ No newline at end of file diff --git a/inherit_graph_2.png b/inherit_graph_2.png new file mode 100644 index 000000000..e368004ee Binary files /dev/null and b/inherit_graph_2.png differ diff --git a/inherit_graph_20.map b/inherit_graph_20.map new file mode 100644 index 000000000..3e415a4fe --- /dev/null +++ b/inherit_graph_20.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_20.md5 b/inherit_graph_20.md5 new file mode 100644 index 000000000..601bffa1a --- /dev/null +++ b/inherit_graph_20.md5 @@ -0,0 +1 @@ +24bc010492b5b99e2569158a9d94fc9e \ No newline at end of file diff --git a/inherit_graph_20.png b/inherit_graph_20.png new file mode 100644 index 000000000..2714c0fd2 Binary files /dev/null and b/inherit_graph_20.png differ diff --git a/inherit_graph_21.map b/inherit_graph_21.map new file mode 100644 index 000000000..7a773350b --- /dev/null +++ b/inherit_graph_21.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_21.md5 b/inherit_graph_21.md5 new file mode 100644 index 000000000..d5721f4d6 --- /dev/null +++ b/inherit_graph_21.md5 @@ -0,0 +1 @@ +f3bff5f7476d058a14d69552bbe5da42 \ No newline at end of file diff --git a/inherit_graph_21.png b/inherit_graph_21.png new file mode 100644 index 000000000..48f198fa5 Binary files /dev/null and b/inherit_graph_21.png differ diff --git a/inherit_graph_22.map b/inherit_graph_22.map new file mode 100644 index 000000000..1acf9989b --- /dev/null +++ b/inherit_graph_22.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_22.md5 b/inherit_graph_22.md5 new file mode 100644 index 000000000..9e2f16d35 --- /dev/null +++ b/inherit_graph_22.md5 @@ -0,0 +1 @@ +9ab4f350d9932be4b8d722cb2da7f9f3 \ No newline at end of file diff --git a/inherit_graph_22.png b/inherit_graph_22.png new file mode 100644 index 000000000..5f1987fc6 Binary files /dev/null and b/inherit_graph_22.png differ diff --git a/inherit_graph_23.map b/inherit_graph_23.map new file mode 100644 index 000000000..0152e087f --- /dev/null +++ b/inherit_graph_23.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_23.md5 b/inherit_graph_23.md5 new file mode 100644 index 000000000..aade36bc2 --- /dev/null +++ b/inherit_graph_23.md5 @@ -0,0 +1 @@ +e8ee10fc3ad73d99087814308dea91ca \ No newline at end of file diff --git a/inherit_graph_23.png b/inherit_graph_23.png new file mode 100644 index 000000000..7a096a679 Binary files /dev/null and b/inherit_graph_23.png differ diff --git a/inherit_graph_24.map b/inherit_graph_24.map new file mode 100644 index 000000000..dca7a358b --- /dev/null +++ b/inherit_graph_24.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_24.md5 b/inherit_graph_24.md5 new file mode 100644 index 000000000..fbef9a6b4 --- /dev/null +++ b/inherit_graph_24.md5 @@ -0,0 +1 @@ +5816ad23681e298edcbe91d3eb2fe531 \ No newline at end of file diff --git a/inherit_graph_24.png b/inherit_graph_24.png new file mode 100644 index 000000000..622b3e0e4 Binary files /dev/null and b/inherit_graph_24.png differ diff --git a/inherit_graph_25.map b/inherit_graph_25.map new file mode 100644 index 000000000..529217eff --- /dev/null +++ b/inherit_graph_25.map @@ -0,0 +1,7 @@ + + + + + + + diff --git a/inherit_graph_25.md5 b/inherit_graph_25.md5 new file mode 100644 index 000000000..da48a7635 --- /dev/null +++ b/inherit_graph_25.md5 @@ -0,0 +1 @@ +0167881deb6f0c9c442f1e63b254be44 \ No newline at end of file diff --git a/inherit_graph_25.png b/inherit_graph_25.png new file mode 100644 index 000000000..756df3880 Binary files /dev/null and b/inherit_graph_25.png differ diff --git a/inherit_graph_26.map b/inherit_graph_26.map new file mode 100644 index 000000000..3570a4d45 --- /dev/null +++ b/inherit_graph_26.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_26.md5 b/inherit_graph_26.md5 new file mode 100644 index 000000000..d329d22d8 --- /dev/null +++ b/inherit_graph_26.md5 @@ -0,0 +1 @@ +54060053997a49091d3f7c340a9cc13e \ No newline at end of file diff --git a/inherit_graph_26.png b/inherit_graph_26.png new file mode 100644 index 000000000..90c54cb4b Binary files /dev/null and b/inherit_graph_26.png differ diff --git a/inherit_graph_27.map b/inherit_graph_27.map new file mode 100644 index 000000000..832a894f9 --- /dev/null +++ b/inherit_graph_27.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_27.md5 b/inherit_graph_27.md5 new file mode 100644 index 000000000..6caacba02 --- /dev/null +++ b/inherit_graph_27.md5 @@ -0,0 +1 @@ +b9450bcd72fb8bb078ab823f4d3d784d \ No newline at end of file diff --git a/inherit_graph_27.png b/inherit_graph_27.png new file mode 100644 index 000000000..22d8137bd Binary files /dev/null and b/inherit_graph_27.png differ diff --git a/inherit_graph_28.map b/inherit_graph_28.map new file mode 100644 index 000000000..691ed173f --- /dev/null +++ b/inherit_graph_28.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_28.md5 b/inherit_graph_28.md5 new file mode 100644 index 000000000..ef65b6337 --- /dev/null +++ b/inherit_graph_28.md5 @@ -0,0 +1 @@ +62ae36d0906765f17dd70b8091ac17c5 \ No newline at end of file diff --git a/inherit_graph_28.png b/inherit_graph_28.png new file mode 100644 index 000000000..1007d3539 Binary files /dev/null and b/inherit_graph_28.png differ diff --git a/inherit_graph_29.map b/inherit_graph_29.map new file mode 100644 index 000000000..458b9c93b --- /dev/null +++ b/inherit_graph_29.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_29.md5 b/inherit_graph_29.md5 new file mode 100644 index 000000000..a991bf889 --- /dev/null +++ b/inherit_graph_29.md5 @@ -0,0 +1 @@ +08092e3bc94266721c0b334074940ed9 \ No newline at end of file diff --git a/inherit_graph_29.png b/inherit_graph_29.png new file mode 100644 index 000000000..5f8b18e16 Binary files /dev/null and b/inherit_graph_29.png differ diff --git a/inherit_graph_3.map b/inherit_graph_3.map new file mode 100644 index 000000000..ebaf3d5fd --- /dev/null +++ b/inherit_graph_3.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_3.md5 b/inherit_graph_3.md5 new file mode 100644 index 000000000..27d384407 --- /dev/null +++ b/inherit_graph_3.md5 @@ -0,0 +1 @@ +1553e9fb5f9ac4f32dae1aa03b8cbc37 \ No newline at end of file diff --git a/inherit_graph_3.png b/inherit_graph_3.png new file mode 100644 index 000000000..1b32a1f54 Binary files /dev/null and b/inherit_graph_3.png differ diff --git a/inherit_graph_30.map b/inherit_graph_30.map new file mode 100644 index 000000000..6ef075d82 --- /dev/null +++ b/inherit_graph_30.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_30.md5 b/inherit_graph_30.md5 new file mode 100644 index 000000000..b6092a4eb --- /dev/null +++ b/inherit_graph_30.md5 @@ -0,0 +1 @@ +b9ed23634de55cb543c4c311847468f0 \ No newline at end of file diff --git a/inherit_graph_30.png b/inherit_graph_30.png new file mode 100644 index 000000000..a276ab82a Binary files /dev/null and b/inherit_graph_30.png differ diff --git a/inherit_graph_31.map b/inherit_graph_31.map new file mode 100644 index 000000000..2e8e2053f --- /dev/null +++ b/inherit_graph_31.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_31.md5 b/inherit_graph_31.md5 new file mode 100644 index 000000000..273840bd7 --- /dev/null +++ b/inherit_graph_31.md5 @@ -0,0 +1 @@ +dd2b95b8ac46f5feb04a93e7441443b8 \ No newline at end of file diff --git a/inherit_graph_31.png b/inherit_graph_31.png new file mode 100644 index 000000000..6c88d2a0d Binary files /dev/null and b/inherit_graph_31.png differ diff --git a/inherit_graph_32.map b/inherit_graph_32.map new file mode 100644 index 000000000..b671df058 --- /dev/null +++ b/inherit_graph_32.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_32.md5 b/inherit_graph_32.md5 new file mode 100644 index 000000000..845cf6f58 --- /dev/null +++ b/inherit_graph_32.md5 @@ -0,0 +1 @@ +8356195b2968fa94bb07f767ce45dfac \ No newline at end of file diff --git a/inherit_graph_32.png b/inherit_graph_32.png new file mode 100644 index 000000000..18e95da20 Binary files /dev/null and b/inherit_graph_32.png differ diff --git a/inherit_graph_33.map b/inherit_graph_33.map new file mode 100644 index 000000000..aa69e348e --- /dev/null +++ b/inherit_graph_33.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_33.md5 b/inherit_graph_33.md5 new file mode 100644 index 000000000..fa60686c8 --- /dev/null +++ b/inherit_graph_33.md5 @@ -0,0 +1 @@ +27cf57c7b64319d49fae89c37b9e7b1c \ No newline at end of file diff --git a/inherit_graph_33.png b/inherit_graph_33.png new file mode 100644 index 000000000..db075b4d6 Binary files /dev/null and b/inherit_graph_33.png differ diff --git a/inherit_graph_34.map b/inherit_graph_34.map new file mode 100644 index 000000000..140350c64 --- /dev/null +++ b/inherit_graph_34.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_34.md5 b/inherit_graph_34.md5 new file mode 100644 index 000000000..00a2c1e90 --- /dev/null +++ b/inherit_graph_34.md5 @@ -0,0 +1 @@ +970eab6ae76f25f9c7f8a4ebd64b97fe \ No newline at end of file diff --git a/inherit_graph_34.png b/inherit_graph_34.png new file mode 100644 index 000000000..84b5f7ee8 Binary files /dev/null and b/inherit_graph_34.png differ diff --git a/inherit_graph_35.map b/inherit_graph_35.map new file mode 100644 index 000000000..acee9dce0 --- /dev/null +++ b/inherit_graph_35.map @@ -0,0 +1,5 @@ + + + + + diff --git a/inherit_graph_35.md5 b/inherit_graph_35.md5 new file mode 100644 index 000000000..58a02dc69 --- /dev/null +++ b/inherit_graph_35.md5 @@ -0,0 +1 @@ +e96fd1f00493b43926b1e0db36809952 \ No newline at end of file diff --git a/inherit_graph_35.png b/inherit_graph_35.png new file mode 100644 index 000000000..e71be013b Binary files /dev/null and b/inherit_graph_35.png differ diff --git a/inherit_graph_36.map b/inherit_graph_36.map new file mode 100644 index 000000000..88b97d482 --- /dev/null +++ b/inherit_graph_36.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_36.md5 b/inherit_graph_36.md5 new file mode 100644 index 000000000..fc7f596e1 --- /dev/null +++ b/inherit_graph_36.md5 @@ -0,0 +1 @@ +37532b4d3b0abeaba90ea16339a6cd61 \ No newline at end of file diff --git a/inherit_graph_36.png b/inherit_graph_36.png new file mode 100644 index 000000000..e553e5150 Binary files /dev/null and b/inherit_graph_36.png differ diff --git a/inherit_graph_37.map b/inherit_graph_37.map new file mode 100644 index 000000000..df13c91c9 --- /dev/null +++ b/inherit_graph_37.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_37.md5 b/inherit_graph_37.md5 new file mode 100644 index 000000000..6b46099e0 --- /dev/null +++ b/inherit_graph_37.md5 @@ -0,0 +1 @@ +ceaa2e4f57e4b67306d013728ef7be20 \ No newline at end of file diff --git a/inherit_graph_37.png b/inherit_graph_37.png new file mode 100644 index 000000000..56c3463f8 Binary files /dev/null and b/inherit_graph_37.png differ diff --git a/inherit_graph_38.map b/inherit_graph_38.map new file mode 100644 index 000000000..809a2404f --- /dev/null +++ b/inherit_graph_38.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_38.md5 b/inherit_graph_38.md5 new file mode 100644 index 000000000..e637f4231 --- /dev/null +++ b/inherit_graph_38.md5 @@ -0,0 +1 @@ +ca0375ff8413a414d7f3b5b1e75664e5 \ No newline at end of file diff --git a/inherit_graph_38.png b/inherit_graph_38.png new file mode 100644 index 000000000..5cc9b1b4c Binary files /dev/null and b/inherit_graph_38.png differ diff --git a/inherit_graph_39.map b/inherit_graph_39.map new file mode 100644 index 000000000..005906b12 --- /dev/null +++ b/inherit_graph_39.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_39.md5 b/inherit_graph_39.md5 new file mode 100644 index 000000000..2f43546a9 --- /dev/null +++ b/inherit_graph_39.md5 @@ -0,0 +1 @@ +7164764369139aa547062683badb0ae9 \ No newline at end of file diff --git a/inherit_graph_39.png b/inherit_graph_39.png new file mode 100644 index 000000000..14ea7bd83 Binary files /dev/null and b/inherit_graph_39.png differ diff --git a/inherit_graph_4.map b/inherit_graph_4.map new file mode 100644 index 000000000..bebf43f3e --- /dev/null +++ b/inherit_graph_4.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_4.md5 b/inherit_graph_4.md5 new file mode 100644 index 000000000..730b8ee4b --- /dev/null +++ b/inherit_graph_4.md5 @@ -0,0 +1 @@ +d094dfe221f590f1557a5598136f99e2 \ No newline at end of file diff --git a/inherit_graph_4.png b/inherit_graph_4.png new file mode 100644 index 000000000..1fe7424b4 Binary files /dev/null and b/inherit_graph_4.png differ diff --git a/inherit_graph_40.map b/inherit_graph_40.map new file mode 100644 index 000000000..d4dd951cc --- /dev/null +++ b/inherit_graph_40.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_40.md5 b/inherit_graph_40.md5 new file mode 100644 index 000000000..e491a7da0 --- /dev/null +++ b/inherit_graph_40.md5 @@ -0,0 +1 @@ +1026827ac8bb8bb58f5caef9b2f322fe \ No newline at end of file diff --git a/inherit_graph_40.png b/inherit_graph_40.png new file mode 100644 index 000000000..920f82eed Binary files /dev/null and b/inherit_graph_40.png differ diff --git a/inherit_graph_41.map b/inherit_graph_41.map new file mode 100644 index 000000000..2f2d7d96e --- /dev/null +++ b/inherit_graph_41.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_41.md5 b/inherit_graph_41.md5 new file mode 100644 index 000000000..3966c6a56 --- /dev/null +++ b/inherit_graph_41.md5 @@ -0,0 +1 @@ +147920169f9d58f9cf178f8371cb8e9a \ No newline at end of file diff --git a/inherit_graph_41.png b/inherit_graph_41.png new file mode 100644 index 000000000..7966929b9 Binary files /dev/null and b/inherit_graph_41.png differ diff --git a/inherit_graph_42.map b/inherit_graph_42.map new file mode 100644 index 000000000..1b2290bb3 --- /dev/null +++ b/inherit_graph_42.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_42.md5 b/inherit_graph_42.md5 new file mode 100644 index 000000000..e88d37c53 --- /dev/null +++ b/inherit_graph_42.md5 @@ -0,0 +1 @@ +106e70262d883ea306c5edc4d27e5585 \ No newline at end of file diff --git a/inherit_graph_42.png b/inherit_graph_42.png new file mode 100644 index 000000000..8851f5eef Binary files /dev/null and b/inherit_graph_42.png differ diff --git a/inherit_graph_43.map b/inherit_graph_43.map new file mode 100644 index 000000000..5cd125b6c --- /dev/null +++ b/inherit_graph_43.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_43.md5 b/inherit_graph_43.md5 new file mode 100644 index 000000000..329f18606 --- /dev/null +++ b/inherit_graph_43.md5 @@ -0,0 +1 @@ +cbba8be594492d5503d0bf27cfd13c44 \ No newline at end of file diff --git a/inherit_graph_43.png b/inherit_graph_43.png new file mode 100644 index 000000000..185121b2d Binary files /dev/null and b/inherit_graph_43.png differ diff --git a/inherit_graph_44.map b/inherit_graph_44.map new file mode 100644 index 000000000..1cf0cf165 --- /dev/null +++ b/inherit_graph_44.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_44.md5 b/inherit_graph_44.md5 new file mode 100644 index 000000000..f2450bf18 --- /dev/null +++ b/inherit_graph_44.md5 @@ -0,0 +1 @@ +72069e62a3b6bc5a63c9967efe11809c \ No newline at end of file diff --git a/inherit_graph_44.png b/inherit_graph_44.png new file mode 100644 index 000000000..65ea947c4 Binary files /dev/null and b/inherit_graph_44.png differ diff --git a/inherit_graph_45.map b/inherit_graph_45.map new file mode 100644 index 000000000..ed9cdd203 --- /dev/null +++ b/inherit_graph_45.map @@ -0,0 +1,5 @@ + + + + + diff --git a/inherit_graph_45.md5 b/inherit_graph_45.md5 new file mode 100644 index 000000000..1420d969f --- /dev/null +++ b/inherit_graph_45.md5 @@ -0,0 +1 @@ +a09fde5e74c0343d75245dbc1e8633a4 \ No newline at end of file diff --git a/inherit_graph_45.png b/inherit_graph_45.png new file mode 100644 index 000000000..4cb67f5e1 Binary files /dev/null and b/inherit_graph_45.png differ diff --git a/inherit_graph_46.map b/inherit_graph_46.map new file mode 100644 index 000000000..11605026b --- /dev/null +++ b/inherit_graph_46.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_46.md5 b/inherit_graph_46.md5 new file mode 100644 index 000000000..b3c3397bf --- /dev/null +++ b/inherit_graph_46.md5 @@ -0,0 +1 @@ +fcfc0f9490f54351d9c83870abab05d7 \ No newline at end of file diff --git a/inherit_graph_46.png b/inherit_graph_46.png new file mode 100644 index 000000000..f0a40dadb Binary files /dev/null and b/inherit_graph_46.png differ diff --git a/inherit_graph_47.map b/inherit_graph_47.map new file mode 100644 index 000000000..7b572f810 --- /dev/null +++ b/inherit_graph_47.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_47.md5 b/inherit_graph_47.md5 new file mode 100644 index 000000000..24d7e21be --- /dev/null +++ b/inherit_graph_47.md5 @@ -0,0 +1 @@ +e0888656890384f044d69114769878ac \ No newline at end of file diff --git a/inherit_graph_47.png b/inherit_graph_47.png new file mode 100644 index 000000000..5c2cc6401 Binary files /dev/null and b/inherit_graph_47.png differ diff --git a/inherit_graph_48.map b/inherit_graph_48.map new file mode 100644 index 000000000..f7022240d --- /dev/null +++ b/inherit_graph_48.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_48.md5 b/inherit_graph_48.md5 new file mode 100644 index 000000000..851a7b304 --- /dev/null +++ b/inherit_graph_48.md5 @@ -0,0 +1 @@ +c4988a4c8e5b8835eb9618614d8e8631 \ No newline at end of file diff --git a/inherit_graph_48.png b/inherit_graph_48.png new file mode 100644 index 000000000..3d875e6fc Binary files /dev/null and b/inherit_graph_48.png differ diff --git a/inherit_graph_49.map b/inherit_graph_49.map new file mode 100644 index 000000000..0612db201 --- /dev/null +++ b/inherit_graph_49.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_49.md5 b/inherit_graph_49.md5 new file mode 100644 index 000000000..7f5d5238f --- /dev/null +++ b/inherit_graph_49.md5 @@ -0,0 +1 @@ +5e21954f6a07333bea5c071f37a01888 \ No newline at end of file diff --git a/inherit_graph_49.png b/inherit_graph_49.png new file mode 100644 index 000000000..2175d4d68 Binary files /dev/null and b/inherit_graph_49.png differ diff --git a/inherit_graph_5.map b/inherit_graph_5.map new file mode 100644 index 000000000..000e9ef84 --- /dev/null +++ b/inherit_graph_5.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_5.md5 b/inherit_graph_5.md5 new file mode 100644 index 000000000..293e48189 --- /dev/null +++ b/inherit_graph_5.md5 @@ -0,0 +1 @@ +22f72c05d33a580aef30d3b89a0c4ac6 \ No newline at end of file diff --git a/inherit_graph_5.png b/inherit_graph_5.png new file mode 100644 index 000000000..737de6faf Binary files /dev/null and b/inherit_graph_5.png differ diff --git a/inherit_graph_50.map b/inherit_graph_50.map new file mode 100644 index 000000000..ef3b38937 --- /dev/null +++ b/inherit_graph_50.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_50.md5 b/inherit_graph_50.md5 new file mode 100644 index 000000000..d58294cf1 --- /dev/null +++ b/inherit_graph_50.md5 @@ -0,0 +1 @@ +76e850b350ff98384a22942c081a6328 \ No newline at end of file diff --git a/inherit_graph_50.png b/inherit_graph_50.png new file mode 100644 index 000000000..d2f497d86 Binary files /dev/null and b/inherit_graph_50.png differ diff --git a/inherit_graph_51.map b/inherit_graph_51.map new file mode 100644 index 000000000..e7114c94d --- /dev/null +++ b/inherit_graph_51.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_51.md5 b/inherit_graph_51.md5 new file mode 100644 index 000000000..758b35aa6 --- /dev/null +++ b/inherit_graph_51.md5 @@ -0,0 +1 @@ +1412fe7e409492597612c5d6548ad02f \ No newline at end of file diff --git a/inherit_graph_51.png b/inherit_graph_51.png new file mode 100644 index 000000000..c732867b7 Binary files /dev/null and b/inherit_graph_51.png differ diff --git a/inherit_graph_52.map b/inherit_graph_52.map new file mode 100644 index 000000000..b72dd731c --- /dev/null +++ b/inherit_graph_52.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_52.md5 b/inherit_graph_52.md5 new file mode 100644 index 000000000..ec8dcb2db --- /dev/null +++ b/inherit_graph_52.md5 @@ -0,0 +1 @@ +fa61ae5ea3bac596f464b00803b07888 \ No newline at end of file diff --git a/inherit_graph_52.png b/inherit_graph_52.png new file mode 100644 index 000000000..abc354bb3 Binary files /dev/null and b/inherit_graph_52.png differ diff --git a/inherit_graph_53.map b/inherit_graph_53.map new file mode 100644 index 000000000..991bf8dc2 --- /dev/null +++ b/inherit_graph_53.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_53.md5 b/inherit_graph_53.md5 new file mode 100644 index 000000000..c4ccb1aec --- /dev/null +++ b/inherit_graph_53.md5 @@ -0,0 +1 @@ +27122b248363e7b5a4f459888103d1cc \ No newline at end of file diff --git a/inherit_graph_53.png b/inherit_graph_53.png new file mode 100644 index 000000000..a4af1c6b2 Binary files /dev/null and b/inherit_graph_53.png differ diff --git a/inherit_graph_54.map b/inherit_graph_54.map new file mode 100644 index 000000000..bc4022c7d --- /dev/null +++ b/inherit_graph_54.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_54.md5 b/inherit_graph_54.md5 new file mode 100644 index 000000000..6b255d72a --- /dev/null +++ b/inherit_graph_54.md5 @@ -0,0 +1 @@ +9d9aca89209dbf74c98a549e2b3c3890 \ No newline at end of file diff --git a/inherit_graph_54.png b/inherit_graph_54.png new file mode 100644 index 000000000..4ed963471 Binary files /dev/null and b/inherit_graph_54.png differ diff --git a/inherit_graph_55.map b/inherit_graph_55.map new file mode 100644 index 000000000..c23f236e5 --- /dev/null +++ b/inherit_graph_55.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_55.md5 b/inherit_graph_55.md5 new file mode 100644 index 000000000..e5b04d566 --- /dev/null +++ b/inherit_graph_55.md5 @@ -0,0 +1 @@ +319f59f680f3881de17350e7aa63b103 \ No newline at end of file diff --git a/inherit_graph_55.png b/inherit_graph_55.png new file mode 100644 index 000000000..9ea014cef Binary files /dev/null and b/inherit_graph_55.png differ diff --git a/inherit_graph_56.map b/inherit_graph_56.map new file mode 100644 index 000000000..bec725652 --- /dev/null +++ b/inherit_graph_56.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_56.md5 b/inherit_graph_56.md5 new file mode 100644 index 000000000..fbe367f85 --- /dev/null +++ b/inherit_graph_56.md5 @@ -0,0 +1 @@ +dd2a10d5d2685569b9974c41ded614da \ No newline at end of file diff --git a/inherit_graph_56.png b/inherit_graph_56.png new file mode 100644 index 000000000..cc3db29f5 Binary files /dev/null and b/inherit_graph_56.png differ diff --git a/inherit_graph_57.map b/inherit_graph_57.map new file mode 100644 index 000000000..1642d07b4 --- /dev/null +++ b/inherit_graph_57.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_57.md5 b/inherit_graph_57.md5 new file mode 100644 index 000000000..778208d57 --- /dev/null +++ b/inherit_graph_57.md5 @@ -0,0 +1 @@ +226968c3e6b6b8446c206df6658063f9 \ No newline at end of file diff --git a/inherit_graph_57.png b/inherit_graph_57.png new file mode 100644 index 000000000..7fbe703bd Binary files /dev/null and b/inherit_graph_57.png differ diff --git a/inherit_graph_58.map b/inherit_graph_58.map new file mode 100644 index 000000000..d9942367f --- /dev/null +++ b/inherit_graph_58.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_58.md5 b/inherit_graph_58.md5 new file mode 100644 index 000000000..4d78736f2 --- /dev/null +++ b/inherit_graph_58.md5 @@ -0,0 +1 @@ +c76f2d7c282ccb9bc0f24da27d550e36 \ No newline at end of file diff --git a/inherit_graph_58.png b/inherit_graph_58.png new file mode 100644 index 000000000..095c43c7b Binary files /dev/null and b/inherit_graph_58.png differ diff --git a/inherit_graph_59.map b/inherit_graph_59.map new file mode 100644 index 000000000..d686088a3 --- /dev/null +++ b/inherit_graph_59.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_59.md5 b/inherit_graph_59.md5 new file mode 100644 index 000000000..fc1c569ac --- /dev/null +++ b/inherit_graph_59.md5 @@ -0,0 +1 @@ +9ae0741b92966d690be1fd1420641acf \ No newline at end of file diff --git a/inherit_graph_59.png b/inherit_graph_59.png new file mode 100644 index 000000000..a8d6a645a Binary files /dev/null and b/inherit_graph_59.png differ diff --git a/inherit_graph_6.map b/inherit_graph_6.map new file mode 100644 index 000000000..a983f0d0d --- /dev/null +++ b/inherit_graph_6.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_6.md5 b/inherit_graph_6.md5 new file mode 100644 index 000000000..e889e1eaa --- /dev/null +++ b/inherit_graph_6.md5 @@ -0,0 +1 @@ +57162925f30fd6589b1e3ad0e86327eb \ No newline at end of file diff --git a/inherit_graph_6.png b/inherit_graph_6.png new file mode 100644 index 000000000..de0fa16db Binary files /dev/null and b/inherit_graph_6.png differ diff --git a/inherit_graph_60.map b/inherit_graph_60.map new file mode 100644 index 000000000..65d505c51 --- /dev/null +++ b/inherit_graph_60.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_60.md5 b/inherit_graph_60.md5 new file mode 100644 index 000000000..5a5ba5ffc --- /dev/null +++ b/inherit_graph_60.md5 @@ -0,0 +1 @@ +189c61d0b13d363eb311c1b126f385b7 \ No newline at end of file diff --git a/inherit_graph_60.png b/inherit_graph_60.png new file mode 100644 index 000000000..4e9e57c0e Binary files /dev/null and b/inherit_graph_60.png differ diff --git a/inherit_graph_61.map b/inherit_graph_61.map new file mode 100644 index 000000000..7ad7a0595 --- /dev/null +++ b/inherit_graph_61.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_61.md5 b/inherit_graph_61.md5 new file mode 100644 index 000000000..e57515937 --- /dev/null +++ b/inherit_graph_61.md5 @@ -0,0 +1 @@ +ac7452292daac3eb613bb9e744cd84c9 \ No newline at end of file diff --git a/inherit_graph_61.png b/inherit_graph_61.png new file mode 100644 index 000000000..e62e37eb6 Binary files /dev/null and b/inherit_graph_61.png differ diff --git a/inherit_graph_62.map b/inherit_graph_62.map new file mode 100644 index 000000000..b263a35b1 --- /dev/null +++ b/inherit_graph_62.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_62.md5 b/inherit_graph_62.md5 new file mode 100644 index 000000000..ae6d37de1 --- /dev/null +++ b/inherit_graph_62.md5 @@ -0,0 +1 @@ +2aed292e81df319545f4f4ef968da104 \ No newline at end of file diff --git a/inherit_graph_62.png b/inherit_graph_62.png new file mode 100644 index 000000000..b177f42be Binary files /dev/null and b/inherit_graph_62.png differ diff --git a/inherit_graph_7.map b/inherit_graph_7.map new file mode 100644 index 000000000..c45b7f169 --- /dev/null +++ b/inherit_graph_7.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_7.md5 b/inherit_graph_7.md5 new file mode 100644 index 000000000..ab3f50923 --- /dev/null +++ b/inherit_graph_7.md5 @@ -0,0 +1 @@ +333fde60818a424877b08e17cbd1ec19 \ No newline at end of file diff --git a/inherit_graph_7.png b/inherit_graph_7.png new file mode 100644 index 000000000..a9ef82250 Binary files /dev/null and b/inherit_graph_7.png differ diff --git a/inherit_graph_8.map b/inherit_graph_8.map new file mode 100644 index 000000000..4e635d398 --- /dev/null +++ b/inherit_graph_8.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_8.md5 b/inherit_graph_8.md5 new file mode 100644 index 000000000..a2aa0dc59 --- /dev/null +++ b/inherit_graph_8.md5 @@ -0,0 +1 @@ +a27d617d1e0f8afb46b7b6a5aa689280 \ No newline at end of file diff --git a/inherit_graph_8.png b/inherit_graph_8.png new file mode 100644 index 000000000..1f4efcd7f Binary files /dev/null and b/inherit_graph_8.png differ diff --git a/inherit_graph_9.map b/inherit_graph_9.map new file mode 100644 index 000000000..7b253f6fa --- /dev/null +++ b/inherit_graph_9.map @@ -0,0 +1,3 @@ + + + diff --git a/inherit_graph_9.md5 b/inherit_graph_9.md5 new file mode 100644 index 000000000..be8fc65a1 --- /dev/null +++ b/inherit_graph_9.md5 @@ -0,0 +1 @@ +ccbad72bcddc29bf44b2d2c141b794ea \ No newline at end of file diff --git a/inherit_graph_9.png b/inherit_graph_9.png new file mode 100644 index 000000000..0f3ac5464 Binary files /dev/null and b/inherit_graph_9.png differ diff --git a/inherits.html b/inherits.html new file mode 100644 index 000000000..61671d366 --- /dev/null +++ b/inherits.html @@ -0,0 +1,537 @@ + + + + + + + + +FTXUI: Class Hierarchy + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Class Hierarchy
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + + + + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+
+
+ + + + + diff --git a/input__in__frame_8cpp.html b/input__in__frame_8cpp.html new file mode 100644 index 000000000..8672b1c45 --- /dev/null +++ b/input__in__frame_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: input_in_frame.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
input_in_frame.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 14 of file input_in_frame.cpp.

+ +
+
+
+
+ + + + + diff --git a/input__in__frame_8cpp.js b/input__in__frame_8cpp.js new file mode 100644 index 000000000..9152f0396 --- /dev/null +++ b/input__in__frame_8cpp.js @@ -0,0 +1,4 @@ +var input__in__frame_8cpp = +[ + [ "main", "input__in__frame_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/input__in__frame_8cpp_source.html b/input__in__frame_8cpp_source.html new file mode 100644 index 000000000..2383e135e --- /dev/null +++ b/input__in__frame_8cpp_source.html @@ -0,0 +1,249 @@ + + + + + + + + +FTXUI: input_in_frame.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
input_in_frame.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2021 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <memory> // for allocator, __shared_ptr_access
+
5#include <string> // for string, basic_string, operator+, to_string
+
6#include <vector> // for vector
+
7
+
8#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
9#include "ftxui/component/component.hpp" // for Input, Renderer, Vertical
+
10#include "ftxui/component/component_base.hpp" // for ComponentBase
+
11#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
+
12#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, vscroll_indicator, HEIGHT, LESS_THAN
+
13
+
+
14int main() {
+
15 using namespace ftxui;
+
16
+
17 Component input_list = Container::Vertical({});
+
18 std::vector<std::string> items(100, "");
+
19 for (size_t i = 0; i < items.size(); ++i) {
+
20 input_list->Add(Input(&(items[i]), "placeholder " + std::to_string(i)));
+
21 }
+
22
+
23 auto renderer = Renderer(input_list, [&] {
+
24 return input_list->Render() | vscroll_indicator | frame | border |
+
25 size(HEIGHT, LESS_THAN, 10);
+
26 });
+
27
+
28 auto screen = ScreenInteractive::TerminalOutput();
+
29 screen.Loop(renderer);
+
30}
+
+ + + + +
int main()
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< ComponentBase > Component
+ +
+
+ + + + + diff --git a/input__style_8cpp.html b/input__style_8cpp.html new file mode 100644 index 000000000..0441c2fb6 --- /dev/null +++ b/input__style_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: input_style.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
input_style.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 16 of file input_style.cpp.

+ +
+
+
+
+ + + + + diff --git a/input__style_8cpp.js b/input__style_8cpp.js new file mode 100644 index 000000000..01dc71c5f --- /dev/null +++ b/input__style_8cpp.js @@ -0,0 +1,4 @@ +var input__style_8cpp = +[ + [ "main", "input__style_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/input__style_8cpp_source.html b/input__style_8cpp_source.html new file mode 100644 index 000000000..8a5b340bf --- /dev/null +++ b/input__style_8cpp_source.html @@ -0,0 +1,321 @@ + + + + + + + + +FTXUI: input_style.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
input_style.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <ftxui/dom/linear_gradient.hpp> // for LinearGradient
+
5#include <ftxui/screen/color.hpp> // for Color, Color::White, Color::Red, Color::Blue, Color::Black, Color::GrayDark, ftxui
+
6#include <functional> // for function
+
7#include <string> // for allocator, string
+
8#include <utility> // for move
+
9
+
10#include "ftxui/component/component.hpp" // for Input, Horizontal, Vertical, operator|
+
11#include "ftxui/component/component_base.hpp" // for Component
+
12#include "ftxui/component/component_options.hpp" // for InputState, InputOption
+
13#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
14#include "ftxui/dom/elements.hpp" // for operator|=, Element, bgcolor, operator|, separatorEmpty, color, borderEmpty, separator, text, center, dim, hbox, vbox, border, borderDouble, borderRounded
+
15
+
+
16int main() {
+
17 using namespace ftxui;
+
18
+
19 InputOption style_1 = InputOption::Default();
+
20
+
21 InputOption style_2 = InputOption::Spacious();
+
22
+
23 InputOption style_3 = InputOption::Spacious();
+
24 style_3.transform = [](InputState state) {
+
25 state.element |= borderEmpty;
+
26
+
27 if (state.is_placeholder) {
+
28 state.element |= dim;
+
29 }
+
30
+
31 if (state.focused) {
+
32 state.element |= borderDouble;
+
33 state.element |= bgcolor(Color::White);
+
34 state.element |= color(Color::Black);
+
35 } else if (state.hovered) {
+
36 state.element |= borderRounded;
+
37 state.element |= bgcolor(LinearGradient(90, Color::Blue, Color::Red));
+
38 state.element |= color(Color::White);
+
39 } else {
+
40 state.element |= border;
+
41 state.element |= bgcolor(LinearGradient(0, Color::Blue, Color::Red));
+
42 state.element |= color(Color::White);
+
43 }
+
44
+
45 return state.element;
+
46 };
+
47
+
48 InputOption style_4 = InputOption::Spacious();
+
49 style_4.transform = [](InputState state) {
+
50 state.element = hbox({
+
51 text("Theorem") | center | borderEmpty | bgcolor(Color::Red),
+
52 separatorEmpty(),
+
53 separator() | color(Color::White),
+
54 separatorEmpty(),
+
55 std::move(state.element),
+
56 });
+
57
+
58 state.element |= borderEmpty;
+
59 if (state.is_placeholder) {
+
60 state.element |= dim;
+
61 }
+
62
+
63 if (state.focused) {
+
64 state.element |= bgcolor(Color::Black);
+
65 } else {
+
66 state.element |= bgcolor(Color::Blue);
+
67 }
+
68
+
69 if (state.hovered) {
+
70 state.element |= bgcolor(Color::GrayDark);
+
71 }
+
72
+
73 return vbox({state.element, separatorEmpty()});
+
74 };
+
75
+
76 auto generateUiFromStyle = [&](InputOption style) {
+
77 auto first_name = new std::string(); // Leaked
+
78 auto middle_name = new std::string(); // Leaked
+
79 auto last_name = new std::string(); // Leaked
+
80 return Container::Vertical({
+
81 Input(first_name, "first name", style),
+
82 Input(middle_name, "middle name", style),
+
83 Input(last_name, "last name", style),
+
84 }) |
+
85 borderEmpty;
+
86 };
+
87
+
88 auto ui = Container::Horizontal({
+
89 generateUiFromStyle(style_1),
+
90 generateUiFromStyle(style_2),
+
91 generateUiFromStyle(style_3),
+
92 generateUiFromStyle(style_4),
+
93 });
+
94
+
95 auto screen = ScreenInteractive::TerminalOutput();
+
96 screen.Loop(ui);
+
97}
+
+ + + + + +
std::function< Element(InputState)> transform
+
Option for the Input component.
+
A class representing the settings for linear-gradient color effect.
+
int main()
+ +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
Used to define style for the Input component.
+
+
+ + + + + diff --git a/installation.html b/installation.html new file mode 100644 index 000000000..92531bae1 --- /dev/null +++ b/installation.html @@ -0,0 +1,271 @@ + + + + + + + + +FTXUI: Installation + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Installation
+
+
+

Table of Contents

+ +
+

title-img

+

+Overview

+

FTXUI can be integrated into your project using several build systems and package managers.
+ This page serves as an entry point for the available integration methods.

+

+Supported Methods

+ +

+Next Steps

+

Once FTXUI is installed:

+ +

+Contributions

+

If you use another build system or package manager, feel free to contribute a guide.
+ You can also open a feature request on the GitHub issue tracker.

+
+ + + + +
Previous
Getting Started
+
+
+
+ + + + + diff --git a/installation.js b/installation.js new file mode 100644 index 000000000..f53918a15 --- /dev/null +++ b/installation.js @@ -0,0 +1,29 @@ +var installation = +[ + [ "CMake", "installation_cmake.html", [ + [ "Overview", "installation.html#overview", null ], + [ "Supported Methods", "installation.html#supported-methods", null ], + [ "Next Steps", "installation.html#next-steps", null ], + [ "Contributions", "installation.html#contributions", null ], + [ "Methods of Integration", "installation_cmake.html#methods-of-integration", [ + [ "Using FetchContent", "installation_cmake.html#using-fetchcontent", null ], + [ "Using find_package", "installation_cmake.html#using-find_package", null ], + [ "Using git submodule", "installation_cmake.html#using-git-submodule", null ] + ] ], + [ "Optional CMake Flags", "installation_cmake.html#optional-cmake-flags", null ], + [ "Verifying Integration", "installation_cmake.html#verifying-integration", null ] + ] ], + [ "Bazel", "installation_bazel.html", null ], + [ "Vcpkg", "installation_vcpkg.html", [ + [ "Vcpkg Package", "installation_vcpkg.html#vcpkg-package", null ], + [ "Install FTXUI using Vcpkg", "installation_vcpkg.html#install-ftxui-using-vcpkg", null ], + [ "Configure your build system.", "installation_vcpkg.html#configure-your-build-system", null ] + ] ], + [ "Conan", "installation_conan.html", null ], + [ "Manual", "installation_manual.html", null ], + [ "Nix", "installation_nix.html", null ], + [ "Debian/Ubuntu", "installation_debian.html", null ], + [ "Arch Linux", "installation_arch.html", null ], + [ "openSUSE", "installation_opensuse.html", null ], + [ "XMake", "installation_xmake.html", null ] +]; \ No newline at end of file diff --git a/installation_8md.html b/installation_8md.html new file mode 100644 index 000000000..aebf31929 --- /dev/null +++ b/installation_8md.html @@ -0,0 +1,209 @@ + + + + + + + + +FTXUI: installation.md File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
installation.md File Reference
+
+
+
+
+ + + + + diff --git a/installation__arch_8md.html b/installation__arch_8md.html new file mode 100644 index 000000000..fca60e751 --- /dev/null +++ b/installation__arch_8md.html @@ -0,0 +1,209 @@ + + + + + + + + +FTXUI: installation_arch.md File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
installation_arch.md File Reference
+
+
+
+
+ + + + + diff --git a/installation__bazel_8md.html b/installation__bazel_8md.html new file mode 100644 index 000000000..ca6e972eb --- /dev/null +++ b/installation__bazel_8md.html @@ -0,0 +1,209 @@ + + + + + + + + +FTXUI: installation_bazel.md File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
installation_bazel.md File Reference
+
+
+
+
+ + + + + diff --git a/installation__cmake_8md.html b/installation__cmake_8md.html new file mode 100644 index 000000000..e864ca7e8 --- /dev/null +++ b/installation__cmake_8md.html @@ -0,0 +1,209 @@ + + + + + + + + +FTXUI: installation_cmake.md File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
installation_cmake.md File Reference
+
+
+
+
+ + + + + diff --git a/installation__conan_8md.html b/installation__conan_8md.html new file mode 100644 index 000000000..898d6c69b --- /dev/null +++ b/installation__conan_8md.html @@ -0,0 +1,209 @@ + + + + + + + + +FTXUI: installation_conan.md File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
installation_conan.md File Reference
+
+
+
+
+ + + + + diff --git a/installation__debian_8md.html b/installation__debian_8md.html new file mode 100644 index 000000000..fa27b3120 --- /dev/null +++ b/installation__debian_8md.html @@ -0,0 +1,209 @@ + + + + + + + + +FTXUI: installation_debian.md File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
installation_debian.md File Reference
+
+
+
+
+ + + + + diff --git a/installation__manual_8md.html b/installation__manual_8md.html new file mode 100644 index 000000000..e7d6397c2 --- /dev/null +++ b/installation__manual_8md.html @@ -0,0 +1,209 @@ + + + + + + + + +FTXUI: installation_manual.md File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
installation_manual.md File Reference
+
+
+
+
+ + + + + diff --git a/installation__nix_8md.html b/installation__nix_8md.html new file mode 100644 index 000000000..e39841548 --- /dev/null +++ b/installation__nix_8md.html @@ -0,0 +1,209 @@ + + + + + + + + +FTXUI: installation_nix.md File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
installation_nix.md File Reference
+
+
+
+
+ + + + + diff --git a/installation__opensuse_8md.html b/installation__opensuse_8md.html new file mode 100644 index 000000000..59ec3e547 --- /dev/null +++ b/installation__opensuse_8md.html @@ -0,0 +1,209 @@ + + + + + + + + +FTXUI: installation_opensuse.md File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
installation_opensuse.md File Reference
+
+
+
+
+ + + + + diff --git a/installation__vcpkg_8md.html b/installation__vcpkg_8md.html new file mode 100644 index 000000000..e5ce02962 --- /dev/null +++ b/installation__vcpkg_8md.html @@ -0,0 +1,209 @@ + + + + + + + + +FTXUI: installation_vcpkg.md File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
installation_vcpkg.md File Reference
+
+
+
+
+ + + + + diff --git a/installation__xmake_8md.html b/installation__xmake_8md.html new file mode 100644 index 000000000..d6303810a --- /dev/null +++ b/installation__xmake_8md.html @@ -0,0 +1,209 @@ + + + + + + + + +FTXUI: installation_xmake.md File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
installation_xmake.md File Reference
+
+
+
+
+ + + + + diff --git a/installation_arch.html b/installation_arch.html new file mode 100644 index 000000000..376053319 --- /dev/null +++ b/installation_arch.html @@ -0,0 +1,228 @@ + + + + + + + + +FTXUI: Arch Linux + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Arch Linux
+
+
+

FTXUI is packaged on the AUR. Install using an AUR helper:

+
yay -S ftxui
+

You can also manually download the PKGBUILD from https://aur.archlinux.org/packages/ftxui.

+

Once installed, you can use it in your CMake projects by adding the following to your CMakeLists.txt:

+
find_package(ftxui REQUIRED)
+
add_executable(main main.cpp)
+
target_link_libraries(main
+
PRIVATE ftxui::screen
+
PRIVATE ftxui::dom
+
PRIVATE ftxui::component
+
)
+
Note
This is an unofficial package. That means it is not maintained by the FTXUI team, but by the community. The package maintainers seems to actively update the package to the latest version. Thanks to the maintainers for their work!
+
+ + + + +
Previous
Getting Started
+
+
+
+ + + + + diff --git a/installation_bazel.html b/installation_bazel.html new file mode 100644 index 000000000..3838ca5d6 --- /dev/null +++ b/installation_bazel.html @@ -0,0 +1,234 @@ + + + + + + + + +FTXUI: Bazel + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Bazel
+
+
+

FTXUI can be integrated into your project using Bazel with Bzlmod (Bazel modules).

+

The library is registered in the Bazel Central Registry

+

MODULE.bazel

bazel_dep(name = "ftxui", version = "6.1.9")
+

BUILD.bazel

cc_binary(
+
name = "main",
+
srcs = ["main.cpp"],
+
deps = [
+
"@ftxui//:component",
+
"@ftxui//:dom",
+
"@ftxui//:screen",
+
],
+
)
+

+Starter Project

+

You can use the official Bazel starter project for a minimal working setup:

+ +
+ + + + +
Previous
Getting Started
+
+
+
+ + + + + diff --git a/installation_cmake.html b/installation_cmake.html new file mode 100644 index 000000000..43c54b3f9 --- /dev/null +++ b/installation_cmake.html @@ -0,0 +1,316 @@ + + + + + + + + +FTXUI: CMake + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
CMake
+
+
+ +

This page explains how to depend on FTXUI using CMake.
+

+

+Methods of Integration

+

+Using FetchContent

+

This approach downloads FTXUI at configure time and doesn't require a system-wide install.

+
include(FetchContent)
+
+
FetchContent_Declare(ftxui
+
GIT_REPOSITORY https://github.com/ArthurSonzogni/FTXUI
+
GIT_TAG v6.1.9 # Replace with a version, tag, or commit hash
+
)
+
+
FetchContent_MakeAvailable(ftxui)
+
+
add_executable(main main.cpp)
+
target_link_libraries(main
+
PRIVATE ftxui::screen
+
PRIVATE ftxui::dom
+
PRIVATE ftxui::component
+
)
+

This ensures reproducible builds and easy dependency management.

+

+Using find_package

+

If FTXUI is installed system-wide or via a package manager (e.g. vcpkg or Conan), you can use:

+
find_package(ftxui REQUIRED)
+
+
add_executable(main main.cpp)
+
target_link_libraries(main
+
PRIVATE ftxui::screen
+
PRIVATE ftxui::dom
+
PRIVATE ftxui::component
+
)
+

Make sure the package is visible in your CMAKE_PREFIX_PATH.

+

+Using git submodule

+

You can also add FTXUI as a Git submodule, keeping it as part of your repository:

+
git submodule add https://github.com/ArthurSonzogni/FTXUI external/ftxui
+
git submodule update --init --recursive
+

When cloning a repository that already includes FTXUI as a submodule, make sure to fetch submodules with:

+
git clone --recurse-submodules <your-repo>
+
# Or, if already cloned:
+
git submodule update --init --recursive
+

Then in your CMakeLists.txt:

+
add_subdirectory(external/ftxui)
+
+
add_executable(main main.cpp)
+
target_link_libraries(main
+
PRIVATE ftxui::screen
+
PRIVATE ftxui::dom
+
PRIVATE ftxui::component
+
)
+

This approach works well if you want to vendor FTXUI in your own repository.

+

+Optional CMake Flags

+

FTXUI supports the following CMake options:

+ + + + + + + + + + + + + +
Option Description Default
FTXUI_BUILD_EXAMPLES Build bundled examples OFF
FTXUI_BUILD_DOCS Build the documentation OFF
FTXUI_BUILD_TESTS Enable tests OFF
FTXUI_ENABLE_INSTALL Generate install targets ON
FTXUI_MICROSOFT_TERMINAL_FALLBACK Improve Windows compatibility ON/OFF
+

To enable an option:

+
cmake -DFTXUI_BUILD_EXAMPLES=ON ..
+

+Verifying Integration

+

To confirm the setup is working, build and run a minimal example. If you need a complete template, see: ftxui-starter

+
+ + + + +
Previous
Getting Started
+
+
+
+ + + + + diff --git a/installation_conan.html b/installation_conan.html new file mode 100644 index 000000000..3857e6553 --- /dev/null +++ b/installation_conan.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: Conan + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Conan
+
+
+

Unofficial recipe for FTXUI exists on Conan Center: https://conan.io/center/recipes/ftxui

+
Note
This is an unofficial recipe. That means it is not maintained by the FTXUI team, but by the community. The package maintainers seems to actively update the package to the latest version. Thanks to the maintainers for their work!
+
Todo
Add instructions on how to use the conan recipe.
+
Todo
Please consider adding an "official" recipe to Conan Center if know how. It could be a github action that will automatically update the conan center when a new release is made.
+
+ + + + +
Previous
Getting Started
+
+
+
+ + + + + diff --git a/installation_debian.html b/installation_debian.html new file mode 100644 index 000000000..eb98b46a7 --- /dev/null +++ b/installation_debian.html @@ -0,0 +1,237 @@ + + + + + + + + +FTXUI: Debian/Ubuntu + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Debian/Ubuntu
+
+
+

+Debian and Ubuntu Packages (Unofficial)

+

Pre-built packages are provided by the distributions. Install with:

+
sudo apt install libftxui-dev
+

The following packages are available:

    +
  • ftxui-doc
  • +
  • ftxui-examples
  • +
  • libftxui-component<version>
  • +
  • libftxui-dev
  • +
  • libftxui-dom<version>
  • +
  • libftxui-screen<version>
  • +
+

Once installed, you can use it in your CMake projects by adding the following to your CMakeLists.txt:

+
find_package(ftxui REQUIRED)
+
add_executable(main main.cpp)
+
target_link_libraries(main
+
PRIVATE ftxui::screen
+
PRIVATE ftxui::dom
+
PRIVATE ftxui::component
+
)
+
Note
This is an unofficial package. That means it is not maintained by the FTXUI team, but by the community.
+
+ + + + +
Previous
Getting Started
+
+
+
+ + + + + diff --git a/installation_manual.html b/installation_manual.html new file mode 100644 index 000000000..ce0a110ee --- /dev/null +++ b/installation_manual.html @@ -0,0 +1,243 @@ + + + + + + + + +FTXUI: Manual + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Manual
+
+
+

Table of Contents

+ +
+

+Building from Source (Official)

+

Clone and build the project using CMake:

+
git clone https://github.com/ArthurSonzogni/FTXUI.git
+
cd FTXUI
+
cmake -S . -B build -DFTXUI_ENABLE_INSTALL=ON -D
+
cmake --build build -j
+
sudo cmake --install build
+

Once installed you can use it in your CMake projects by adding the following to your CMakeLists.txt:

+
find_package(ftxui REQUIRED)
+
add_executable(main main.cpp)
+
target_link_libraries(main
+
PRIVATE ftxui::screen
+
PRIVATE ftxui::dom
+
PRIVATE ftxui::component
+
)
+
+ + + + +
Previous
Getting Started
+
+
+
+ + + + + diff --git a/installation_nix.html b/installation_nix.html new file mode 100644 index 000000000..cc8a6163a --- /dev/null +++ b/installation_nix.html @@ -0,0 +1,231 @@ + + + + + + + + +FTXUI: Nix + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Nix
+
+
+
Note
FTXUI author is not very knowledgeable about Nix. This page has been mostly generated by AI. If you have any suggestions to improve it, please open a PR.
+

+Nix Flake

+

FTXUI ships with a flake.nix providing both packages and a development shell.

+

+Build the Library

+
nix build github:ArthurSonzogni/FTXUI
+

The resulting package is accessible via the result link.

+

+Use as a Dependency

+

Add FTXUI to your flake inputs:

+
{
+
inputs.ftxui.url = "github:ArthurSonzogni/FTXUI";
+
}
+

Then reference ftxui.packages.<system>.ftxui in your outputs.

+
+ + + + +
Previous
Getting Started
+
+
+
+ + + + + diff --git a/installation_opensuse.html b/installation_opensuse.html new file mode 100644 index 000000000..c3c040a80 --- /dev/null +++ b/installation_opensuse.html @@ -0,0 +1,225 @@ + + + + + + + + +FTXUI: openSUSE + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
openSUSE
+
+
+

+openSUSE Package (Unofficial)

+

FTXUI seems to be available from the devel:libraries:c_c++ repository.

+
sudo zypper addrepo https://download.opensuse.org/repositories/devel:libraries:c_c++/openSUSE_Leap_$releasever/devel:libraries:c_c++.repo
+
sudo zypper install ftxui
+

See https://build.opensuse.org/package/show/devel:libraries:c_c++/ftxui for details.

+
Note
This is an unofficial package. That means it is not maintained by the FTXUI team, but by the community.
+
+
Note
The FTXUI author is not very knowledgeable about openSUSE. This page has been mostly generated by AI. If you have any suggestions to improve it, please open a PR.
+
+ + + + +
Previous
Getting Started
+
+
+
+ + + + + diff --git a/installation_vcpkg.html b/installation_vcpkg.html new file mode 100644 index 000000000..3339c7ec6 --- /dev/null +++ b/installation_vcpkg.html @@ -0,0 +1,281 @@ + + + + + + + + +FTXUI: Vcpkg + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
Vcpkg
+
+
+

Table of Contents

+ +
+

+Vcpkg Package

+

FTXUI is available in the Vcpkg registry

+

To use it, you can add the following to your vcpkg.json:

+
{
+
"name": "your-project",
+
"version-string": "0.1.0",
+
"dependencies": [
+
{
+
"name": "ftxui",
+
"version>=": "6.1.9"
+
}
+
]
+
}
+

+Install FTXUI using Vcpkg

+
vcpkg install --triplet x64-linux # or x64-windows / arm64-osx etc.
+

+Configure your build system.

+

If you are using CMake, you can use the following in your CMakeLists.txt:

+

CMakeLists.txt

cmake_minimum_required(VERSION 3.15)
+
project(my_project)
+
+
# Make sure vcpkg toolchain file is passed at configure time
+
find_package(ftxui CONFIG REQUIRED)
+
+
add_executable(main main.cpp)
+
target_link_libraries(main
+
PRIVATE ftxui::screen
+
PRIVATE ftxui::dom
+
PRIVATE ftxui::component
+
)
+

main.cpp

+ + +
+
int main() {
+
using namespace ftxui;
+
+
auto screen = ScreenInteractive::TerminalOutput();
+
auto button = Button("Click me", [] { std::cout << "Clicked!\n"; });
+
+
screen.Loop(button);
+
}
+ + + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +

Configure and build the project

cmake -B build -S . -DCMAKE_TOOLCHAIN_FILE=/path/to/vcpkg/scripts/buildsystems/vcpkg.cmake
+
cmake --build build
+
./build/main
+
+ + + + +
Previous
Getting Started
+
+
+
+ + + + + diff --git a/installation_xmake.html b/installation_xmake.html new file mode 100644 index 000000000..556a8809b --- /dev/null +++ b/installation_xmake.html @@ -0,0 +1,242 @@ + + + + + + + + +FTXUI: XMake + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
XMake
+
+
+

Table of Contents

+ +
+

+XMake Package (Unofficial)

+

FTXUI is available in the xmake-repo

+

Example xmake.lua snippet:

+
add_requires("ftxui", {system = false})
+
+
target("demo")
+
set_kind("binary")
+
add_files("src/*.cpp")
+
add_packages("ftxui")
+

Refer to the XMake documentation for further options.

+
Note
This is an unofficial package. That means it is not maintained by the FTXUI team, but by the community.
+
+
Note
The FTXUI author is not very knowledgeable about openSUSE. This page has been mostly generated by AI. If you have any suggestions to improve it, please open a PR.
+
+
+ + + + +
Previous
Getting Started
+
+
+
+ + + + + diff --git a/introduction_8md.html b/introduction_8md.html new file mode 100644 index 000000000..6662682a9 --- /dev/null +++ b/introduction_8md.html @@ -0,0 +1,209 @@ + + + + + + + + +FTXUI: introduction.md File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
introduction.md File Reference
+
+
+
+
+ + + + + diff --git a/inverted_8cpp.html b/inverted_8cpp.html new file mode 100644 index 000000000..b806fe855 --- /dev/null +++ b/inverted_8cpp.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: inverted.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
inverted.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+ + + + +

+Functions

Element inverted (Element child)
 Add a filter that will invert the foreground and the background colors.
 
+
+
+ + + + + diff --git a/inverted_8cpp.js b/inverted_8cpp.js new file mode 100644 index 000000000..34ad23209 --- /dev/null +++ b/inverted_8cpp.js @@ -0,0 +1,4 @@ +var inverted_8cpp = +[ + [ "inverted", "inverted_8cpp.html#ga672456b8f2091b615a30ff755418b37b", null ] +]; \ No newline at end of file diff --git a/inverted_8cpp_source.html b/inverted_8cpp_source.html new file mode 100644 index 000000000..ebe632203 --- /dev/null +++ b/inverted_8cpp_source.html @@ -0,0 +1,260 @@ + + + + + + + + +FTXUI: inverted.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
inverted.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2020 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <memory> // for make_shared
+
5#include <utility> // for move
+
6
+
7#include "ftxui/dom/elements.hpp" // for Element, inverted
+
8#include "ftxui/dom/node.hpp" // for Node
+
9#include "ftxui/dom/node_decorator.hpp" // for NodeDecorator
+
10#include "ftxui/screen/box.hpp" // for Box
+
11#include "ftxui/screen/screen.hpp" // for Pixel, Screen
+
12
+
13namespace ftxui {
+
14
+
15namespace {
+
16class Inverted : public NodeDecorator {
+
17 public:
+ +
19
+
20 void Render(Screen& screen) override {
+
21 Node::Render(screen);
+
22 for (int y = box_.y_min; y <= box_.y_max; ++y) {
+
23 for (int x = box_.x_min; x <= box_.x_max; ++x) {
+
24 screen.PixelAt(x, y).inverted ^= true;
+
25 }
+
26 }
+
27 }
+
28};
+
29} // namespace
+
30
+
31/// @brief Add a filter that will invert the foreground and the background
+
32/// colors.
+
33/// @ingroup dom
+
+ +
35 return std::make_shared<Inverted>(std::move(child));
+
36}
+
+
37
+
38} // namespace ftxui
+ +
NodeDecorator(Element child)
+ +
friend void Render(Screen &screen, Node *node, Selection &selection)
Definition node.cpp:96
+
Element inverted(Element)
Add a filter that will invert the foreground and the background colors.
Definition inverted.cpp:34
+
void Render(Screen &screen, const Element &element)
Display an element on a ftxui::Screen.
Definition node.cpp:84
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+ + + +
+
+ + + + + diff --git a/italic_8cpp.html b/italic_8cpp.html new file mode 100644 index 000000000..b9da153ae --- /dev/null +++ b/italic_8cpp.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: italic.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
italic.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+ + + + +

+Functions

Element italic (Element child)
 Apply a underlinedDouble to text.
 
+
+
+ + + + + diff --git a/italic_8cpp.js b/italic_8cpp.js new file mode 100644 index 000000000..f68063f36 --- /dev/null +++ b/italic_8cpp.js @@ -0,0 +1,4 @@ +var italic_8cpp = +[ + [ "italic", "italic_8cpp.html#ga8a8d190765de7bbd9e78f9e639c2a96d", null ] +]; \ No newline at end of file diff --git a/italic_8cpp_source.html b/italic_8cpp_source.html new file mode 100644 index 000000000..eb93a3a2f --- /dev/null +++ b/italic_8cpp_source.html @@ -0,0 +1,258 @@ + + + + + + + + +FTXUI: italic.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
italic.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2025 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <memory> // for make_shared
+
5#include <utility> // for move
+
6
+
7#include "ftxui/dom/elements.hpp" // for Element, underlinedDouble
+
8#include "ftxui/dom/node.hpp" // for Node
+
9#include "ftxui/dom/node_decorator.hpp" // for NodeDecorator
+
10#include "ftxui/screen/box.hpp" // for Box
+
11#include "ftxui/screen/screen.hpp" // for Pixel, Screen
+
12
+
13namespace ftxui {
+
14
+
15/// @brief Apply a underlinedDouble to text.
+
16/// @ingroup dom
+
+ +
18 class Impl : public NodeDecorator {
+
19 public:
+
20 using NodeDecorator::NodeDecorator;
+
21
+
22 void Render(Screen& screen) override {
+
23 for (int y = box_.y_min; y <= box_.y_max; ++y) {
+
24 for (int x = box_.x_min; x <= box_.x_max; ++x) {
+
25 screen.PixelAt(x, y).italic = true;
+
26 }
+
27 }
+
28 Node::Render(screen);
+
29 }
+
30 };
+
31
+
32 return std::make_shared<Impl>(std::move(child));
+
33}
+
+
34
+
35} // namespace ftxui
+ + + +
Element italic(Element)
Apply a underlinedDouble to text.
Definition italic.cpp:17
+
Pixel & PixelAt(int x, int y)
Access a cell (Pixel) at a given position.
Definition image.cpp:43
+
bool italic
Definition pixel.hpp:31
+
A rectangular grid of Pixel.
Definition screen.hpp:26
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< Node > Element
Definition elements.hpp:22
+ + + +
+
+ + + + + diff --git a/jquery.js b/jquery.js new file mode 100644 index 000000000..875ada738 --- /dev/null +++ b/jquery.js @@ -0,0 +1,204 @@ +/*! jQuery v3.6.0 | (c) OpenJS Foundation and other contributors | jquery.org/license */ +!function(e,t){"use strict";"object"==typeof module&&"object"==typeof module.exports?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:this,function(C,e){"use strict";var t=[],r=Object.getPrototypeOf,s=t.slice,g=t.flat?function(e){return t.flat.call(e)}:function(e){return t.concat.apply([],e)},u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType&&"function"!=typeof e.item},x=function(e){return null!=e&&e===e.window},E=C.document,c={type:!0,src:!0,nonce:!0,noModule:!0};function b(e,t,n){var r,i,o=(n=n||E).createElement("script");if(o.text=e,t)for(r in c)(i=t[r]||t.getAttribute&&t.getAttribute(r))&&o.setAttribute(r,i);n.head.appendChild(o).parentNode.removeChild(o)}function w(e){return null==e?e+"":"object"==typeof e||"function"==typeof e?n[o.call(e)]||"object":typeof e} +var f="3.6.0",S=function(e,t){return new S.fn.init(e,t)};function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),U=new RegExp(M+"|>"),X=new RegExp(F),V=new RegExp("^"+I+"$"),G={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+W),PSEUDO:new RegExp("^"+F),CHILD:new RegExp( +"^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+R+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/HTML$/i,Q=/^(?:input|select|textarea|button)$/i,J=/^h\d$/i,K=/^[^{]+\{\s*\[native \w/,Z=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ee=/[+~]/,te=new RegExp("\\\\[\\da-fA-F]{1,6}"+M+"?|\\\\([^\\r\\n\\f])","g"),ne=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},re=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ie=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},oe=function(){T()},ae=be(function(e){return!0===e.disabled&&"fieldset"===e.nodeName.toLowerCase()},{dir:"parentNode",next:"legend"});try{H.apply(t=O.call(p.childNodes),p.childNodes),t[p.childNodes.length].nodeType +}catch(e){H={apply:t.length?function(e,t){L.apply(e,O.call(t))}:function(e,t){var n=e.length,r=0;while(e[n++]=t[r++]);e.length=n-1}}}function se(t,e,n,r){var i,o,a,s,u,l,c,f=e&&e.ownerDocument,p=e?e.nodeType:9;if(n=n||[],"string"!=typeof t||!t||1!==p&&9!==p&&11!==p)return n;if(!r&&(T(e),e=e||C,E)){if(11!==p&&(u=Z.exec(t)))if(i=u[1]){if(9===p){if(!(a=e.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(e,a)&&a.id===i)return n.push(a),n}else{if(u[2])return H.apply(n,e.getElementsByTagName(t)),n;if((i=u[3])&&d.getElementsByClassName&&e.getElementsByClassName)return H.apply(n,e.getElementsByClassName(i)),n}if(d.qsa&&!N[t+" "]&&(!v||!v.test(t))&&(1!==p||"object"!==e.nodeName.toLowerCase())){if(c=t,f=e,1===p&&(U.test(t)||z.test(t))){(f=ee.test(t)&&ye(e.parentNode)||e)===e&&d.scope||((s=e.getAttribute("id"))?s=s.replace(re,ie):e.setAttribute("id",s=S)),o=(l=h(t)).length;while(o--)l[o]=(s?"#"+s:":scope")+" "+xe(l[o]);c=l.join(",")}try{return H.apply(n,f.querySelectorAll(c +)),n}catch(e){N(t,!0)}finally{s===S&&e.removeAttribute("id")}}}return g(t.replace($,"$1"),e,n,r)}function ue(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function le(e){return e[S]=!0,e}function ce(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function fe(e,t){var n=e.split("|"),r=n.length;while(r--)b.attrHandle[n[r]]=t}function pe(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)while(n=n.nextSibling)if(n===t)return-1;return e?1:-1}function de(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function he(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function ge(t){return function(e){ +return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ae(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function ve(a){return le(function(o){return o=+o,le(function(e,t){var n,r=a([],e.length,o),i=r.length;while(i--)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ye(e){return e&&"undefined"!=typeof e.getElementsByTagName&&e}for(e in d=se.support={},i=se.isXML=function(e){var t=e&&e.namespaceURI,n=e&&(e.ownerDocument||e).documentElement;return!Y.test(t||n&&n.nodeName||"HTML")},T=se.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:p;return r!=C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),p!=C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",oe,!1):n.attachEvent&&n.attachEvent("onunload",oe)),d.scope=ce(function(e){return a.appendChild(e).appendChild(C.createElement("div")),"undefined"!=typeof e.querySelectorAll&&!e.querySelectorAll( +":scope fieldset div").length}),d.attributes=ce(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ce(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=K.test(C.getElementsByClassName),d.getById=ce(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(te,ne);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(te,ne);return function(e){var t="undefined"!=typeof e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if("undefined"!=typeof t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];i=t.getElementsByName(e),r=0;while(o=i[r++])if((n=o.getAttributeNode("id") +)&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return"undefined"!=typeof t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"===e){while(n=o[i++])1===n.nodeType&&r.push(n);return r}return o},b.find.CLASS=d.getElementsByClassName&&function(e,t){if("undefined"!=typeof t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=K.test(C.querySelectorAll))&&(ce(function(e){var t;a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+R+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),(t=C.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||v.push( +"\\["+M+"*name"+M+"*="+M+"*(?:''|\"\")"),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]"),e.querySelectorAll("\\\f"),v.push("[\\r\\n\\f]")}),ce(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=K.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ce(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",F)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=K.test( +a.compareDocumentPosition),y=t||K.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)while(t=t.parentNode)if(t===e)return!0;return!1},j=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e==C||e.ownerDocument==p&&y(p,e)?-1:t==C||t.ownerDocument==p&&y(p,t)?1:u?P(u,e)-P(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e==C?-1:t==C?1:i?-1:o?1:u?P(u,e)-P(u,t):0;if(i===o)return pe(e,t);n=e;while(n=n.parentNode)a.unshift(n);n=t;while(n=n.parentNode)s.unshift(n);while(a[r]===s[r])r++;return r?pe(a[r],s[r]):a[r]==p?-1:s[r]==p?1:0}),C},se.matches=function(e,t){return se(e,null, +null,t)},se.matchesSelector=function(e,t){if(T(e),d.matchesSelector&&E&&!N[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){N(t,!0)}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(te,ne),e[3]=(e[3]||e[4]||e[5]||"").replace(te,ne),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||se.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&se.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return G.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(te,ne +).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=m[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&m(e,function(e){return t.test("string"==typeof e.className&&e.className||"undefined"!=typeof e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=se.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function j(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||D,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this)}).prototype=S.fn,D=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){while((e=e[t])&&1!==e.nodeType);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for( +var e=0;e\x20\t\r\n\f]*)/i,he=/^$|^module$|\/(?:java|ecma)script/i;ce=E.createDocumentFragment().appendChild(E.createElement("div")),(fe=E.createElement("input")).setAttribute("type","radio"),fe.setAttribute("checked","checked"),fe.setAttribute("name","t"),ce.appendChild(fe),y.checkClone=ce.cloneNode(!0).cloneNode(!0).lastChild.checked,ce.innerHTML="",y.noCloneChecked=!!ce.cloneNode(!0).lastChild.defaultValue,ce.innerHTML="",y.option=!!ce.lastChild;var ge={thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function ve(e,t){var n; +return n="undefined"!=typeof e.getElementsByTagName?e.getElementsByTagName(t||"*"):"undefined"!=typeof e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&A(e,t)?S.merge([e],n):n}function ye(e,t){for(var n=0,r=e.length;n",""]);var me=/<|&#?\w+;/;function xe(e,t,n,r,i){for(var o,a,s,u,l,c,f=t.createDocumentFragment(),p=[],d=0,h=e.length;d\s*$/g;function je(e,t){return A(e,"table")&&A(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function De(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function qe(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function Le(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(Y.hasData(e)&&(s=Y.get(e).events))for(i in Y.remove(t,"handle events"),s)for(n=0, +r=s[i].length;n").attr(n.scriptAttrs||{}).prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var _t,zt=[],Ut=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=zt.pop()||S.expando+"_"+wt.guid++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(Ut.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&Ut.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(Ut,"$1"+r):!1!==e.jsonp&&(e.url+=(Tt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r] +,C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,zt.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((_t=E.implementation.createHTMLDocument("").body).innerHTML="
",2===_t.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=xe([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each( +function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,i=r.left):(a=parseFloat(o)||0,i=parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r, +"position"))t=r.getBoundingClientRect();else{t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;while(e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position"))e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var e=this.offsetParent;while(e&&"static"===S.css(e,"position"))e=e.offsetParent;return e||re})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return $(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=Fe(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Pe.test(t)?S(e).position()[n]+"px":t})} +),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return $(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.fn.extend({bind:function(e,t,n){return this.on(e,null,t,n)},unbind:function(e,t){return this.off(e,null,t)},delegate:function(e,t,n,r){return this.on(t,e,n,r)},undelegate:function(e,t,n){return 1===arguments.length?this.off(e,"**"):this.off(t,e||"**",n)},hover:function(e,t){return this.mouseenter(e).mouseleave(t||e)}}),S.each( +"blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0",options:{classes:{},disabled:!1,create:null},_createWidget:function(t,e){e=y(e||this.defaultElement||this)[0],this.element=y(e),this.uuid=i++,this.eventNamespace="."+this.widgetName+this.uuid,this.bindings=y(),this.hoverable=y(),this.focusable=y(),this.classesElementLookup={},e!==this&&(y.data(e,this.widgetFullName,this),this._on(!0,this.element,{remove:function(t +){t.target===e&&this.destroy()}}),this.document=y(e.style?e.ownerDocument:e.document||e),this.window=y(this.document[0].defaultView||this.document[0].parentWindow)),this.options=y.widget.extend({},this.options,this._getCreateOptions(),t),this._create(),this.options.disabled&&this._setOptionDisabled(this.options.disabled),this._trigger("create",null,this._getCreateEventData()),this._init()},_getCreateOptions:function(){return{}},_getCreateEventData:y.noop,_create:y.noop,_init:y.noop,destroy:function(){var i=this;this._destroy(),y.each(this.classesElementLookup,function(t,e){i._removeClass(e,t)}),this.element.off(this.eventNamespace).removeData(this.widgetFullName),this.widget().off(this.eventNamespace).removeAttr("aria-disabled"),this.bindings.off(this.eventNamespace)},_destroy:y.noop,widget:function(){return this.element},option:function(t,e){var i,s,n,o=t;if(0===arguments.length)return y.widget.extend({},this.options);if("string"==typeof t)if(o={},t=(i=t.split(".")).shift(),i.length){for(s=o[t +]=y.widget.extend({},this.options[t]),n=0;n
"),i=e.children()[0];return y("body").append(e),t=i.offsetWidth,e.css("overflow","scroll"),t===(i=i.offsetWidth)&&(i=e[0].clientWidth),e.remove(),s=t-i}, +getScrollInfo:function(t){var e=t.isWindow||t.isDocument?"":t.element.css("overflow-x"),i=t.isWindow||t.isDocument?"":t.element.css("overflow-y"),e="scroll"===e||"auto"===e&&t.widthx(D(s),D(n))?o.important="horizontal":o.important="vertical",p.using.call(this,t,o)}),h.offset(y.extend(l,{using:t}))})},y.ui.position={fit:{left:function(t,e){var i=e.within, +s=i.isWindow?i.scrollLeft:i.offset.left,n=i.width,o=t.left-e.collisionPosition.marginLeft,h=s-o,a=o+e.collisionWidth-n-s;e.collisionWidth>n?0n?0=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return!0}}),y.ui.plugin={add:function(t,e,i){var s,n=y.ui[t].prototype;for(s in i)n.plugins[s]=n.plugins[s]||[],n.plugins[s].push([e,i[s]])},call:function(t,e,i,s){var n,o=t.plugins[e];if(o&&(s||t.element[0].parentNode&&11!==t.element[0].parentNode.nodeType))for(n=0;n").css({overflow:"hidden",position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),top:this.element.css("top"),left:this.element.css("left")})), +this.element=this.element.parent().data("ui-resizable",this.element.resizable("instance")),this.elementIsWrapper=!0,t={marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom"),marginLeft:this.originalElement.css("marginLeft")},this.element.css(t),this.originalElement.css("margin",0),this.originalResizeStyle=this.originalElement.css("resize"),this.originalElement.css("resize","none"),this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"})),this.originalElement.css(t),this._proportionallyResize()),this._setupHandles(),e.autoHide&&y(this.element).on("mouseenter",function(){e.disabled||(i._removeClass("ui-resizable-autohide"),i._handles.show())}).on("mouseleave",function(){e.disabled||i.resizing||(i._addClass("ui-resizable-autohide"),i._handles.hide())}),this._mouseInit()},_destroy:function(){this._mouseDestroy(),this._addedHandles.remove();function t(t){y(t +).removeData("resizable").removeData("ui-resizable").off(".resizable")}var e;return this.elementIsWrapper&&(t(this.element),e=this.element,this.originalElement.css({position:e.css("position"),width:e.outerWidth(),height:e.outerHeight(),top:e.css("top"),left:e.css("left")}).insertAfter(e),e.remove()),this.originalElement.css("resize",this.originalResizeStyle),t(this.originalElement),this},_setOption:function(t,e){switch(this._super(t,e),t){case"handles":this._removeHandles(),this._setupHandles();break;case"aspectRatio":this._aspectRatio=!!e}},_setupHandles:function(){var t,e,i,s,n,o=this.options,h=this;if(this.handles=o.handles||(y(".ui-resizable-handle",this.element).length?{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",nw:".ui-resizable-nw"}:"e,s,se"),this._handles=y(),this._addedHandles=y(),this.handles.constructor===String)for("all"===this.handles&&(this.handles="n,e,s,w,se,sw,ne,nw"),i=this.handles.split( +","),this.handles={},e=0;e"),this._addClass(n,"ui-resizable-handle "+s),n.css({zIndex:o.zIndex}),this.handles[t]=".ui-resizable-"+t,this.element.children(this.handles[t]).length||(this.element.append(n),this._addedHandles=this._addedHandles.add(n));this._renderAxis=function(t){var e,i,s;for(e in t=t||this.element,this.handles)this.handles[e].constructor===String?this.handles[e]=this.element.children(this.handles[e]).first().show():(this.handles[e].jquery||this.handles[e].nodeType)&&(this.handles[e]=y(this.handles[e]),this._on(this.handles[e],{mousedown:h._mouseDown})),this.elementIsWrapper&&this.originalElement[0].nodeName.match(/^(textarea|input|select|button)$/i)&&(i=y(this.handles[e],this.element),s=/sw|ne|nw|se|n|s/.test(e)?i.outerHeight():i.outerWidth(),i=["padding",/ne|nw|n/.test(e)?"Top":/se|sw|s/.test(e)?"Bottom":/^e$/.test(e)?"Right":"Left"].join(""),t.css(i,s),this._proportionallyResize()),this._handles=this._handles.add( +this.handles[e])},this._renderAxis(this.element),this._handles=this._handles.add(this.element.find(".ui-resizable-handle")),this._handles.disableSelection(),this._handles.on("mouseover",function(){h.resizing||(this.className&&(n=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i)),h.axis=n&&n[1]?n[1]:"se")}),o.autoHide&&(this._handles.hide(),this._addClass("ui-resizable-autohide"))},_removeHandles:function(){this._addedHandles.remove()},_mouseCapture:function(t){var e,i,s=!1;for(e in this.handles)(i=y(this.handles[e])[0])!==t.target&&!y.contains(i,t.target)||(s=!0);return!this.options.disabled&&s},_mouseStart:function(t){var e,i,s=this.options,n=this.element;return this.resizing=!0,this._renderProxy(),e=this._num(this.helper.css("left")),i=this._num(this.helper.css("top")),s.containment&&(e+=y(s.containment).scrollLeft()||0,i+=y(s.containment).scrollTop()||0),this.offset=this.helper.offset(),this.position={left:e,top:i},this.size=this._helper?{width:this.helper.width(),height:this.helper.height()}:{ +width:n.width(),height:n.height()},this.originalSize=this._helper?{width:n.outerWidth(),height:n.outerHeight()}:{width:n.width(),height:n.height()},this.sizeDiff={width:n.outerWidth()-n.width(),height:n.outerHeight()-n.height()},this.originalPosition={left:e,top:i},this.originalMousePosition={left:t.pageX,top:t.pageY},this.aspectRatio="number"==typeof s.aspectRatio?s.aspectRatio:this.originalSize.width/this.originalSize.height||1,s=y(".ui-resizable-"+this.axis).css("cursor"),y("body").css("cursor","auto"===s?this.axis+"-resize":s),this._addClass("ui-resizable-resizing"),this._propagate("start",t),!0},_mouseDrag:function(t){var e=this.originalMousePosition,i=this.axis,s=t.pageX-e.left||0,e=t.pageY-e.top||0,i=this._change[i];return this._updatePrevProperties(),i&&(e=i.apply(this,[t,s,e]),this._updateVirtualBoundaries(t.shiftKey),(this._aspectRatio||t.shiftKey)&&(e=this._updateRatio(e,t)),e=this._respectSize(e,t),this._updateCache(e),this._propagate("resize",t),e=this._applyChanges(), +!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize(),y.isEmptyObject(e)||(this._updatePrevProperties(),this._trigger("resize",t,this.ui()),this._applyChanges())),!1},_mouseStop:function(t){this.resizing=!1;var e,i,s,n=this.options,o=this;return this._helper&&(s=(e=(i=this._proportionallyResizeElements).length&&/textarea/i.test(i[0].nodeName))&&this._hasScroll(i[0],"left")?0:o.sizeDiff.height,i=e?0:o.sizeDiff.width,e={width:o.helper.width()-i,height:o.helper.height()-s},i=parseFloat(o.element.css("left"))+(o.position.left-o.originalPosition.left)||null,s=parseFloat(o.element.css("top"))+(o.position.top-o.originalPosition.top)||null,n.animate||this.element.css(y.extend(e,{top:s,left:i})),o.helper.height(o.size.height),o.helper.width(o.size.width),this._helper&&!n.animate&&this._proportionallyResize()),y("body").css("cursor","auto"),this._removeClass("ui-resizable-resizing"),this._propagate("stop",t),this._helper&&this.helper.remove(),!1},_updatePrevProperties:function(){ +this.prevPosition={top:this.position.top,left:this.position.left},this.prevSize={width:this.size.width,height:this.size.height}},_applyChanges:function(){var t={};return this.position.top!==this.prevPosition.top&&(t.top=this.position.top+"px"),this.position.left!==this.prevPosition.left&&(t.left=this.position.left+"px"),this.size.width!==this.prevSize.width&&(t.width=this.size.width+"px"),this.size.height!==this.prevSize.height&&(t.height=this.size.height+"px"),this.helper.css(t),t},_updateVirtualBoundaries:function(t){var e,i,s=this.options,n={minWidth:this._isNumber(s.minWidth)?s.minWidth:0,maxWidth:this._isNumber(s.maxWidth)?s.maxWidth:1/0,minHeight:this._isNumber(s.minHeight)?s.minHeight:0,maxHeight:this._isNumber(s.maxHeight)?s.maxHeight:1/0};(this._aspectRatio||t)&&(e=n.minHeight*this.aspectRatio,i=n.minWidth/this.aspectRatio,s=n.maxHeight*this.aspectRatio,t=n.maxWidth/this.aspectRatio,e>n.minWidth&&(n.minWidth=e),i>n.minHeight&&(n.minHeight=i),st.width,h=this._isNumber(t.height)&&e.minHeight&&e.minHeight>t.height,a=this.originalPosition.left+this.originalSize.width,r=this.originalPosition.top+this.originalSize.height +,l=/sw|nw|w/.test(i),i=/nw|ne|n/.test(i);return o&&(t.width=e.minWidth),h&&(t.height=e.minHeight),s&&(t.width=e.maxWidth),n&&(t.height=e.maxHeight),o&&l&&(t.left=a-e.minWidth),s&&l&&(t.left=a-e.maxWidth),h&&i&&(t.top=r-e.minHeight),n&&i&&(t.top=r-e.maxHeight),t.width||t.height||t.left||!t.top?t.width||t.height||t.top||!t.left||(t.left=null):t.top=null,t},_getPaddingPlusBorderDimensions:function(t){for(var e=0,i=[],s=[t.css("borderTopWidth"),t.css("borderRightWidth"),t.css("borderBottomWidth"),t.css("borderLeftWidth")],n=[t.css("paddingTop"),t.css("paddingRight"),t.css("paddingBottom"),t.css("paddingLeft")];e<4;e++)i[e]=parseFloat(s[e])||0,i[e]+=parseFloat(n[e])||0;return{height:i[0]+i[2],width:i[1]+i[3]}},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var t,e=0,i=this.helper||this.element;e").css({overflow:"hidden"}),this._addClass(this.helper,this._helper),this.helper.css({width:this.element.outerWidth(),height:this.element.outerHeight(),position:"absolute",left:this.elementOffset.left+"px",top:this.elementOffset.top+"px",zIndex:++e.zIndex}),this.helper.appendTo("body").disableSelection()):this.helper=this.element},_change:{e:function(t,e){return{width:this.originalSize.width+e}},w:function(t,e){var i=this.originalSize;return{left:this.originalPosition.left+e,width:i.width-e}},n:function(t,e,i){var s=this.originalSize;return{top:this.originalPosition.top+i,height:s.height-i}},s:function(t,e,i){return{height:this.originalSize.height+i}},se:function(t,e,i){return y.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},sw:function(t,e, +i){return y.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[t,e,i]))},ne:function(t,e,i){return y.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[t,e,i]))},nw:function(t,e,i){return y.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[t,e,i]))}},_propagate:function(t,e){y.ui.plugin.call(this,t,[e,this.ui()]),"resize"!==t&&this._trigger(t,e,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}}),y.ui.plugin.add("resizable","animate",{stop:function(e){var i=y(this).resizable("instance"),t=i.options,s=i._proportionallyResizeElements,n=s.length&&/textarea/i.test(s[0].nodeName),o=n&&i._hasScroll(s[0],"left")?0:i.sizeDiff.height,h=n?0:i.sizeDiff.width,n={width:i.size.width-h,height:i.size.height-o},h=parseFloat(i.element.css("left"))+(i.position.left-i.originalPosition.left +)||null,o=parseFloat(i.element.css("top"))+(i.position.top-i.originalPosition.top)||null;i.element.animate(y.extend(n,o&&h?{top:o,left:h}:{}),{duration:t.animateDuration,easing:t.animateEasing,step:function(){var t={width:parseFloat(i.element.css("width")),height:parseFloat(i.element.css("height")),top:parseFloat(i.element.css("top")),left:parseFloat(i.element.css("left"))};s&&s.length&&y(s[0]).css({width:t.width,height:t.height}),i._updateCache(t),i._propagate("resize",e)}})}}),y.ui.plugin.add("resizable","containment",{start:function(){var i,s,n=y(this).resizable("instance"),t=n.options,e=n.element,o=t.containment,h=o instanceof y?o.get(0):/parent/.test(o)?e.parent().get(0):o;h&&(n.containerElement=y(h),/document/.test(o)||o===document?(n.containerOffset={left:0,top:0},n.containerPosition={left:0,top:0},n.parentData={element:y(document),left:0,top:0,width:y(document).width(),height:y(document).height()||document.body.parentNode.scrollHeight}):(i=y(h),s=[],y(["Top","Right","Left","Bottom"]).each(function(t,e +){s[t]=n._num(i.css("padding"+e))}),n.containerOffset=i.offset(),n.containerPosition=i.position(),n.containerSize={height:i.innerHeight()-s[3],width:i.innerWidth()-s[1]},t=n.containerOffset,e=n.containerSize.height,o=n.containerSize.width,o=n._hasScroll(h,"left")?h.scrollWidth:o,e=n._hasScroll(h)?h.scrollHeight:e,n.parentData={element:h,left:t.left,top:t.top,width:o,height:e}))},resize:function(t){var e=y(this).resizable("instance"),i=e.options,s=e.containerOffset,n=e.position,o=e._aspectRatio||t.shiftKey,h={top:0,left:0},a=e.containerElement,t=!0;a[0]!==document&&/static/.test(a.css("position"))&&(h=s),n.left<(e._helper?s.left:0)&&(e.size.width=e.size.width+(e._helper?e.position.left-s.left:e.position.left-h.left),o&&(e.size.height=e.size.width/e.aspectRatio,t=!1),e.position.left=i.helper?s.left:0),n.top<(e._helper?s.top:0)&&(e.size.height=e.size.height+(e._helper?e.position.top-s.top:e.position.top),o&&(e.size.width=e.size.height*e.aspectRatio,t=!1),e.position.top=e._helper?s.top:0), +i=e.containerElement.get(0)===e.element.parent().get(0),n=/relative|absolute/.test(e.containerElement.css("position")),i&&n?(e.offset.left=e.parentData.left+e.position.left,e.offset.top=e.parentData.top+e.position.top):(e.offset.left=e.element.offset().left,e.offset.top=e.element.offset().top),n=Math.abs(e.sizeDiff.width+(e._helper?e.offset.left-h.left:e.offset.left-s.left)),s=Math.abs(e.sizeDiff.height+(e._helper?e.offset.top-h.top:e.offset.top-s.top)),n+e.size.width>=e.parentData.width&&(e.size.width=e.parentData.width-n,o&&(e.size.height=e.size.width/e.aspectRatio,t=!1)),s+e.size.height>=e.parentData.height&&(e.size.height=e.parentData.height-s,o&&(e.size.width=e.size.height*e.aspectRatio,t=!1)),t||(e.position.left=e.prevPosition.left,e.position.top=e.prevPosition.top,e.size.width=e.prevSize.width,e.size.height=e.prevSize.height)},stop:function(){var t=y(this).resizable("instance"),e=t.options,i=t.containerOffset,s=t.containerPosition,n=t.containerElement,o=y(t.helper),h=o.offset(),a=o.outerWidth( +)-t.sizeDiff.width,o=o.outerHeight()-t.sizeDiff.height;t._helper&&!e.animate&&/relative/.test(n.css("position"))&&y(this).css({left:h.left-s.left-i.left,width:a,height:o}),t._helper&&!e.animate&&/static/.test(n.css("position"))&&y(this).css({left:h.left-s.left-i.left,width:a,height:o})}}),y.ui.plugin.add("resizable","alsoResize",{start:function(){var t=y(this).resizable("instance").options;y(t.alsoResize).each(function(){var t=y(this);t.data("ui-resizable-alsoresize",{width:parseFloat(t.width()),height:parseFloat(t.height()),left:parseFloat(t.css("left")),top:parseFloat(t.css("top"))})})},resize:function(t,i){var e=y(this).resizable("instance"),s=e.options,n=e.originalSize,o=e.originalPosition,h={height:e.size.height-n.height||0,width:e.size.width-n.width||0,top:e.position.top-o.top||0,left:e.position.left-o.left||0};y(s.alsoResize).each(function(){var t=y(this),s=y(this).data("ui-resizable-alsoresize"),n={},e=t.parents(i.originalElement[0]).length?["width","height"]:["width","height","top","left"];y.each(e, +function(t,e){var i=(s[e]||0)+(h[e]||0);i&&0<=i&&(n[e]=i||null)}),t.css(n)})},stop:function(){y(this).removeData("ui-resizable-alsoresize")}}),y.ui.plugin.add("resizable","ghost",{start:function(){var t=y(this).resizable("instance"),e=t.size;t.ghost=t.originalElement.clone(),t.ghost.css({opacity:.25,display:"block",position:"relative",height:e.height,width:e.width,margin:0,left:0,top:0}),t._addClass(t.ghost,"ui-resizable-ghost"),!1!==y.uiBackCompat&&"string"==typeof t.options.ghost&&t.ghost.addClass(this.options.ghost),t.ghost.appendTo(t.helper)},resize:function(){var t=y(this).resizable("instance");t.ghost&&t.ghost.css({position:"relative",height:t.size.height,width:t.size.width})},stop:function(){var t=y(this).resizable("instance");t.ghost&&t.helper&&t.helper.get(0).removeChild(t.ghost.get(0))}}),y.ui.plugin.add("resizable","grid",{resize:function(){var t,e=y(this).resizable("instance"),i=e.options,s=e.size,n=e.originalSize,o=e.originalPosition,h=e.axis,a="number"==typeof i.grid?[i.grid,i.grid]:i.grid,r=a[0 +]||1,l=a[1]||1,u=Math.round((s.width-n.width)/r)*r,p=Math.round((s.height-n.height)/l)*l,d=n.width+u,c=n.height+p,f=i.maxWidth&&i.maxWidthd,s=i.minHeight&&i.minHeight>c;i.grid=a,m&&(d+=r),s&&(c+=l),f&&(d-=r),g&&(c-=l),/^(se|s|e)$/.test(h)?(e.size.width=d,e.size.height=c):/^(ne)$/.test(h)?(e.size.width=d,e.size.height=c,e.position.top=o.top-p):/^(sw)$/.test(h)?(e.size.width=d,e.size.height=c,e.position.left=o.left-u):((c-l<=0||d-r<=0)&&(t=e._getPaddingPlusBorderDimensions(this)),0=f[g]?0:Math.min(f[g],n));!a&&1-1){ +targetElements.on(evt+EVENT_NAMESPACE,function elementToggle(event){$.powerTip.toggle(this,event)})}else{targetElements.on(evt+EVENT_NAMESPACE,function elementOpen(event){$.powerTip.show(this,event)})}});$.each(options.closeEvents,function(idx,evt){if($.inArray(evt,options.openEvents)<0){targetElements.on(evt+EVENT_NAMESPACE,function elementClose(event){$.powerTip.hide(this,!isMouseEvent(event))})}});targetElements.on("keydown"+EVENT_NAMESPACE,function elementKeyDown(event){if(event.keyCode===27){$.powerTip.hide(this,true)}})}return targetElements};$.fn.powerTip.defaults={fadeInTime:200,fadeOutTime:100,followMouse:false,popupId:"powerTip",popupClass:null,intentSensitivity:7,intentPollInterval:100,closeDelay:100,placement:"n",smartPlacement:false,offset:10,mouseOnToPopup:false,manual:false,openEvents:["mouseenter","focus"],closeEvents:["mouseleave","blur"]};$.fn.powerTip.smartPlacementLists={n:["n","ne","nw","s"],e:["e","ne","se","w","nw","sw","n","s","e"],s:["s","se","sw","n"],w:["w","nw","sw","e","ne","se", +"n","s","w"],nw:["nw","w","sw","n","s","se","nw"],ne:["ne","e","se","n","s","sw","ne"],sw:["sw","w","nw","s","n","ne","sw"],se:["se","e","ne","s","n","nw","se"],"nw-alt":["nw-alt","n","ne-alt","sw-alt","s","se-alt","w","e"],"ne-alt":["ne-alt","n","nw-alt","se-alt","s","sw-alt","e","w"],"sw-alt":["sw-alt","s","se-alt","nw-alt","n","ne-alt","w","e"],"se-alt":["se-alt","s","sw-alt","ne-alt","n","nw-alt","e","w"]};$.powerTip={show:function apiShowTip(element,event){if(isMouseEvent(event)){trackMouse(event);session.previousX=event.pageX;session.previousY=event.pageY;$(element).data(DATA_DISPLAYCONTROLLER).show()}else{$(element).first().data(DATA_DISPLAYCONTROLLER).show(true,true)}return element},reposition:function apiResetPosition(element){$(element).first().data(DATA_DISPLAYCONTROLLER).resetPosition();return element},hide:function apiCloseTip(element,immediate){var displayController;immediate=element?immediate:true;if(element){displayController=$(element).first().data(DATA_DISPLAYCONTROLLER)}else if( +session.activeHover){displayController=session.activeHover.data(DATA_DISPLAYCONTROLLER)}if(displayController){displayController.hide(immediate)}return element},toggle:function apiToggle(element,event){if(session.activeHover&&session.activeHover.is(element)){$.powerTip.hide(element,!isMouseEvent(event))}else{$.powerTip.show(element,event)}return element}};$.powerTip.showTip=$.powerTip.show;$.powerTip.closeTip=$.powerTip.hide;function CSSCoordinates(){var me=this;me.top="auto";me.left="auto";me.right="auto";me.bottom="auto";me.set=function(property,value){if($.isNumeric(value)){me[property]=Math.round(value)}}}function DisplayController(element,options,tipController){var hoverTimer=null,myCloseDelay=null;function openTooltip(immediate,forceOpen){cancelTimer();if(!element.data(DATA_HASACTIVEHOVER)){if(!immediate){session.tipOpenImminent=true;hoverTimer=setTimeout(function intentDelay(){hoverTimer=null;checkForIntent()},options.intentPollInterval)}else{if(forceOpen){element.data(DATA_FORCEDOPEN,true)} +closeAnyDelayed();tipController.showTip(element)}}else{cancelClose()}}function closeTooltip(disableDelay){if(myCloseDelay){myCloseDelay=session.closeDelayTimeout=clearTimeout(myCloseDelay);session.delayInProgress=false}cancelTimer();session.tipOpenImminent=false;if(element.data(DATA_HASACTIVEHOVER)){element.data(DATA_FORCEDOPEN,false);if(!disableDelay){session.delayInProgress=true;session.closeDelayTimeout=setTimeout(function closeDelay(){session.closeDelayTimeout=null;tipController.hideTip(element);session.delayInProgress=false;myCloseDelay=null},options.closeDelay);myCloseDelay=session.closeDelayTimeout}else{tipController.hideTip(element)}}}function checkForIntent(){var xDifference=Math.abs(session.previousX-session.currentX),yDifference=Math.abs(session.previousY-session.currentY),totalDifference=xDifference+yDifference;if(totalDifference",{id:options.popupId});if($body.length===0){$body=$("body")}$body.append(tipElement);session.tooltips=session.tooltips?session.tooltips.add(tipElement):tipElement}if(options.followMouse){if(!tipElement.data(DATA_HASMOUSEMOVE)){$document.on("mousemove"+EVENT_NAMESPACE,positionTipOnCursor);$window.on("scroll"+EVENT_NAMESPACE,positionTipOnCursor);tipElement.data(DATA_HASMOUSEMOVE,true)}}function beginShowTip(element){element.data(DATA_HASACTIVEHOVER,true);tipElement.queue(function queueTipInit(next){showTip(element);next()})}function showTip(element){var tipContent;if(!element.data(DATA_HASACTIVEHOVER)){return}if( +session.isTipOpen){if(!session.isClosing){hideTip(session.activeHover)}tipElement.delay(100).queue(function queueTipAgain(next){showTip(element);next()});return}element.trigger("powerTipPreRender");tipContent=getTooltipContent(element);if(tipContent){tipElement.empty().append(tipContent)}else{return}element.trigger("powerTipRender");session.activeHover=element;session.isTipOpen=true;tipElement.data(DATA_MOUSEONTOTIP,options.mouseOnToPopup);tipElement.addClass(options.popupClass);if(!options.followMouse||element.data(DATA_FORCEDOPEN)){positionTipOnElement(element);session.isFixedTipOpen=true}else{positionTipOnCursor()}if(!element.data(DATA_FORCEDOPEN)&&!options.followMouse){$document.on("click"+EVENT_NAMESPACE,function documentClick(event){var target=event.target;if(target!==element[0]){if(options.mouseOnToPopup){if(target!==tipElement[0]&&!$.contains(tipElement[0],target)){$.powerTip.hide()}}else{$.powerTip.hide()}}})}if(options.mouseOnToPopup&&!options.manual){tipElement.on("mouseenter"+EVENT_NAMESPACE, +function tipMouseEnter(){if(session.activeHover){session.activeHover.data(DATA_DISPLAYCONTROLLER).cancel()}});tipElement.on("mouseleave"+EVENT_NAMESPACE,function tipMouseLeave(){if(session.activeHover){session.activeHover.data(DATA_DISPLAYCONTROLLER).hide()}})}tipElement.fadeIn(options.fadeInTime,function fadeInCallback(){if(!session.desyncTimeout){session.desyncTimeout=setInterval(closeDesyncedTip,500)}element.trigger("powerTipOpen")})}function hideTip(element){session.isClosing=true;session.isTipOpen=false;session.desyncTimeout=clearInterval(session.desyncTimeout);element.data(DATA_HASACTIVEHOVER,false);element.data(DATA_FORCEDOPEN,false);$document.off("click"+EVENT_NAMESPACE);tipElement.off(EVENT_NAMESPACE);tipElement.fadeOut(options.fadeOutTime,function fadeOutCallback(){var coords=new CSSCoordinates;session.activeHover=null;session.isClosing=false;session.isFixedTipOpen=false;tipElement.removeClass();coords.set("top",session.currentY+options.offset);coords.set("left",session.currentX+options.offset); +tipElement.css(coords);element.trigger("powerTipClose")})}function positionTipOnCursor(){var tipWidth,tipHeight,coords,collisions,collisionCount;if(!session.isFixedTipOpen&&(session.isTipOpen||session.tipOpenImminent&&tipElement.data(DATA_HASMOUSEMOVE))){tipWidth=tipElement.outerWidth();tipHeight=tipElement.outerHeight();coords=new CSSCoordinates;coords.set("top",session.currentY+options.offset);coords.set("left",session.currentX+options.offset);collisions=getViewportCollisions(coords,tipWidth,tipHeight);if(collisions!==Collision.none){collisionCount=countFlags(collisions);if(collisionCount===1){if(collisions===Collision.right){coords.set("left",session.scrollLeft+session.windowWidth-tipWidth)}else if(collisions===Collision.bottom){coords.set("top",session.scrollTop+session.windowHeight-tipHeight)}}else{coords.set("left",session.currentX-tipWidth-options.offset);coords.set("top",session.currentY-tipHeight-options.offset)}}tipElement.css(coords)}}function positionTipOnElement(element){var priorityList, +finalPlacement;if(options.smartPlacement||options.followMouse&&element.data(DATA_FORCEDOPEN)){priorityList=$.fn.powerTip.smartPlacementLists[options.placement];$.each(priorityList,function(idx,pos){var collisions=getViewportCollisions(placeTooltip(element,pos),tipElement.outerWidth(),tipElement.outerHeight());finalPlacement=pos;return collisions!==Collision.none})}else{placeTooltip(element,options.placement);finalPlacement=options.placement}tipElement.removeClass("w nw sw e ne se n s w se-alt sw-alt ne-alt nw-alt");tipElement.addClass(finalPlacement)}function placeTooltip(element,placement){var iterationCount=0,tipWidth,tipHeight,coords=new CSSCoordinates;coords.set("top",0);coords.set("left",0);tipElement.css(coords);do{tipWidth=tipElement.outerWidth();tipHeight=tipElement.outerHeight();coords=placementCalculator.compute(element,placement,tipWidth,tipHeight,options.offset);tipElement.css(coords)}while(++iterationCount<=5&&(tipWidth!==tipElement.outerWidth()||tipHeight!==tipElement.outerHeight())); +return coords}function closeDesyncedTip(){var isDesynced=false,hasDesyncableCloseEvent=$.grep(["mouseleave","mouseout","blur","focusout"],function(eventType){return $.inArray(eventType,options.closeEvents)!==-1}).length>0;if(session.isTipOpen&&!session.isClosing&&!session.delayInProgress&&hasDesyncableCloseEvent){if(session.activeHover.data(DATA_HASACTIVEHOVER)===false||session.activeHover.is(":disabled")){isDesynced=true}else if(!isMouseOver(session.activeHover)&&!session.activeHover.is(":focus")&&!session.activeHover.data(DATA_FORCEDOPEN)){if(tipElement.data(DATA_MOUSEONTOTIP)){if(!isMouseOver(tipElement)){isDesynced=true}}else{isDesynced=true}}if(isDesynced){hideTip(session.activeHover)}}}this.showTip=beginShowTip;this.hideTip=hideTip;this.resetPosition=positionTipOnElement}function isSvgElement(element){return Boolean(window.SVGElement&&element[0]instanceof SVGElement)}function isMouseEvent(event){return Boolean(event&&$.inArray(event.type,MOUSE_EVENTS)>-1&&typeof event.pageX==="number")} +function initTracking(){if(!session.mouseTrackingActive){session.mouseTrackingActive=true;getViewportDimensions();$(getViewportDimensions);$document.on("mousemove"+EVENT_NAMESPACE,trackMouse);$window.on("resize"+EVENT_NAMESPACE,trackResize);$window.on("scroll"+EVENT_NAMESPACE,trackScroll)}}function getViewportDimensions(){session.scrollLeft=$window.scrollLeft();session.scrollTop=$window.scrollTop();session.windowWidth=$window.width();session.windowHeight=$window.height()}function trackResize(){session.windowWidth=$window.width();session.windowHeight=$window.height()}function trackScroll(){var x=$window.scrollLeft(),y=$window.scrollTop();if(x!==session.scrollLeft){session.currentX+=x-session.scrollLeft;session.scrollLeft=x}if(y!==session.scrollTop){session.currentY+=y-session.scrollTop;session.scrollTop=y}}function trackMouse(event){session.currentX=event.pageX;session.currentY=event.pageY}function isMouseOver(element){var elementPosition=element.offset(),elementBox=element[0].getBoundingClientRect(), +elementWidth=elementBox.right-elementBox.left,elementHeight=elementBox.bottom-elementBox.top;return session.currentX>=elementPosition.left&&session.currentX<=elementPosition.left+elementWidth&&session.currentY>=elementPosition.top&&session.currentY<=elementPosition.top+elementHeight}function getTooltipContent(element){var tipText=element.data(DATA_POWERTIP),tipObject=element.data(DATA_POWERTIPJQ),tipTarget=element.data(DATA_POWERTIPTARGET),targetElement,content;if(tipText){if($.isFunction(tipText)){tipText=tipText.call(element[0])}content=tipText}else if(tipObject){if($.isFunction(tipObject)){tipObject=tipObject.call(element[0])}if(tipObject.length>0){content=tipObject.clone(true,true)}}else if(tipTarget){targetElement=$("#"+tipTarget);if(targetElement.length>0){content=targetElement.html()}}return content}function getViewportCollisions(coords,elementWidth,elementHeight){var viewportTop=session.scrollTop,viewportLeft=session.scrollLeft,viewportBottom=viewportTop+session.windowHeight, +viewportRight=viewportLeft+session.windowWidth,collisions=Collision.none;if(coords.topviewportBottom||Math.abs(coords.bottom-session.windowHeight)>viewportBottom){collisions|=Collision.bottom}if(coords.leftviewportRight){collisions|=Collision.left}if(coords.left+elementWidth>viewportRight||coords.right1)){a.preventDefault();var c=a.originalEvent.changedTouches[0],d=document.createEvent("MouseEvents");d.initMouseEvent(b,!0,!0,window,1,c.screenX,c.screenY,c.clientX,c.clientY,!1,!1,!1,!1,0,null),a.target.dispatchEvent(d)}}if(a.support.touch="ontouchend"in document,a.support.touch){var e,b=a.ui.mouse.prototype,c=b._mouseInit,d=b._mouseDestroy;b._touchStart=function(a){var b=this;!e&&b._mouseCapture(a.originalEvent.changedTouches[0])&&(e=!0,b._touchMoved=!1,f(a,"mouseover"),f(a,"mousemove"),f(a,"mousedown"))},b._touchMove=function(a){e&&(this._touchMoved=!0,f(a,"mousemove"))},b._touchEnd=function(a){e&&(f(a,"mouseup"),f(a,"mouseout"),this._touchMoved||f(a,"click"),e=!1)},b._mouseInit=function(){var b=this;b.element.bind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b,"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),c.call(b)},b._mouseDestroy=function(){var b=this;b.element.unbind({touchstart:a.proxy(b,"_touchStart"),touchmove:a.proxy(b, +"_touchMove"),touchend:a.proxy(b,"_touchEnd")}),d.call(b)}}}(jQuery); +/*! SmartMenus jQuery Plugin - v1.1.0 - September 17, 2017 + * http://www.smartmenus.org/ + * Copyright Vasil Dinkov, Vadikom Web Ltd. http://vadikom.com; Licensed MIT */(function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&"object"==typeof module.exports?module.exports=t(require("jquery")):t(jQuery)})(function($){function initMouseDetection(t){var e=".smartmenus_mouse";if(mouseDetectionEnabled||t)mouseDetectionEnabled&&t&&($(document).off(e),mouseDetectionEnabled=!1);else{var i=!0,s=null,o={mousemove:function(t){var e={x:t.pageX,y:t.pageY,timeStamp:(new Date).getTime()};if(s){var o=Math.abs(s.x-e.x),a=Math.abs(s.y-e.y);if((o>0||a>0)&&2>=o&&2>=a&&300>=e.timeStamp-s.timeStamp&&(mouse=!0,i)){var n=$(t.target).closest("a");n.is("a")&&$.each(menuTrees,function(){return $.contains(this.$root[0],n[0])?(this.itemEnter({currentTarget:n[0]}),!1):void 0}),i=!1}}s=e}};o[touchEvents?"touchstart":"pointerover pointermove pointerout MSPointerOver MSPointerMove MSPointerOut"]=function(t){isTouchEvent(t.originalEvent)&&(mouse=!1)},$(document).on(getEventsNS(o,e)), +mouseDetectionEnabled=!0}}function isTouchEvent(t){return!/^(4|mouse)$/.test(t.pointerType)}function getEventsNS(t,e){e||(e="");var i={};for(var s in t)i[s.split(" ").join(e+" ")+e]=t[s];return i}var menuTrees=[],mouse=!1,touchEvents="ontouchstart"in window,mouseDetectionEnabled=!1,requestAnimationFrame=window.requestAnimationFrame||function(t){return setTimeout(t,1e3/60)},cancelAnimationFrame=window.cancelAnimationFrame||function(t){clearTimeout(t)},canAnimate=!!$.fn.animate;return $.SmartMenus=function(t,e){this.$root=$(t),this.opts=e,this.rootId="",this.accessIdPrefix="",this.$subArrow=null,this.activatedItems=[],this.visibleSubMenus=[],this.showTimeout=0,this.hideTimeout=0,this.scrollTimeout=0,this.clickActivated=!1,this.focusActivated=!1,this.zIndexInc=0,this.idInc=0,this.$firstLink=null,this.$firstSub=null,this.disabled=!1,this.$disableOverlay=null,this.$touchScrollingSub=null,this.cssTransforms3d="perspective"in t.style||"webkitPerspective"in t.style,this.wasCollapsible=!1,this.init()},$.extend( +$.SmartMenus,{hideAll:function(){$.each(menuTrees,function(){this.menuHideAll()})},destroy:function(){for(;menuTrees.length;)menuTrees[0].destroy();initMouseDetection(!0)},prototype:{init:function(t){var e=this;if(!t){menuTrees.push(this),this.rootId=((new Date).getTime()+Math.random()+"").replace(/\D/g,""),this.accessIdPrefix="sm-"+this.rootId+"-",this.$root.hasClass("sm-rtl")&&(this.opts.rightToLeftSubMenus=!0);var i=".smartmenus";this.$root.data("smartmenus",this).attr("data-smartmenus-id",this.rootId).dataSM("level",1).on(getEventsNS({"mouseover focusin":$.proxy(this.rootOver,this),"mouseout focusout":$.proxy(this.rootOut,this),keydown:$.proxy(this.rootKeyDown,this)},i)).on(getEventsNS({mouseenter:$.proxy(this.itemEnter,this),mouseleave:$.proxy(this.itemLeave,this),mousedown:$.proxy(this.itemDown,this),focus:$.proxy(this.itemFocus,this),blur:$.proxy(this.itemBlur,this),click:$.proxy(this.itemClick,this)},i),"a"),i+=this.rootId,this.opts.hideOnClick&&$(document).on(getEventsNS({touchstart:$.proxy( +this.docTouchStart,this),touchmove:$.proxy(this.docTouchMove,this),touchend:$.proxy(this.docTouchEnd,this),click:$.proxy(this.docClick,this)},i)),$(window).on(getEventsNS({"resize orientationchange":$.proxy(this.winResize,this)},i)),this.opts.subIndicators&&(this.$subArrow=$("").addClass("sub-arrow"),this.opts.subIndicatorsText&&this.$subArrow.html(this.opts.subIndicatorsText)),initMouseDetection()}if(this.$firstSub=this.$root.find("ul").each(function(){e.menuInit($(this))}).eq(0),this.$firstLink=this.$root.find("a").eq(0),this.opts.markCurrentItem){var s=/(index|default)\.[^#\?\/]*/i,o=/#.*/,a=window.location.href.replace(s,""),n=a.replace(o,"");this.$root.find("a").each(function(){var t=this.href.replace(s,""),i=$(this);(t==a||t==n)&&(i.addClass("current"),e.opts.markCurrentTree&&i.parentsUntil("[data-smartmenus-id]","ul").each(function(){$(this).dataSM("parent-a").addClass("current")}))})}this.wasCollapsible=this.isCollapsible()},destroy:function(t){if(!t){var e=".smartmenus";this.$root.removeData( +"smartmenus").removeAttr("data-smartmenus-id").removeDataSM("level").off(e),e+=this.rootId,$(document).off(e),$(window).off(e),this.opts.subIndicators&&(this.$subArrow=null)}this.menuHideAll();var i=this;this.$root.find("ul").each(function(){var t=$(this);t.dataSM("scroll-arrows")&&t.dataSM("scroll-arrows").remove(),t.dataSM("shown-before")&&((i.opts.subMenusMinWidth||i.opts.subMenusMaxWidth)&&t.css({width:"",minWidth:"",maxWidth:""}).removeClass("sm-nowrap"),t.dataSM("scroll-arrows")&&t.dataSM("scroll-arrows").remove(),t.css({zIndex:"",top:"",left:"",marginLeft:"",marginTop:"",display:""})),0==(t.attr("id")||"").indexOf(i.accessIdPrefix)&&t.removeAttr("id")}).removeDataSM("in-mega").removeDataSM("shown-before").removeDataSM("scroll-arrows").removeDataSM("parent-a").removeDataSM("level").removeDataSM("beforefirstshowfired").removeAttr("role").removeAttr("aria-hidden").removeAttr("aria-labelledby").removeAttr("aria-expanded"),this.$root.find("a.has-submenu").each(function(){var t=$(this);0==t.attr("id" +).indexOf(i.accessIdPrefix)&&t.removeAttr("id")}).removeClass("has-submenu").removeDataSM("sub").removeAttr("aria-haspopup").removeAttr("aria-controls").removeAttr("aria-expanded").closest("li").removeDataSM("sub"),this.opts.subIndicators&&this.$root.find("span.sub-arrow").remove(),this.opts.markCurrentItem&&this.$root.find("a.current").removeClass("current"),t||(this.$root=null,this.$firstLink=null,this.$firstSub=null,this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),menuTrees.splice($.inArray(this,menuTrees),1))},disable:function(t){if(!this.disabled){if(this.menuHideAll(),!t&&!this.opts.isPopup&&this.$root.is(":visible")){var e=this.$root.offset();this.$disableOverlay=$('
').css({position:"absolute",top:e.top,left:e.left,width:this.$root.outerWidth(),height:this.$root.outerHeight(),zIndex:this.getStartZIndex(!0),opacity:0}).appendTo(document.body)}this.disabled=!0}},docClick:function(t){return this.$touchScrollingSub?( +this.$touchScrollingSub=null,void 0):((this.visibleSubMenus.length&&!$.contains(this.$root[0],t.target)||$(t.target).closest("a").length)&&this.menuHideAll(),void 0)},docTouchEnd:function(){if(this.lastTouch){if(!(!this.visibleSubMenus.length||void 0!==this.lastTouch.x2&&this.lastTouch.x1!=this.lastTouch.x2||void 0!==this.lastTouch.y2&&this.lastTouch.y1!=this.lastTouch.y2||this.lastTouch.target&&$.contains(this.$root[0],this.lastTouch.target))){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var t=this;this.hideTimeout=setTimeout(function(){t.menuHideAll()},350)}this.lastTouch=null}},docTouchMove:function(t){if(this.lastTouch){var e=t.originalEvent.touches[0];this.lastTouch.x2=e.pageX,this.lastTouch.y2=e.pageY}},docTouchStart:function(t){var e=t.originalEvent.touches[0];this.lastTouch={x1:e.pageX,y1:e.pageY,target:e.target}},enable:function(){this.disabled&&(this.$disableOverlay&&(this.$disableOverlay.remove(),this.$disableOverlay=null),this.disabled=!1)},getClosestMenu:function(t){for( +var e=$(t).closest("ul");e.dataSM("in-mega");)e=e.parent().closest("ul");return e[0]||null},getHeight:function(t){return this.getOffset(t,!0)},getOffset:function(t,e){var i;"none"==t.css("display")&&(i={position:t[0].style.position,visibility:t[0].style.visibility},t.css({position:"absolute",visibility:"hidden"}).show());var s=t[0].getBoundingClientRect&&t[0].getBoundingClientRect(),o=s&&(e?s.height||s.bottom-s.top:s.width||s.right-s.left);return o||0===o||(o=e?t[0].offsetHeight:t[0].offsetWidth),i&&t.hide().css(i),o},getStartZIndex:function(t){var e=parseInt(this[t?"$root":"$firstSub"].css("z-index"));return!t&&isNaN(e)&&(e=parseInt(this.$root.css("z-index"))),isNaN(e)?1:e},getTouchPoint:function(t){return t.touches&&t.touches[0]||t.changedTouches&&t.changedTouches[0]||t},getViewport:function(t){var e=t?"Height":"Width",i=document.documentElement["client"+e],s=window["inner"+e];return s&&(i=Math.min(i,s)),i},getViewportHeight:function(){return this.getViewport(!0)},getViewportWidth:function(){ +return this.getViewport()},getWidth:function(t){return this.getOffset(t)},handleEvents:function(){return!this.disabled&&this.isCSSOn()},handleItemEvents:function(t){return this.handleEvents()&&!this.isLinkInMegaMenu(t)},isCollapsible:function(){return"static"==this.$firstSub.css("position")},isCSSOn:function(){return"inline"!=this.$firstLink.css("display")},isFixed:function(){var t="fixed"==this.$root.css("position");return t||this.$root.parentsUntil("body").each(function(){return"fixed"==$(this).css("position")?(t=!0,!1):void 0}),t},isLinkInMegaMenu:function(t){return $(this.getClosestMenu(t[0])).hasClass("mega-menu")},isTouchMode:function(){return!mouse||this.opts.noMouseOver||this.isCollapsible()},itemActivate:function(t,e){var i=t.closest("ul"),s=i.dataSM("level");if(s>1&&(!this.activatedItems[s-2]||this.activatedItems[s-2][0]!=i.dataSM("parent-a")[0])){var o=this;$(i.parentsUntil("[data-smartmenus-id]","ul").get().reverse()).add(i).each(function(){o.itemActivate($(this).dataSM("parent-a"))})}if(( +!this.isCollapsible()||e)&&this.menuHideSubMenus(this.activatedItems[s-1]&&this.activatedItems[s-1][0]==t[0]?s:s-1),this.activatedItems[s-1]=t,this.$root.triggerHandler("activate.smapi",t[0])!==!1){var a=t.dataSM("sub");a&&(this.isTouchMode()||!this.opts.showOnClick||this.clickActivated)&&this.menuShow(a)}},itemBlur:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&this.$root.triggerHandler("blur.smapi",e[0])},itemClick:function(t){var e=$(t.currentTarget);if(this.handleItemEvents(e)){if(this.$touchScrollingSub&&this.$touchScrollingSub[0]==e.closest("ul")[0])return this.$touchScrollingSub=null,t.stopPropagation(),!1;if(this.$root.triggerHandler("click.smapi",e[0])===!1)return!1;var i=$(t.target).is(".sub-arrow"),s=e.dataSM("sub"),o=s?2==s.dataSM("level"):!1,a=this.isCollapsible(),n=/toggle$/.test(this.opts.collapsibleBehavior),r=/link$/.test(this.opts.collapsibleBehavior),h=/^accordion/.test(this.opts.collapsibleBehavior);if(s&&!s.is(":visible")){if((!r||!a||i)&&(this.opts.showOnClick&&o&&( +this.clickActivated=!0),this.itemActivate(e,h),s.is(":visible")))return this.focusActivated=!0,!1}else if(a&&(n||i))return this.itemActivate(e,h),this.menuHide(s),n&&(this.focusActivated=!1),!1;return this.opts.showOnClick&&o||e.hasClass("disabled")||this.$root.triggerHandler("select.smapi",e[0])===!1?!1:void 0}},itemDown:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&e.dataSM("mousedown",!0)},itemEnter:function(t){var e=$(t.currentTarget);if(this.handleItemEvents(e)){if(!this.isTouchMode()){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0);var i=this;this.showTimeout=setTimeout(function(){i.itemActivate(e)},this.opts.showOnClick&&1==e.closest("ul").dataSM("level")?1:this.opts.showTimeout)}this.$root.triggerHandler("mouseenter.smapi",e[0])}},itemFocus:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&(!this.focusActivated||this.isTouchMode()&&e.dataSM("mousedown")||this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0]==e[0 +]||this.itemActivate(e,!0),this.$root.triggerHandler("focus.smapi",e[0]))},itemLeave:function(t){var e=$(t.currentTarget);this.handleItemEvents(e)&&(this.isTouchMode()||(e[0].blur(),this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0)),e.removeDataSM("mousedown"),this.$root.triggerHandler("mouseleave.smapi",e[0]))},menuHide:function(t){if(this.$root.triggerHandler("beforehide.smapi",t[0])!==!1&&(canAnimate&&t.stop(!0,!0),"none"!=t.css("display"))){var e=function(){t.css("z-index","")};this.isCollapsible()?canAnimate&&this.opts.collapsibleHideFunction?this.opts.collapsibleHideFunction.call(this,t,e):t.hide(this.opts.collapsibleHideDuration,e):canAnimate&&this.opts.hideFunction?this.opts.hideFunction.call(this,t,e):t.hide(this.opts.hideDuration,e),t.dataSM("scroll")&&(this.menuScrollStop(t),t.css({"touch-action":"","-ms-touch-action":"","-webkit-transform":"",transform:""}).off(".smartmenus_scroll").removeDataSM("scroll").dataSM("scroll-arrows").hide()),t.dataSM("parent-a").removeClass( +"highlighted").attr("aria-expanded","false"),t.attr({"aria-expanded":"false","aria-hidden":"true"});var i=t.dataSM("level");this.activatedItems.splice(i-1,1),this.visibleSubMenus.splice($.inArray(t,this.visibleSubMenus),1),this.$root.triggerHandler("hide.smapi",t[0])}},menuHideAll:function(){this.showTimeout&&(clearTimeout(this.showTimeout),this.showTimeout=0);for(var t=this.opts.isPopup?1:0,e=this.visibleSubMenus.length-1;e>=t;e--)this.menuHide(this.visibleSubMenus[e]);this.opts.isPopup&&(canAnimate&&this.$root.stop(!0,!0),this.$root.is(":visible")&&(canAnimate&&this.opts.hideFunction?this.opts.hideFunction.call(this,this.$root):this.$root.hide(this.opts.hideDuration))),this.activatedItems=[],this.visibleSubMenus=[],this.clickActivated=!1,this.focusActivated=!1,this.zIndexInc=0,this.$root.triggerHandler("hideAll.smapi")},menuHideSubMenus:function(t){for(var e=this.activatedItems.length-1;e>=t;e--){var i=this.activatedItems[e].dataSM("sub");i&&this.menuHide(i)}},menuInit:function(t){if(!t.dataSM("in-mega")){ +t.hasClass("mega-menu")&&t.find("ul").dataSM("in-mega",!0);for(var e=2,i=t[0];(i=i.parentNode.parentNode)!=this.$root[0];)e++;var s=t.prevAll("a").eq(-1);s.length||(s=t.prevAll().find("a").eq(-1)),s.addClass("has-submenu").dataSM("sub",t),t.dataSM("parent-a",s).dataSM("level",e).parent().dataSM("sub",t);var o=s.attr("id")||this.accessIdPrefix+ ++this.idInc,a=t.attr("id")||this.accessIdPrefix+ ++this.idInc;s.attr({id:o,"aria-haspopup":"true","aria-controls":a,"aria-expanded":"false"}),t.attr({id:a,role:"group","aria-hidden":"true","aria-labelledby":o,"aria-expanded":"false"}),this.opts.subIndicators&&s[this.opts.subIndicatorsPos](this.$subArrow.clone())}},menuPosition:function(t){var e,i,s=t.dataSM("parent-a"),o=s.closest("li"),a=o.parent(),n=t.dataSM("level"),r=this.getWidth(t),h=this.getHeight(t),u=s.offset(),l=u.left,c=u.top,d=this.getWidth(s),m=this.getHeight(s),p=$(window),f=p.scrollLeft(),v=p.scrollTop(),b=this.getViewportWidth(),S=this.getViewportHeight(),g=a.parent().is("[data-sm-horizontal-sub]" +)||2==n&&!a.hasClass("sm-vertical"),M=this.opts.rightToLeftSubMenus&&!o.is("[data-sm-reverse]")||!this.opts.rightToLeftSubMenus&&o.is("[data-sm-reverse]"),w=2==n?this.opts.mainMenuSubOffsetX:this.opts.subMenusSubOffsetX,T=2==n?this.opts.mainMenuSubOffsetY:this.opts.subMenusSubOffsetY;if(g?(e=M?d-r-w:w,i=this.opts.bottomToTopSubMenus?-h-T:m+T):(e=M?w-r:d-w,i=this.opts.bottomToTopSubMenus?m-T-h:T),this.opts.keepInViewport){var y=l+e,I=c+i;if(M&&f>y?e=g?f-y+e:d-w:!M&&y+r>f+b&&(e=g?f+b-r-y+e:w-r),g||(S>h&&I+h>v+S?i+=v+S-h-I:(h>=S||v>I)&&(i+=v-I)),g&&(I+h>v+S+.49||v>I)||!g&&h>S+.49){var x=this;t.dataSM("scroll-arrows")||t.dataSM("scroll-arrows",$([$('')[0],$('')[0]]).on({mouseenter:function(){t.dataSM("scroll").up=$(this).hasClass("scroll-up"),x.menuScroll(t)},mouseleave:function(e){x.menuScrollStop(t),x.menuScrollOut(t,e)},"mousewheel DOMMouseScroll":function(t){ +t.preventDefault()}}).insertAfter(t));var A=".smartmenus_scroll";if(t.dataSM("scroll",{y:this.cssTransforms3d?0:i-m,step:1,itemH:m,subH:h,arrowDownH:this.getHeight(t.dataSM("scroll-arrows").eq(1))}).on(getEventsNS({mouseover:function(e){x.menuScrollOver(t,e)},mouseout:function(e){x.menuScrollOut(t,e)},"mousewheel DOMMouseScroll":function(e){x.menuScrollMousewheel(t,e)}},A)).dataSM("scroll-arrows").css({top:"auto",left:"0",marginLeft:e+(parseInt(t.css("border-left-width"))||0),width:r-(parseInt(t.css("border-left-width"))||0)-(parseInt(t.css("border-right-width"))||0),zIndex:t.css("z-index")}).eq(g&&this.opts.bottomToTopSubMenus?0:1).show(),this.isFixed()){var C={};C[touchEvents?"touchstart touchmove touchend":"pointerdown pointermove pointerup MSPointerDown MSPointerMove MSPointerUp"]=function(e){x.menuScrollTouch(t,e)},t.css({"touch-action":"none","-ms-touch-action":"none"}).on(getEventsNS(C,A))}}}t.css({top:"auto",left:"0",marginLeft:e,marginTop:i-m})},menuScroll:function(t,e,i){var s,o=t.dataSM("scroll"), +a=t.dataSM("scroll-arrows"),n=o.up?o.upEnd:o.downEnd;if(!e&&o.momentum){if(o.momentum*=.92,s=o.momentum,.5>s)return this.menuScrollStop(t),void 0}else s=i||(e||!this.opts.scrollAccelerate?this.opts.scrollStep:Math.floor(o.step));var r=t.dataSM("level");if(this.activatedItems[r-1]&&this.activatedItems[r-1].dataSM("sub")&&this.activatedItems[r-1].dataSM("sub").is(":visible")&&this.menuHideSubMenus(r-1),o.y=o.up&&o.y>=n||!o.up&&n>=o.y?o.y:Math.abs(n-o.y)>s?o.y+(o.up?s:-s):n,t.css(this.cssTransforms3d?{"-webkit-transform":"translate3d(0, "+o.y+"px, 0)",transform:"translate3d(0, "+o.y+"px, 0)"}:{marginTop:o.y}),mouse&&(o.up&&o.y>o.downEnd||!o.up&&o.y0;t.dataSM("scroll-arrows").eq(i?0:1).is(":visible")&&(t.dataSM("scroll").up=i,this.menuScroll(t,!0))}e.preventDefault()},menuScrollOut:function(t,e){mouse&&(/^scroll-(up|down)/.test((e.relatedTarget||"").className)||(t[0]==e.relatedTarget||$.contains(t[0],e.relatedTarget))&&this.getClosestMenu(e.relatedTarget)==t[0]||t.dataSM("scroll-arrows").css("visibility","hidden"))},menuScrollOver:function(t,e){if(mouse&&!/^scroll-(up|down)/.test(e.target.className)&&this.getClosestMenu(e.target)==t[0]){this.menuScrollRefreshData(t);var i=t.dataSM("scroll"),s=$(window).scrollTop()-t.dataSM("parent-a").offset().top-i.itemH;t.dataSM("scroll-arrows").eq(0).css("margin-top",s).end().eq(1).css("margin-top",s+this.getViewportHeight()-i.arrowDownH).end().css("visibility","visible")}},menuScrollRefreshData:function(t){var e=t.dataSM("scroll"),i=$(window).scrollTop()-t.dataSM("parent-a").offset().top-e.itemH;this.cssTransforms3d&&(i=-(parseFloat(t.css("margin-top"))-i)),$.extend(e,{upEnd:i, +downEnd:i+this.getViewportHeight()-e.subH})},menuScrollStop:function(t){return this.scrollTimeout?(cancelAnimationFrame(this.scrollTimeout),this.scrollTimeout=0,t.dataSM("scroll").step=1,!0):void 0},menuScrollTouch:function(t,e){if(e=e.originalEvent,isTouchEvent(e)){var i=this.getTouchPoint(e);if(this.getClosestMenu(i.target)==t[0]){var s=t.dataSM("scroll");if(/(start|down)$/i.test(e.type))this.menuScrollStop(t)?(e.preventDefault(),this.$touchScrollingSub=t):this.$touchScrollingSub=null,this.menuScrollRefreshData(t),$.extend(s,{touchStartY:i.pageY,touchStartTime:e.timeStamp});else if(/move$/i.test(e.type)){var o=void 0!==s.touchY?s.touchY:s.touchStartY;if(void 0!==o&&o!=i.pageY){this.$touchScrollingSub=t;var a=i.pageY>o;void 0!==s.up&&s.up!=a&&$.extend(s,{touchStartY:i.pageY,touchStartTime:e.timeStamp}),$.extend(s,{up:a,touchY:i.pageY}),this.menuScroll(t,!0,Math.abs(i.pageY-o))}e.preventDefault()}else void 0!==s.touchY&&((s.momentum=15*Math.pow(Math.abs(i.pageY-s.touchStartY)/(e.timeStamp-s.touchStartTime),2) +)&&(this.menuScrollStop(t),this.menuScroll(t),e.preventDefault()),delete s.touchY)}}},menuShow:function(t){if((t.dataSM("beforefirstshowfired")||(t.dataSM("beforefirstshowfired",!0),this.$root.triggerHandler("beforefirstshow.smapi",t[0])!==!1))&&this.$root.triggerHandler("beforeshow.smapi",t[0])!==!1&&(t.dataSM("shown-before",!0),canAnimate&&t.stop(!0,!0),!t.is(":visible"))){var e=t.dataSM("parent-a"),i=this.isCollapsible();if((this.opts.keepHighlighted||i)&&e.addClass("highlighted"),i)t.removeClass("sm-nowrap").css({zIndex:"",width:"auto",minWidth:"",maxWidth:"",top:"",left:"",marginLeft:"",marginTop:""});else{if(t.css("z-index",this.zIndexInc=(this.zIndexInc||this.getStartZIndex())+1),(this.opts.subMenusMinWidth||this.opts.subMenusMaxWidth)&&(t.css({width:"auto",minWidth:"",maxWidth:""}).addClass("sm-nowrap"),this.opts.subMenusMinWidth&&t.css("min-width",this.opts.subMenusMinWidth),this.opts.subMenusMaxWidth)){var s=this.getWidth(t);t.css("max-width",this.opts.subMenusMaxWidth),s>this.getWidth(t +)&&t.removeClass("sm-nowrap").css("width",this.opts.subMenusMaxWidth)}this.menuPosition(t)}var o=function(){t.css("overflow","")};i?canAnimate&&this.opts.collapsibleShowFunction?this.opts.collapsibleShowFunction.call(this,t,o):t.show(this.opts.collapsibleShowDuration,o):canAnimate&&this.opts.showFunction?this.opts.showFunction.call(this,t,o):t.show(this.opts.showDuration,o),e.attr("aria-expanded","true"),t.attr({"aria-expanded":"true","aria-hidden":"false"}),this.visibleSubMenus.push(t),this.$root.triggerHandler("show.smapi",t[0])}},popupHide:function(t){this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0);var e=this;this.hideTimeout=setTimeout(function(){e.menuHideAll()},t?1:this.opts.hideTimeout)},popupShow:function(t,e){if(!this.opts.isPopup)return alert('SmartMenus jQuery Error:\n\nIf you want to show this menu via the "popupShow" method, set the isPopup:true option.'),void 0;if(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),this.$root.dataSM("shown-before",!0), +canAnimate&&this.$root.stop(!0,!0),!this.$root.is(":visible")){this.$root.css({left:t,top:e});var i=this,s=function(){i.$root.css("overflow","")};canAnimate&&this.opts.showFunction?this.opts.showFunction.call(this,this.$root,s):this.$root.show(this.opts.showDuration,s),this.visibleSubMenus[0]=this.$root}},refresh:function(){this.destroy(!0),this.init(!0)},rootKeyDown:function(t){if(this.handleEvents())switch(t.keyCode){case 27:var e=this.activatedItems[0];if(e){this.menuHideAll(),e[0].focus();var i=e.dataSM("sub");i&&this.menuHide(i)}break;case 32:var s=$(t.target);if(s.is("a")&&this.handleItemEvents(s)){var i=s.dataSM("sub");i&&!i.is(":visible")&&(this.itemClick({currentTarget:t.target}),t.preventDefault())}}},rootOut:function(t){if(this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&(this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0),!this.opts.showOnClick||!this.opts.hideOnClick)){var e=this;this.hideTimeout=setTimeout(function(){e.menuHideAll()},this.opts.hideTimeout)}}, +rootOver:function(t){this.handleEvents()&&!this.isTouchMode()&&t.target!=this.$root[0]&&this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=0)},winResize:function(t){if(this.handleEvents()){if(!("onorientationchange"in window)||"orientationchange"==t.type){var e=this.isCollapsible();this.wasCollapsible&&e||(this.activatedItems.length&&this.activatedItems[this.activatedItems.length-1][0].blur(),this.menuHideAll()),this.wasCollapsible=e}}else if(this.$disableOverlay){var i=this.$root.offset();this.$disableOverlay.css({top:i.top,left:i.left,width:this.$root.outerWidth(),height:this.$root.outerHeight()})}}}}),$.fn.dataSM=function(t,e){return e?this.data(t+"_smartmenus",e):this.data(t+"_smartmenus")},$.fn.removeDataSM=function(t){return this.removeData(t+"_smartmenus")},$.fn.smartmenus=function(options){if("string"==typeof options){var args=arguments,method=options;return Array.prototype.shift.call(args),this.each(function(){var t=$(this).data("smartmenus");t&&t[method]&&t[method].apply(t,args)})} +return this.each(function(){var dataOpts=$(this).data("sm-options")||null;if(dataOpts)try{dataOpts=eval("("+dataOpts+")")}catch(e){dataOpts=null,alert('ERROR\n\nSmartMenus jQuery init:\nInvalid "data-sm-options" attribute value syntax.')}new $.SmartMenus(this,$.extend({},$.fn.smartmenus.defaults,options,dataOpts))})},$.fn.smartmenus.defaults={isPopup:!1,mainMenuSubOffsetX:0,mainMenuSubOffsetY:0,subMenusSubOffsetX:0,subMenusSubOffsetY:0,subMenusMinWidth:"10em",subMenusMaxWidth:"20em",subIndicators:!0,subIndicatorsPos:"append",subIndicatorsText:"",scrollStep:30,scrollAccelerate:!0,showTimeout:250,hideTimeout:500,showDuration:0,showFunction:null,hideDuration:0,hideFunction:function(t,e){t.fadeOut(200,e)},collapsibleShowDuration:0,collapsibleShowFunction:function(t,e){t.slideDown(200,e)},collapsibleHideDuration:0,collapsibleHideFunction:function(t,e){t.slideUp(200,e)},showOnClick:!1,hideOnClick:!0,noMouseOver:!1,keepInViewport:!0,keepHighlighted:!0,markCurrentItem:!1,markCurrentTree:!0,rightToLeftSubMenus:!1, +bottomToTopSubMenus:!1,collapsibleBehavior:"default"},$}); diff --git a/linear__gradient_8cppm.html b/linear__gradient_8cppm.html new file mode 100644 index 000000000..467551070 --- /dev/null +++ b/linear__gradient_8cppm.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: linear_gradient.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
linear_gradient.cppm File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+
+
+ + + + + diff --git a/linear__gradient_8cppm_source.html b/linear__gradient_8cppm_source.html new file mode 100644 index 000000000..c1b369f7f --- /dev/null +++ b/linear__gradient_8cppm_source.html @@ -0,0 +1,229 @@ + + + + + + + + +FTXUI: linear_gradient.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
linear_gradient.cppm
+
+
+Go to the documentation of this file.
1/// @module ftxui.dom.linear_gradient
+
2/// @brief Module file for the LinearGradient struct of the Dom module
+
3
+
4module;
+
5
+ +
7
+
8export module ftxui.dom.linear_gradient;
+
9
+
10/**
+
11 * @namespace ftxui
+
12 * @brief The FTXUI ftxui:: namespace
+
13 */
+
14export namespace ftxui {
+ +
16}
+
A class representing the settings for linear-gradient color effect.
+ +
Module file for the LinearGradient struct of the Dom module.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
+
+ + + + + diff --git a/linear__gradient_8hpp.html b/linear__gradient_8hpp.html new file mode 100644 index 000000000..1166e0b63 --- /dev/null +++ b/linear__gradient_8hpp.html @@ -0,0 +1,229 @@ + + + + + + + + +FTXUI: linear_gradient.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
linear_gradient.hpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + + + +

+Classes

struct  LinearGradient
 A class representing the settings for linear-gradient color effect. More...
 
struct  LinearGradient::Stop
 
+ + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+
+
+ + + + + diff --git a/linear__gradient_8hpp.js b/linear__gradient_8hpp.js new file mode 100644 index 000000000..ca0141236 --- /dev/null +++ b/linear__gradient_8hpp.js @@ -0,0 +1,4 @@ +var linear__gradient_8hpp = +[ + [ "Stop", "structftxui_1_1LinearGradient_1_1Stop.html", "structftxui_1_1LinearGradient_1_1Stop" ] +]; \ No newline at end of file diff --git a/linear__gradient_8hpp_source.html b/linear__gradient_8hpp_source.html new file mode 100644 index 000000000..e83ba9673 --- /dev/null +++ b/linear__gradient_8hpp_source.html @@ -0,0 +1,283 @@ + + + + + + + + +FTXUI: linear_gradient.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
linear_gradient.hpp
+
+
+Go to the documentation of this file.
1// Copyright 2023 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#ifndef FTXUI_DOM_LINEAR_GRADIENT_HPP
+
5#define FTXUI_DOM_LINEAR_GRADIENT_HPP
+
6
+
7#include <optional>
+
8#include <vector>
+
9
+
10#include "ftxui/screen/color.hpp" // for Colors
+
11
+
12namespace ftxui {
+
13
+
14/// @brief A class representing the settings for linear-gradient color effect.
+
15///
+
16/// Example:
+
17/// ```cpp
+
18/// LinearGradient()
+
19/// .Angle(45)
+
20/// .Stop(Color::Red, 0.0)
+
21/// .Stop(Color::Green, 0.5)
+
22/// .Stop(Color::Blue, 1.0);
+
23/// ```
+
24///
+
25/// There are also shorthand constructors:
+
26/// ```cpp
+
27/// LinearGradient(Color::Red, Color::Blue);
+
28/// LinearGradient(45, Color::Red, Color::Blue);
+
29/// ```
+
30///
+
31/// @ingroup dom
+
+ +
33 float angle = 0.f;
+
34
+
35 /// A stop is a color at a specific position in the gradient.
+
36 /// The position is a value between 0.0 and 1.0,
+
37 /// where 0.0 is the start of the gradient
+
38 /// and 1.0 is the end of the gradient.
+
+
39 struct Stop {
+ +
41 std::optional<float> position;
+
42 };
+
+
43 std::vector<Stop> stops;
+
44
+
45 // Simple constructor
+ +
47 LinearGradient(Color begin, Color end);
+
48 LinearGradient(float angle, Color begin, Color end);
+
49
+
50 // Modifier using the builder pattern.
+ +
52 LinearGradient& Stop(Color color, float position);
+ +
54};
+
+
55
+
56} // namespace ftxui
+
57
+
58#endif // FTXUI_DOM_LINEAR_GRADIENT_HPP
+ +
LinearGradient & Stop(Color color, float position)
Add a color stop to the gradient.
+
LinearGradient & Angle(float angle)
Set the angle of the gradient.
+
LinearGradient()
Build the "empty" gradient. This is often followed by calls to LinearGradient::Angle() and LinearGrad...
+
std::vector< Stop > stops
+ +
A class representing the settings for linear-gradient color effect.
+ +
Color is a class that represents a color in the terminal user interface.
Definition color.hpp:22
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ +
std::optional< float > position
+
+
+ + + + + diff --git a/linear__gradient__gallery_8cpp.html b/linear__gradient__gallery_8cpp.html new file mode 100644 index 000000000..03ca363b7 --- /dev/null +++ b/linear__gradient__gallery_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: linear_gradient_gallery.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
linear_gradient_gallery.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + +

+Functions

int main ()
 
+

Function Documentation

+ +

◆ main()

+ +
+
+ + + + + + + +
int main ()
+
+ +

Definition at line 15 of file linear_gradient_gallery.cpp.

+ +
+
+
+
+ + + + + diff --git a/linear__gradient__gallery_8cpp.js b/linear__gradient__gallery_8cpp.js new file mode 100644 index 000000000..3efaa28ae --- /dev/null +++ b/linear__gradient__gallery_8cpp.js @@ -0,0 +1,4 @@ +var linear__gradient__gallery_8cpp = +[ + [ "main", "linear__gradient__gallery_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/linear__gradient__gallery_8cpp_source.html b/linear__gradient__gallery_8cpp_source.html new file mode 100644 index 000000000..c01d0de86 --- /dev/null +++ b/linear__gradient__gallery_8cpp_source.html @@ -0,0 +1,277 @@ + + + + + + + + +FTXUI: linear_gradient_gallery.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
linear_gradient_gallery.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2023 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#include <ftxui/component/component_base.hpp> // for ComponentBase, Component
+
5#include <ftxui/dom/elements.hpp> // for operator|, Element, flex, bgcolor, text, vbox, center
+
6#include <ftxui/dom/linear_gradient.hpp> // for LinearGradient
+
7#include <ftxui/screen/color.hpp> // for Color, Color::Blue, Color::Red
+
8#include <memory> // for __shared_ptr_access, shared_ptr
+
9#include <string> // for allocator, operator+, char_traits, string, to_string
+
10
+
11#include "ftxui/component/captured_mouse.hpp" // for ftxui
+
12#include "ftxui/component/component.hpp" // for Slider, Renderer, Vertical
+
13#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
+
14
+
+
15int main() {
+
16 using namespace ftxui;
+
17 auto screen = ScreenInteractive::Fullscreen();
+
18
+
19 int angle = 180.f;
+
20 float start = 0.f;
+
21 float end = 1.f;
+
22
+
23 std::string slider_angle_text;
+
24 std::string slider_start_text;
+
25 std::string slider_end_text;
+
26
+
27 auto slider_angle = Slider(&slider_angle_text, &angle, 0, 360);
+
28 auto slider_start = Slider(&slider_start_text, &start, 0.f, 1.f, 0.05f);
+
29 auto slider_end = Slider(&slider_end_text, &end, 0.f, 1.f, 0.05f);
+
30
+
31 auto layout = Container::Vertical({
+
32 slider_angle,
+
33 slider_start,
+
34 slider_end,
+
35 });
+
36
+
37 auto renderer = Renderer(layout, [&] {
+
38 slider_angle_text = "angle = " + std::to_string(angle) + "°";
+
39 slider_start_text = "start = " + std::to_string(int(start * 100)) + "%";
+
40 slider_end_text = "end = " + std::to_string(int(end * 100)) + "%";
+
41
+
42 auto background = text("Gradient") | center |
+
43 bgcolor(LinearGradient()
+
44 .Angle(angle)
+
45 .Stop(Color::Blue, start)
+
46 .Stop(Color::Red, end));
+
47 return vbox({
+
48 background | flex,
+
49 layout->Render(),
+
50 }) |
+
51 flex;
+
52 });
+
53
+
54 screen.Loop(renderer);
+
55}
+
+ + + + + +
A class representing the settings for linear-gradient color effect.
+ + +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+ + +
+
+ + + + + diff --git a/loop_8cpp.html b/loop_8cpp.html new file mode 100644 index 000000000..412013bc7 --- /dev/null +++ b/loop_8cpp.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: loop.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
loop.cpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+
+
+ + + + + diff --git a/loop_8cpp_source.html b/loop_8cpp_source.html new file mode 100644 index 000000000..6301d2cc2 --- /dev/null +++ b/loop_8cpp_source.html @@ -0,0 +1,287 @@ + + + + + + + + +FTXUI: loop.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
loop.cpp
+
+
+Go to the documentation of this file.
1// Copyright 2022 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+ +
5
+
6#include <utility> // for move
+
7
+
8#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive, Component
+
9
+
10namespace ftxui {
+
11
+
12/// @brief A Loop is a wrapper around a Component and a ScreenInteractive.
+
13/// It is used to run a Component in a terminal.
+
14/// @see Component, ScreenInteractive.
+
15/// @see ScreenInteractive::Loop().
+
16/// @see ScreenInteractive::ExitLoop().
+
17/// @param[in] screen The screen to use.
+
18/// @param[in] component The component to run.
+
19// NOLINTNEXTLINE
+
+ +
21 : screen_(screen), component_(std::move(component)) {
+
22 screen_->PreMain();
+
23}
+
+
24
+
+ +
26 screen_->PostMain();
+
27}
+
+
28
+
29/// @brief Whether the loop has quitted.
+
+ +
31 return screen_->HasQuitted();
+
32}
+
+
33
+
34/// @brief Execute the loop. Make the `component` to process every pending
+
35/// tasks/events. A new frame might be drawn if the previous was invalidated.
+
36/// Return true until the loop hasn't completed.
+
+ +
38 screen_->RunOnce(component_);
+
39}
+
+
40
+
41/// @brief Wait for at least one event to be handled and execute
+
42/// `Loop::RunOnce()`.
+
+ +
44 screen_->RunOnceBlocking(component_);
+
45}
+
+
46
+
47/// Execute the loop, blocking the current thread, up until the loop has
+
48/// quitted.
+
+
49void Loop::Run() {
+
50 while (!HasQuitted()) {
+ +
52 }
+
53}
+
+
54
+
55} // namespace ftxui
+
bool HasQuitted()
Whether the loop has quitted.
Definition loop.cpp:30
+ +
void Run()
Definition loop.cpp:49
+
Loop(ScreenInteractive *screen, Component component)
A Loop is a wrapper around a Component and a ScreenInteractive. It is used to run a Component in a te...
Definition loop.cpp:20
+
void RunOnce()
Execute the loop. Make the component to process every pending tasks/events. A new frame might be draw...
Definition loop.cpp:37
+
void RunOnceBlocking()
Wait for at least one event to be handled and execute Loop::RunOnce().
Definition loop.cpp:43
+
ScreenInteractive is a Screen that can handle events, run a main loop, and manage components.
+ +
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< ComponentBase > Component
+ +
+
+ + + + + diff --git a/loop_8cppm.html b/loop_8cppm.html new file mode 100644 index 000000000..97cc04db3 --- /dev/null +++ b/loop_8cppm.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: loop.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
loop.cppm File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+
+
+ + + + + diff --git a/loop_8cppm_source.html b/loop_8cppm_source.html new file mode 100644 index 000000000..9caca3b80 --- /dev/null +++ b/loop_8cppm_source.html @@ -0,0 +1,236 @@ + + + + + + + + +FTXUI: loop.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
loop.cppm
+
+
+Go to the documentation of this file.
1/// @module ftxui.component.loop
+
2/// @brief Module file for the Loop class of the Component module
+
3
+
4module;
+
5
+ +
7
+
8export module ftxui.component.loop;
+
9
+
10/**
+
11 * @namespace ftxui
+
12 * @brief The FTXUI ftxui:: namespace
+
13 */
+
14export namespace ftxui {
+ +
16 using ftxui::Component;
+ +
18
+
19 using ftxui::Loop;
+
20}
+
It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ft...
+
Loop is a class that manages the event loop for a component.
Definition loop.hpp:56
+
ScreenInteractive is a Screen that can handle events, run a main loop, and manage components.
+ +
Module file for the Loop class of the Component module.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< ComponentBase > Component
+
+
+ + + + + diff --git a/loop_8hpp.html b/loop_8hpp.html new file mode 100644 index 000000000..b4484c260 --- /dev/null +++ b/loop_8hpp.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: loop.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+ +
loop.hpp File Reference
+
+
+ +

Go to the source code of this file.

+ + + + + +

+Classes

class  Loop
 Loop is a class that manages the event loop for a component. More...
 
+ + + + +

+Namespaces

namespace  ftxui
 The FTXUI ftxui:: namespace.
 
+
+
+ + + + + diff --git a/loop_8hpp_source.html b/loop_8hpp_source.html new file mode 100644 index 000000000..039dbebf2 --- /dev/null +++ b/loop_8hpp_source.html @@ -0,0 +1,307 @@ + + + + + + + + +FTXUI: loop.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
+
+ + + + + + +
+
FTXUI 6.1.9 +
+
C++ functional terminal UI.
+
+
+ + + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+
+
+
+
+
Loading...
+
Searching...
+
No Matches
+
+
+
+
+ +
+
loop.hpp
+
+
+Go to the documentation of this file.
1// Copyright 2022 Arthur Sonzogni. All rights reserved.
+
2// Use of this source code is governed by the MIT license that can be found in
+
3// the LICENSE file.
+
4#ifndef FTXUI_COMPONENT_LOOP_HPP
+
5#define FTXUI_COMPONENT_LOOP_HPP
+
6
+
7#include <memory> // for shared_ptr
+
8
+
9#include "ftxui/component/component_base.hpp" // for ComponentBase
+
10
+
11namespace ftxui {
+
12class ComponentBase;
+
13
+
14using Component = std::shared_ptr<ComponentBase>;
+
15class ScreenInteractive;
+
16
+
17/// @brief Loop is a class that manages the event loop for a component.
+
18///
+
19/// It is responsible for running the component, handling events, and
+
20/// updating the screen.
+
21///
+
22/// The Loop class is designed to be used with a ScreenInteractive object,
+
23/// which represents the terminal screen.
+
24///
+
25/// **Example**
+
26/// ```cpp
+
27/// #include <ftxui/component/component.hpp>
+
28/// #include <ftxui/component/screen_interactive.hpp>
+
29/// #include <ftxui/component/loop.hpp>
+
30///
+
31/// int main() {
+
32/// auto screen = ftxui::ScreenInteractive::TerminalOutput();
+
33/// auto component = ftxui::Button("Click me", [] { ... });
+
34///
+
35/// ftxui::Loop loop(screen.get(), component);
+
36///
+
37/// // Either
+
38/// loop.Run(); // Blocking until the component quits.
+
39///
+
40/// // Or
+
41/// loop.RunOnce(); // Non-blocking, returns immediately.
+
42///
+
43/// // Or
+
44/// loop.RunOnceBlocking(); // Blocking until handling one event.
+
45///
+
46/// // Or in a loop:
+
47/// while (!loop.HasQuitted()) {
+
48/// loop.RunOnce();
+
49///
+
50/// // Do something else like running a different library loop function.
+
51/// }
+
52/// }
+
53/// ```
+
54///
+
55/// @ingroup component
+
+
56class Loop {
+
57 public:
+
58 Loop(ScreenInteractive* screen, Component component);
+
59 ~Loop();
+
60
+
61 bool HasQuitted();
+
62 void RunOnce();
+
63 void RunOnceBlocking();
+
64 void Run();
+
65
+
66 // This class is non copyable/movable.
+
67 Loop(const Loop&) = default;
+
68 Loop(Loop&&) = delete;
+
69 Loop& operator=(Loop&&) = delete;
+
70 Loop(const ScreenInteractive&) = delete;
+
71 Loop& operator=(const Loop&) = delete;
+
72
+
73 private:
+
74 ScreenInteractive* screen_;
+
75 Component component_;
+
76};
+
+
77
+
78} // namespace ftxui
+
79
+
80#endif // FTXUI_COMPONENT_LOOP_HPP
+ +
bool HasQuitted()
Whether the loop has quitted.
Definition loop.cpp:30
+
Loop(const ScreenInteractive &)=delete
+ +
void Run()
Definition loop.cpp:49
+
Loop(ScreenInteractive *screen, Component component)
A Loop is a wrapper around a Component and a ScreenInteractive. It is used to run a Component in a te...
Definition loop.cpp:20
+
Loop & operator=(const Loop &)=delete
+
void RunOnce()
Execute the loop. Make the component to process every pending tasks/events. A new frame might be draw...
Definition loop.cpp:37
+
Loop(const Loop &)=default
+
Loop & operator=(Loop &&)=delete
+
Loop(Loop &&)=delete
+
void RunOnceBlocking()
Wait for at least one event to be handled and execute Loop::RunOnce().
Definition loop.cpp:43
+
Loop is a class that manages the event loop for a component.
Definition loop.hpp:56
+
ScreenInteractive is a Screen that can handle events, run a main loop, and manage components.
+
The FTXUI ftxui:: namespace.
Definition animation.hpp:10
+
std::shared_ptr< ComponentBase > Component
+
+
+ + + + + diff --git a/menu.js b/menu.js new file mode 100644 index 000000000..0fd1e9901 --- /dev/null +++ b/menu.js @@ -0,0 +1,134 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ +function initMenu(relPath,searchEnabled,serverSide,searchPage,search,treeview) { + function makeTree(data,relPath) { + let result=''; + if ('children' in data) { + result+='
    '; + for (let i in data.children) { + let url; + const link = data.children[i].url; + if (link.substring(0,1)=='^') { + url = link.substring(1); + } else { + url = relPath+link; + } + result+='
  • '+ + data.children[i].text+''+ + makeTree(data.children[i],relPath)+'
  • '; + } + result+='
'; + } + return result; + } + let searchBoxHtml; + if (searchEnabled) { + if (serverSide) { + searchBoxHtml='
'+ + '
'+ + '
 '+ + ''+ + '
'+ + '
'+ + '
'+ + '
'; + } else { + searchBoxHtml='
'+ + ''+ + ' '+ + ''+ + ''+ + ''+ + ''+ + ''+ + '
'; + } + } + + $('#main-nav').before('
'+ + ''+ + ''+ + '
'); + $('#main-nav').append(makeTree(menudata,relPath)); + $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu'); + if (searchBoxHtml) { + $('#main-menu').append('
  • '); + } + const $mainMenuState = $('#main-menu-state'); + let prevWidth = 0; + if ($mainMenuState.length) { + const initResizableIfExists = function() { + if (typeof initResizable==='function') initResizable(treeview); + } + // animate mobile menu + $mainMenuState.change(function() { + const $menu = $('#main-menu'); + let options = { duration: 250, step: initResizableIfExists }; + if (this.checked) { + options['complete'] = () => $menu.css('display', 'block'); + $menu.hide().slideDown(options); + } else { + options['complete'] = () => $menu.css('display', 'none'); + $menu.show().slideUp(options); + } + }); + // set default menu visibility + const resetState = function() { + const $menu = $('#main-menu'); + const newWidth = $(window).outerWidth(); + if (newWidth!=prevWidth) { + if ($(window).outerWidth()<768) { + $mainMenuState.prop('checked',false); $menu.hide(); + $('#searchBoxPos1').html(searchBoxHtml); + $('#searchBoxPos2').hide(); + } else { + $menu.show(); + $('#searchBoxPos1').empty(); + $('#searchBoxPos2').html(searchBoxHtml); + $('#searchBoxPos2').show(); + } + if (typeof searchBox!=='undefined') { + searchBox.CloseResultsWindow(); + } + prevWidth = newWidth; + } + } + $(window).ready(function() { resetState(); initResizableIfExists(); }); + $(window).resize(resetState); + } + $('#main-menu').smartmenus(); +} +/* @license-end */ diff --git a/menu2_8cpp.html b/menu2_8cpp.html new file mode 100644 index 000000000..56041b0d1 --- /dev/null +++ b/menu2_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: menu2.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    menu2.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Functions

    int main ()
     
    +

    Function Documentation

    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 16 of file menu2.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/menu2_8cpp.js b/menu2_8cpp.js new file mode 100644 index 000000000..edda1b3fe --- /dev/null +++ b/menu2_8cpp.js @@ -0,0 +1,4 @@ +var menu2_8cpp = +[ + [ "main", "menu2_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/menu2_8cpp_source.html b/menu2_8cpp_source.html new file mode 100644 index 000000000..768f86ed5 --- /dev/null +++ b/menu2_8cpp_source.html @@ -0,0 +1,300 @@ + + + + + + + + +FTXUI: menu2.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    menu2.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <functional> // for function
    +
    5#include <memory> // for allocator, __shared_ptr_access
    +
    6#include <string> // for string, basic_string, operator+, to_string
    +
    7#include <vector> // for vector
    +
    8
    +
    9#include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    10#include "ftxui/component/component.hpp" // for Menu, Horizontal, Renderer
    +
    11#include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    12#include "ftxui/component/component_options.hpp" // for MenuOption
    +
    13#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
    +
    14#include "ftxui/dom/elements.hpp" // for text, separator, bold, hcenter, vbox, hbox, gauge, Element, operator|, border
    +
    15
    +
    +
    16int main() {
    +
    17 using namespace ftxui;
    +
    18 auto screen = ScreenInteractive::TerminalOutput();
    +
    19
    +
    20 std::vector<std::string> left_menu_entries = {
    +
    21 "0%", "10%", "20%", "30%", "40%", "50%", "60%", "70%", "80%", "90%",
    +
    22 };
    +
    23 std::vector<std::string> right_menu_entries = {
    +
    24 "0%", "1%", "2%", "3%", "4%", "5%", "6%", "7%", "8%", "9%", "10%",
    +
    25 };
    +
    26
    +
    27 auto menu_option = MenuOption();
    +
    28 menu_option.on_enter = screen.ExitLoopClosure();
    +
    29
    +
    30 int left_menu_selected = 0;
    +
    31 int right_menu_selected = 0;
    +
    32 Component left_menu_ =
    +
    33 Menu(&left_menu_entries, &left_menu_selected, menu_option);
    +
    34 Component right_menu_ =
    +
    35 Menu(&right_menu_entries, &right_menu_selected, menu_option);
    +
    36
    +
    37 Component container = Container::Horizontal({
    +
    38 left_menu_,
    +
    39 right_menu_,
    +
    40 });
    +
    41
    +
    42 auto renderer = Renderer(container, [&] {
    +
    43 int sum = left_menu_selected * 10 + right_menu_selected;
    +
    44 return vbox({
    +
    45 // -------- Top panel --------------
    +
    46 hbox({
    +
    47 // -------- Left Menu --------------
    +
    48 vbox({
    +
    49 hcenter(bold(text("Percentage by 10%"))),
    +
    50 separator(),
    +
    51 left_menu_->Render(),
    +
    52 }),
    +
    53 separator(),
    +
    54 // -------- Right Menu --------------
    +
    55 vbox({
    +
    56 hcenter(bold(text("Percentage by 1%"))),
    +
    57 separator(),
    +
    58 right_menu_->Render(),
    +
    59 }),
    +
    60 separator(),
    +
    61 }),
    +
    62 separator(),
    +
    63 // -------- Bottom panel --------------
    +
    64 vbox({
    +
    65 hbox({
    +
    66 text(" gauge : "),
    +
    67 gauge(sum / 100.0),
    +
    68 }),
    +
    69 hbox({
    +
    70 text(" text : "),
    +
    71 text(std::to_string(sum) + " %"),
    +
    72 }),
    +
    73 }),
    +
    74 }) |
    +
    75 border;
    +
    76 });
    +
    77
    +
    78 screen.Loop(renderer);
    +
    79}
    +
    + + + + + +
    Option for the Menu component.
    +
    int main()
    Definition menu2.cpp:16
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::shared_ptr< ComponentBase > Component
    + +
    +
    + + + + + diff --git a/menu__entries_8cpp.html b/menu__entries_8cpp.html new file mode 100644 index 000000000..900471417 --- /dev/null +++ b/menu__entries_8cpp.html @@ -0,0 +1,262 @@ + + + + + + + + +FTXUI: menu_entries.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    menu_entries.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + + +

    +Functions

    MenuEntryOption Colored (ftxui::Color c)
     
    int main ()
     
    +

    Function Documentation

    + +

    ◆ Colored()

    + +
    +
    + + + + + + + +
    MenuEntryOption Colored (ftxui::Color c)
    +
    +
    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 36 of file menu_entries.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/menu__entries_8cpp.js b/menu__entries_8cpp.js new file mode 100644 index 000000000..ee2679207 --- /dev/null +++ b/menu__entries_8cpp.js @@ -0,0 +1,5 @@ +var menu__entries_8cpp = +[ + [ "Colored", "menu__entries_8cpp.html#a12f3ca405f8238e1d03dff81d4cf6997", null ], + [ "main", "menu__entries_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/menu__entries_8cpp_source.html b/menu__entries_8cpp_source.html new file mode 100644 index 000000000..14a930487 --- /dev/null +++ b/menu__entries_8cpp_source.html @@ -0,0 +1,331 @@ + + + + + + + + +FTXUI: menu_entries.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    menu_entries.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <functional> // for function
    +
    5#include <iostream> // for basic_ostream::operator<<, operator<<, endl, basic_ostream, basic_ostream<>::__ostream_type, cout, ostream
    +
    6#include <memory> // for allocator, shared_ptr, __shared_ptr_access
    +
    7#include <string> // for char_traits, to_string, operator+, string, basic_string
    +
    8
    +
    9#include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    10#include "ftxui/component/component.hpp" // for MenuEntry, Renderer, Vertical
    +
    11#include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    12#include "ftxui/component/component_options.hpp" // for MenuEntryOption
    +
    13#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    14#include "ftxui/dom/elements.hpp" // for operator|, Element, separator, text, hbox, size, frame, color, vbox, HEIGHT, LESS_THAN, bold, border, inverted
    +
    15#include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Cyan, Color::Green, Color::Red, Color::Yellow
    +
    16
    +
    17using namespace ftxui;
    +
    18
    +
    19// Define a special style for some menu entry.
    +
    + +
    21 MenuEntryOption option;
    +
    22 option.transform = [c](EntryState state) {
    +
    23 state.label = (state.active ? "> " : " ") + state.label;
    +
    24 Element e = text(state.label) | color(c);
    +
    25 if (state.focused) {
    +
    26 e = e | inverted;
    +
    27 }
    +
    28 if (state.active) {
    +
    29 e = e | bold;
    +
    30 }
    +
    31 return e;
    +
    32 };
    +
    33 return option;
    +
    34}
    +
    +
    35
    +
    +
    36int main() {
    + +
    38
    +
    39 int selected = 0;
    +
    40 auto menu = Container::Vertical(
    +
    41 {
    +
    42 MenuEntry(" 1. improve"),
    +
    43 MenuEntry(" 2. tolerant"),
    +
    44 MenuEntry(" 3. career"),
    +
    45 MenuEntry(" 4. cast"),
    +
    46 MenuEntry(" 5. question"),
    +
    47
    +
    48 Renderer([] { return separator(); }),
    +
    49
    +
    50 MenuEntry(" 6. rear", Colored(Color::Red)),
    +
    51 MenuEntry(" 7. drown", Colored(Color::Yellow)),
    +
    52 MenuEntry(" 8. nail", Colored(Color::Green)),
    +
    53 MenuEntry(" 9. quit", Colored(Color::Cyan)),
    +
    54 MenuEntry("10. decorative", Colored(Color::Blue)),
    +
    55
    +
    56 Renderer([] { return separator(); }),
    +
    57
    +
    58 MenuEntry("11. costume"),
    +
    59 MenuEntry("12. pick"),
    +
    60 MenuEntry("13. oral"),
    +
    61 MenuEntry("14. minister"),
    +
    62 MenuEntry("15. football"),
    +
    63 MenuEntry("16. welcome"),
    +
    64 MenuEntry("17. copper"),
    +
    65 MenuEntry("18. inhabitant"),
    +
    66 MenuEntry("19. fortune"),
    +
    67 },
    +
    68 &selected);
    +
    69
    +
    70 // Display together the menu with a border
    +
    71 auto renderer = Renderer(menu, [&] {
    +
    72 return vbox({
    +
    73 hbox(text("selected = "), text(std::to_string(selected))),
    +
    74 separator(),
    +
    75 menu->Render() | frame | size(HEIGHT, LESS_THAN, 10),
    +
    76 }) |
    +
    77 border;
    +
    78 });
    +
    79
    +
    80 screen.Loop(renderer);
    +
    81
    +
    82 std::cout << "Selected element = " << selected << std::endl;
    +
    83}
    +
    + + + + + + +
    static ScreenInteractive TerminalOutput()
    +
    std::function< Element(const EntryState &state)> transform
    +
    Component MenuEntry(MenuEntryOption options)
    A specific menu entry. They can be put into a Container::Vertical to form a menu.
    +
    Component Renderer(Component child, std::function< Element()>)
    Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
    +
    Component Vertical(Components children)
    A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
    +
    Option for the MenuEntry component.
    +
    virtual void Render(Screen &screen)
    Display an element on a ftxui::Screen.
    Definition node.cpp:59
    +
    Decorator size(WidthOrHeight, Constraint, int value)
    Apply a constraint on the size of an element.
    +
    Element bold(Element)
    Use a bold font, for elements with more emphasis.
    Definition bold.cpp:33
    +
    Element inverted(Element)
    Add a filter that will invert the foreground and the background colors.
    Definition inverted.cpp:34
    +
    Element text(std::wstring text)
    Display a piece of unicode text.
    Definition text.cpp:160
    +
    Element separator()
    Draw a vertical or horizontal separation in between two other elements.
    +
    Decorator color(Color)
    Decorate using a foreground color.
    +
    Element vbox(Elements)
    A container displaying elements vertically one by one.
    Definition vbox.cpp:96
    + + + + + +
    Color is a class that represents a color in the terminal user interface.
    Definition color.hpp:22
    +
    MenuEntryOption Colored(ftxui::Color c)
    +
    int main()
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    Element hbox(Elements)
    A container displaying elements horizontally one by one.
    Definition hbox.cpp:94
    +
    @ LESS_THAN
    Definition elements.hpp:162
    + +
    arguments for transform from |ButtonOption|, |CheckboxOption|, |RadioboxOption|, |MenuEntryOption|,...
    +
    +
    + + + + + diff --git a/menu__entries__animated_8cpp.html b/menu__entries__animated_8cpp.html new file mode 100644 index 000000000..abdc86575 --- /dev/null +++ b/menu__entries__animated_8cpp.html @@ -0,0 +1,260 @@ + + + + + + + + +FTXUI: menu_entries_animated.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    menu_entries_animated.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + + +

    +Functions

    MenuEntryOption Colored (ftxui::Color c)
     
    int main ()
     
    +

    Function Documentation

    + +

    ◆ Colored()

    + +
    +
    + + + + + + + +
    MenuEntryOption Colored (ftxui::Color c)
    +
    + +

    Definition at line 19 of file menu_entries_animated.cpp.

    + +
    +
    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 30 of file menu_entries_animated.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/menu__entries__animated_8cpp.js b/menu__entries__animated_8cpp.js new file mode 100644 index 000000000..d31884100 --- /dev/null +++ b/menu__entries__animated_8cpp.js @@ -0,0 +1,5 @@ +var menu__entries__animated_8cpp = +[ + [ "Colored", "menu__entries__animated_8cpp.html#a12f3ca405f8238e1d03dff81d4cf6997", null ], + [ "main", "menu__entries__animated_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/menu__entries__animated_8cpp_source.html b/menu__entries__animated_8cpp_source.html new file mode 100644 index 000000000..758c65835 --- /dev/null +++ b/menu__entries__animated_8cpp_source.html @@ -0,0 +1,314 @@ + + + + + + + + +FTXUI: menu_entries_animated.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    menu_entries_animated.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <iostream> // for basic_ostream::operator<<, operator<<, endl, basic_ostream, basic_ostream<>::__ostream_type, cout, ostream
    +
    5#include <memory> // for shared_ptr, __shared_ptr_access
    +
    6#include <string> // for to_string, allocator
    +
    7
    +
    8#include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    9#include "ftxui/component/component.hpp" // for MenuEntryAnimated, Renderer, Vertical
    +
    10#include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    11#include "ftxui/component/component_options.hpp" // for MenuEntryAnimated
    +
    12#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    13#include "ftxui/dom/elements.hpp" // for operator|, separator, Element, Decorator, color, text, hbox, size, bold, frame, inverted, vbox, HEIGHT, LESS_THAN, border
    +
    14#include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Cyan, Color::Green, Color::Red, Color::Yellow
    +
    15
    +
    16using namespace ftxui;
    +
    17
    +
    18// Define a special style for some menu entry.
    + +
    29
    +
    +
    30int main() {
    + +
    32
    +
    33 int selected = 0;
    +
    34 auto menu = Container::Vertical(
    +
    35 {
    +
    36 MenuEntry(" 1. rear", Colored(Color::Red)),
    +
    37 MenuEntry(" 2. drown", Colored(Color::Yellow)),
    +
    38 MenuEntry(" 3. nail", Colored(Color::Green)),
    +
    39 MenuEntry(" 4. quit", Colored(Color::Cyan)),
    +
    40 MenuEntry(" 5. decorative", Colored(Color::Blue)),
    +
    41 MenuEntry(" 7. costume"),
    +
    42 MenuEntry(" 8. pick"),
    +
    43 MenuEntry(" 9. oral"),
    +
    44 MenuEntry("11. minister"),
    +
    45 MenuEntry("12. football"),
    +
    46 MenuEntry("13. welcome"),
    +
    47 MenuEntry("14. copper"),
    +
    48 MenuEntry("15. inhabitant"),
    +
    49 },
    +
    50 &selected);
    +
    51
    +
    52 // Display together the menu with a border
    +
    53 auto renderer = Renderer(menu, [&] {
    +
    54 return vbox({
    +
    55 hbox(text("selected = "), text(std::to_string(selected))),
    +
    56 separator(),
    +
    57 menu->Render() | frame,
    +
    58 }) |
    +
    59 border | bgcolor(Color::Black);
    +
    60 });
    +
    61
    +
    62 screen.Loop(renderer);
    +
    63
    +
    64 std::cout << "Selected element = " << selected << std::endl;
    +
    65}
    +
    + + + + + + +
    static ScreenInteractive TerminalOutput()
    + + + +
    AnimatedColorsOption animated_colors
    +
    Component MenuEntry(MenuEntryOption options)
    A specific menu entry. They can be put into a Container::Vertical to form a menu.
    +
    Component Renderer(Component child, std::function< Element()>)
    Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
    +
    Component Vertical(Components children)
    A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
    +
    Option for the MenuEntry component.
    +
    virtual void Render(Screen &screen)
    Display an element on a ftxui::Screen.
    Definition node.cpp:59
    +
    Decorator bgcolor(Color)
    Decorate using a background color.
    +
    Element text(std::wstring text)
    Display a piece of unicode text.
    Definition text.cpp:160
    +
    Element separator()
    Draw a vertical or horizontal separation in between two other elements.
    +
    Element vbox(Elements)
    A container displaying elements vertically one by one.
    Definition vbox.cpp:96
    + + + + + + + +
    Color is a class that represents a color in the terminal user interface.
    Definition color.hpp:22
    +
    MenuEntryOption Colored(ftxui::Color c)
    + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    Element hbox(Elements)
    A container displaying elements horizontally one by one.
    Definition hbox.cpp:94
    +
    Element frame(Element)
    Allow an element to be displayed inside a 'virtual' area. It size can be larger than its container....
    Definition frame.cpp:118
    + + + +
    +
    + + + + + diff --git a/menu__in__frame_8cpp.html b/menu__in__frame_8cpp.html new file mode 100644 index 000000000..662c4cf70 --- /dev/null +++ b/menu__in__frame_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: menu_in_frame.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    menu_in_frame.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Functions

    int main ()
     
    +

    Function Documentation

    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 16 of file menu_in_frame.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/menu__in__frame_8cpp.js b/menu__in__frame_8cpp.js new file mode 100644 index 000000000..d92a0836f --- /dev/null +++ b/menu__in__frame_8cpp.js @@ -0,0 +1,4 @@ +var menu__in__frame_8cpp = +[ + [ "main", "menu__in__frame_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/menu__in__frame_8cpp_source.html b/menu__in__frame_8cpp_source.html new file mode 100644 index 000000000..a25d5e224 --- /dev/null +++ b/menu__in__frame_8cpp_source.html @@ -0,0 +1,258 @@ + + + + + + + + +FTXUI: menu_in_frame.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    menu_in_frame.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <memory> // for shared_ptr, __shared_ptr_access
    +
    5#include <string> // for string, basic_string, operator+, to_string
    +
    6#include <vector> // for vector
    +
    7
    +
    8#include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    9#include "ftxui/component/component.hpp" // for Radiobox, Renderer
    +
    10#include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    11#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    12#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, HEIGHT, LESS_THAN
    +
    13
    +
    14using namespace ftxui;
    +
    15
    +
    +
    16int main() {
    +
    17 std::vector<std::string> entries;
    +
    18 int selected = 0;
    +
    19
    +
    20 for (int i = 0; i < 30; ++i) {
    +
    21 entries.push_back("Entry " + std::to_string(i));
    +
    22 }
    +
    23 auto radiobox = Menu(&entries, &selected);
    +
    24 auto renderer = Renderer(radiobox, [&] {
    +
    25 return radiobox->Render() | vscroll_indicator | frame |
    + +
    27 });
    +
    28
    +
    29 auto screen = ScreenInteractive::FitComponent();
    +
    30 screen.Loop(renderer);
    +
    31
    +
    32 return 0;
    +
    33}
    +
    + + + + +
    static ScreenInteractive FitComponent()
    +
    Component Menu(MenuOption options)
    A list of text. The focused element is selected.
    +
    Component Renderer(Component child, std::function< Element()>)
    Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
    +
    Decorator size(WidthOrHeight, Constraint, int value)
    Apply a constraint on the size of an element.
    +
    Element border(Element)
    Draw a border around the element.
    +
    int main()
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + +
    @ LESS_THAN
    Definition elements.hpp:162
    + +
    +
    + + + + + diff --git a/menu__in__frame__horizontal_8cpp.html b/menu__in__frame__horizontal_8cpp.html new file mode 100644 index 000000000..10d4f4a0b --- /dev/null +++ b/menu__in__frame__horizontal_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: menu_in_frame_horizontal.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    menu_in_frame_horizontal.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Functions

    int main ()
     
    +

    Function Documentation

    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 16 of file menu_in_frame_horizontal.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/menu__in__frame__horizontal_8cpp.js b/menu__in__frame__horizontal_8cpp.js new file mode 100644 index 000000000..a8fb908dc --- /dev/null +++ b/menu__in__frame__horizontal_8cpp.js @@ -0,0 +1,4 @@ +var menu__in__frame__horizontal_8cpp = +[ + [ "main", "menu__in__frame__horizontal_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/menu__in__frame__horizontal_8cpp_source.html b/menu__in__frame__horizontal_8cpp_source.html new file mode 100644 index 000000000..dac7a1b32 --- /dev/null +++ b/menu__in__frame__horizontal_8cpp_source.html @@ -0,0 +1,254 @@ + + + + + + + + +FTXUI: menu_in_frame_horizontal.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    menu_in_frame_horizontal.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <memory> // for shared_ptr, __shared_ptr_access
    +
    5#include <string> // for string, basic_string, operator+, to_string
    +
    6#include <vector> // for vector
    +
    7
    +
    8#include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    9#include "ftxui/component/component.hpp" // for Radiobox, Renderer
    +
    10#include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    11#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    12#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, HEIGHT, LESS_THAN
    +
    13
    +
    14using namespace ftxui;
    +
    15
    +
    +
    16int main() {
    +
    17 std::vector<std::string> entries;
    +
    18 int selected = 0;
    +
    19
    +
    20 for (int i = 0; i < 100; ++i) {
    +
    21 entries.push_back(std::to_string(i));
    +
    22 }
    +
    23 auto radiobox = Menu(&entries, &selected, MenuOption::Horizontal());
    +
    24 auto renderer = Renderer(
    +
    25 radiobox, [&] { return radiobox->Render() | hscroll_indicator | frame; });
    +
    26
    +
    27 auto screen = ScreenInteractive::FitComponent();
    +
    28 screen.Loop(renderer);
    +
    29
    +
    30 return 0;
    +
    31}
    +
    + + + + +
    static ScreenInteractive FitComponent()
    +
    static MenuOption Horizontal()
    Standard options for a horizontal menu. This can be useful to implement a tab bar.
    +
    Component Menu(MenuOption options)
    A list of text. The focused element is selected.
    +
    Component Renderer(Component child, std::function< Element()>)
    Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
    + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    Element frame(Element)
    Allow an element to be displayed inside a 'virtual' area. It size can be larger than its container....
    Definition frame.cpp:118
    + +
    +
    + + + + + diff --git a/menu__multiple_8cpp.html b/menu__multiple_8cpp.html new file mode 100644 index 000000000..96f89f29f --- /dev/null +++ b/menu__multiple_8cpp.html @@ -0,0 +1,266 @@ + + + + + + + + +FTXUI: menu_multiple.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    menu_multiple.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + + +

    +Functions

    Component Window (std::string title, Component component)
     
    int main ()
     
    +

    Function Documentation

    + +

    ◆ Window()

    + +
    +
    + + + + + + + + + + + +
    Component Window (std::string title,
    Component component )
    +
    +
    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 23 of file menu_multiple.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/menu__multiple_8cpp.js b/menu__multiple_8cpp.js new file mode 100644 index 000000000..7db2259a2 --- /dev/null +++ b/menu__multiple_8cpp.js @@ -0,0 +1,5 @@ +var menu__multiple_8cpp = +[ + [ "Window", "menu__multiple_8cpp.html#ac2013764d7f0c7eb57876c3755e98bb3", null ], + [ "main", "menu__multiple_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/menu__multiple_8cpp_source.html b/menu__multiple_8cpp_source.html new file mode 100644 index 000000000..f2e72221e --- /dev/null +++ b/menu__multiple_8cpp_source.html @@ -0,0 +1,309 @@ + + + + + + + + +FTXUI: menu_multiple.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    menu_multiple.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <stdlib.h> // for EXIT_SUCCESS
    +
    5#include <memory> // for allocator, __shared_ptr_access
    +
    6#include <string> // for string, operator+, basic_string, to_string, char_traits
    +
    7#include <vector> // for vector, __alloc_traits<>::value_type
    +
    8
    +
    9#include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    10#include "ftxui/component/component.hpp" // for Menu, Renderer, Horizontal, Vertical
    +
    11#include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    12#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
    +
    13#include "ftxui/dom/elements.hpp" // for text, Element, operator|, window, flex, vbox
    +
    14
    +
    15using namespace ftxui;
    +
    16
    +
    +
    17Component Window(std::string title, Component component) {
    +
    18 return Renderer(component, [component, title] { //
    +
    19 return window(text(title), component->Render()) | flex;
    +
    20 });
    +
    21}
    +
    +
    22
    +
    +
    23int main() {
    +
    24 int menu_selected[] = {0, 0, 0};
    +
    25 std::vector<std::vector<std::string>> menu_entries = {
    +
    26 {
    +
    27 "Ananas",
    +
    28 "Raspberry",
    +
    29 "Citrus",
    +
    30 },
    +
    31 {
    +
    32 "Potatoes",
    +
    33 "Weat",
    +
    34 "Rise",
    +
    35 },
    +
    36 {
    +
    37 "Carrot",
    +
    38 "Lettuce",
    +
    39 "Tomato",
    +
    40 },
    +
    41 };
    +
    42
    +
    43 int menu_selected_global = 0;
    +
    44 auto menu_global = Container::Vertical(
    +
    45 {
    +
    46 Window("Menu 1", Menu(&menu_entries[0], &menu_selected[0])),
    +
    47 Window("Menu 2", Menu(&menu_entries[1], &menu_selected[1])),
    +
    48 Window("Menu 3", Menu(&menu_entries[2], &menu_selected[2])),
    +
    49 },
    +
    50 &menu_selected_global);
    +
    51
    +
    52 auto info = Renderer([&] {
    +
    53 int g = menu_selected_global;
    +
    54 std::string value = menu_entries[g][menu_selected[g]];
    +
    55 return window(text("Content"), //
    +
    56 vbox({
    +
    57 text("menu_selected_global = " + std::to_string(g)),
    +
    58 text("menu_selected[0] = " +
    +
    59 std::to_string(menu_selected[0])),
    +
    60 text("menu_selected[1] = " +
    +
    61 std::to_string(menu_selected[1])),
    +
    62 text("menu_selected[2] = " +
    +
    63 std::to_string(menu_selected[2])),
    +
    64 text("Value = " + value),
    +
    65 })) |
    +
    66 flex;
    +
    67 });
    +
    68
    +
    69 auto global = Container::Horizontal({
    +
    70 menu_global,
    +
    71 info,
    +
    72 });
    +
    73
    + +
    75 screen.Loop(global);
    +
    76 return EXIT_SUCCESS;
    +
    77}
    +
    + + + + +
    static ScreenInteractive TerminalOutput()
    +
    Element Render()
    Draw the component. Build a ftxui::Element to be drawn on the ftxui::Screen representing this ftxui::...
    +
    Component Horizontal(Components children)
    A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow...
    +
    Component Menu(MenuOption options)
    A list of text. The focused element is selected.
    +
    Component Renderer(Component child, std::function< Element()>)
    Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
    +
    Component Window(WindowOptions option)
    A draggeable / resizeable window. To use multiple of them, they must be stacked using Container::Stac...
    +
    Component Vertical(Components children)
    A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
    +
    Element window(Element title, Element content, BorderStyle border=ROUNDED)
    Draw window with a title and a border around the element.
    +
    Element flex(Element)
    Make a child element to expand proportionally to the space left in a container.
    Definition flex.cpp:123
    +
    Element text(std::wstring text)
    Display a piece of unicode text.
    Definition text.cpp:160
    +
    Element vbox(Elements)
    A container displaying elements vertically one by one.
    Definition vbox.cpp:96
    +
    int main()
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::shared_ptr< ComponentBase > Component
    + +
    +
    + + + + + diff --git a/menu__style_8cpp.html b/menu__style_8cpp.html new file mode 100644 index 000000000..aad621b30 --- /dev/null +++ b/menu__style_8cpp.html @@ -0,0 +1,590 @@ + + + + + + + + +FTXUI: menu_style.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    menu_style.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Functions

    Component VMenu1 (std::vector< std::string > *entries, int *selected)
     
    Component VMenu2 (std::vector< std::string > *entries, int *selected)
     
    Component VMenu3 (std::vector< std::string > *entries, int *selected)
     
    Component VMenu4 (std::vector< std::string > *entries, int *selected)
     
    Component VMenu5 (std::vector< std::string > *entries, int *selected)
     
    Component VMenu6 (std::vector< std::string > *entries, int *selected)
     
    Component VMenu7 (std::vector< std::string > *entries, int *selected)
     
    Component VMenu8 (std::vector< std::string > *entries, int *selected)
     
    Component HMenu1 (std::vector< std::string > *entries, int *selected)
     
    Component HMenu2 (std::vector< std::string > *entries, int *selected)
     
    Component HMenu3 (std::vector< std::string > *entries, int *selected)
     
    Component HMenu4 (std::vector< std::string > *entries, int *selected)
     
    Component HMenu5 (std::vector< std::string > *entries, int *selected)
     
    int main ()
     
    +

    Function Documentation

    + +

    ◆ VMenu1()

    + +
    +
    + + + + + + + + + + + +
    Component VMenu1 (std::vector< std::string > * entries,
    int * selected )
    +
    +
    Examples
    examples/component/menu_style.cpp.
    +
    + +

    Definition at line 114 of file menu_style.cpp.

    + +
    +
    + +

    ◆ VMenu2()

    + +
    +
    + + + + + + + + + + + +
    Component VMenu2 (std::vector< std::string > * entries,
    int * selected )
    +
    +
    Examples
    examples/component/menu_style.cpp.
    +
    + +

    Definition at line 130 of file menu_style.cpp.

    + +
    +
    + +

    ◆ VMenu3()

    + +
    +
    + + + + + + + + + + + +
    Component VMenu3 (std::vector< std::string > * entries,
    int * selected )
    +
    +
    Examples
    examples/component/menu_style.cpp.
    +
    + +

    Definition at line 146 of file menu_style.cpp.

    + +
    +
    + +

    ◆ VMenu4()

    + +
    +
    + + + + + + + + + + + +
    Component VMenu4 (std::vector< std::string > * entries,
    int * selected )
    +
    +
    Examples
    examples/component/menu_style.cpp.
    +
    + +

    Definition at line 166 of file menu_style.cpp.

    + +
    +
    + +

    ◆ VMenu5()

    + +
    +
    + + + + + + + + + + + +
    Component VMenu5 (std::vector< std::string > * entries,
    int * selected )
    +
    +
    Examples
    examples/component/menu_style.cpp.
    +
    + +

    Definition at line 186 of file menu_style.cpp.

    + +
    +
    + +

    ◆ VMenu6()

    + +
    +
    + + + + + + + + + + + +
    Component VMenu6 (std::vector< std::string > * entries,
    int * selected )
    +
    +
    Examples
    examples/component/menu_style.cpp.
    +
    + +

    Definition at line 204 of file menu_style.cpp.

    + +
    +
    + +

    ◆ VMenu7()

    + +
    +
    + + + + + + + + + + + +
    Component VMenu7 (std::vector< std::string > * entries,
    int * selected )
    +
    +
    Examples
    examples/component/menu_style.cpp.
    +
    + +

    Definition at line 212 of file menu_style.cpp.

    + +
    +
    + +

    ◆ VMenu8()

    + +
    +
    + + + + + + + + + + + +
    Component VMenu8 (std::vector< std::string > * entries,
    int * selected )
    +
    +
    Examples
    examples/component/menu_style.cpp.
    +
    + +

    Definition at line 223 of file menu_style.cpp.

    + +
    +
    + +

    ◆ HMenu1()

    + +
    +
    + + + + + + + + + + + +
    Component HMenu1 (std::vector< std::string > * entries,
    int * selected )
    +
    +
    Examples
    examples/component/menu_style.cpp.
    +
    + +

    Definition at line 230 of file menu_style.cpp.

    + +
    +
    + +

    ◆ HMenu2()

    + +
    +
    + + + + + + + + + + + +
    Component HMenu2 (std::vector< std::string > * entries,
    int * selected )
    +
    +
    Examples
    examples/component/menu_style.cpp.
    +
    + +

    Definition at line 234 of file menu_style.cpp.

    + +
    +
    + +

    ◆ HMenu3()

    + +
    +
    + + + + + + + + + + + +
    Component HMenu3 (std::vector< std::string > * entries,
    int * selected )
    +
    +
    Examples
    examples/component/menu_style.cpp.
    +
    + +

    Definition at line 238 of file menu_style.cpp.

    + +
    +
    + +

    ◆ HMenu4()

    + +
    +
    + + + + + + + + + + + +
    Component HMenu4 (std::vector< std::string > * entries,
    int * selected )
    +
    +
    Examples
    examples/component/menu_style.cpp.
    +
    + +

    Definition at line 245 of file menu_style.cpp.

    + +
    +
    + +

    ◆ HMenu5()

    + +
    +
    + + + + + + + + + + + +
    Component HMenu5 (std::vector< std::string > * entries,
    int * selected )
    +
    +
    Examples
    examples/component/menu_style.cpp.
    +
    + +

    Definition at line 249 of file menu_style.cpp.

    + +
    +
    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 36 of file menu_style.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/menu__style_8cpp.js b/menu__style_8cpp.js new file mode 100644 index 000000000..9219ff628 --- /dev/null +++ b/menu__style_8cpp.js @@ -0,0 +1,17 @@ +var menu__style_8cpp = +[ + [ "VMenu1", "menu__style_8cpp.html#abc833415e917ac2a93b5a4f35df2f0fb", null ], + [ "VMenu2", "menu__style_8cpp.html#ab1c7204fedc90016a50553cdcdc9b58b", null ], + [ "VMenu3", "menu__style_8cpp.html#aec99d3a88e71643df15281e0041e44a2", null ], + [ "VMenu4", "menu__style_8cpp.html#afc540158e9fcd015af9e24d4ef072214", null ], + [ "VMenu5", "menu__style_8cpp.html#a62669e7b3cf3a388a714910a16cce19b", null ], + [ "VMenu6", "menu__style_8cpp.html#aeeb06101b3a771616149626f203be146", null ], + [ "VMenu7", "menu__style_8cpp.html#af07f6b560af2a9d723b3e53360d280b5", null ], + [ "VMenu8", "menu__style_8cpp.html#afade922e195c0cda670066485469de56", null ], + [ "HMenu1", "menu__style_8cpp.html#a909976f4b60ea372663d733e16011767", null ], + [ "HMenu2", "menu__style_8cpp.html#a9ec2a6df3ad7dd845b4d4ab507d9d5fe", null ], + [ "HMenu3", "menu__style_8cpp.html#ab5a58c425dbca17b57cfcbf4b8c98e2e", null ], + [ "HMenu4", "menu__style_8cpp.html#a1aead66022c928952b560ebab9913346", null ], + [ "HMenu5", "menu__style_8cpp.html#a16cc679d7e91d82d484eff7e443539cb", null ], + [ "main", "menu__style_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/menu__style_8cpp_source.html b/menu__style_8cpp_source.html new file mode 100644 index 000000000..f8194afca --- /dev/null +++ b/menu__style_8cpp_source.html @@ -0,0 +1,558 @@ + + + + + + + + +FTXUI: menu_style.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    menu_style.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <array> // for array
    +
    5#include <chrono> // for milliseconds
    +
    6#include <functional> // for function
    +
    7#include <memory> // for __shared_ptr_access, shared_ptr, allocator
    +
    8#include <string> // for string, char_traits, operator+, basic_string
    +
    9#include <vector> // for vector
    +
    10
    +
    11#include "ftxui/component/animation.hpp" // for ElasticOut, Linear
    +
    12#include "ftxui/component/component.hpp" // for Menu, Horizontal, Renderer, Vertical
    +
    13#include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    14#include "ftxui/component/component_options.hpp" // for MenuOption, EntryState, MenuEntryOption, AnimatedColorOption, AnimatedColorsOption, UnderlineOption
    +
    15#include "ftxui/component/mouse.hpp" // for ftxui
    +
    16#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
    +
    17#include "ftxui/dom/elements.hpp" // for separator, operator|, Element, text, bgcolor, hbox, bold, color, filler, border, vbox, borderDouble, dim, flex, hcenter
    +
    18#include "ftxui/screen/color.hpp" // for Color, Color::Red, Color::Black, Color::Yellow, Color::Blue, Color::Default, Color::White
    +
    19
    +
    20using namespace ftxui;
    +
    21
    +
    22Component VMenu1(std::vector<std::string>* entries, int* selected);
    +
    23Component VMenu2(std::vector<std::string>* entries, int* selected);
    +
    24Component VMenu3(std::vector<std::string>* entries, int* selected);
    +
    25Component VMenu4(std::vector<std::string>* entries, int* selected);
    +
    26Component VMenu5(std::vector<std::string>* entries, int* selected);
    +
    27Component VMenu6(std::vector<std::string>* entries, int* selected);
    +
    28Component VMenu7(std::vector<std::string>* entries, int* selected);
    +
    29Component VMenu8(std::vector<std::string>* entries, int* selected);
    +
    30Component HMenu1(std::vector<std::string>* entries, int* selected);
    +
    31Component HMenu2(std::vector<std::string>* entries, int* selected);
    +
    32Component HMenu3(std::vector<std::string>* entries, int* selected);
    +
    33Component HMenu4(std::vector<std::string>* entries, int* selected);
    +
    34Component HMenu5(std::vector<std::string>* entries, int* selected);
    +
    35
    +
    +
    36int main() {
    + +
    38
    +
    39 std::vector<std::string> entries{
    +
    40 "Monkey", "Dog", "Cat", "Bird", "Elephant", "Cat",
    +
    41 };
    +
    42 std::array<int, 12> selected = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
    +
    43
    +
    44 auto vmenu_1_ = VMenu1(&entries, &selected[0]);
    +
    45 auto vmenu_2_ = VMenu2(&entries, &selected[1]);
    +
    46 auto vmenu_3_ = VMenu3(&entries, &selected[2]);
    +
    47 auto vmenu_4_ = VMenu4(&entries, &selected[3]);
    +
    48 auto vmenu_5_ = VMenu5(&entries, &selected[4]);
    +
    49 auto vmenu_6_ = VMenu6(&entries, &selected[5]);
    +
    50 auto vmenu_7_ = VMenu7(&entries, &selected[6]);
    +
    51 auto vmenu_8_ = VMenu8(&entries, &selected[7]);
    +
    52
    +
    53 auto hmenu_1_ = HMenu1(&entries, &selected[8]);
    +
    54 auto hmenu_2_ = HMenu2(&entries, &selected[9]);
    +
    55 auto hmenu_3_ = HMenu3(&entries, &selected[10]);
    +
    56 auto hmenu_4_ = HMenu4(&entries, &selected[11]);
    +
    57 auto hmenu_5_ = HMenu5(&entries, &selected[12]);
    +
    58
    +
    59 auto container = Container::Vertical({
    + +
    61 vmenu_1_,
    +
    62 vmenu_2_,
    +
    63 vmenu_3_,
    +
    64 vmenu_4_,
    +
    65 vmenu_5_,
    +
    66 vmenu_6_,
    +
    67 vmenu_7_,
    +
    68 vmenu_8_,
    +
    69 }),
    +
    70 hmenu_1_,
    +
    71 hmenu_2_,
    +
    72 hmenu_3_,
    +
    73 hmenu_4_,
    +
    74 hmenu_5_,
    +
    75 });
    +
    76
    +
    77 auto renderer = Renderer(container, [&] {
    +
    78 return //
    +
    79 hbox({
    +
    80 vbox({
    +
    81 hbox({
    +
    82 vmenu_1_->Render(),
    +
    83 separator(),
    +
    84 vmenu_2_->Render(),
    +
    85 separator(),
    +
    86 vmenu_3_->Render(),
    +
    87 separator(),
    +
    88 vmenu_4_->Render(),
    +
    89 separator(),
    +
    90 vmenu_5_->Render(),
    +
    91 vmenu_6_->Render(),
    +
    92 separator(),
    +
    93 vmenu_7_->Render(),
    +
    94 separator(),
    +
    95 vmenu_8_->Render(),
    +
    96 }),
    +
    97 separator(),
    +
    98 hmenu_1_->Render(),
    +
    99 separator(),
    +
    100 hmenu_2_->Render(),
    +
    101 separator(),
    +
    102 hmenu_3_->Render(),
    +
    103 separator(),
    +
    104 hmenu_4_->Render(),
    +
    105 hmenu_5_->Render(),
    +
    106 }) | border,
    +
    107 filler(),
    +
    108 });
    +
    109 });
    +
    110
    +
    111 screen.Loop(renderer);
    +
    112}
    +
    +
    113
    +
    +
    114Component VMenu1(std::vector<std::string>* entries, int* selected) {
    +
    115 auto option = MenuOption::Vertical();
    +
    116 option.entries_option.transform = [](EntryState state) {
    +
    117 state.label = (state.active ? "> " : " ") + state.label;
    +
    118 Element e = text(state.label);
    +
    119 if (state.focused) {
    +
    120 e = e | bgcolor(Color::Blue);
    +
    121 }
    +
    122 if (state.active) {
    +
    123 e = e | bold;
    +
    124 }
    +
    125 return e;
    +
    126 };
    +
    127 return Menu(entries, selected, option);
    +
    128}
    +
    +
    129
    +
    +
    130Component VMenu2(std::vector<std::string>* entries, int* selected) {
    +
    131 auto option = MenuOption::Vertical();
    +
    132 option.entries_option.transform = [](EntryState state) {
    +
    133 state.label += (state.active ? " <" : " ");
    +
    134 Element e = hbox(filler(), text(state.label));
    +
    135 if (state.focused) {
    +
    136 e = e | bgcolor(Color::Red);
    +
    137 }
    +
    138 if (state.active) {
    +
    139 e = e | bold;
    +
    140 }
    +
    141 return e;
    +
    142 };
    +
    143 return Menu(entries, selected, option);
    +
    144}
    +
    +
    145
    +
    +
    146Component VMenu3(std::vector<std::string>* entries, int* selected) {
    +
    147 auto option = MenuOption::Vertical();
    +
    148 option.entries_option.transform = [](EntryState state) {
    +
    149 Element e = state.active ? text("[" + state.label + "]")
    +
    150 : text(" " + state.label + " ");
    +
    151 if (state.focused) {
    +
    152 e = e | bold;
    +
    153 }
    +
    154
    +
    155 if (state.focused) {
    +
    156 e = e | color(Color::Blue);
    +
    157 }
    +
    158 if (state.active) {
    +
    159 e = e | bold;
    +
    160 }
    +
    161 return e;
    +
    162 };
    +
    163 return Menu(entries, selected, option);
    +
    164}
    +
    +
    165
    +
    +
    166Component VMenu4(std::vector<std::string>* entries, int* selected) {
    +
    167 auto option = MenuOption::Vertical();
    +
    168 option.entries_option.transform = [](EntryState state) {
    +
    169 if (state.active && state.focused) {
    +
    170 return text(state.label) | color(Color::Yellow) | bgcolor(Color::Black) |
    +
    171 bold;
    +
    172 }
    +
    173
    +
    174 if (state.active) {
    +
    175 return text(state.label) | color(Color::Yellow) | bgcolor(Color::Black);
    +
    176 }
    +
    177 if (state.focused) {
    +
    178 return text(state.label) | color(Color::Black) | bgcolor(Color::Yellow) |
    +
    179 bold;
    +
    180 }
    +
    181 return text(state.label) | color(Color::Black) | bgcolor(Color::Yellow);
    +
    182 };
    +
    183 return Menu(entries, selected, option);
    +
    184}
    +
    +
    185
    +
    +
    186Component VMenu5(std::vector<std::string>* entries, int* selected) {
    +
    187 auto option = MenuOption::Vertical();
    +
    188 option.entries_option.transform = [](EntryState state) {
    +
    189 auto element = text(state.label);
    +
    190 if (state.active && state.focused) {
    +
    191 return element | borderDouble;
    +
    192 }
    +
    193 if (state.active) {
    +
    194 return element | border;
    +
    195 }
    +
    196 if (state.focused) {
    +
    197 return element | bold;
    +
    198 }
    +
    199 return element;
    +
    200 };
    +
    201 return Menu(entries, selected, option);
    +
    202}
    +
    +
    203
    +
    +
    204Component VMenu6(std::vector<std::string>* entries, int* selected) {
    +
    205 auto option = MenuOption::VerticalAnimated();
    +
    206 option.underline.color_inactive = Color::Default;
    +
    207 option.underline.color_active = Color::Red;
    +
    208 option.underline.SetAnimationFunction(animation::easing::Linear);
    +
    209 return Menu(entries, selected, option);
    +
    210}
    +
    +
    211
    +
    +
    212Component VMenu7(std::vector<std::string>* entries, int* selected) {
    +
    213 auto option = MenuOption::Vertical();
    +
    214 option.entries_option.animated_colors.foreground.enabled = true;
    +
    215 option.entries_option.animated_colors.background.enabled = true;
    +
    216 option.entries_option.animated_colors.background.active = Color::Red;
    +
    217 option.entries_option.animated_colors.background.inactive = Color::Black;
    +
    218 option.entries_option.animated_colors.foreground.active = Color::White;
    +
    219 option.entries_option.animated_colors.foreground.inactive = Color::Red;
    +
    220 return Menu(entries, selected, option);
    +
    221}
    +
    +
    222
    +
    +
    223Component VMenu8(std::vector<std::string>* entries, int* selected) {
    +
    224 auto option = MenuOption::Vertical();
    +
    225 option.entries_option.animated_colors.foreground.Set(
    +
    226 Color::Red, Color::White, std::chrono::milliseconds(500));
    +
    227 return Menu(entries, selected, option);
    +
    228}
    +
    +
    229
    +
    +
    230Component HMenu1(std::vector<std::string>* entries, int* selected) {
    +
    231 return Menu(entries, selected, MenuOption::Horizontal());
    +
    232}
    +
    +
    233
    +
    +
    234Component HMenu2(std::vector<std::string>* entries, int* selected) {
    +
    235 return Menu(entries, selected, MenuOption::Toggle());
    +
    236}
    +
    +
    237
    +
    +
    238Component HMenu3(std::vector<std::string>* entries, int* selected) {
    +
    239 auto option = MenuOption::Toggle();
    +
    240 option.elements_infix = [] { return text(" 🮣🮠 "); };
    +
    241
    +
    242 return Menu(entries, selected, option);
    +
    243}
    +
    +
    244
    +
    +
    245Component HMenu4(std::vector<std::string>* entries, int* selected) {
    +
    246 return Menu(entries, selected, MenuOption::HorizontalAnimated());
    +
    247}
    +
    +
    248
    +
    +
    249Component HMenu5(std::vector<std::string>* entries, int* selected) {
    +
    250 auto option = MenuOption::HorizontalAnimated();
    +
    251 option.underline.SetAnimation(std::chrono::milliseconds(1500),
    +
    252 animation::easing::ElasticOut);
    +
    253 option.entries_option.transform = [](EntryState state) {
    +
    254 Element e = text(state.label) | hcenter | flex;
    +
    255 if (state.active && state.focused) {
    +
    256 e = e | bold;
    +
    257 }
    +
    258 if (!state.focused && !state.active) {
    +
    259 e = e | dim;
    +
    260 }
    +
    261 return e;
    +
    262 };
    +
    263 option.underline.color_inactive = Color::Default;
    +
    264 option.underline.color_active = Color::Red;
    +
    265 return Menu(entries, selected, option);
    +
    266}
    +
    + + + + + + +
    static ScreenInteractive TerminalOutput()
    +
    static MenuOption Toggle()
    Standard options for a horizontal menu with some separator. This can be useful to implement a tab bar...
    +
    static MenuOption Horizontal()
    Standard options for a horizontal menu. This can be useful to implement a tab bar.
    +
    static MenuOption VerticalAnimated()
    Standard options for an animated vertical menu. This can be useful to implement a list of selectable ...
    +
    static MenuOption Vertical()
    Standard options for a vertical menu. This can be useful to implement a list of selectable items.
    +
    static MenuOption HorizontalAnimated()
    Standard options for an animated horizontal menu. This can be useful to implement a tab bar.
    +
    Component Horizontal(Components children)
    A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow...
    +
    Component Menu(MenuOption options)
    A list of text. The focused element is selected.
    +
    Component Renderer(Component child, std::function< Element()>)
    Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
    +
    Component Vertical(Components children)
    A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
    +
    virtual void Render(Screen &screen)
    Display an element on a ftxui::Screen.
    Definition node.cpp:59
    +
    Decorator bgcolor(Color)
    Decorate using a background color.
    +
    Element borderDouble(Element)
    Draw a double border around the element.
    +
    Element flex(Element)
    Make a child element to expand proportionally to the space left in a container.
    Definition flex.cpp:123
    +
    Element bold(Element)
    Use a bold font, for elements with more emphasis.
    Definition bold.cpp:33
    +
    Element text(std::wstring text)
    Display a piece of unicode text.
    Definition text.cpp:160
    +
    Element separator()
    Draw a vertical or horizontal separation in between two other elements.
    +
    Element filler()
    An element that will take expand proportionally to the space left in a container.
    Definition flex.cpp:98
    +
    Element dim(Element)
    Use a light font, for elements with less emphasis.
    Definition dim.cpp:33
    +
    Element border(Element)
    Draw a border around the element.
    +
    Decorator color(Color)
    Decorate using a foreground color.
    +
    Element vbox(Elements)
    A container displaying elements vertically one by one.
    Definition vbox.cpp:96
    + + + + + + +
    Component HMenu5(std::vector< std::string > *entries, int *selected)
    +
    Component HMenu4(std::vector< std::string > *entries, int *selected)
    +
    Component VMenu5(std::vector< std::string > *entries, int *selected)
    +
    Component HMenu1(std::vector< std::string > *entries, int *selected)
    +
    Component HMenu2(std::vector< std::string > *entries, int *selected)
    +
    Component VMenu2(std::vector< std::string > *entries, int *selected)
    +
    Component HMenu3(std::vector< std::string > *entries, int *selected)
    +
    Component VMenu1(std::vector< std::string > *entries, int *selected)
    +
    int main()
    +
    Component VMenu3(std::vector< std::string > *entries, int *selected)
    +
    Component VMenu6(std::vector< std::string > *entries, int *selected)
    +
    Component VMenu7(std::vector< std::string > *entries, int *selected)
    +
    Component VMenu8(std::vector< std::string > *entries, int *selected)
    +
    Component VMenu4(std::vector< std::string > *entries, int *selected)
    + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    Element hbox(Elements)
    A container displaying elements horizontally one by one.
    Definition hbox.cpp:94
    +
    std::shared_ptr< ComponentBase > Component
    + +
    arguments for transform from |ButtonOption|, |CheckboxOption|, |RadioboxOption|, |MenuEntryOption|,...
    +
    +
    + + + + + diff --git a/menu__underline__animated__gallery_8cpp.html b/menu__underline__animated__gallery_8cpp.html new file mode 100644 index 000000000..ae29b8579 --- /dev/null +++ b/menu__underline__animated__gallery_8cpp.html @@ -0,0 +1,285 @@ + + + + + + + + +FTXUI: menu_underline_animated_gallery.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    menu_underline_animated_gallery.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + + + + +

    +Functions

    Component DummyComponent (int id)
     
    Component Text (const std::string &t)
     
    int main ()
     
    +

    Function Documentation

    + +

    ◆ DummyComponent()

    + +
    +
    + + + + + + + +
    Component DummyComponent (int id)
    +
    +
    + +

    ◆ Text()

    + +
    +
    + + + + + + + +
    Component Text (const std::string & t)
    +
    +
    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 34 of file menu_underline_animated_gallery.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/menu__underline__animated__gallery_8cpp.js b/menu__underline__animated__gallery_8cpp.js new file mode 100644 index 000000000..b90f1e809 --- /dev/null +++ b/menu__underline__animated__gallery_8cpp.js @@ -0,0 +1,6 @@ +var menu__underline__animated__gallery_8cpp = +[ + [ "DummyComponent", "menu__underline__animated__gallery_8cpp.html#a488a81f58d76f17bf95ef222f68e0dfe", null ], + [ "Text", "menu__underline__animated__gallery_8cpp.html#abd88e1b2ce2a860c64bbcd44c0e0282b", null ], + [ "main", "menu__underline__animated__gallery_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/menu__underline__animated__gallery_8cpp_source.html b/menu__underline__animated__gallery_8cpp_source.html new file mode 100644 index 000000000..da0ef3564 --- /dev/null +++ b/menu__underline__animated__gallery_8cpp_source.html @@ -0,0 +1,333 @@ + + + + + + + + +FTXUI: menu_underline_animated_gallery.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    menu_underline_animated_gallery.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <chrono> // for operator""ms, literals
    +
    5#include <memory> // for allocator, shared_ptr, __shared_ptr_access
    +
    6#include <string> // for string, operator+, to_string, basic_string
    +
    7#include <vector> // for vector
    +
    8
    +
    9#include "ftxui/component/animation.hpp" // for BackOut, Duration
    +
    10#include "ftxui/component/component.hpp" // for Menu, Renderer, Vertical
    +
    11#include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    12#include "ftxui/component/component_options.hpp" // for MenuOption, UnderlineOption
    +
    13#include "ftxui/component/mouse.hpp" // for ftxui
    +
    14#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
    +
    15#include "ftxui/dom/elements.hpp" // for text, Element, operator|, borderEmpty, inverted
    +
    16#include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Red
    +
    17
    +
    18using namespace ftxui;
    +
    19
    +
    + +
    21 return Renderer([id](bool focused) {
    +
    22 auto t = text("component " + std::to_string(id));
    +
    23 if (focused) {
    +
    24 t = t | inverted;
    +
    25 }
    +
    26 return t;
    +
    27 });
    +
    28}
    +
    +
    29
    +
    +
    30Component Text(const std::string& t) {
    +
    31 return Renderer([t] { return text(t) | borderEmpty; });
    +
    32}
    +
    +
    33
    +
    +
    34int main() {
    +
    35 using namespace std::literals;
    +
    36 std::vector<std::string> tab_values{
    +
    37 "Tab 1", "Tab 2", "Tab 3", "A very very long tab", "탭",
    +
    38 };
    +
    39 int tab_selected = 0;
    +
    40
    +
    41 auto container = Container::Vertical({});
    +
    42
    +
    43 int frame_count = 0;
    +
    44 container->Add(Renderer(
    +
    45 [&] { return text("Frame count: " + std::to_string(frame_count++)); }));
    +
    46
    +
    47 {
    +
    48 auto option = MenuOption::HorizontalAnimated();
    +
    49 container->Add(Text("This demonstrate the Menu component"));
    +
    50 container->Add(Menu(&tab_values, &tab_selected, option));
    +
    51 }
    +
    52
    +
    53 {
    +
    54 container->Add(Text("Set underline color to blue"));
    +
    55 auto option = MenuOption::HorizontalAnimated();
    +
    56 option.underline.color_inactive = Color::Blue;
    +
    57 container->Add(Menu(&tab_values, &tab_selected, option));
    +
    58 }
    +
    59
    +
    60 {
    +
    61 container->Add(Text("Set underline active color to red"));
    +
    62 auto option = MenuOption::HorizontalAnimated();
    +
    63 option.underline.color_active = Color::Red;
    +
    64 container->Add(Menu(&tab_values, &tab_selected, option));
    +
    65 }
    +
    66
    +
    67 {
    +
    68 container->Add(Text("Set animation duration to 0ms"));
    +
    69 auto option = MenuOption::HorizontalAnimated();
    +
    70 option.underline.SetAnimationDuration(0ms);
    +
    71 container->Add(Menu(&tab_values, &tab_selected, option));
    +
    72 }
    +
    73
    +
    74 {
    +
    75 container->Add(Text("Set animation easing function to back-out"));
    +
    76 auto option = MenuOption::HorizontalAnimated();
    +
    77 option.underline.SetAnimationFunction(animation::easing::BackOut);
    +
    78 option.underline.SetAnimationDuration(350ms);
    +
    79 container->Add(Menu(&tab_values, &tab_selected, option));
    +
    80 }
    +
    81
    +
    82 // option.underline_animation_follower_delay = 250ms
    +
    83 {
    +
    84 container->Add(Text("Add delay to desynchronize animation"));
    +
    85 auto option = MenuOption::HorizontalAnimated();
    +
    86 option.underline.follower_delay = 250ms;
    +
    87 container->Add(Menu(&tab_values, &tab_selected, option));
    +
    88 }
    +
    89
    +
    90 container->SetActiveChild(container->ChildAt(2));
    +
    91
    + +
    93 screen.Loop(container);
    +
    94}
    +
    + + + + + + +
    static ScreenInteractive TerminalOutput()
    +
    void Add(Component children)
    Add a child. @param child The child to be attached.
    Definition component.cpp:70
    +
    static MenuOption HorizontalAnimated()
    Standard options for an animated horizontal menu. This can be useful to implement a tab bar.
    +
    Component Menu(MenuOption options)
    A list of text. The focused element is selected.
    +
    Component Renderer(Component child, std::function< Element()>)
    Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
    +
    Component Vertical(Components children)
    A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
    +
    Element inverted(Element)
    Add a filter that will invert the foreground and the background colors.
    Definition inverted.cpp:34
    +
    Element text(std::wstring text)
    Display a piece of unicode text.
    Definition text.cpp:160
    +
    Element borderEmpty(Element)
    Draw an empty border around the element.
    + + + + + + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::shared_ptr< ComponentBase > Component
    + +
    +
    + + + + + diff --git a/menudata.js b/menudata.js new file mode 100644 index 000000000..ce6c78f78 --- /dev/null +++ b/menudata.js @@ -0,0 +1,174 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file +*/ +var menudata={children:[ +{text:"Pages",url:"pages.html"}, +{text:"Reference",url:"topics.html"}, +{text:"Modules",url:"modules.html",children:[ +{text:"Modules List",url:"modules.html"}]}, +{text:"Classes",url:"annotated.html",children:[ +{text:"Class List",url:"annotated.html"}, +{text:"Class Hierarchy",url:"inherits.html"}, +{text:"Class Members",url:"functions.html",children:[ +{text:"All",url:"functions.html",children:[ +{text:"a",url:"functions.html#index_a"}, +{text:"b",url:"functions_b.html#index_b"}, +{text:"c",url:"functions_c.html#index_c"}, +{text:"d",url:"functions_d.html#index_d"}, +{text:"e",url:"functions_e.html#index_e"}, +{text:"f",url:"functions_f.html#index_f"}, +{text:"g",url:"functions_g.html#index_g"}, +{text:"h",url:"functions_h.html#index_h"}, +{text:"i",url:"functions_i.html#index_i"}, +{text:"j",url:"functions_j.html#index_j"}, +{text:"k",url:"functions_k.html#index_k"}, +{text:"l",url:"functions_l.html#index_l"}, +{text:"m",url:"functions_m.html#index_m"}, +{text:"n",url:"functions_n.html#index_n"}, +{text:"o",url:"functions_o.html#index_o"}, +{text:"p",url:"functions_p.html#index_p"}, +{text:"q",url:"functions_q.html#index_q"}, +{text:"r",url:"functions_r.html#index_r"}, +{text:"s",url:"functions_s.html#index_s"}, +{text:"t",url:"functions_t.html#index_t"}, +{text:"u",url:"functions_u.html#index_u"}, +{text:"v",url:"functions_v.html#index_v"}, +{text:"w",url:"functions_w.html#index_w"}, +{text:"x",url:"functions_x.html#index_x"}, +{text:"y",url:"functions_y.html#index_y"}, +{text:"z",url:"functions_z.html#index_z"}, +{text:"~",url:"functions_~.html#index__7E"}]}, +{text:"Functions",url:"functions_func.html",children:[ +{text:"a",url:"functions_func.html#index_a"}, +{text:"b",url:"functions_func_b.html#index_b"}, +{text:"c",url:"functions_func_c.html#index_c"}, +{text:"d",url:"functions_func_d.html#index_d"}, +{text:"e",url:"functions_func_e.html#index_e"}, +{text:"f",url:"functions_func_f.html#index_f"}, +{text:"g",url:"functions_func_g.html#index_g"}, +{text:"h",url:"functions_func_h.html#index_h"}, +{text:"i",url:"functions_func_i.html#index_i"}, +{text:"l",url:"functions_func_l.html#index_l"}, +{text:"m",url:"functions_func_m.html#index_m"}, +{text:"n",url:"functions_func_n.html#index_n"}, +{text:"o",url:"functions_func_o.html#index_o"}, +{text:"p",url:"functions_func_p.html#index_p"}, +{text:"r",url:"functions_func_r.html#index_r"}, +{text:"s",url:"functions_func_s.html#index_s"}, +{text:"t",url:"functions_func_t.html#index_t"}, +{text:"u",url:"functions_func_u.html#index_u"}, +{text:"v",url:"functions_func_v.html#index_v"}, +{text:"w",url:"functions_func_w.html#index_w"}, +{text:"~",url:"functions_func_~.html#index__7E"}]}, +{text:"Variables",url:"functions_vars.html",children:[ +{text:"a",url:"functions_vars.html#index_a"}, +{text:"b",url:"functions_vars_b.html#index_b"}, +{text:"c",url:"functions_vars_c.html#index_c"}, +{text:"d",url:"functions_vars_d.html#index_d"}, +{text:"e",url:"functions_vars_e.html#index_e"}, +{text:"f",url:"functions_vars_f.html#index_f"}, +{text:"g",url:"functions_vars_g.html#index_g"}, +{text:"h",url:"functions_vars_h.html#index_h"}, +{text:"i",url:"functions_vars_i.html#index_i"}, +{text:"j",url:"functions_vars_j.html#index_j"}, +{text:"k",url:"functions_vars_k.html#index_k"}, +{text:"l",url:"functions_vars_l.html#index_l"}, +{text:"m",url:"functions_vars_m.html#index_m"}, +{text:"n",url:"functions_vars_n.html#index_n"}, +{text:"o",url:"functions_vars_o.html#index_o"}, +{text:"p",url:"functions_vars_p.html#index_p"}, +{text:"q",url:"functions_vars_q.html#index_q"}, +{text:"r",url:"functions_vars_r.html#index_r"}, +{text:"s",url:"functions_vars_s.html#index_s"}, +{text:"t",url:"functions_vars_t.html#index_t"}, +{text:"u",url:"functions_vars_u.html#index_u"}, +{text:"v",url:"functions_vars_v.html#index_v"}, +{text:"w",url:"functions_vars_w.html#index_w"}, +{text:"x",url:"functions_vars_x.html#index_x"}, +{text:"y",url:"functions_vars_y.html#index_y"}, +{text:"z",url:"functions_vars_z.html#index_z"}]}, +{text:"Typedefs",url:"functions_type.html"}, +{text:"Enumerations",url:"functions_enum.html"}, +{text:"Enumerator",url:"functions_eval.html",children:[ +{text:"a",url:"functions_eval.html#index_a"}, +{text:"b",url:"functions_eval_b.html#index_b"}, +{text:"c",url:"functions_eval_c.html#index_c"}, +{text:"d",url:"functions_eval_d.html#index_d"}, +{text:"g",url:"functions_eval_g.html#index_g"}, +{text:"h",url:"functions_eval_h.html#index_h"}, +{text:"i",url:"functions_eval_i.html#index_i"}, +{text:"k",url:"functions_eval_k.html#index_k"}, +{text:"l",url:"functions_eval_l.html#index_l"}, +{text:"m",url:"functions_eval_m.html#index_m"}, +{text:"n",url:"functions_eval_n.html#index_n"}, +{text:"o",url:"functions_eval_o.html#index_o"}, +{text:"p",url:"functions_eval_p.html#index_p"}, +{text:"r",url:"functions_eval_r.html#index_r"}, +{text:"s",url:"functions_eval_s.html#index_s"}, +{text:"t",url:"functions_eval_t.html#index_t"}, +{text:"u",url:"functions_eval_u.html#index_u"}, +{text:"v",url:"functions_eval_v.html#index_v"}, +{text:"w",url:"functions_eval_w.html#index_w"}, +{text:"y",url:"functions_eval_y.html#index_y"}]}, +{text:"Related Symbols",url:"functions_rela.html"}]}]}, +{text:"Files",url:"files.html",children:[ +{text:"File List",url:"files.html"}, +{text:"File Members",url:"globals.html",children:[ +{text:"All",url:"globals.html",children:[ +{text:"a",url:"globals.html#index_a"}, +{text:"b",url:"globals.html#index_b"}, +{text:"c",url:"globals.html#index_c"}, +{text:"d",url:"globals.html#index_d"}, +{text:"e",url:"globals.html#index_e"}, +{text:"f",url:"globals.html#index_f"}, +{text:"g",url:"globals.html#index_g"}, +{text:"h",url:"globals.html#index_h"}, +{text:"i",url:"globals.html#index_i"}, +{text:"l",url:"globals.html#index_l"}, +{text:"m",url:"globals.html#index_m"}, +{text:"n",url:"globals.html#index_n"}, +{text:"p",url:"globals.html#index_p"}, +{text:"r",url:"globals.html#index_r"}, +{text:"s",url:"globals.html#index_s"}, +{text:"t",url:"globals.html#index_t"}, +{text:"v",url:"globals.html#index_v"}, +{text:"w",url:"globals.html#index_w"}, +{text:"x",url:"globals.html#index_x"}, +{text:"y",url:"globals.html#index_y"}]}, +{text:"Functions",url:"globals_func.html",children:[ +{text:"c",url:"globals_func.html#index_c"}, +{text:"d",url:"globals_func.html#index_d"}, +{text:"e",url:"globals_func.html#index_e"}, +{text:"h",url:"globals_func.html#index_h"}, +{text:"i",url:"globals_func.html#index_i"}, +{text:"l",url:"globals_func.html#index_l"}, +{text:"m",url:"globals_func.html#index_m"}, +{text:"n",url:"globals_func.html#index_n"}, +{text:"s",url:"globals_func.html#index_s"}, +{text:"t",url:"globals_func.html#index_t"}, +{text:"v",url:"globals_func.html#index_v"}, +{text:"w",url:"globals_func.html#index_w"}]}, +{text:"Variables",url:"globals_vars.html"}, +{text:"Macros",url:"globals_defs.html"}]}]}, +{text:"Examples",url:"examples.html"}]} diff --git a/minus.svg b/minus.svg new file mode 100644 index 000000000..f70d0c1a1 --- /dev/null +++ b/minus.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/minusd.svg b/minusd.svg new file mode 100644 index 000000000..5f8e87962 --- /dev/null +++ b/minusd.svg @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/modal_8cpp.html b/modal_8cpp.html new file mode 100644 index 000000000..c5104ab4c --- /dev/null +++ b/modal_8cpp.html @@ -0,0 +1,228 @@ + + + + + + + + +FTXUI: modal.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    modal.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + + +

    +Functions

    Component Modal (Component main, Component modal, const bool *show_modal)
     
    ComponentDecorator Modal (Component modal, const bool *show_modal)
     
    +
    +
    + + + + + diff --git a/modal_8cpp.js b/modal_8cpp.js new file mode 100644 index 000000000..3a021ee36 --- /dev/null +++ b/modal_8cpp.js @@ -0,0 +1,5 @@ +var modal_8cpp = +[ + [ "Modal", "modal_8cpp.html#ga5185342fbba215496cb8a6805f36089c", null ], + [ "Modal", "modal_8cpp.html#ga5babae0bb25f8cada57784cc5d27fb74", null ] +]; \ No newline at end of file diff --git a/modal_8cpp_source.html b/modal_8cpp_source.html new file mode 100644 index 000000000..2fde5b8b9 --- /dev/null +++ b/modal_8cpp_source.html @@ -0,0 +1,290 @@ + + + + + + + + +FTXUI: modal.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    modal.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2022 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <ftxui/component/event.hpp> // for Event
    +
    5#include <ftxui/dom/elements.hpp> // for operator|, Element, center, clear_under, dbox
    +
    6#include <memory> // for __shared_ptr_access, shared_ptr
    +
    7#include <utility> // for move
    +
    8
    +
    9#include "ftxui/component/component.hpp" // for Make, Tab, ComponentDecorator, Modal
    +
    10#include "ftxui/component/component_base.hpp" // for Component, ComponentBase
    +
    11
    +
    12namespace ftxui {
    +
    13
    +
    14// Add a |modal| window on top of the |main| component. It is shown one on the
    +
    15// top of the other when |show_modal| is true.
    +
    16/// @ingroup component
    +
    17// NOLINTNEXTLINE
    +
    +
    18Component Modal(Component main, Component modal, const bool* show_modal) {
    +
    19 class Impl : public ComponentBase {
    +
    20 public:
    +
    21 explicit Impl(Component main, Component modal, const bool* show_modal)
    +
    22 : main_(std::move(main)),
    +
    23 modal_(std::move(modal)),
    +
    24 show_modal_(show_modal) {
    +
    25 Add(Container::Tab({main_, modal_}, &selector_));
    +
    26 }
    +
    27
    +
    28 private:
    +
    29 Element OnRender() override {
    +
    30 selector_ = *show_modal_;
    +
    31 auto document = main_->Render();
    +
    32 if (*show_modal_) {
    +
    33 document = dbox({
    +
    34 document,
    +
    35 modal_->Render() | clear_under | center,
    +
    36 });
    +
    37 }
    +
    38 return document;
    +
    39 }
    +
    40
    +
    41 bool OnEvent(Event event) override {
    +
    42 selector_ = *show_modal_;
    +
    43 return ComponentBase::OnEvent(event);
    +
    44 }
    +
    45
    +
    46 Component main_;
    +
    47 Component modal_;
    +
    48 const bool* show_modal_;
    +
    49 int selector_ = *show_modal_;
    +
    50 };
    +
    51 return Make<Impl>(main, modal, show_modal);
    +
    52}
    +
    +
    53
    +
    54// Decorate a component. Add a |modal| window on top of it. It is shown one on
    +
    55// the top of the other when |show_modal| is true.
    +
    56/// @ingroup component
    +
    57// NOLINTNEXTLINE
    +
    +
    58ComponentDecorator Modal(Component modal, const bool* show_modal) {
    +
    59 return [modal, show_modal](Component main) {
    +
    60 return Modal(std::move(main), modal, show_modal);
    +
    61 };
    +
    62}
    +
    +
    63
    +
    64} // namespace ftxui
    + + + + + +
    It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ft...
    +
    Component Modal(Component main, Component modal, const bool *show_modal)
    Definition modal.cpp:18
    +
    Represent an event. It can be key press event, a terminal resize, or more ...
    Definition event.hpp:29
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::shared_ptr< T > Make(Args &&... args)
    Definition component.hpp:27
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    std::function< Component(Component)> ComponentDecorator
    Definition component.hpp:32
    +
    std::shared_ptr< ComponentBase > Component
    +
    +
    + + + + + diff --git a/modal__dialog_8cpp.html b/modal__dialog_8cpp.html new file mode 100644 index 000000000..27e4cdc7a --- /dev/null +++ b/modal__dialog_8cpp.html @@ -0,0 +1,322 @@ + + + + + + + + +FTXUI: modal_dialog.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    modal_dialog.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + + + + +

    +Functions

    Component MainComponent (std::function< void()> show_modal, std::function< void()> exit)
     
    Component ModalComponent (std::function< void()> do_nothing, std::function< void()> hide_modal)
     
    int main (int argc, const char *argv[])
     
    + + + +

    +Variables

    auto button_style = ButtonOption::Animated()
     
    +

    Function Documentation

    + +

    ◆ MainComponent()

    + +
    +
    + + + + + + + + + + + +
    Component MainComponent (std::function< void()> show_modal,
    std::function< void()> exit )
    +
    +
    Examples
    examples/component/modal_dialog.cpp.
    +
    + +

    Definition at line 18 of file modal_dialog.cpp.

    + +
    +
    + +

    ◆ ModalComponent()

    + +
    +
    + + + + + + + + + + + +
    Component ModalComponent (std::function< void()> do_nothing,
    std::function< void()> hide_modal )
    +
    +
    Examples
    examples/component/modal_dialog.cpp.
    +
    + +

    Definition at line 40 of file modal_dialog.cpp.

    + +
    +
    + +

    ◆ main()

    + +
    +
    + + + + + + + + + + + +
    int main (int argc,
    const char * argv[] )
    +
    + +

    Definition at line 59 of file modal_dialog.cpp.

    + +
    +
    +

    Variable Documentation

    + +

    ◆ button_style

    + +
    +
    + + + + +
    auto button_style = ButtonOption::Animated()
    +
    +
    Examples
    examples/component/modal_dialog.cpp.
    +
    + +

    Definition at line 15 of file modal_dialog.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/modal__dialog_8cpp.js b/modal__dialog_8cpp.js new file mode 100644 index 000000000..c5070d9f0 --- /dev/null +++ b/modal__dialog_8cpp.js @@ -0,0 +1,7 @@ +var modal__dialog_8cpp = +[ + [ "MainComponent", "modal__dialog_8cpp.html#aa61b015248766b6067b6d3c99f04c389", null ], + [ "ModalComponent", "modal__dialog_8cpp.html#a3b73476f6f304dce17f808a7c3789f5c", null ], + [ "main", "modal__dialog_8cpp.html#ac0f2228420376f4db7e1274f2b41667c", null ], + [ "button_style", "modal__dialog_8cpp.html#a1a0df261e66f85913256ea3d321b3e87", null ] +]; \ No newline at end of file diff --git a/modal__dialog_8cpp_source.html b/modal__dialog_8cpp_source.html new file mode 100644 index 000000000..156c33a94 --- /dev/null +++ b/modal__dialog_8cpp_source.html @@ -0,0 +1,324 @@ + + + + + + + + +FTXUI: modal_dialog.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    modal_dialog.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2022 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <ftxui/component/component_options.hpp> // for ButtonOption
    +
    5#include <ftxui/component/mouse.hpp> // for ftxui
    +
    6#include <functional> // for function
    +
    7#include <memory> // for allocator, shared_ptr
    +
    8
    +
    9#include "ftxui/component/component.hpp" // for Button, operator|=, Renderer, Vertical, Modal
    +
    10#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive, Component
    +
    11#include "ftxui/dom/elements.hpp" // for operator|, separator, text, size, Element, vbox, border, GREATER_THAN, WIDTH, center, HEIGHT
    +
    12
    +
    13using namespace ftxui;
    +
    14
    + +
    16
    +
    17// Definition of the main component. The details are not important.
    +
    +
    18Component MainComponent(std::function<void()> show_modal,
    +
    19 std::function<void()> exit) {
    +
    20 auto component = Container::Vertical({
    +
    21 Button("Show modal", show_modal, button_style),
    +
    22 Button("Quit", exit, button_style),
    +
    23 });
    +
    24 // Polish how the two buttons are rendered:
    +
    25 component |= Renderer([&](Element inner) {
    +
    26 return vbox({
    +
    27 text("Main component"),
    +
    28 separator(),
    +
    29 inner,
    +
    30 }) //
    +
    31 | size(WIDTH, GREATER_THAN, 15) //
    +
    32 | size(HEIGHT, GREATER_THAN, 15) //
    +
    33 | border //
    +
    34 | center; //
    +
    35 });
    +
    36 return component;
    +
    37}
    +
    +
    38
    +
    39// Definition of the modal component. The details are not important.
    +
    +
    40Component ModalComponent(std::function<void()> do_nothing,
    +
    41 std::function<void()> hide_modal) {
    +
    42 auto component = Container::Vertical({
    +
    43 Button("Do nothing", do_nothing, button_style),
    +
    44 Button("Quit modal", hide_modal, button_style),
    +
    45 });
    +
    46 // Polish how the two buttons are rendered:
    +
    47 component |= Renderer([&](Element inner) {
    +
    48 return vbox({
    +
    49 text("Modal component "),
    +
    50 separator(),
    +
    51 inner,
    +
    52 }) //
    +
    53 | size(WIDTH, GREATER_THAN, 30) //
    +
    54 | border; //
    +
    55 });
    +
    56 return component;
    +
    57}
    +
    +
    58
    +
    +
    59int main(int argc, const char* argv[]) {
    + +
    61
    +
    62 // State of the application:
    +
    63 bool modal_shown = false;
    +
    64
    +
    65 // Some actions modifying the state:
    +
    66 auto show_modal = [&] { modal_shown = true; };
    +
    67 auto hide_modal = [&] { modal_shown = false; };
    +
    68 auto exit = screen.ExitLoopClosure();
    +
    69 auto do_nothing = [&] {};
    +
    70
    +
    71 // Instanciate the main and modal components:
    +
    72 auto main_component = MainComponent(show_modal, exit);
    +
    73 auto modal_component = ModalComponent(do_nothing, hide_modal);
    +
    74
    +
    75 // Use the `Modal` function to use together the main component and its modal
    +
    76 // window. The |modal_shown| boolean controls whether the modal is shown or
    +
    77 // not.
    +
    78 main_component |= Modal(modal_component, &modal_shown);
    +
    79
    +
    80 screen.Loop(main_component);
    +
    81 return 0;
    +
    82}
    +
    + + + + +
    static ButtonOption Animated()
    Create a ButtonOption, using animated colors.
    +
    static ScreenInteractive TerminalOutput()
    +
    Component Button(ButtonOption options)
    Draw a button. Execute a function when clicked.
    +
    Component Modal(Component main, Component modal, const bool *show_modal)
    Definition modal.cpp:18
    +
    Component Renderer(Component child, std::function< Element()>)
    Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
    +
    Component Vertical(Components children)
    A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
    +
    Decorator size(WidthOrHeight, Constraint, int value)
    Apply a constraint on the size of an element.
    +
    Element center(Element)
    Center an element horizontally and vertically.
    +
    Element text(std::wstring text)
    Display a piece of unicode text.
    Definition text.cpp:160
    +
    Element separator()
    Draw a vertical or horizontal separation in between two other elements.
    +
    Element border(Element)
    Draw a border around the element.
    +
    Element vbox(Elements)
    A container displaying elements vertically one by one.
    Definition vbox.cpp:96
    +
    auto button_style
    +
    Component ModalComponent(std::function< void()> do_nothing, std::function< void()> hide_modal)
    +
    Component MainComponent(std::function< void()> show_modal, std::function< void()> exit)
    + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + + +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    @ GREATER_THAN
    Definition elements.hpp:162
    +
    std::shared_ptr< ComponentBase > Component
    + +
    +
    + + + + + diff --git a/modal__dialog__custom_8cpp.html b/modal__dialog__custom_8cpp.html new file mode 100644 index 000000000..74e5af224 --- /dev/null +++ b/modal__dialog__custom_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: modal_dialog_custom.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    modal_dialog_custom.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Functions

    int main ()
     
    +

    Function Documentation

    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 14 of file modal_dialog_custom.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/modal__dialog__custom_8cpp.js b/modal__dialog__custom_8cpp.js new file mode 100644 index 000000000..aa5e03d9b --- /dev/null +++ b/modal__dialog__custom_8cpp.js @@ -0,0 +1,4 @@ +var modal__dialog__custom_8cpp = +[ + [ "main", "modal__dialog__custom_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/modal__dialog__custom_8cpp_source.html b/modal__dialog__custom_8cpp_source.html new file mode 100644 index 000000000..7da92ec73 --- /dev/null +++ b/modal__dialog__custom_8cpp_source.html @@ -0,0 +1,312 @@ + + + + + + + + +FTXUI: modal_dialog_custom.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    modal_dialog_custom.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <memory> // for allocator, shared_ptr, __shared_ptr_access
    +
    5#include <string> // for string, basic_string, char_traits, operator+
    +
    6#include <vector> // for vector
    +
    7
    +
    8#include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    9#include "ftxui/component/component.hpp" // for Button, Renderer, Horizontal, Tab
    +
    10#include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    11#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    12#include "ftxui/dom/elements.hpp" // for operator|, Element, filler, text, hbox, separator, center, vbox, bold, border, clear_under, dbox, size, GREATER_THAN, HEIGHT
    +
    13
    +
    +
    14int main() {
    +
    15 using namespace ftxui;
    +
    16 auto screen = ScreenInteractive::TerminalOutput();
    +
    17
    +
    18 // There are two layers. One at depth = 0 and the modal window at depth = 1;
    +
    19 int depth = 0;
    +
    20
    +
    21 // The current rating of FTXUI.
    +
    22 std::string rating = "3/5 stars";
    +
    23
    +
    24 // At depth=0, two buttons. One for rating FTXUI and one for quitting.
    +
    25 auto button_rate_ftxui = Button("Rate FTXUI", [&] { depth = 1; });
    +
    26 auto button_quit = Button("Quit", screen.ExitLoopClosure());
    +
    27
    +
    28 auto depth_0_container = Container::Horizontal({
    +
    29 button_rate_ftxui,
    +
    30 button_quit,
    +
    31 });
    +
    32 auto depth_0_renderer = Renderer(depth_0_container, [&] {
    +
    33 return vbox({
    +
    34 text("Modal dialog example"),
    +
    35 separator(),
    +
    36 text("☆☆☆ FTXUI:" + rating + " ☆☆☆") | bold,
    +
    37 filler(),
    +
    38 hbox({
    +
    39 button_rate_ftxui->Render(),
    +
    40 filler(),
    +
    41 button_quit->Render(),
    +
    42 }),
    +
    43 }) |
    +
    44 border | size(HEIGHT, GREATER_THAN, 18) | center;
    +
    45 });
    +
    46
    +
    47 // At depth=1, The "modal" window.
    +
    48 std::vector<std::string> rating_labels = {
    +
    49 "1/5 stars", "2/5 stars", "3/5 stars", "4/5 stars", "5/5 stars",
    +
    50 };
    +
    51 auto on_rating = [&](std::string new_rating) {
    +
    52 rating = new_rating;
    +
    53 depth = 0;
    +
    54 };
    +
    55 auto depth_1_container = Container::Horizontal({
    +
    56 Button(&rating_labels[0], [&] { on_rating(rating_labels[0]); }),
    +
    57 Button(&rating_labels[1], [&] { on_rating(rating_labels[1]); }),
    +
    58 Button(&rating_labels[2], [&] { on_rating(rating_labels[2]); }),
    +
    59 Button(&rating_labels[3], [&] { on_rating(rating_labels[3]); }),
    +
    60 Button(&rating_labels[4], [&] { on_rating(rating_labels[4]); }),
    +
    61 });
    +
    62
    +
    63 auto depth_1_renderer = Renderer(depth_1_container, [&] {
    +
    64 return vbox({
    +
    65 text("Do you like FTXUI?"),
    +
    66 separator(),
    +
    67 hbox(depth_1_container->Render()),
    +
    68 }) |
    +
    69 border;
    +
    70 });
    +
    71
    +
    72 auto main_container = Container::Tab(
    +
    73 {
    +
    74 depth_0_renderer,
    +
    75 depth_1_renderer,
    +
    76 },
    +
    77 &depth);
    +
    78
    +
    79 auto main_renderer = Renderer(main_container, [&] {
    +
    80 Element document = depth_0_renderer->Render();
    +
    81
    +
    82 if (depth == 1) {
    +
    83 document = dbox({
    +
    84 document,
    +
    85 depth_1_renderer->Render() | clear_under | center,
    +
    86 });
    +
    87 }
    +
    88 return document;
    +
    89 });
    +
    90
    +
    91 screen.Loop(main_renderer);
    +
    92 return 0;
    +
    93}
    +
    + + + + +
    int main()
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    + +
    +
    + + + + + diff --git a/module-component-examples.html b/module-component-examples.html new file mode 100644 index 000000000..02e6aee60 --- /dev/null +++ b/module-component-examples.html @@ -0,0 +1,4642 @@ + + + + + + + + +FTXUI: Example + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Example
    +
    +
    + +

    +button

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <memory> // for shared_ptr, __shared_ptr_access
    +
    #include <string> // for operator+, to_string
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Button, Horizontal, Renderer
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for separator, gauge, text, Element, operator|, vbox, border
    +
    +
    using namespace ftxui;
    +
    +
    // This is a helper function to create a button with a custom style.
    +
    // The style is defined by a lambda function that takes an EntryState and
    +
    // returns an Element.
    +
    // We are using `center` to center the text inside the button, then `border` to
    +
    // add a border around the button, and finally `flex` to make the button fill
    +
    // the available space.
    + +
    auto option = ButtonOption::Animated();
    +
    option.transform = [](const EntryState& s) {
    +
    auto element = text(s.label);
    +
    if (s.focused) {
    +
    element |= bold;
    +
    }
    +
    return element | center | borderEmpty | flex;
    +
    };
    +
    return option;
    +
    }
    +
    +
    int main() {
    +
    int value = 50;
    +
    +
    // clang-format off
    +
    auto btn_dec_01 = Button("-1", [&] { value += 1; }, Style());
    +
    auto btn_inc_01 = Button("+1", [&] { value -= 1; }, Style());
    +
    auto btn_dec_10 = Button("-10", [&] { value -= 10; }, Style());
    +
    auto btn_inc_10 = Button("+10", [&] { value += 10; }, Style());
    +
    // clang-format on
    +
    +
    // The tree of components. This defines how to navigate using the keyboard.
    +
    // The selected `row` is shared to get a grid layout.
    +
    int row = 0;
    +
    auto buttons = Container::Vertical({
    +
    Container::Horizontal({btn_dec_01, btn_inc_01}, &row) | flex,
    +
    Container::Horizontal({btn_dec_10, btn_inc_10}, &row) | flex,
    +
    });
    +
    +
    // Modify the way to render them on screen:
    +
    auto component = Renderer(buttons, [&] {
    +
    return vbox({
    +
    text("value = " + std::to_string(value)),
    +
    separator(),
    +
    buttons->Render() | flex,
    +
    }) |
    +
    flex | border;
    +
    });
    +
    +
    auto screen = ScreenInteractive::FitComponent();
    +
    screen.Loop(component);
    +
    return 0;
    +
    }
    + + + + +
    ButtonOption Style()
    + +
    Option for the AnimatedButton component.
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + +
    arguments for transform from |ButtonOption|, |CheckboxOption|, |RadioboxOption|, |MenuEntryOption|,...
    +

    +button_animated

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <memory> // for shared_ptr, __shared_ptr_access
    +
    #include <string> // for operator+, to_string
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Button, Horizontal, Renderer
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/component_options.hpp" // for ButtonOption
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for gauge, separator, text, vbox, operator|, Element, border
    +
    #include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Green, Color::Red
    +
    +
    using namespace ftxui;
    +
    +
    int main() {
    +
    int value = 50;
    +
    +
    // The tree of components. This defines how to navigate using the keyboard.
    +
    auto buttons = Container::Horizontal({
    +
    Button(
    +
    "Decrease", [&] { value--; }, ButtonOption::Animated(Color::Red)),
    +
    Button(
    +
    "Reset", [&] { value = 50; }, ButtonOption::Animated(Color::Green)),
    +
    Button(
    +
    "Increase", [&] { value++; }, ButtonOption::Animated(Color::Blue)),
    +
    });
    +
    +
    // Modify the way to render them on screen:
    +
    auto component = Renderer(buttons, [&] {
    +
    return vbox({
    +
    vbox({
    +
    text("value = " + std::to_string(value)),
    +
    separator(),
    +
    gauge(value * 0.01f),
    +
    }) | border,
    +
    buttons->Render(),
    +
    });
    +
    });
    +
    +
    auto screen = ScreenInteractive::FitComponent();
    +
    screen.Loop(component);
    +
    return 0;
    +
    }
    + + +

    +button_in_frame

    +

    Demo

    // Copyright 2022 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <memory> // for allocator, __shared_ptr_access, shared_ptr
    +
    #include <string> // for to_string, operator+
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Button, Renderer, Vertical
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/component_options.hpp" // for ButtonOption
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for operator|, text, Element, hbox, separator, size, vbox, border, frame, vscroll_indicator, HEIGHT, LESS_THAN
    +
    #include "ftxui/screen/color.hpp" // for Color, Color::Default, Color::GrayDark, Color::White
    +
    +
    using namespace ftxui;
    +
    +
    int main() {
    +
    int counter = 0;
    +
    auto on_click = [&] { counter++; };
    +
    +
    auto style = ButtonOption::Animated(Color::Default, Color::GrayDark,
    +
    Color::Default, Color::White);
    +
    +
    auto container = Container::Vertical({});
    +
    for (int i = 0; i < 30; ++i) {
    +
    auto button = Button("Button " + std::to_string(i), on_click, style);
    +
    container->Add(button);
    +
    }
    +
    +
    auto renderer = Renderer(container, [&] {
    +
    return vbox({
    +
    hbox({
    +
    text("Counter:"),
    +
    text(std::to_string(counter)),
    +
    }),
    +
    separator(),
    +
    container->Render() | vscroll_indicator | frame |
    +
    size(HEIGHT, LESS_THAN, 20),
    +
    }) |
    +
    border;
    +
    });
    +
    +
    auto screen = ScreenInteractive::FitComponent();
    +
    screen.Loop(renderer);
    +
    +
    return 0;
    +
    }
    +

    +button_style

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <string> // for operator+, to_string
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Button, Vertical, Renderer, Horizontal, operator|
    +
    #include "ftxui/component/component_base.hpp" // for Component
    +
    #include "ftxui/component/component_options.hpp" // for ButtonOption
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for Element, separator, text, border
    +
    #include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Green, Color::Red
    +
    +
    using namespace ftxui;
    +
    +
    int main() {
    +
    int value = 0;
    +
    auto action = [&] { value++; };
    +
    auto action_renderer =
    +
    Renderer([&] { return text("count = " + std::to_string(value)); });
    +
    +
    auto buttons =
    +
    Container::Vertical({
    +
    action_renderer,
    +
    Renderer([] { return separator(); }),
    +
    Container::Horizontal({
    +
    Container::Vertical({
    +
    Button("Ascii 1", action, ButtonOption::Ascii()),
    +
    Button("Ascii 2", action, ButtonOption::Ascii()),
    +
    Button("Ascii 3", action, ButtonOption::Ascii()),
    +
    }),
    +
    Renderer([] { return separator(); }),
    +
    Container::Vertical({
    +
    Button("Simple 1", action, ButtonOption::Simple()),
    +
    Button("Simple 2", action, ButtonOption::Simple()),
    +
    Button("Simple 3", action, ButtonOption::Simple()),
    +
    }),
    +
    Renderer([] { return separator(); }),
    +
    Container::Vertical({
    +
    Button("Animated 1", action, ButtonOption::Animated()),
    +
    Button("Animated 2", action, ButtonOption::Animated()),
    +
    Button("Animated 3", action, ButtonOption::Animated()),
    +
    }),
    +
    Renderer([] { return separator(); }),
    +
    Container::Vertical({
    +
    Button("Animated 4", action,
    +
    ButtonOption::Animated(Color::Red)),
    +
    Button("Animated 5", action,
    +
    ButtonOption::Animated(Color::Green)),
    +
    Button("Animated 6", action,
    +
    ButtonOption::Animated(Color::Blue)),
    +
    }),
    +
    }),
    +
    }) |
    +
    border;
    +
    +
    auto screen = ScreenInteractive::FitComponent();
    +
    screen.Loop(buttons);
    +
    return 0;
    +
    }
    +

    +canvas_animated

    +

    Demo

    // Copyright 2021 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSED file.
    +
    #include <cmath> // for sin, cos
    +
    #include <ftxui/dom/elements.hpp> // for canvas, Element, separator, hbox, operator|, border
    +
    #include <ftxui/screen/screen.hpp> // for Pixel
    +
    #include <memory> // for allocator, shared_ptr, __shared_ptr_access
    +
    #include <string> // for string, basic_string
    +
    #include <utility> // for move
    +
    #include <vector> // for vector, __alloc_traits<>::value_type
    +
    +
    #include "ftxui/component/component.hpp" // for Renderer, CatchEvent, Horizontal, Menu, Tab
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/event.hpp" // for Event
    +
    #include "ftxui/component/mouse.hpp" // for Mouse
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    #include "ftxui/dom/canvas.hpp" // for Canvas
    +
    #include "ftxui/screen/color.hpp" // for Color, Color::Red, Color::Blue, Color::Green, ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    +
    int mouse_x = 0;
    +
    int mouse_y = 0;
    +
    +
    // A triangle following the mouse, using braille characters.
    +
    auto renderer_line_braille = Renderer([&] {
    +
    auto c = Canvas(100, 100);
    +
    c.DrawText(0, 0, "Several lines (braille)");
    +
    c.DrawPointLine(mouse_x, mouse_y, 80, 10, Color::Red);
    +
    c.DrawPointLine(80, 10, 80, 40, Color::Blue);
    +
    c.DrawPointLine(80, 40, mouse_x, mouse_y, Color::Green);
    +
    return canvas(std::move(c));
    +
    });
    +
    +
    // A triangle following the mouse, using block characters.
    +
    auto renderer_line_block = Renderer([&] {
    +
    auto c = Canvas(100, 100);
    +
    c.DrawText(0, 0, "Several lines (block)");
    +
    c.DrawBlockLine(mouse_x, mouse_y, 80, 10, Color::Red);
    +
    c.DrawBlockLine(80, 10, 80, 40, Color::Blue);
    +
    c.DrawBlockLine(80, 40, mouse_x, mouse_y, Color::Green);
    +
    return canvas(std::move(c));
    +
    });
    +
    +
    // A circle following the mouse, using braille characters.
    +
    auto renderer_circle_braille = Renderer([&] {
    +
    auto c = Canvas(100, 100);
    +
    c.DrawText(0, 0, "A circle (braille)");
    +
    c.DrawPointCircle(mouse_x, mouse_y, 30);
    +
    return canvas(std::move(c));
    +
    });
    +
    +
    // A circle following the mouse, using block characters.
    +
    auto renderer_circle_block = Renderer([&] {
    +
    auto c = Canvas(100, 100);
    +
    c.DrawText(0, 0, "A circle (block)");
    +
    c.DrawBlockCircle(mouse_x, mouse_y, 30);
    +
    return canvas(std::move(c));
    +
    });
    +
    +
    // A filled circle following the mouse, using braille characters.
    +
    auto renderer_circle_filled_braille = Renderer([&] {
    +
    auto c = Canvas(100, 100);
    +
    c.DrawText(0, 0, "A circle filled (braille)");
    +
    c.DrawPointCircleFilled(mouse_x, mouse_y, 30);
    +
    return canvas(std::move(c));
    +
    });
    +
    +
    // A filled circle following the mouse, using block characters.
    +
    auto renderer_circle_filled_block = Renderer([&] {
    +
    auto c = Canvas(100, 100);
    +
    c.DrawText(0, 0, "A circle filled (block)");
    +
    c.DrawBlockCircleFilled(mouse_x, mouse_y, 30);
    +
    return canvas(std::move(c));
    +
    });
    +
    +
    // An ellipse following the mouse, using braille characters.
    +
    auto renderer_ellipse_braille = Renderer([&] {
    +
    auto c = Canvas(100, 100);
    +
    c.DrawText(0, 0, "An ellipse (braille)");
    +
    c.DrawPointEllipse(mouse_x / 2, mouse_y / 2, mouse_x / 2, mouse_y / 2);
    +
    return canvas(std::move(c));
    +
    });
    +
    +
    // An ellipse following the mouse, using block characters.
    +
    auto renderer_ellipse_block = Renderer([&] {
    +
    auto c = Canvas(100, 100);
    +
    c.DrawText(0, 0, "An ellipse (block)");
    +
    c.DrawBlockEllipse(mouse_x / 2, mouse_y / 2, mouse_x / 2, mouse_y / 2);
    +
    return canvas(std::move(c));
    +
    });
    +
    +
    // An ellipse following the mouse filled, using braille characters.
    +
    auto renderer_ellipse_filled_braille = Renderer([&] {
    +
    auto c = Canvas(100, 100);
    +
    c.DrawText(0, 0, "A filled ellipse (braille)");
    +
    c.DrawPointEllipseFilled(mouse_x / 2, mouse_y / 2, mouse_x / 2,
    +
    mouse_y / 2);
    +
    return canvas(std::move(c));
    +
    });
    +
    +
    // An ellipse following the mouse filled, using block characters.
    +
    auto renderer_ellipse_filled_block = Renderer([&] {
    +
    auto c = Canvas(100, 100);
    +
    c.DrawText(0, 0, "A filled ellipse (block)");
    +
    c.DrawBlockEllipseFilled(mouse_x / 2, mouse_y / 2, mouse_x / 2,
    +
    mouse_y / 2);
    +
    c.DrawBlockEllipse(mouse_x / 2, mouse_y / 2, mouse_x / 2, mouse_y / 2);
    +
    return canvas(std::move(c));
    +
    });
    +
    +
    // A text following the mouse
    +
    auto renderer_text = Renderer([&] {
    +
    auto c = Canvas(100, 100);
    +
    c.DrawText(0, 0, "A piece of text");
    +
    c.DrawText(mouse_x, mouse_y, "This is a piece of text with effects",
    +
    [](Pixel& p) {
    +
    p.foreground_color = Color::Red;
    +
    p.underlined = true;
    +
    p.bold = true;
    +
    });
    +
    return canvas(std::move(c));
    +
    });
    +
    +
    auto renderer_plot_1 = Renderer([&] {
    +
    auto c = Canvas(100, 100);
    +
    c.DrawText(0, 0, "A graph");
    +
    +
    std::vector<int> ys(100);
    +
    for (int x = 0; x < 100; x++) {
    +
    float dx = float(x - mouse_x);
    +
    float dy = 50.f;
    +
    ys[x] = int(dy + 20 * cos(dx * 0.14) + 10 * sin(dx * 0.42));
    +
    }
    +
    for (int x = 1; x < 99; x++) {
    +
    c.DrawPointLine(x, ys[x], x + 1, ys[x + 1]);
    +
    }
    +
    +
    return canvas(std::move(c));
    +
    });
    +
    +
    auto renderer_plot_2 = Renderer([&] {
    +
    auto c = Canvas(100, 100);
    +
    c.DrawText(0, 0, "A symmetrical graph filled");
    +
    std::vector<int> ys(100);
    +
    for (int x = 0; x < 100; x++) {
    +
    ys[x] = int(30 + //
    +
    10 * cos(x * 0.2 - mouse_x * 0.05) + //
    +
    5 * sin(x * 0.4) + //
    +
    5 * sin(x * 0.3 - mouse_y * 0.05)); //
    +
    }
    +
    for (int x = 0; x < 100; x++) {
    +
    c.DrawPointLine(x, 50 + ys[x], x, 50 - ys[x], Color::Red);
    +
    }
    +
    +
    return canvas(std::move(c));
    +
    });
    +
    +
    auto renderer_plot_3 = Renderer([&] {
    +
    auto c = Canvas(100, 100);
    +
    c.DrawText(0, 0, "A 2D gaussian plot");
    +
    int size = 15;
    +
    +
    // mouse_x = 5mx + 3*my
    +
    // mouse_y = 0mx + -5my + 90
    +
    float my = (mouse_y - 90) / -5.f;
    +
    float mx = (mouse_x - 3 * my) / 5.f;
    +
    std::vector<std::vector<float>> ys(size, std::vector<float>(size));
    +
    for (int y = 0; y < size; y++) {
    +
    for (int x = 0; x < size; x++) {
    +
    float dx = x - mx;
    +
    float dy = y - my;
    +
    ys[y][x] = -1.5 + 3.0 * std::exp(-0.2f * (dx * dx + dy * dy));
    +
    }
    +
    }
    +
    for (int y = 0; y < size; y++) {
    +
    for (int x = 0; x < size; x++) {
    +
    if (x != 0) {
    +
    c.DrawPointLine(
    +
    5 * (x - 1) + 3 * (y - 0), 90 - 5 * (y - 0) - 5 * ys[y][x - 1],
    +
    5 * (x - 0) + 3 * (y - 0), 90 - 5 * (y - 0) - 5 * ys[y][x]);
    +
    }
    +
    if (y != 0) {
    +
    c.DrawPointLine(
    +
    5 * (x - 0) + 3 * (y - 1), 90 - 5 * (y - 1) - 5 * ys[y - 1][x],
    +
    5 * (x - 0) + 3 * (y - 0), 90 - 5 * (y - 0) - 5 * ys[y][x]);
    +
    }
    +
    }
    +
    }
    +
    +
    return canvas(std::move(c));
    +
    });
    +
    +
    int selected_tab = 12;
    +
    auto tab = Container::Tab(
    +
    {
    +
    renderer_line_braille,
    +
    renderer_line_block,
    +
    renderer_circle_braille,
    +
    renderer_circle_block,
    +
    renderer_circle_filled_braille,
    +
    renderer_circle_filled_block,
    +
    renderer_ellipse_braille,
    +
    renderer_ellipse_block,
    +
    renderer_ellipse_filled_braille,
    +
    renderer_ellipse_filled_block,
    +
    +
    renderer_plot_1,
    +
    renderer_plot_2,
    +
    renderer_plot_3,
    +
    +
    renderer_text,
    +
    },
    +
    &selected_tab);
    +
    +
    // This capture the last mouse position.
    +
    auto tab_with_mouse = CatchEvent(tab, [&](Event e) {
    +
    if (e.is_mouse()) {
    +
    mouse_x = (e.mouse().x - 1) * 2;
    +
    mouse_y = (e.mouse().y - 1) * 4;
    +
    }
    +
    return false;
    +
    });
    +
    +
    std::vector<std::string> tab_titles = {
    +
    "line (braille)",
    +
    "line (block)",
    +
    "circle (braille)",
    +
    "circle (block)",
    +
    "circle filled (braille)",
    +
    "circle filled (block)",
    +
    "ellipse (braille)",
    +
    "ellipse (block)",
    +
    "ellipse filled (braille)",
    +
    "ellipse filled (block)",
    +
    "plot_1 simple",
    +
    "plot_2 filled",
    +
    "plot_3 3D",
    +
    "text",
    +
    };
    +
    auto tab_toggle = Menu(&tab_titles, &selected_tab);
    +
    +
    auto component = Container::Horizontal({
    +
    tab_with_mouse,
    +
    tab_toggle,
    +
    });
    +
    +
    // Add some separator to decorate the whole component:
    +
    auto component_renderer = Renderer(component, [&] {
    +
    return hbox({
    +
    tab_with_mouse->Render(),
    +
    separator(),
    +
    tab_toggle->Render(),
    +
    }) |
    +
    border;
    +
    });
    +
    +
    auto screen = ScreenInteractive::FitComponent();
    +
    screen.Loop(component_renderer);
    +
    +
    return 0;
    +
    }
    + + +
    bool is_mouse() const
    Definition event.hpp:109
    +
    struct Mouse mouse
    Definition event.hpp:144
    +
    Represent an event. It can be key press event, a terminal resize, or more ...
    Definition event.hpp:29
    +
    Canvas is a drawable buffer associated with drawing operations.
    Definition canvas.hpp:38
    +
    Color foreground_color
    Definition pixel.hpp:49
    +
    bool bold
    Definition pixel.hpp:29
    +
    bool underlined
    Definition pixel.hpp:33
    +
    A Unicode character and its associated style.
    Definition pixel.hpp:15
    + + +

    +checkbox

    +

    Demo

    // Copyright 2021 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <array> // for array
    +
    #include <iostream>
    +
    #include <memory> // for shared_ptr, __shared_ptr_access
    +
    #include <string> // for operator+, to_string
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Checkbox, Renderer, Vertical
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, vscroll_indicator, HEIGHT, LESS_THAN
    +
    +
    using namespace ftxui;
    +
    +
    int main() {
    +
    bool download = false;
    +
    bool upload = false;
    +
    bool ping = false;
    +
    +
    auto container = Container::Vertical({
    +
    Checkbox("Download", &download),
    +
    Checkbox("Upload", &upload),
    +
    Checkbox("Ping", &ping),
    +
    });
    +
    +
    auto screen = ScreenInteractive::FitComponent();
    +
    screen.Loop(container);
    +
    +
    std::cout << "---" << std::endl;
    +
    std::cout << "Download: " << download << std::endl;
    +
    std::cout << "Upload: " << upload << std::endl;
    +
    std::cout << "Ping: " << ping << std::endl;
    +
    std::cout << "---" << std::endl;
    +
    +
    return 0;
    +
    }
    +

    +checkbox_in_frame

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <array> // for array
    +
    #include <memory> // for shared_ptr, __shared_ptr_access
    +
    #include <string> // for operator+, to_string
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Checkbox, Renderer, Vertical
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, vscroll_indicator, HEIGHT, LESS_THAN
    +
    +
    using namespace ftxui;
    +
    +
    int main() {
    +
    std::array<bool, 30> states;
    +
    +
    auto container = Container::Vertical({});
    +
    for (int i = 0; i < 30; ++i) {
    +
    states[i] = false;
    +
    container->Add(Checkbox("Checkbox" + std::to_string(i), &states[i]));
    +
    }
    +
    +
    auto renderer = Renderer(container, [&] {
    +
    return container->Render() | vscroll_indicator | frame |
    +
    size(HEIGHT, LESS_THAN, 10) | border;
    +
    });
    +
    +
    auto screen = ScreenInteractive::FitComponent();
    +
    screen.Loop(renderer);
    +
    +
    return 0;
    +
    }
    +

    +collapsible

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <memory> // for allocator, make_shared, __shared_ptr_access
    +
    #include <utility> // for move
    +
    #include <vector> // for vector
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Collapsible, Renderer, Vertical
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for text, hbox, Element
    +
    +
    using namespace ftxui;
    +
    +
    // Take a list of component, display them vertically, one column shifted to the
    +
    // right.
    +
    Component Inner(std::vector<Component> children) {
    +
    Component vlist = Container::Vertical(std::move(children));
    +
    return Renderer(vlist, [vlist] {
    +
    return hbox({
    +
    text(" "),
    +
    vlist->Render(),
    +
    });
    +
    });
    +
    }
    +
    + +
    return std::make_shared<ComponentBase>();
    +
    }
    +
    +
    int main() {
    +
    auto component =
    +
    Collapsible("Collapsible 1",
    + +
    Collapsible("Collapsible 1.1",
    + +
    Collapsible("Collapsible 1.1.1", Empty()),
    +
    Collapsible("Collapsible 1.1.2", Empty()),
    +
    Collapsible("Collapsible 1.1.3", Empty()),
    +
    })),
    +
    Collapsible("Collapsible 1.2",
    + +
    Collapsible("Collapsible 1.2.1", Empty()),
    +
    Collapsible("Collapsible 1.2.2", Empty()),
    +
    Collapsible("Collapsible 1.2.3", Empty()),
    +
    })),
    +
    Collapsible("Collapsible 1.3",
    + +
    Collapsible("Collapsible 1.3.1", Empty()),
    +
    Collapsible("Collapsible 1.3.2", Empty()),
    +
    Collapsible("Collapsible 1.3.3", Empty()),
    +
    })),
    +
    }));
    +
    +
    ScreenInteractive::FitComponent().Loop(component);
    +
    }
    +
    Component Inner(std::vector< Component > children)
    +
    Component Empty()
    +
    std::shared_ptr< ComponentBase > Component
    +

    +composition

    +

    Demo

    // Copyright 2021 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <memory> // for allocator, shared_ptr, __shared_ptr_access
    +
    #include <string> // for operator+, to_string
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Button, Horizontal, Renderer
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for text, separator, Element, operator|, vbox, border
    +
    +
    using namespace ftxui;
    +
    +
    // An example of how to compose multiple components into one and maintain their
    +
    // interactiveness.
    +
    int main() {
    +
    auto left_count = 0;
    +
    auto right_count = 0;
    +
    +
    auto left_buttons = Container::Horizontal({
    +
    Button("Decrease", [&] { left_count--; }),
    +
    Button("Increase", [&] { left_count++; }),
    +
    });
    +
    +
    auto right_buttons = Container::Horizontal({
    +
    Button("Decrease", [&] { right_count--; }),
    +
    Button("Increase", [&] { right_count++; }),
    +
    });
    +
    +
    // Renderer decorates its child with a new rendering function. The way the
    +
    // children reacts to events is maintained.
    +
    auto leftpane = Renderer(left_buttons, [&] {
    +
    return vbox({
    +
    text("This is the left control"),
    +
    separator(),
    +
    text("Left button count: " + std::to_string(left_count)),
    +
    left_buttons->Render(),
    +
    }) |
    +
    border;
    +
    });
    +
    +
    auto rightpane = Renderer(right_buttons, [&] {
    +
    return vbox({
    +
    text("This is the right control"),
    +
    separator(),
    +
    text("Right button count: " + std::to_string(right_count)),
    +
    right_buttons->Render(),
    +
    }) |
    +
    border;
    +
    });
    +
    +
    // Container groups components togethers. To render a Container::Horizontal,
    +
    // it render its children side by side. It maintains their interactiveness and
    +
    // provide the logic to navigate from one to the other using the arrow keys.
    +
    auto composition = Container::Horizontal({leftpane, rightpane});
    +
    +
    auto screen = ScreenInteractive::FitComponent();
    +
    screen.Loop(composition);
    +
    return 0;
    +
    }
    +
    +
    // Thanks to Chris Morgan for this example!
    +

    +custom_loop

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <stdlib.h> // for EXIT_SUCCESS
    +
    #include <chrono> // for milliseconds
    +
    #include <ftxui/component/event.hpp> // for Event
    +
    #include <ftxui/component/mouse.hpp> // for ftxui
    +
    #include <ftxui/dom/elements.hpp> // for text, separator, Element, operator|, vbox, border
    +
    #include <memory> // for allocator, shared_ptr
    +
    #include <string> // for operator+, to_string
    +
    #include <thread> // for sleep_for
    +
    +
    #include "ftxui/component/component.hpp" // for CatchEvent, Renderer, operator|=
    +
    #include "ftxui/component/loop.hpp" // for Loop
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    auto screen = ScreenInteractive::FitComponent();
    +
    +
    // Create a component counting the number of frames drawn and event handled.
    +
    int custom_loop_count = 0;
    +
    int frame_count = 0;
    +
    int event_count = 0;
    +
    auto component = Renderer([&] {
    +
    frame_count++;
    +
    return vbox({
    +
    text("This demonstrates using a custom ftxui::Loop. It "),
    +
    text("runs at 100 iterations per seconds. The FTXUI events "),
    +
    text("are all processed once per iteration and a new frame "),
    +
    text("is rendered as needed"),
    +
    separator(),
    +
    text("ftxui event count: " + std::to_string(event_count)),
    +
    text("ftxui frame count: " + std::to_string(frame_count)),
    +
    text("Custom loop count: " + std::to_string(custom_loop_count)),
    +
    }) |
    +
    border;
    +
    });
    +
    +
    component |= CatchEvent([&](Event) -> bool {
    +
    event_count++;
    +
    return false;
    +
    });
    +
    +
    Loop loop(&screen, component);
    +
    +
    while (!loop.HasQuitted()) {
    +
    custom_loop_count++;
    +
    loop.RunOnce();
    +
    std::this_thread::sleep_for(std::chrono::milliseconds(10));
    +
    }
    +
    +
    return EXIT_SUCCESS;
    +
    }
    +
    Loop is a class that manages the event loop for a component.
    Definition loop.hpp:56
    + +

    +dropdown

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <string> // for basic_string, string, allocator
    +
    #include <vector> // for vector
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Dropdown, Horizontal, Vertical
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    +
    std::vector<std::string> entries = {
    +
    "tribute", "clearance", "ally", "bend", "electronics",
    +
    "module", "era", "cultural", "sniff", "nationalism",
    +
    "negotiation", "deliver", "figure", "east", "tribute",
    +
    "clearance", "ally", "bend", "electronics", "module",
    +
    "era", "cultural", "sniff", "nationalism", "negotiation",
    +
    "deliver", "figure", "east", "tribute", "clearance",
    +
    "ally", "bend", "electronics", "module", "era",
    +
    "cultural", "sniff", "nationalism", "negotiation", "deliver",
    +
    "figure", "east",
    +
    };
    +
    +
    int selected_1 = 0;
    +
    int selected_2 = 0;
    +
    int selected_3 = 0;
    +
    int selected_4 = 0;
    +
    +
    auto layout = Container::Vertical({
    +
    Container::Horizontal({
    +
    Dropdown(&entries, &selected_1),
    +
    Dropdown(&entries, &selected_2),
    +
    }),
    +
    Container::Horizontal({
    +
    Dropdown(&entries, &selected_3),
    +
    Dropdown(&entries, &selected_4),
    +
    }),
    +
    });
    +
    +
    auto screen = ScreenInteractive::FitComponent();
    +
    screen.Loop(layout);
    +
    }
    +

    +dropdown_custom

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <string> // for basic_string, string, allocator
    +
    #include <vector> // for vector
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Dropdown, Horizontal, Vertical
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    +
    std::vector<std::string> entries = {
    +
    "tribute", "clearance", "ally", "bend", "electronics",
    +
    "module", "era", "cultural", "sniff", "nationalism",
    +
    "negotiation", "deliver", "figure", "east", "tribute",
    +
    "clearance", "ally", "bend", "electronics", "module",
    +
    "era", "cultural", "sniff", "nationalism", "negotiation",
    +
    "deliver", "figure", "east", "tribute", "clearance",
    +
    "ally", "bend", "electronics", "module", "era",
    +
    "cultural", "sniff", "nationalism", "negotiation", "deliver",
    +
    "figure", "east",
    +
    };
    +
    +
    auto dropdown_1 = Dropdown({
    +
    .radiobox = {.entries = &entries},
    +
    .transform =
    +
    [](bool open, Element checkbox, Element radiobox) {
    +
    if (open) {
    +
    return vbox({
    +
    checkbox | inverted,
    +
    radiobox | vscroll_indicator | frame |
    +
    size(HEIGHT, LESS_THAN, 10),
    +
    filler(),
    +
    });
    +
    }
    +
    return vbox({
    +
    checkbox,
    +
    filler(),
    +
    });
    +
    },
    +
    });
    +
    +
    auto dropdown_2 = Dropdown({
    +
    .radiobox = {.entries = &entries},
    +
    .transform =
    +
    [](bool open, Element checkbox, Element radiobox) {
    +
    if (open) {
    +
    return vbox({
    +
    checkbox | inverted,
    +
    radiobox | vscroll_indicator | frame |
    +
    size(HEIGHT, LESS_THAN, 10) | bgcolor(Color::Blue),
    +
    filler(),
    +
    });
    +
    }
    +
    return vbox({
    +
    checkbox | bgcolor(Color::Blue),
    +
    filler(),
    +
    });
    +
    },
    +
    });
    +
    +
    auto dropdown_3 = Dropdown({
    +
    .radiobox =
    +
    {
    +
    .entries = &entries,
    +
    .transform =
    +
    [](const EntryState& s) {
    +
    auto t = text(s.label) | borderEmpty;
    +
    if (s.active) {
    +
    t |= bold;
    +
    }
    +
    if (s.focused) {
    +
    t |= inverted;
    +
    }
    +
    return t;
    +
    },
    +
    },
    +
    .transform =
    +
    [](bool open, Element checkbox, Element radiobox) {
    +
    checkbox |= borderEmpty;
    +
    if (open) {
    +
    return vbox({
    +
    checkbox | inverted,
    +
    radiobox | vscroll_indicator | frame |
    +
    size(HEIGHT, LESS_THAN, 20) | bgcolor(Color::Red),
    +
    filler(),
    +
    });
    +
    }
    +
    return vbox({
    +
    checkbox | bgcolor(Color::Red),
    +
    filler(),
    +
    });
    +
    },
    +
    });
    +
    +
    auto screen = ScreenInteractive::FitComponent();
    +
    screen.Loop(Container::Horizontal({
    +
    dropdown_1,
    +
    dropdown_2,
    +
    dropdown_3,
    +
    }));
    +
    }
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +

    +flexbox_gallery

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <stddef.h> // for size_t
    +
    #include <memory> // for shared_ptr, __shared_ptr_access, allocator
    +
    #include <string> // for string, basic_string, to_string, operator+, char_traits
    +
    #include <vector> // for vector
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Radiobox, Vertical, Checkbox, Horizontal, Renderer, ResizableSplitBottom, ResizableSplitRight
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for text, window, operator|, vbox, hbox, Element, flexbox, bgcolor, filler, flex, size, border, hcenter, color, EQUAL, bold, dim, notflex, xflex_grow, yflex_grow, HEIGHT, WIDTH
    +
    #include "ftxui/dom/flexbox_config.hpp" // for FlexboxConfig, FlexboxConfig::AlignContent, FlexboxConfig::JustifyContent, FlexboxConfig::AlignContent::Center, FlexboxConfig::AlignItems, FlexboxConfig::Direction, FlexboxConfig::JustifyContent::Center, FlexboxConfig::Wrap
    +
    #include "ftxui/screen/color.hpp" // for Color, Color::Black
    +
    +
    using namespace ftxui;
    +
    +
    int main() {
    +
    auto screen = ScreenInteractive::Fullscreen();
    +
    +
    int direction_index = 0;
    +
    int wrap_index = 0;
    +
    int justify_content_index = 0;
    +
    int align_items_index = 0;
    +
    int align_content_index = 0;
    +
    +
    std::vector<std::string> directions = {
    +
    "Row",
    +
    "RowInversed",
    +
    "Column",
    +
    "ColumnInversed",
    +
    };
    +
    +
    std::vector<std::string> wraps = {
    +
    "NoWrap",
    +
    "Wrap",
    +
    "WrapInversed",
    +
    };
    +
    +
    std::vector<std::string> justify_content = {
    +
    "FlexStart", "FlexEnd", "Center", "Stretch",
    +
    "SpaceBetween", "SpaceAround", "SpaceEvenly",
    +
    };
    +
    +
    std::vector<std::string> align_items = {
    +
    "FlexStart",
    +
    "FlexEnd",
    +
    "Center",
    +
    "Stretch",
    +
    };
    +
    +
    std::vector<std::string> align_content = {
    +
    "FlexStart", "FlexEnd", "Center", "Stretch",
    +
    "SpaceBetween", "SpaceAround", "SpaceEvenly",
    +
    };
    +
    +
    auto radiobox_direction = Radiobox(&directions, &direction_index);
    +
    auto radiobox_wrap = Radiobox(&wraps, &wrap_index);
    +
    auto radiobox_justify_content =
    +
    Radiobox(&justify_content, &justify_content_index);
    +
    auto radiobox_align_items = Radiobox(&align_items, &align_items_index);
    +
    auto radiobox_align_content = Radiobox(&align_content, &align_content_index);
    +
    +
    bool element_xflex_grow = false;
    +
    bool element_yflex_grow = false;
    +
    bool group_xflex_grow = true;
    +
    bool group_yflex_grow = true;
    +
    auto checkbox_element_xflex_grow =
    +
    Checkbox("element |= xflex_grow", &element_xflex_grow);
    +
    auto checkbox_element_yflex_grow =
    +
    Checkbox("element |= yflex_grow", &element_yflex_grow);
    +
    auto checkbox_group_xflex_grow =
    +
    Checkbox("group |= xflex_grow", &group_xflex_grow);
    +
    auto checkbox_group_yflex_grow =
    +
    Checkbox("group |= yflex_grow", &group_yflex_grow);
    +
    +
    auto make_box = [&](size_t dimx, size_t dimy, size_t index) {
    +
    std::string title = std::to_string(dimx) + "x" + std::to_string(dimy);
    +
    auto element = window(text(title) | hcenter | bold,
    +
    text(std::to_string(index)) | hcenter | dim) |
    +
    size(WIDTH, EQUAL, dimx) | size(HEIGHT, EQUAL, dimy) |
    +
    bgcolor(Color::HSV(index * 25, 255, 255)) |
    +
    color(Color::Black);
    +
    if (element_xflex_grow) {
    +
    element = element | xflex_grow;
    +
    }
    +
    if (element_yflex_grow) {
    +
    element = element | yflex_grow;
    +
    }
    +
    return element;
    +
    };
    +
    +
    auto content_renderer = Renderer([&] {
    +
    FlexboxConfig config;
    +
    config.direction = static_cast<FlexboxConfig::Direction>(direction_index);
    +
    config.wrap = static_cast<FlexboxConfig::Wrap>(wrap_index);
    +
    config.justify_content =
    +
    static_cast<FlexboxConfig::JustifyContent>(justify_content_index);
    +
    config.align_items =
    +
    static_cast<FlexboxConfig::AlignItems>(align_items_index);
    +
    config.align_content =
    +
    static_cast<FlexboxConfig::AlignContent>(align_content_index);
    +
    +
    auto group = flexbox(
    +
    {
    +
    make_box(8, 4, 0),
    +
    make_box(9, 6, 1),
    +
    make_box(11, 6, 2),
    +
    make_box(10, 4, 3),
    +
    make_box(13, 7, 4),
    +
    make_box(12, 4, 5),
    +
    make_box(12, 5, 6),
    +
    make_box(10, 4, 7),
    +
    make_box(12, 4, 8),
    +
    make_box(10, 5, 9),
    +
    },
    +
    config);
    +
    +
    group = group | bgcolor(Color::Black);
    +
    +
    group = group | notflex;
    +
    +
    if (!group_xflex_grow) {
    +
    group = hbox(group, filler());
    +
    }
    +
    if (!group_yflex_grow) {
    +
    group = vbox(group, filler());
    +
    }
    +
    +
    group = group | flex;
    +
    return group;
    +
    });
    +
    +
    auto center = FlexboxConfig()
    +
    .Set(FlexboxConfig::JustifyContent::Center)
    +
    .Set(FlexboxConfig::AlignContent::Center);
    +
    int space_right = 10;
    +
    int space_bottom = 1;
    +
    content_renderer = ResizableSplitRight(
    +
    Renderer([&] { return flexbox({text("resizable")}, center); }),
    +
    content_renderer, &space_right);
    +
    content_renderer = ResizableSplitBottom(
    +
    Renderer([&] { return flexbox({text("resizable")}, center); }),
    +
    content_renderer, &space_bottom);
    +
    +
    auto main_container = Container::Vertical({
    +
    Container::Horizontal({
    +
    radiobox_direction,
    +
    radiobox_wrap,
    +
    Container::Vertical({
    +
    checkbox_element_xflex_grow,
    +
    checkbox_element_yflex_grow,
    +
    checkbox_group_xflex_grow,
    +
    checkbox_group_yflex_grow,
    +
    }),
    +
    }),
    +
    Container::Horizontal({
    +
    radiobox_justify_content,
    +
    radiobox_align_items,
    +
    radiobox_align_content,
    +
    }),
    +
    content_renderer,
    +
    });
    +
    +
    auto main_renderer = Renderer(main_container, [&] {
    +
    return vbox({
    +
    vbox({hbox({
    +
    window(text("FlexboxConfig::Direction"),
    +
    radiobox_direction->Render()),
    +
    window(text("FlexboxConfig::Wrap"), radiobox_wrap->Render()),
    +
    window(text("Misc:"),
    +
    vbox({
    +
    checkbox_element_xflex_grow->Render(),
    +
    checkbox_element_yflex_grow->Render(),
    +
    checkbox_group_xflex_grow->Render(),
    +
    checkbox_group_yflex_grow->Render(),
    +
    })),
    +
    }),
    +
    hbox({
    +
    window(text("FlexboxConfig::JustifyContent"),
    +
    radiobox_justify_content->Render()),
    +
    window(text("FlexboxConfig::AlignItems"),
    +
    radiobox_align_items->Render()),
    +
    window(text("FlexboxConfig::AlignContent"),
    +
    radiobox_align_content->Render()),
    +
    })}),
    +
    content_renderer->Render() | flex | border,
    +
    });
    +
    });
    +
    +
    screen.Loop(main_renderer);
    +
    +
    return 0;
    +
    }
    +
    Element make_box(int x, int y)
    + + + + + + + + + +
    JustifyContent justify_content
    + +
    FlexboxConfig & Set(FlexboxConfig::Direction)
    Set the flexbox direction.
    +
    FlexboxConfig is a configuration structure that defines the layout properties for a flexbox container...
    +

    +focus

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <memory> // for allocator, shared_ptr, __shared_ptr_access
    +
    #include <string> // for operator+, char_traits, to_string, string
    +
    #include <vector> // for vector
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Slider, Renderer, Vertical
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for Elements, Element, operator|, separator, text, focusPositionRelative, size, border, flex, frame, bgcolor, gridbox, vbox, EQUAL, center, HEIGHT, WIDTH
    +
    #include "ftxui/screen/color.hpp" // for Color
    +
    +
    using namespace ftxui;
    +
    +
    Element make_box(int x, int y) {
    +
    std::string title = "(" + std::to_string(x) + ", " + std::to_string(y) + ")";
    +
    return text(title) | center | size(WIDTH, EQUAL, 18) |
    +
    size(HEIGHT, EQUAL, 9) | border |
    +
    bgcolor(Color::HSV(x * 255 / 15, 255, y * 255 / 15));
    +
    };
    +
    + +
    std::vector<Elements> rows;
    +
    for (int i = 0; i < 15; i++) {
    +
    std::vector<Element> cols;
    +
    for (int j = 0; j < 15; j++) {
    +
    cols.push_back(make_box(i, j));
    +
    }
    +
    rows.push_back(cols);
    +
    }
    +
    +
    return gridbox(rows);
    +
    };
    +
    +
    int main() {
    +
    float focus_x = 0.5f;
    +
    float focus_y = 0.5f;
    +
    +
    auto slider_x = Slider("x", &focus_x, 0.f, 1.f, 0.01f);
    +
    auto slider_y = Slider("y", &focus_y, 0.f, 1.f, 0.01f);
    +
    +
    auto renderer = Renderer(
    +
    Container::Vertical({
    +
    slider_x,
    +
    slider_y,
    +
    }),
    +
    [&] {
    +
    auto title = "focusPositionRelative(" + //
    +
    std::to_string(focus_x) + ", " + //
    +
    std::to_string(focus_y) + ")"; //
    +
    return vbox({
    +
    text(title),
    +
    separator(),
    +
    slider_x->Render(),
    +
    slider_y->Render(),
    +
    separator(),
    +
    make_grid() | focusPositionRelative(focus_x, focus_y) |
    +
    frame | flex,
    +
    }) |
    +
    border;
    +
    });
    +
    +
    auto screen = ScreenInteractive::Fullscreen();
    +
    screen.Loop(renderer);
    +
    +
    return 0;
    +
    }
    +
    Element make_grid()
    +

    +focus_cursor

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <ftxui/component/captured_mouse.hpp> // for ftxui
    +
    #include <string> // for allocator, operator+, char_traits, string
    +
    +
    #include "ftxui/component/component.hpp" // for Renderer, Vertical
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive, Component
    +
    #include "ftxui/dom/elements.hpp" // for text, Decorator, focus, focusCursorBar, focusCursorBarBlinking, focusCursorBlock, focusCursorBlockBlinking, focusCursorUnderline, focusCursorUnderlineBlinking, hbox, Element
    +
    +
    using namespace ftxui;
    +
    +
    Component Instance(std::string label, Decorator focusCursor) {
    +
    return Renderer([=](bool focused) {
    +
    if (focused) {
    +
    return hbox({
    +
    text("> " + label + " "),
    +
    focusCursor(text(" ")),
    +
    });
    +
    }
    +
    return text(" " + label + " ");
    +
    });
    +
    };
    +
    +
    int main() {
    +
    auto screen = ScreenInteractive::Fullscreen();
    +
    screen.Loop(Container::Vertical({
    +
    Instance("focus", focus),
    +
    Instance("focusCursorBlock", focusCursorBlock),
    +
    Instance("focusCursorBlockBlinking", focusCursorBlockBlinking),
    +
    Instance("focusCursorBar", focusCursorBar),
    +
    Instance("focusCursorBarBlinking", focusCursorBarBlinking),
    +
    Instance("focusCursorUnderline", focusCursorUnderline),
    +
    Instance("focusCursorUnderlineBlinking", focusCursorUnderlineBlinking),
    +
    }));
    +
    return 0;
    +
    }
    +
    Component Instance(std::string label, Decorator focusCursor)
    +
    std::function< Element(Element)> Decorator
    Definition elements.hpp:24
    +

    +gallery

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <functional> // for function
    +
    #include <memory> // for shared_ptr, allocator, __shared_ptr_access
    +
    #include <string> // for string, basic_string
    +
    #include <vector> // for vector
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Slider, Checkbox, Vertical, Renderer, Button, Input, Menu, Radiobox, Toggle
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for separator, operator|, Element, size, xflex, text, WIDTH, hbox, vbox, EQUAL, border, GREATER_THAN
    +
    +
    using namespace ftxui;
    +
    +
    // Display a component nicely with a title on the left.
    +
    Component Wrap(std::string name, Component component) {
    +
    return Renderer(component, [name, component] {
    +
    return hbox({
    +
    text(name) | size(WIDTH, EQUAL, 8),
    +
    separator(),
    +
    component->Render() | xflex,
    +
    }) |
    +
    xflex;
    +
    });
    +
    }
    +
    +
    int main() {
    +
    auto screen = ScreenInteractive::FitComponent();
    +
    +
    // -- Menu
    +
    // ----------------------------------------------------------------------
    +
    const std::vector<std::string> menu_entries = {
    +
    "Menu 1",
    +
    "Menu 2",
    +
    "Menu 3",
    +
    "Menu 4",
    +
    };
    +
    int menu_selected = 0;
    +
    auto menu = Menu(&menu_entries, &menu_selected);
    +
    menu = Wrap("Menu", menu);
    +
    +
    // -- Toggle------------------------------------------------------------------
    +
    int toggle_selected = 0;
    +
    std::vector<std::string> toggle_entries = {
    +
    "Toggle_1",
    +
    "Toggle_2",
    +
    };
    +
    auto toggle = Toggle(&toggle_entries, &toggle_selected);
    +
    toggle = Wrap("Toggle", toggle);
    +
    +
    // -- Checkbox ---------------------------------------------------------------
    +
    bool checkbox_1_selected = false;
    +
    bool checkbox_2_selected = false;
    +
    bool checkbox_3_selected = false;
    +
    bool checkbox_4_selected = false;
    +
    +
    auto checkboxes = Container::Vertical({
    +
    Checkbox("checkbox1", &checkbox_1_selected),
    +
    Checkbox("checkbox2", &checkbox_2_selected),
    +
    Checkbox("checkbox3", &checkbox_3_selected),
    +
    Checkbox("checkbox4", &checkbox_4_selected),
    +
    });
    +
    checkboxes = Wrap("Checkbox", checkboxes);
    +
    +
    // -- Radiobox ---------------------------------------------------------------
    +
    int radiobox_selected = 0;
    +
    std::vector<std::string> radiobox_entries = {
    +
    "Radiobox 1",
    +
    "Radiobox 2",
    +
    "Radiobox 3",
    +
    "Radiobox 4",
    +
    };
    +
    auto radiobox = Radiobox(&radiobox_entries, &radiobox_selected);
    +
    radiobox = Wrap("Radiobox", radiobox);
    +
    +
    // -- Input ------------------------------------------------------------------
    +
    std::string input_label;
    +
    auto input = Input(&input_label, "placeholder");
    +
    input = Wrap("Input", input);
    +
    +
    // -- Button -----------------------------------------------------------------
    +
    std::string button_label = "Quit";
    +
    std::function<void()> on_button_clicked_;
    +
    auto button = Button(&button_label, screen.ExitLoopClosure());
    +
    button = Wrap("Button", button);
    +
    +
    // -- Slider -----------------------------------------------------------------
    +
    int slider_value_1 = 12;
    +
    int slider_value_2 = 56;
    +
    int slider_value_3 = 128;
    +
    auto sliders = Container::Vertical({
    +
    Slider("R:", &slider_value_1, 0, 256, 1),
    +
    Slider("G:", &slider_value_2, 0, 256, 1),
    +
    Slider("B:", &slider_value_3, 0, 256, 1),
    +
    });
    +
    sliders = Wrap("Slider", sliders);
    +
    +
    // A large text:
    +
    auto lorel_ipsum = Renderer([] {
    +
    return vbox({
    +
    text("Lorem ipsum dolor sit amet, consectetur adipiscing elit. "),
    +
    text("Sed do eiusmod tempor incididunt ut labore et dolore magna "
    +
    "aliqua. "),
    +
    text("Ut enim ad minim veniam, quis nostrud exercitation ullamco "
    +
    "laboris nisi ut aliquip ex ea commodo consequat. "),
    +
    text("Duis aute irure dolor in reprehenderit in voluptate velit esse "
    +
    "cillum dolore eu fugiat nulla pariatur. "),
    +
    text("Excepteur sint occaecat cupidatat non proident, sunt in culpa "
    +
    "qui officia deserunt mollit anim id est laborum. "),
    +
    +
    });
    +
    });
    +
    lorel_ipsum = Wrap("Lorel Ipsum", lorel_ipsum);
    +
    +
    // -- Layout
    +
    // -----------------------------------------------------------------
    +
    auto layout = Container::Vertical({
    +
    menu,
    +
    toggle,
    +
    checkboxes,
    +
    radiobox,
    +
    input,
    +
    sliders,
    +
    button,
    +
    lorel_ipsum,
    +
    });
    +
    +
    auto component = Renderer(layout, [&] {
    +
    return vbox({
    +
    menu->Render(),
    +
    separator(),
    +
    toggle->Render(),
    +
    separator(),
    +
    checkboxes->Render(),
    +
    separator(),
    +
    radiobox->Render(),
    +
    separator(),
    +
    input->Render(),
    +
    separator(),
    +
    sliders->Render(),
    +
    separator(),
    +
    button->Render(),
    +
    separator(),
    +
    lorel_ipsum->Render(),
    +
    }) |
    +
    xflex | size(WIDTH, GREATER_THAN, 40) | border;
    +
    });
    +
    +
    screen.Loop(component);
    +
    +
    return 0;
    +
    }
    +
    Component Wrap(std::string name, Component component)
    Definition gallery.cpp:18
    +

    +homescreen

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <stddef.h> // for size_t
    +
    #include <array> // for array
    +
    #include <atomic> // for atomic
    +
    #include <chrono> // for operator""s, chrono_literals
    +
    #include <cmath> // for sin
    + +
    #include <functional> // for ref, reference_wrapper, function
    +
    #include <memory> // for allocator, shared_ptr, __shared_ptr_access
    +
    #include <string> // for string, basic_string, char_traits, operator+, to_string
    +
    #include <thread> // for sleep_for, thread
    +
    #include <utility> // for move
    +
    #include <vector> // for vector
    +
    +
    #include "../dom/color_info_sorted_2d.ipp" // for ColorInfoSorted2D
    +
    #include "ftxui/component/component.hpp" // for Checkbox, Renderer, Horizontal, Vertical, Input, Menu, Radiobox, ResizableSplitLeft, Tab
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase, Component
    +
    #include "ftxui/component/component_options.hpp" // for MenuOption, InputOption
    +
    #include "ftxui/component/event.hpp" // for Event, Event::Custom
    +
    #include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for text, color, operator|, bgcolor, filler, Element, vbox, size, hbox, separator, flex, window, graph, EQUAL, paragraph, WIDTH, hcenter, Elements, bold, vscroll_indicator, HEIGHT, flexbox, hflow, border, frame, flex_grow, gauge, paragraphAlignCenter, paragraphAlignJustify, paragraphAlignLeft, paragraphAlignRight, dim, spinner, LESS_THAN, center, yframe, GREATER_THAN
    +
    #include "ftxui/dom/flexbox_config.hpp" // for FlexboxConfig
    +
    #include "ftxui/screen/color.hpp" // for Color, Color::BlueLight, Color::RedLight, Color::Black, Color::Blue, Color::Cyan, Color::CyanLight, Color::GrayDark, Color::GrayLight, Color::Green, Color::GreenLight, Color::Magenta, Color::MagentaLight, Color::Red, Color::White, Color::Yellow, Color::YellowLight, Color::Default, Color::Palette256, ftxui
    +
    #include "ftxui/screen/color_info.hpp" // for ColorInfo
    +
    #include "ftxui/screen/terminal.hpp" // for Size, Dimensions
    +
    +
    using namespace ftxui;
    +
    +
    int main() {
    +
    auto screen = ScreenInteractive::Fullscreen();
    +
    +
    // ---------------------------------------------------------------------------
    +
    // HTOP
    +
    // ---------------------------------------------------------------------------
    +
    int shift = 0;
    +
    +
    auto my_graph = [&shift](int width, int height) {
    +
    std::vector<int> output(width);
    +
    for (int i = 0; i < width; ++i) {
    +
    float v = 0.5f;
    +
    v += 0.1f * sin((i + shift) * 0.1f);
    +
    v += 0.2f * sin((i + shift + 10) * 0.15f);
    +
    v += 0.1f * sin((i + shift) * 0.03f);
    +
    v *= height;
    +
    output[i] = (int)v;
    +
    }
    +
    return output;
    +
    };
    +
    +
    auto htop = Renderer([&] {
    +
    auto frequency = vbox({
    +
    text("Frequency [Mhz]") | hcenter,
    +
    hbox({
    +
    vbox({
    +
    text("2400 "),
    +
    filler(),
    +
    text("1200 "),
    +
    filler(),
    +
    text("0 "),
    +
    }),
    +
    graph(std::ref(my_graph)) | flex,
    +
    }) | flex,
    +
    });
    +
    +
    auto utilization = vbox({
    +
    text("Utilization [%]") | hcenter,
    +
    hbox({
    +
    vbox({
    +
    text("100 "),
    +
    filler(),
    +
    text("50 "),
    +
    filler(),
    +
    text("0 "),
    +
    }),
    +
    graph(std::ref(my_graph)) | color(Color::RedLight),
    +
    }) | flex,
    +
    });
    +
    +
    auto ram = vbox({
    +
    text("Ram [Mo]") | hcenter,
    +
    hbox({
    +
    vbox({
    +
    text("8192"),
    +
    filler(),
    +
    text("4096 "),
    +
    filler(),
    +
    text("0 "),
    +
    }),
    +
    graph(std::ref(my_graph)) | color(Color::BlueLight),
    +
    }) | flex,
    +
    });
    +
    +
    return hbox({
    +
    vbox({
    +
    frequency | flex,
    +
    separator(),
    +
    utilization | flex,
    +
    }) | flex,
    +
    separator(),
    +
    ram | flex,
    +
    }) |
    +
    flex;
    +
    });
    +
    +
    // ---------------------------------------------------------------------------
    +
    // Compiler
    +
    // ---------------------------------------------------------------------------
    +
    +
    const std::vector<std::string> compiler_entries = {
    +
    "gcc",
    +
    "clang",
    +
    "emcc",
    +
    "game_maker",
    +
    "Ada compilers",
    +
    "ALGOL 60 compilers",
    +
    "ALGOL 68 compilers",
    +
    "Assemblers (Intel *86)",
    +
    "Assemblers (Motorola 68*)",
    +
    "Assemblers (Zilog Z80)",
    +
    "Assemblers (other)",
    +
    "BASIC Compilers",
    +
    "BASIC interpreters",
    +
    "Batch compilers",
    +
    "C compilers",
    +
    "Source-to-source compilers",
    +
    "C++ compilers",
    +
    "C# compilers",
    +
    "COBOL compilers",
    +
    "Common Lisp compilers",
    +
    "D compilers",
    +
    "DIBOL/DBL compilers",
    +
    "ECMAScript interpreters",
    +
    "Eiffel compilers",
    +
    "Fortran compilers",
    +
    "Go compilers",
    +
    "Haskell compilers",
    +
    "Java compilers",
    +
    "Pascal compilers",
    +
    "Perl Interpreters",
    +
    "PHP compilers",
    +
    "PL/I compilers",
    +
    "Python compilers",
    +
    "Scheme compilers and interpreters",
    +
    "Smalltalk compilers",
    +
    "Tcl Interpreters",
    +
    "VMS Interpreters",
    +
    "Rexx Interpreters",
    +
    "CLI compilers",
    +
    };
    +
    +
    int compiler_selected = 0;
    +
    Component compiler = Radiobox(&compiler_entries, &compiler_selected);
    +
    +
    std::array<std::string, 8> options_label = {
    +
    "-Wall",
    +
    "-Werror",
    +
    "-lpthread",
    +
    "-O3",
    +
    "-Wabi-tag",
    +
    "-Wno-class-conversion",
    +
    "-Wcomma-subscript",
    +
    "-Wno-conversion-null",
    +
    };
    +
    std::array<bool, 8> options_state = {
    +
    false, false, false, false, false, false, false, false,
    +
    };
    +
    +
    std::vector<std::string> input_entries;
    +
    int input_selected = 0;
    +
    Component input = Menu(&input_entries, &input_selected);
    +
    +
    auto input_option = InputOption();
    +
    std::string input_add_content;
    +
    input_option.on_enter = [&] {
    +
    input_entries.push_back(input_add_content);
    +
    input_add_content = "";
    +
    };
    +
    Component input_add = Input(&input_add_content, "input files", input_option);
    +
    +
    std::string executable_content_ = "";
    +
    Component executable_ = Input(&executable_content_, "executable");
    +
    +
    Component flags = Container::Vertical({
    +
    Checkbox(&options_label[0], &options_state[0]),
    +
    Checkbox(&options_label[1], &options_state[1]),
    +
    Checkbox(&options_label[2], &options_state[2]),
    +
    Checkbox(&options_label[3], &options_state[3]),
    +
    Checkbox(&options_label[4], &options_state[4]),
    +
    Checkbox(&options_label[5], &options_state[5]),
    +
    Checkbox(&options_label[6], &options_state[6]),
    +
    Checkbox(&options_label[7], &options_state[7]),
    +
    });
    +
    +
    auto compiler_component = Container::Horizontal({
    +
    compiler,
    +
    flags,
    +
    Container::Vertical({
    +
    executable_,
    +
    Container::Horizontal({
    +
    input_add,
    +
    input,
    +
    }),
    +
    }),
    +
    });
    +
    +
    auto render_command = [&] {
    +
    Elements line;
    +
    // Compiler
    +
    line.push_back(text(compiler_entries[compiler_selected]) | bold);
    +
    // flags
    +
    for (int i = 0; i < 8; ++i) {
    +
    if (options_state[i]) {
    +
    line.push_back(text(" "));
    +
    line.push_back(text(options_label[i]) | dim);
    +
    }
    +
    }
    +
    // Executable
    +
    if (!executable_content_.empty()) {
    +
    line.push_back(text(" -o ") | bold);
    +
    line.push_back(text(executable_content_) | color(Color::BlueLight) |
    +
    bold);
    +
    }
    +
    // Input
    +
    for (auto& it : input_entries) {
    +
    line.push_back(text(" " + it) | color(Color::RedLight));
    +
    }
    +
    return line;
    +
    };
    +
    +
    auto compiler_renderer = Renderer(compiler_component, [&] {
    +
    auto compiler_win = window(text("Compiler"),
    +
    compiler->Render() | vscroll_indicator | frame);
    +
    auto flags_win =
    +
    window(text("Flags"), flags->Render() | vscroll_indicator | frame);
    +
    auto executable_win = window(text("Executable:"), executable_->Render());
    +
    auto input_win =
    +
    window(text("Input"), hbox({
    +
    vbox({
    +
    hbox({
    +
    text("Add: "),
    +
    input_add->Render(),
    +
    }) | size(WIDTH, EQUAL, 20) |
    +
    size(HEIGHT, EQUAL, 1),
    +
    filler(),
    +
    }),
    +
    separator(),
    +
    input->Render() | vscroll_indicator | frame |
    +
    size(HEIGHT, EQUAL, 3) | flex,
    +
    }));
    +
    return vbox({
    +
    hbox({
    +
    compiler_win,
    +
    flags_win,
    +
    vbox({
    +
    executable_win | size(WIDTH, EQUAL, 20),
    +
    input_win | size(WIDTH, EQUAL, 60),
    +
    }),
    +
    filler(),
    +
    }) | size(HEIGHT, LESS_THAN, 8),
    +
    hflow(render_command()) | flex_grow,
    +
    }) |
    +
    flex_grow;
    +
    });
    +
    +
    // ---------------------------------------------------------------------------
    +
    // Spinner
    +
    // ---------------------------------------------------------------------------
    +
    auto spinner_tab_renderer = Renderer([&] {
    +
    Elements entries;
    +
    for (int i = 0; i < 22; ++i) {
    +
    entries.push_back(spinner(i, shift / 5) | bold |
    +
    size(WIDTH, GREATER_THAN, 2) | border);
    +
    }
    +
    return hflow(std::move(entries));
    +
    });
    +
    +
    // ---------------------------------------------------------------------------
    +
    // Colors
    +
    // ---------------------------------------------------------------------------
    +
    auto color_tab_renderer = Renderer([] {
    +
    auto basic_color_display =
    +
    vbox({
    +
    text("16 color palette:"),
    +
    separator(),
    +
    hbox({
    +
    vbox({
    +
    color(Color::Default, text("Default")),
    +
    color(Color::Black, text("Black")),
    +
    color(Color::GrayDark, text("GrayDark")),
    +
    color(Color::GrayLight, text("GrayLight")),
    +
    color(Color::White, text("White")),
    +
    color(Color::Blue, text("Blue")),
    +
    color(Color::BlueLight, text("BlueLight")),
    +
    color(Color::Cyan, text("Cyan")),
    +
    color(Color::CyanLight, text("CyanLight")),
    +
    color(Color::Green, text("Green")),
    +
    color(Color::GreenLight, text("GreenLight")),
    +
    color(Color::Magenta, text("Magenta")),
    +
    color(Color::MagentaLight, text("MagentaLight")),
    +
    color(Color::Red, text("Red")),
    +
    color(Color::RedLight, text("RedLight")),
    +
    color(Color::Yellow, text("Yellow")),
    +
    color(Color::YellowLight, text("YellowLight")),
    +
    }),
    +
    vbox({
    +
    bgcolor(Color::Default, text("Default")),
    +
    bgcolor(Color::Black, text("Black")),
    +
    bgcolor(Color::GrayDark, text("GrayDark")),
    +
    bgcolor(Color::GrayLight, text("GrayLight")),
    +
    bgcolor(Color::White, text("White")),
    +
    bgcolor(Color::Blue, text("Blue")),
    +
    bgcolor(Color::BlueLight, text("BlueLight")),
    +
    bgcolor(Color::Cyan, text("Cyan")),
    +
    bgcolor(Color::CyanLight, text("CyanLight")),
    +
    bgcolor(Color::Green, text("Green")),
    +
    bgcolor(Color::GreenLight, text("GreenLight")),
    +
    bgcolor(Color::Magenta, text("Magenta")),
    +
    bgcolor(Color::MagentaLight, text("MagentaLight")),
    +
    bgcolor(Color::Red, text("Red")),
    +
    bgcolor(Color::RedLight, text("RedLight")),
    +
    bgcolor(Color::Yellow, text("Yellow")),
    +
    bgcolor(Color::YellowLight, text("YellowLight")),
    +
    }),
    +
    }),
    +
    }) |
    +
    border;
    +
    +
    auto palette_256_color_display = text("256 colors palette:");
    +
    {
    +
    std::vector<std::vector<ColorInfo>> info_columns = ColorInfoSorted2D();
    +
    Elements columns;
    +
    for (auto& column : info_columns) {
    +
    Elements column_elements;
    +
    for (auto& it : column) {
    +
    column_elements.push_back(
    +
    text(" ") | bgcolor(Color(Color::Palette256(it.index_256))));
    +
    }
    +
    columns.push_back(hbox(std::move(column_elements)));
    +
    }
    +
    palette_256_color_display = vbox({
    +
    palette_256_color_display,
    +
    separator(),
    +
    vbox(columns),
    +
    }) |
    +
    border;
    +
    }
    +
    +
    // True color display.
    +
    auto true_color_display = text("TrueColors: 24bits:");
    +
    {
    +
    int saturation = 255;
    +
    Elements array;
    +
    for (int value = 0; value < 255; value += 16) {
    +
    Elements line;
    +
    for (int hue = 0; hue < 255; hue += 6) {
    +
    line.push_back(text("▀") //
    +
    | color(Color::HSV(hue, saturation, value)) //
    +
    | bgcolor(Color::HSV(hue, saturation, value + 8)));
    +
    }
    +
    array.push_back(hbox(std::move(line)));
    +
    }
    +
    true_color_display = vbox({
    +
    true_color_display,
    +
    separator(),
    +
    vbox(std::move(array)),
    +
    }) |
    +
    border;
    +
    }
    +
    +
    return flexbox(
    +
    {
    +
    basic_color_display,
    +
    palette_256_color_display,
    +
    true_color_display,
    +
    },
    + +
    });
    +
    +
    // ---------------------------------------------------------------------------
    +
    // Gauges
    +
    // ---------------------------------------------------------------------------
    +
    auto render_gauge = [&shift](int delta) {
    +
    float progress = (shift + delta) % 500 / 500.f;
    +
    return hbox({
    +
    text(std::to_string(int(progress * 100)) + "% ") |
    +
    size(WIDTH, EQUAL, 5),
    +
    gauge(progress),
    +
    });
    +
    };
    +
    +
    auto gauge_component = Renderer([render_gauge] {
    +
    return vbox({
    +
    render_gauge(0) | color(Color::Black),
    +
    render_gauge(100) | color(Color::GrayDark),
    +
    render_gauge(50) | color(Color::GrayLight),
    +
    render_gauge(6894) | color(Color::White),
    +
    separator(),
    +
    render_gauge(6841) | color(Color::Blue),
    +
    render_gauge(9813) | color(Color::BlueLight),
    +
    render_gauge(98765) | color(Color::Cyan),
    +
    render_gauge(98) | color(Color::CyanLight),
    +
    render_gauge(9846) | color(Color::Green),
    +
    render_gauge(1122) | color(Color::GreenLight),
    +
    render_gauge(84) | color(Color::Magenta),
    +
    render_gauge(645) | color(Color::MagentaLight),
    +
    render_gauge(568) | color(Color::Red),
    +
    render_gauge(2222) | color(Color::RedLight),
    +
    render_gauge(220) | color(Color::Yellow),
    +
    render_gauge(348) | color(Color::YellowLight),
    +
    });
    +
    });
    +
    +
    // ---------------------------------------------------------------------------
    +
    // Paragraph
    +
    // ---------------------------------------------------------------------------
    +
    auto make_box = [](size_t dimx, size_t dimy) {
    +
    std::string title = std::to_string(dimx) + "x" + std::to_string(dimy);
    +
    return window(text(title) | hcenter | bold,
    +
    text("content") | hcenter | dim) |
    +
    size(WIDTH, EQUAL, dimx) | size(HEIGHT, EQUAL, dimy);
    +
    };
    +
    +
    auto paragraph_renderer_left = Renderer([&] {
    +
    std::string str =
    +
    "Lorem Ipsum is simply dummy text of the printing and typesetting "
    +
    "industry.\nLorem Ipsum has been the industry's standard dummy text "
    +
    "ever since the 1500s, when an unknown printer took a galley of type "
    +
    "and scrambled it to make a type specimen book.";
    +
    return vbox({
    +
    window(text("Align left:"), paragraphAlignLeft(str)),
    +
    window(text("Align center:"), paragraphAlignCenter(str)),
    +
    window(text("Align right:"), paragraphAlignRight(str)),
    +
    window(text("Align justify:"), paragraphAlignJustify(str)),
    +
    window(text("Side by side"), hbox({
    +
    paragraph(str),
    +
    separator(),
    +
    paragraph(str),
    +
    })),
    +
    window(text("Elements with different size:"),
    +
    flexbox({
    +
    make_box(10, 5),
    +
    make_box(9, 4),
    +
    make_box(8, 4),
    +
    make_box(6, 3),
    +
    make_box(10, 5),
    +
    make_box(9, 4),
    +
    make_box(8, 4),
    +
    make_box(6, 3),
    +
    make_box(10, 5),
    +
    make_box(9, 4),
    +
    make_box(8, 4),
    +
    make_box(6, 3),
    +
    })),
    +
    }) |
    +
    vscroll_indicator | yframe | flex;
    +
    });
    +
    +
    auto paragraph_renderer_right = Renderer([] {
    +
    return paragraph("<--- This vertical bar is resizable using the mouse") |
    +
    center;
    +
    });
    +
    +
    int paragraph_renderer_split_position = Terminal::Size().dimx / 2;
    +
    auto paragraph_renderer_group =
    +
    ResizableSplitLeft(paragraph_renderer_left, paragraph_renderer_right,
    +
    &paragraph_renderer_split_position);
    +
    auto paragraph_renderer_group_renderer =
    +
    Renderer(paragraph_renderer_group,
    +
    [&] { return paragraph_renderer_group->Render(); });
    +
    +
    // ---------------------------------------------------------------------------
    +
    // Tabs
    +
    // ---------------------------------------------------------------------------
    +
    +
    int tab_index = 0;
    +
    std::vector<std::string> tab_entries = {
    +
    "htop", "color", "spinner", "gauge", "compiler", "paragraph",
    +
    };
    +
    auto tab_selection =
    +
    Menu(&tab_entries, &tab_index, MenuOption::HorizontalAnimated());
    +
    auto tab_content = Container::Tab(
    +
    {
    +
    htop,
    +
    color_tab_renderer,
    +
    spinner_tab_renderer,
    +
    gauge_component,
    +
    compiler_renderer,
    +
    paragraph_renderer_group_renderer,
    +
    },
    +
    &tab_index);
    +
    +
    auto exit_button =
    +
    Button("Exit", [&] { screen.Exit(); }, ButtonOption::Animated());
    +
    +
    auto main_container = Container::Vertical({
    +
    Container::Horizontal({
    +
    tab_selection,
    +
    exit_button,
    +
    }),
    +
    tab_content,
    +
    });
    +
    +
    auto main_renderer = Renderer(main_container, [&] {
    +
    return vbox({
    +
    text("FTXUI Demo") | bold | hcenter,
    +
    hbox({
    +
    tab_selection->Render() | flex,
    +
    exit_button->Render(),
    +
    }),
    +
    tab_content->Render() | flex,
    +
    });
    +
    });
    +
    +
    Loop loop(&screen, main_renderer);
    +
    while (!loop.HasQuitted()) {
    +
    // Update the state of the application.
    +
    shift++;
    +
    +
    // Request a new frame to be drawn.
    +
    screen.RequestAnimationFrame();
    +
    +
    // Execute events, and draw the next frame.
    +
    loop.RunOnce();
    +
    +
    // Sleep for a short duration to control the frame rate (60 FPS).
    +
    std::this_thread::sleep_for(std::chrono::milliseconds(1000 / 60));
    +
    }
    +
    +
    return 0;
    +
    }
    + +
    std::vector< std::vector< ftxui::ColorInfo > > ColorInfoSorted2D()
    +
    Option for the Input component.
    +
    FlexboxConfig & SetGap(int gap_x, int gap_y)
    Set the flexbox flex direction.
    + +
    Color is a class that represents a color in the terminal user interface.
    Definition color.hpp:22
    +
    std::vector< Element > Elements
    Definition elements.hpp:23
    + +

    +input

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <memory> // for allocator, __shared_ptr_access
    +
    #include <string> // for char_traits, operator+, string, basic_string
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Input, Renderer, Vertical
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/component_options.hpp" // for InputOption
    +
    #include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for text, hbox, separator, Element, operator|, vbox, border
    +
    #include "ftxui/util/ref.hpp" // for Ref
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    +
    // The data:
    +
    std::string first_name;
    +
    std::string last_name;
    +
    std::string password;
    +
    std::string phoneNumber;
    +
    +
    // The basic input components:
    +
    Component input_first_name = Input(&first_name, "first name");
    +
    Component input_last_name = Input(&last_name, "last name");
    +
    +
    // The password input component:
    +
    InputOption password_option;
    +
    password_option.password = true;
    +
    Component input_password = Input(&password, "password", password_option);
    +
    +
    // The phone number input component:
    +
    // We are using `CatchEvent` to filter out non-digit characters.
    +
    Component input_phone_number = Input(&phoneNumber, "phone number");
    +
    input_phone_number |= CatchEvent([&](Event event) {
    +
    return event.is_character() && !std::isdigit(event.character()[0]);
    +
    });
    +
    input_phone_number |= CatchEvent([&](Event event) {
    +
    return event.is_character() && phoneNumber.size() > 10;
    +
    });
    +
    +
    // The component tree:
    +
    auto component = Container::Vertical({
    +
    input_first_name,
    +
    input_last_name,
    +
    input_password,
    +
    input_phone_number,
    +
    });
    +
    +
    // Tweak how the component tree is rendered:
    +
    auto renderer = Renderer(component, [&] {
    +
    return vbox({
    +
    hbox(text(" First name : "), input_first_name->Render()),
    +
    hbox(text(" Last name : "), input_last_name->Render()),
    +
    hbox(text(" Password : "), input_password->Render()),
    +
    hbox(text(" Phone num : "), input_phone_number->Render()),
    +
    separator(),
    +
    text("Hello " + first_name + " " + last_name),
    +
    text("Your password is " + password),
    +
    text("Your phone number is " + phoneNumber),
    +
    }) |
    +
    border;
    +
    });
    +
    +
    auto screen = ScreenInteractive::TerminalOutput();
    +
    screen.Loop(renderer);
    +
    }
    +
    std::string character() const
    Definition event.hpp:107
    +
    Ref< bool > password
    Obscure the input content using '*'.
    + +

    +input_in_frame

    +

    Demo

    // Copyright 2021 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <memory> // for allocator, __shared_ptr_access
    +
    #include <string> // for string, basic_string, operator+, to_string
    +
    #include <vector> // for vector
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Input, Renderer, Vertical
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, vscroll_indicator, HEIGHT, LESS_THAN
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    +
    Component input_list = Container::Vertical({});
    +
    std::vector<std::string> items(100, "");
    +
    for (size_t i = 0; i < items.size(); ++i) {
    +
    input_list->Add(Input(&(items[i]), "placeholder " + std::to_string(i)));
    +
    }
    +
    +
    auto renderer = Renderer(input_list, [&] {
    +
    return input_list->Render() | vscroll_indicator | frame | border |
    +
    size(HEIGHT, LESS_THAN, 10);
    +
    });
    +
    +
    auto screen = ScreenInteractive::TerminalOutput();
    +
    screen.Loop(renderer);
    +
    }
    +

    +input_style

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <ftxui/dom/linear_gradient.hpp> // for LinearGradient
    +
    #include <ftxui/screen/color.hpp> // for Color, Color::White, Color::Red, Color::Blue, Color::Black, Color::GrayDark, ftxui
    +
    #include <functional> // for function
    +
    #include <string> // for allocator, string
    +
    #include <utility> // for move
    +
    +
    #include "ftxui/component/component.hpp" // for Input, Horizontal, Vertical, operator|
    +
    #include "ftxui/component/component_base.hpp" // for Component
    +
    #include "ftxui/component/component_options.hpp" // for InputState, InputOption
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for operator|=, Element, bgcolor, operator|, separatorEmpty, color, borderEmpty, separator, text, center, dim, hbox, vbox, border, borderDouble, borderRounded
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    +
    InputOption style_1 = InputOption::Default();
    +
    +
    InputOption style_2 = InputOption::Spacious();
    +
    +
    InputOption style_3 = InputOption::Spacious();
    +
    style_3.transform = [](InputState state) {
    +
    state.element |= borderEmpty;
    +
    +
    if (state.is_placeholder) {
    +
    state.element |= dim;
    +
    }
    +
    +
    if (state.focused) {
    +
    state.element |= borderDouble;
    +
    state.element |= bgcolor(Color::White);
    +
    state.element |= color(Color::Black);
    +
    } else if (state.hovered) {
    +
    state.element |= borderRounded;
    +
    state.element |= bgcolor(LinearGradient(90, Color::Blue, Color::Red));
    +
    state.element |= color(Color::White);
    +
    } else {
    +
    state.element |= border;
    +
    state.element |= bgcolor(LinearGradient(0, Color::Blue, Color::Red));
    +
    state.element |= color(Color::White);
    +
    }
    +
    +
    return state.element;
    +
    };
    +
    +
    InputOption style_4 = InputOption::Spacious();
    +
    style_4.transform = [](InputState state) {
    +
    state.element = hbox({
    +
    text("Theorem") | center | borderEmpty | bgcolor(Color::Red),
    +
    separatorEmpty(),
    +
    separator() | color(Color::White),
    +
    separatorEmpty(),
    +
    std::move(state.element),
    +
    });
    +
    +
    state.element |= borderEmpty;
    +
    if (state.is_placeholder) {
    +
    state.element |= dim;
    +
    }
    +
    +
    if (state.focused) {
    +
    state.element |= bgcolor(Color::Black);
    +
    } else {
    +
    state.element |= bgcolor(Color::Blue);
    +
    }
    +
    +
    if (state.hovered) {
    +
    state.element |= bgcolor(Color::GrayDark);
    +
    }
    +
    +
    return vbox({state.element, separatorEmpty()});
    +
    };
    +
    +
    auto generateUiFromStyle = [&](InputOption style) {
    +
    auto first_name = new std::string(); // Leaked
    +
    auto middle_name = new std::string(); // Leaked
    +
    auto last_name = new std::string(); // Leaked
    +
    return Container::Vertical({
    +
    Input(first_name, "first name", style),
    +
    Input(middle_name, "middle name", style),
    +
    Input(last_name, "last name", style),
    +
    }) |
    +
    borderEmpty;
    +
    };
    +
    +
    auto ui = Container::Horizontal({
    +
    generateUiFromStyle(style_1),
    +
    generateUiFromStyle(style_2),
    +
    generateUiFromStyle(style_3),
    +
    generateUiFromStyle(style_4),
    +
    });
    +
    +
    auto screen = ScreenInteractive::TerminalOutput();
    +
    screen.Loop(ui);
    +
    }
    +
    std::function< Element(InputState)> transform
    +
    A class representing the settings for linear-gradient color effect.
    + +
    Used to define style for the Input component.
    +

    +linear_gradient_gallery

    +

    Demo

    // Copyright 2023 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <ftxui/component/component_base.hpp> // for ComponentBase, Component
    +
    #include <ftxui/dom/elements.hpp> // for operator|, Element, flex, bgcolor, text, vbox, center
    +
    #include <ftxui/dom/linear_gradient.hpp> // for LinearGradient
    +
    #include <ftxui/screen/color.hpp> // for Color, Color::Blue, Color::Red
    +
    #include <memory> // for __shared_ptr_access, shared_ptr
    +
    #include <string> // for allocator, operator+, char_traits, string, to_string
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Slider, Renderer, Vertical
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    auto screen = ScreenInteractive::Fullscreen();
    +
    +
    int angle = 180.f;
    +
    float start = 0.f;
    +
    float end = 1.f;
    +
    +
    std::string slider_angle_text;
    +
    std::string slider_start_text;
    +
    std::string slider_end_text;
    +
    +
    auto slider_angle = Slider(&slider_angle_text, &angle, 0, 360);
    +
    auto slider_start = Slider(&slider_start_text, &start, 0.f, 1.f, 0.05f);
    +
    auto slider_end = Slider(&slider_end_text, &end, 0.f, 1.f, 0.05f);
    +
    +
    auto layout = Container::Vertical({
    +
    slider_angle,
    +
    slider_start,
    +
    slider_end,
    +
    });
    +
    +
    auto renderer = Renderer(layout, [&] {
    +
    slider_angle_text = "angle = " + std::to_string(angle) + "°";
    +
    slider_start_text = "start = " + std::to_string(int(start * 100)) + "%";
    +
    slider_end_text = "end = " + std::to_string(int(end * 100)) + "%";
    +
    +
    auto background = text("Gradient") | center |
    +
    bgcolor(LinearGradient()
    +
    .Angle(angle)
    +
    .Stop(Color::Blue, start)
    +
    .Stop(Color::Red, end));
    +
    return vbox({
    +
    background | flex,
    +
    layout->Render(),
    +
    }) |
    +
    flex;
    +
    });
    +
    +
    screen.Loop(renderer);
    +
    }
    + +

    +maybe

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <string> // for string, allocator, basic_string
    +
    #include <vector> // for vector
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for operator|, Maybe, Checkbox, Radiobox, Renderer, Vertical
    +
    #include "ftxui/component/component_base.hpp" // for Component
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for Element, border, color, operator|, text
    +
    #include "ftxui/screen/color.hpp" // for Color, Color::Red
    +
    +
    using namespace ftxui;
    +
    +
    int main() {
    +
    std::vector<std::string> entries = {
    +
    "entry 1",
    +
    "entry 2",
    +
    "entry 3",
    +
    };
    +
    int menu_1_selected = 0;
    +
    int menu_2_selected = 0;
    +
    +
    bool menu_1_show = false;
    +
    bool menu_2_show = false;
    +
    +
    auto layout = Container::Vertical({
    +
    Checkbox("Show menu_1", &menu_1_show),
    +
    Radiobox(&entries, &menu_1_selected) | border | Maybe(&menu_1_show),
    +
    Checkbox("Show menu_2", &menu_2_show),
    +
    Radiobox(&entries, &menu_2_selected) | border | Maybe(&menu_2_show),
    +
    +
    Renderer([] {
    +
    return text("You found the secret combinaison!") | color(Color::Red);
    +
    }) | Maybe([&] { return menu_1_selected == 1 && menu_2_selected == 2; }),
    +
    });
    +
    +
    auto screen = ScreenInteractive::TerminalOutput();
    +
    screen.Loop(layout);
    +
    }
    +

    +menu

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <functional> // for function
    +
    #include <iostream> // for basic_ostream::operator<<, operator<<, endl, basic_ostream, basic_ostream<>::__ostream_type, cout, ostream
    +
    #include <string> // for string, basic_string, allocator
    +
    #include <vector> // for vector
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Menu
    +
    #include "ftxui/component/component_options.hpp" // for MenuOption
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    auto screen = ScreenInteractive::TerminalOutput();
    +
    +
    std::vector<std::string> entries = {
    +
    "entry 1",
    +
    "entry 2",
    +
    "entry 3",
    +
    };
    +
    int selected = 0;
    +
    +
    MenuOption option;
    +
    option.on_enter = screen.ExitLoopClosure();
    +
    auto menu = Menu(&entries, &selected, option);
    +
    +
    screen.Loop(menu);
    +
    +
    std::cout << "Selected element = " << selected << std::endl;
    +
    }
    +
    std::function< void()> on_enter
    +
    Option for the Menu component.
    +

    +menu2

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <functional> // for function
    +
    #include <memory> // for allocator, __shared_ptr_access
    +
    #include <string> // for string, basic_string, operator+, to_string
    +
    #include <vector> // for vector
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Menu, Horizontal, Renderer
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/component_options.hpp" // for MenuOption
    +
    #include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for text, separator, bold, hcenter, vbox, hbox, gauge, Element, operator|, border
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    auto screen = ScreenInteractive::TerminalOutput();
    +
    +
    std::vector<std::string> left_menu_entries = {
    +
    "0%", "10%", "20%", "30%", "40%", "50%", "60%", "70%", "80%", "90%",
    +
    };
    +
    std::vector<std::string> right_menu_entries = {
    +
    "0%", "1%", "2%", "3%", "4%", "5%", "6%", "7%", "8%", "9%", "10%",
    +
    };
    +
    +
    auto menu_option = MenuOption();
    +
    menu_option.on_enter = screen.ExitLoopClosure();
    +
    +
    int left_menu_selected = 0;
    +
    int right_menu_selected = 0;
    +
    Component left_menu_ =
    +
    Menu(&left_menu_entries, &left_menu_selected, menu_option);
    +
    Component right_menu_ =
    +
    Menu(&right_menu_entries, &right_menu_selected, menu_option);
    +
    +
    Component container = Container::Horizontal({
    +
    left_menu_,
    +
    right_menu_,
    +
    });
    +
    +
    auto renderer = Renderer(container, [&] {
    +
    int sum = left_menu_selected * 10 + right_menu_selected;
    +
    return vbox({
    +
    // -------- Top panel --------------
    +
    hbox({
    +
    // -------- Left Menu --------------
    +
    vbox({
    +
    hcenter(bold(text("Percentage by 10%"))),
    +
    separator(),
    +
    left_menu_->Render(),
    +
    }),
    +
    separator(),
    +
    // -------- Right Menu --------------
    +
    vbox({
    +
    hcenter(bold(text("Percentage by 1%"))),
    +
    separator(),
    +
    right_menu_->Render(),
    +
    }),
    +
    separator(),
    +
    }),
    +
    separator(),
    +
    // -------- Bottom panel --------------
    +
    vbox({
    +
    hbox({
    +
    text(" gauge : "),
    +
    gauge(sum / 100.0),
    +
    }),
    +
    hbox({
    +
    text(" text : "),
    +
    text(std::to_string(sum) + " %"),
    +
    }),
    +
    }),
    +
    }) |
    +
    border;
    +
    });
    +
    +
    screen.Loop(renderer);
    +
    }
    +

    +menu_entries

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <functional> // for function
    +
    #include <iostream> // for basic_ostream::operator<<, operator<<, endl, basic_ostream, basic_ostream<>::__ostream_type, cout, ostream
    +
    #include <memory> // for allocator, shared_ptr, __shared_ptr_access
    +
    #include <string> // for char_traits, to_string, operator+, string, basic_string
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for MenuEntry, Renderer, Vertical
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/component_options.hpp" // for MenuEntryOption
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for operator|, Element, separator, text, hbox, size, frame, color, vbox, HEIGHT, LESS_THAN, bold, border, inverted
    +
    #include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Cyan, Color::Green, Color::Red, Color::Yellow
    +
    +
    using namespace ftxui;
    +
    +
    // Define a special style for some menu entry.
    + + +
    option.transform = [c](EntryState state) {
    +
    state.label = (state.active ? "> " : " ") + state.label;
    +
    Element e = text(state.label) | color(c);
    +
    if (state.focused) {
    +
    e = e | inverted;
    +
    }
    +
    if (state.active) {
    +
    e = e | bold;
    +
    }
    +
    return e;
    +
    };
    +
    return option;
    +
    }
    +
    +
    int main() {
    +
    auto screen = ScreenInteractive::TerminalOutput();
    +
    +
    int selected = 0;
    +
    auto menu = Container::Vertical(
    +
    {
    +
    MenuEntry(" 1. improve"),
    +
    MenuEntry(" 2. tolerant"),
    +
    MenuEntry(" 3. career"),
    +
    MenuEntry(" 4. cast"),
    +
    MenuEntry(" 5. question"),
    +
    +
    Renderer([] { return separator(); }),
    +
    +
    MenuEntry(" 6. rear", Colored(Color::Red)),
    +
    MenuEntry(" 7. drown", Colored(Color::Yellow)),
    +
    MenuEntry(" 8. nail", Colored(Color::Green)),
    +
    MenuEntry(" 9. quit", Colored(Color::Cyan)),
    +
    MenuEntry("10. decorative", Colored(Color::Blue)),
    +
    +
    Renderer([] { return separator(); }),
    +
    +
    MenuEntry("11. costume"),
    +
    MenuEntry("12. pick"),
    +
    MenuEntry("13. oral"),
    +
    MenuEntry("14. minister"),
    +
    MenuEntry("15. football"),
    +
    MenuEntry("16. welcome"),
    +
    MenuEntry("17. copper"),
    +
    MenuEntry("18. inhabitant"),
    +
    MenuEntry("19. fortune"),
    +
    },
    +
    &selected);
    +
    +
    // Display together the menu with a border
    +
    auto renderer = Renderer(menu, [&] {
    +
    return vbox({
    +
    hbox(text("selected = "), text(std::to_string(selected))),
    +
    separator(),
    +
    menu->Render() | frame | size(HEIGHT, LESS_THAN, 10),
    +
    }) |
    +
    border;
    +
    });
    +
    +
    screen.Loop(renderer);
    +
    +
    std::cout << "Selected element = " << selected << std::endl;
    +
    }
    +
    std::function< Element(const EntryState &state)> transform
    +
    Option for the MenuEntry component.
    +
    MenuEntryOption Colored(ftxui::Color c)
    +

    +menu_entries_animated

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <iostream> // for basic_ostream::operator<<, operator<<, endl, basic_ostream, basic_ostream<>::__ostream_type, cout, ostream
    +
    #include <memory> // for shared_ptr, __shared_ptr_access
    +
    #include <string> // for to_string, allocator
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for MenuEntryAnimated, Renderer, Vertical
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/component_options.hpp" // for MenuEntryAnimated
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for operator|, separator, Element, Decorator, color, text, hbox, size, bold, frame, inverted, vbox, HEIGHT, LESS_THAN, border
    +
    #include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Cyan, Color::Green, Color::Red, Color::Yellow
    +
    +
    using namespace ftxui;
    +
    +
    // Define a special style for some menu entry.
    + + + + + +
    option.animated_colors.background.inactive = Color::Black;
    +
    option.animated_colors.foreground.active = Color::White;
    + +
    return option;
    +
    }
    +
    +
    int main() {
    +
    auto screen = ScreenInteractive::TerminalOutput();
    +
    +
    int selected = 0;
    +
    auto menu = Container::Vertical(
    +
    {
    +
    MenuEntry(" 1. rear", Colored(Color::Red)),
    +
    MenuEntry(" 2. drown", Colored(Color::Yellow)),
    +
    MenuEntry(" 3. nail", Colored(Color::Green)),
    +
    MenuEntry(" 4. quit", Colored(Color::Cyan)),
    +
    MenuEntry(" 5. decorative", Colored(Color::Blue)),
    +
    MenuEntry(" 7. costume"),
    +
    MenuEntry(" 8. pick"),
    +
    MenuEntry(" 9. oral"),
    +
    MenuEntry("11. minister"),
    +
    MenuEntry("12. football"),
    +
    MenuEntry("13. welcome"),
    +
    MenuEntry("14. copper"),
    +
    MenuEntry("15. inhabitant"),
    +
    },
    +
    &selected);
    +
    +
    // Display together the menu with a border
    +
    auto renderer = Renderer(menu, [&] {
    +
    return vbox({
    +
    hbox(text("selected = "), text(std::to_string(selected))),
    +
    separator(),
    +
    menu->Render() | frame,
    +
    }) |
    +
    border | bgcolor(Color::Black);
    +
    });
    +
    +
    screen.Loop(renderer);
    +
    +
    std::cout << "Selected element = " << selected << std::endl;
    +
    }
    + + + +
    AnimatedColorsOption animated_colors
    + + +

    +menu_in_frame

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <memory> // for shared_ptr, __shared_ptr_access
    +
    #include <string> // for string, basic_string, operator+, to_string
    +
    #include <vector> // for vector
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Radiobox, Renderer
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, HEIGHT, LESS_THAN
    +
    +
    using namespace ftxui;
    +
    +
    int main() {
    +
    std::vector<std::string> entries;
    +
    int selected = 0;
    +
    +
    for (int i = 0; i < 30; ++i) {
    +
    entries.push_back("Entry " + std::to_string(i));
    +
    }
    +
    auto radiobox = Menu(&entries, &selected);
    +
    auto renderer = Renderer(radiobox, [&] {
    +
    return radiobox->Render() | vscroll_indicator | frame |
    +
    size(HEIGHT, LESS_THAN, 10) | border;
    +
    });
    +
    +
    auto screen = ScreenInteractive::FitComponent();
    +
    screen.Loop(renderer);
    +
    +
    return 0;
    +
    }
    +

    +menu_in_frame_horizontal

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <memory> // for shared_ptr, __shared_ptr_access
    +
    #include <string> // for string, basic_string, operator+, to_string
    +
    #include <vector> // for vector
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Radiobox, Renderer
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, HEIGHT, LESS_THAN
    +
    +
    using namespace ftxui;
    +
    +
    int main() {
    +
    std::vector<std::string> entries;
    +
    int selected = 0;
    +
    +
    for (int i = 0; i < 100; ++i) {
    +
    entries.push_back(std::to_string(i));
    +
    }
    +
    auto radiobox = Menu(&entries, &selected, MenuOption::Horizontal());
    +
    auto renderer = Renderer(
    +
    radiobox, [&] { return radiobox->Render() | hscroll_indicator | frame; });
    +
    +
    auto screen = ScreenInteractive::FitComponent();
    +
    screen.Loop(renderer);
    +
    +
    return 0;
    +
    }
    +

    +menu_multiple

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <stdlib.h> // for EXIT_SUCCESS
    +
    #include <memory> // for allocator, __shared_ptr_access
    +
    #include <string> // for string, operator+, basic_string, to_string, char_traits
    +
    #include <vector> // for vector, __alloc_traits<>::value_type
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Menu, Renderer, Horizontal, Vertical
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for text, Element, operator|, window, flex, vbox
    +
    +
    using namespace ftxui;
    +
    +
    Component Window(std::string title, Component component) {
    +
    return Renderer(component, [component, title] { //
    +
    return window(text(title), component->Render()) | flex;
    +
    });
    +
    }
    +
    +
    int main() {
    +
    int menu_selected[] = {0, 0, 0};
    +
    std::vector<std::vector<std::string>> menu_entries = {
    +
    {
    +
    "Ananas",
    +
    "Raspberry",
    +
    "Citrus",
    +
    },
    +
    {
    +
    "Potatoes",
    +
    "Weat",
    +
    "Rise",
    +
    },
    +
    {
    +
    "Carrot",
    +
    "Lettuce",
    +
    "Tomato",
    +
    },
    +
    };
    +
    +
    int menu_selected_global = 0;
    +
    auto menu_global = Container::Vertical(
    +
    {
    +
    Window("Menu 1", Menu(&menu_entries[0], &menu_selected[0])),
    +
    Window("Menu 2", Menu(&menu_entries[1], &menu_selected[1])),
    +
    Window("Menu 3", Menu(&menu_entries[2], &menu_selected[2])),
    +
    },
    +
    &menu_selected_global);
    +
    +
    auto info = Renderer([&] {
    +
    int g = menu_selected_global;
    +
    std::string value = menu_entries[g][menu_selected[g]];
    +
    return window(text("Content"), //
    +
    vbox({
    +
    text("menu_selected_global = " + std::to_string(g)),
    +
    text("menu_selected[0] = " +
    +
    std::to_string(menu_selected[0])),
    +
    text("menu_selected[1] = " +
    +
    std::to_string(menu_selected[1])),
    +
    text("menu_selected[2] = " +
    +
    std::to_string(menu_selected[2])),
    +
    text("Value = " + value),
    +
    })) |
    +
    flex;
    +
    });
    +
    +
    auto global = Container::Horizontal({
    +
    menu_global,
    +
    info,
    +
    });
    +
    +
    auto screen = ScreenInteractive::TerminalOutput();
    +
    screen.Loop(global);
    +
    return EXIT_SUCCESS;
    +
    }
    +
    Component Window(std::string title, Component component)
    +

    +menu_style

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <array> // for array
    +
    #include <chrono> // for milliseconds
    +
    #include <functional> // for function
    +
    #include <memory> // for __shared_ptr_access, shared_ptr, allocator
    +
    #include <string> // for string, char_traits, operator+, basic_string
    +
    #include <vector> // for vector
    +
    +
    #include "ftxui/component/animation.hpp" // for ElasticOut, Linear
    +
    #include "ftxui/component/component.hpp" // for Menu, Horizontal, Renderer, Vertical
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/component_options.hpp" // for MenuOption, EntryState, MenuEntryOption, AnimatedColorOption, AnimatedColorsOption, UnderlineOption
    +
    #include "ftxui/component/mouse.hpp" // for ftxui
    +
    #include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for separator, operator|, Element, text, bgcolor, hbox, bold, color, filler, border, vbox, borderDouble, dim, flex, hcenter
    +
    #include "ftxui/screen/color.hpp" // for Color, Color::Red, Color::Black, Color::Yellow, Color::Blue, Color::Default, Color::White
    +
    +
    using namespace ftxui;
    +
    +
    Component VMenu1(std::vector<std::string>* entries, int* selected);
    +
    Component VMenu2(std::vector<std::string>* entries, int* selected);
    +
    Component VMenu3(std::vector<std::string>* entries, int* selected);
    +
    Component VMenu4(std::vector<std::string>* entries, int* selected);
    +
    Component VMenu5(std::vector<std::string>* entries, int* selected);
    +
    Component VMenu6(std::vector<std::string>* entries, int* selected);
    +
    Component VMenu7(std::vector<std::string>* entries, int* selected);
    +
    Component VMenu8(std::vector<std::string>* entries, int* selected);
    +
    Component HMenu1(std::vector<std::string>* entries, int* selected);
    +
    Component HMenu2(std::vector<std::string>* entries, int* selected);
    +
    Component HMenu3(std::vector<std::string>* entries, int* selected);
    +
    Component HMenu4(std::vector<std::string>* entries, int* selected);
    +
    Component HMenu5(std::vector<std::string>* entries, int* selected);
    +
    +
    int main() {
    +
    auto screen = ScreenInteractive::TerminalOutput();
    +
    +
    std::vector<std::string> entries{
    +
    "Monkey", "Dog", "Cat", "Bird", "Elephant", "Cat",
    +
    };
    +
    std::array<int, 12> selected = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
    +
    +
    auto vmenu_1_ = VMenu1(&entries, &selected[0]);
    +
    auto vmenu_2_ = VMenu2(&entries, &selected[1]);
    +
    auto vmenu_3_ = VMenu3(&entries, &selected[2]);
    +
    auto vmenu_4_ = VMenu4(&entries, &selected[3]);
    +
    auto vmenu_5_ = VMenu5(&entries, &selected[4]);
    +
    auto vmenu_6_ = VMenu6(&entries, &selected[5]);
    +
    auto vmenu_7_ = VMenu7(&entries, &selected[6]);
    +
    auto vmenu_8_ = VMenu8(&entries, &selected[7]);
    +
    +
    auto hmenu_1_ = HMenu1(&entries, &selected[8]);
    +
    auto hmenu_2_ = HMenu2(&entries, &selected[9]);
    +
    auto hmenu_3_ = HMenu3(&entries, &selected[10]);
    +
    auto hmenu_4_ = HMenu4(&entries, &selected[11]);
    +
    auto hmenu_5_ = HMenu5(&entries, &selected[12]);
    +
    +
    auto container = Container::Vertical({
    +
    Container::Horizontal({
    +
    vmenu_1_,
    +
    vmenu_2_,
    +
    vmenu_3_,
    +
    vmenu_4_,
    +
    vmenu_5_,
    +
    vmenu_6_,
    +
    vmenu_7_,
    +
    vmenu_8_,
    +
    }),
    +
    hmenu_1_,
    +
    hmenu_2_,
    +
    hmenu_3_,
    +
    hmenu_4_,
    +
    hmenu_5_,
    +
    });
    +
    +
    auto renderer = Renderer(container, [&] {
    +
    return //
    +
    hbox({
    +
    vbox({
    +
    hbox({
    +
    vmenu_1_->Render(),
    +
    separator(),
    +
    vmenu_2_->Render(),
    +
    separator(),
    +
    vmenu_3_->Render(),
    +
    separator(),
    +
    vmenu_4_->Render(),
    +
    separator(),
    +
    vmenu_5_->Render(),
    +
    vmenu_6_->Render(),
    +
    separator(),
    +
    vmenu_7_->Render(),
    +
    separator(),
    +
    vmenu_8_->Render(),
    +
    }),
    +
    separator(),
    +
    hmenu_1_->Render(),
    +
    separator(),
    +
    hmenu_2_->Render(),
    +
    separator(),
    +
    hmenu_3_->Render(),
    +
    separator(),
    +
    hmenu_4_->Render(),
    +
    hmenu_5_->Render(),
    +
    }) | border,
    +
    filler(),
    +
    });
    +
    });
    +
    +
    screen.Loop(renderer);
    +
    }
    +
    +
    Component VMenu1(std::vector<std::string>* entries, int* selected) {
    +
    auto option = MenuOption::Vertical();
    +
    option.entries_option.transform = [](EntryState state) {
    +
    state.label = (state.active ? "> " : " ") + state.label;
    +
    Element e = text(state.label);
    +
    if (state.focused) {
    +
    e = e | bgcolor(Color::Blue);
    +
    }
    +
    if (state.active) {
    +
    e = e | bold;
    +
    }
    +
    return e;
    +
    };
    +
    return Menu(entries, selected, option);
    +
    }
    +
    +
    Component VMenu2(std::vector<std::string>* entries, int* selected) {
    +
    auto option = MenuOption::Vertical();
    +
    option.entries_option.transform = [](EntryState state) {
    +
    state.label += (state.active ? " <" : " ");
    +
    Element e = hbox(filler(), text(state.label));
    +
    if (state.focused) {
    +
    e = e | bgcolor(Color::Red);
    +
    }
    +
    if (state.active) {
    +
    e = e | bold;
    +
    }
    +
    return e;
    +
    };
    +
    return Menu(entries, selected, option);
    +
    }
    +
    +
    Component VMenu3(std::vector<std::string>* entries, int* selected) {
    +
    auto option = MenuOption::Vertical();
    +
    option.entries_option.transform = [](EntryState state) {
    +
    Element e = state.active ? text("[" + state.label + "]")
    +
    : text(" " + state.label + " ");
    +
    if (state.focused) {
    +
    e = e | bold;
    +
    }
    +
    +
    if (state.focused) {
    +
    e = e | color(Color::Blue);
    +
    }
    +
    if (state.active) {
    +
    e = e | bold;
    +
    }
    +
    return e;
    +
    };
    +
    return Menu(entries, selected, option);
    +
    }
    +
    +
    Component VMenu4(std::vector<std::string>* entries, int* selected) {
    +
    auto option = MenuOption::Vertical();
    +
    option.entries_option.transform = [](EntryState state) {
    +
    if (state.active && state.focused) {
    +
    return text(state.label) | color(Color::Yellow) | bgcolor(Color::Black) |
    +
    bold;
    +
    }
    +
    +
    if (state.active) {
    +
    return text(state.label) | color(Color::Yellow) | bgcolor(Color::Black);
    +
    }
    +
    if (state.focused) {
    +
    return text(state.label) | color(Color::Black) | bgcolor(Color::Yellow) |
    +
    bold;
    +
    }
    +
    return text(state.label) | color(Color::Black) | bgcolor(Color::Yellow);
    +
    };
    +
    return Menu(entries, selected, option);
    +
    }
    +
    +
    Component VMenu5(std::vector<std::string>* entries, int* selected) {
    +
    auto option = MenuOption::Vertical();
    +
    option.entries_option.transform = [](EntryState state) {
    +
    auto element = text(state.label);
    +
    if (state.active && state.focused) {
    +
    return element | borderDouble;
    +
    }
    +
    if (state.active) {
    +
    return element | border;
    +
    }
    +
    if (state.focused) {
    +
    return element | bold;
    +
    }
    +
    return element;
    +
    };
    +
    return Menu(entries, selected, option);
    +
    }
    +
    +
    Component VMenu6(std::vector<std::string>* entries, int* selected) {
    +
    auto option = MenuOption::VerticalAnimated();
    +
    option.underline.color_inactive = Color::Default;
    +
    option.underline.color_active = Color::Red;
    +
    option.underline.SetAnimationFunction(animation::easing::Linear);
    +
    return Menu(entries, selected, option);
    +
    }
    +
    +
    Component VMenu7(std::vector<std::string>* entries, int* selected) {
    +
    auto option = MenuOption::Vertical();
    +
    option.entries_option.animated_colors.foreground.enabled = true;
    +
    option.entries_option.animated_colors.background.enabled = true;
    +
    option.entries_option.animated_colors.background.active = Color::Red;
    +
    option.entries_option.animated_colors.background.inactive = Color::Black;
    +
    option.entries_option.animated_colors.foreground.active = Color::White;
    +
    option.entries_option.animated_colors.foreground.inactive = Color::Red;
    +
    return Menu(entries, selected, option);
    +
    }
    +
    +
    Component VMenu8(std::vector<std::string>* entries, int* selected) {
    +
    auto option = MenuOption::Vertical();
    +
    option.entries_option.animated_colors.foreground.Set(
    +
    Color::Red, Color::White, std::chrono::milliseconds(500));
    +
    return Menu(entries, selected, option);
    +
    }
    +
    +
    Component HMenu1(std::vector<std::string>* entries, int* selected) {
    +
    return Menu(entries, selected, MenuOption::Horizontal());
    +
    }
    +
    +
    Component HMenu2(std::vector<std::string>* entries, int* selected) {
    +
    return Menu(entries, selected, MenuOption::Toggle());
    +
    }
    +
    +
    Component HMenu3(std::vector<std::string>* entries, int* selected) {
    +
    auto option = MenuOption::Toggle();
    +
    option.elements_infix = [] { return text(" 🮣🮠 "); };
    +
    +
    return Menu(entries, selected, option);
    +
    }
    +
    +
    Component HMenu4(std::vector<std::string>* entries, int* selected) {
    +
    return Menu(entries, selected, MenuOption::HorizontalAnimated());
    +
    }
    +
    +
    Component HMenu5(std::vector<std::string>* entries, int* selected) {
    +
    auto option = MenuOption::HorizontalAnimated();
    +
    option.underline.SetAnimation(std::chrono::milliseconds(1500),
    +
    animation::easing::ElasticOut);
    +
    option.entries_option.transform = [](EntryState state) {
    +
    Element e = text(state.label) | hcenter | flex;
    +
    if (state.active && state.focused) {
    +
    e = e | bold;
    +
    }
    +
    if (!state.focused && !state.active) {
    +
    e = e | dim;
    +
    }
    +
    return e;
    +
    };
    +
    option.underline.color_inactive = Color::Default;
    +
    option.underline.color_active = Color::Red;
    +
    return Menu(entries, selected, option);
    +
    }
    + +
    void Set(Color inactive, Color active, animation::Duration duration=std::chrono::milliseconds(250), animation::easing::Function function=animation::easing::QuadraticInOut)
    A color option that can be animated. @params _inactive The color when the component is inactive....
    +
    Component HMenu5(std::vector< std::string > *entries, int *selected)
    +
    Component HMenu4(std::vector< std::string > *entries, int *selected)
    +
    Component VMenu5(std::vector< std::string > *entries, int *selected)
    +
    Component HMenu1(std::vector< std::string > *entries, int *selected)
    +
    Component HMenu2(std::vector< std::string > *entries, int *selected)
    +
    Component VMenu2(std::vector< std::string > *entries, int *selected)
    +
    Component HMenu3(std::vector< std::string > *entries, int *selected)
    +
    Component VMenu1(std::vector< std::string > *entries, int *selected)
    +
    Component VMenu3(std::vector< std::string > *entries, int *selected)
    +
    Component VMenu6(std::vector< std::string > *entries, int *selected)
    +
    Component VMenu7(std::vector< std::string > *entries, int *selected)
    +
    Component VMenu8(std::vector< std::string > *entries, int *selected)
    +
    Component VMenu4(std::vector< std::string > *entries, int *selected)
    +

    +menu_underline_animated_gallery

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <chrono> // for operator""ms, literals
    +
    #include <memory> // for allocator, shared_ptr, __shared_ptr_access
    +
    #include <string> // for string, operator+, to_string, basic_string
    +
    #include <vector> // for vector
    +
    +
    #include "ftxui/component/animation.hpp" // for BackOut, Duration
    +
    #include "ftxui/component/component.hpp" // for Menu, Renderer, Vertical
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/component_options.hpp" // for MenuOption, UnderlineOption
    +
    #include "ftxui/component/mouse.hpp" // for ftxui
    +
    #include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for text, Element, operator|, borderEmpty, inverted
    +
    #include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Red
    +
    +
    using namespace ftxui;
    +
    + +
    return Renderer([id](bool focused) {
    +
    auto t = text("component " + std::to_string(id));
    +
    if (focused) {
    +
    t = t | inverted;
    +
    }
    +
    return t;
    +
    });
    +
    }
    +
    +
    Component Text(const std::string& t) {
    +
    return Renderer([t] { return text(t) | borderEmpty; });
    +
    }
    +
    +
    int main() {
    +
    using namespace std::literals;
    +
    std::vector<std::string> tab_values{
    +
    "Tab 1", "Tab 2", "Tab 3", "A very very long tab", "탭",
    +
    };
    +
    int tab_selected = 0;
    +
    +
    auto container = Container::Vertical({});
    +
    +
    int frame_count = 0;
    +
    container->Add(Renderer(
    +
    [&] { return text("Frame count: " + std::to_string(frame_count++)); }));
    +
    +
    {
    +
    auto option = MenuOption::HorizontalAnimated();
    +
    container->Add(Text("This demonstrate the Menu component"));
    +
    container->Add(Menu(&tab_values, &tab_selected, option));
    +
    }
    +
    +
    {
    +
    container->Add(Text("Set underline color to blue"));
    +
    auto option = MenuOption::HorizontalAnimated();
    +
    option.underline.color_inactive = Color::Blue;
    +
    container->Add(Menu(&tab_values, &tab_selected, option));
    +
    }
    +
    +
    {
    +
    container->Add(Text("Set underline active color to red"));
    +
    auto option = MenuOption::HorizontalAnimated();
    +
    option.underline.color_active = Color::Red;
    +
    container->Add(Menu(&tab_values, &tab_selected, option));
    +
    }
    +
    +
    {
    +
    container->Add(Text("Set animation duration to 0ms"));
    +
    auto option = MenuOption::HorizontalAnimated();
    +
    option.underline.SetAnimationDuration(0ms);
    +
    container->Add(Menu(&tab_values, &tab_selected, option));
    +
    }
    +
    +
    {
    +
    container->Add(Text("Set animation easing function to back-out"));
    +
    auto option = MenuOption::HorizontalAnimated();
    +
    option.underline.SetAnimationFunction(animation::easing::BackOut);
    +
    option.underline.SetAnimationDuration(350ms);
    +
    container->Add(Menu(&tab_values, &tab_selected, option));
    +
    }
    +
    +
    // option.underline_animation_follower_delay = 250ms
    +
    {
    +
    container->Add(Text("Add delay to desynchronize animation"));
    +
    auto option = MenuOption::HorizontalAnimated();
    +
    option.underline.follower_delay = 250ms;
    +
    container->Add(Menu(&tab_values, &tab_selected, option));
    +
    }
    +
    +
    container->SetActiveChild(container->ChildAt(2));
    +
    +
    auto screen = ScreenInteractive::TerminalOutput();
    +
    screen.Loop(container);
    +
    }
    + + +

    +modal_dialog

    +

    Demo

    // Copyright 2022 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <ftxui/component/component_options.hpp> // for ButtonOption
    +
    #include <ftxui/component/mouse.hpp> // for ftxui
    +
    #include <functional> // for function
    +
    #include <memory> // for allocator, shared_ptr
    +
    +
    #include "ftxui/component/component.hpp" // for Button, operator|=, Renderer, Vertical, Modal
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive, Component
    +
    #include "ftxui/dom/elements.hpp" // for operator|, separator, text, size, Element, vbox, border, GREATER_THAN, WIDTH, center, HEIGHT
    +
    +
    using namespace ftxui;
    +
    +
    auto button_style = ButtonOption::Animated();
    +
    +
    // Definition of the main component. The details are not important.
    +
    Component MainComponent(std::function<void()> show_modal,
    +
    std::function<void()> exit) {
    +
    auto component = Container::Vertical({
    +
    Button("Show modal", show_modal, button_style),
    +
    Button("Quit", exit, button_style),
    +
    });
    +
    // Polish how the two buttons are rendered:
    +
    component |= Renderer([&](Element inner) {
    +
    return vbox({
    +
    text("Main component"),
    +
    separator(),
    +
    inner,
    +
    }) //
    +
    | size(WIDTH, GREATER_THAN, 15) //
    +
    | size(HEIGHT, GREATER_THAN, 15) //
    +
    | border //
    +
    | center; //
    +
    });
    +
    return component;
    +
    }
    +
    +
    // Definition of the modal component. The details are not important.
    +
    Component ModalComponent(std::function<void()> do_nothing,
    +
    std::function<void()> hide_modal) {
    +
    auto component = Container::Vertical({
    +
    Button("Do nothing", do_nothing, button_style),
    +
    Button("Quit modal", hide_modal, button_style),
    +
    });
    +
    // Polish how the two buttons are rendered:
    +
    component |= Renderer([&](Element inner) {
    +
    return vbox({
    +
    text("Modal component "),
    +
    separator(),
    +
    inner,
    +
    }) //
    +
    | size(WIDTH, GREATER_THAN, 30) //
    +
    | border; //
    +
    });
    +
    return component;
    +
    }
    +
    +
    int main(int argc, const char* argv[]) {
    +
    auto screen = ScreenInteractive::TerminalOutput();
    +
    +
    // State of the application:
    +
    bool modal_shown = false;
    +
    +
    // Some actions modifying the state:
    +
    auto show_modal = [&] { modal_shown = true; };
    +
    auto hide_modal = [&] { modal_shown = false; };
    +
    auto exit = screen.ExitLoopClosure();
    +
    auto do_nothing = [&] {};
    +
    +
    // Instanciate the main and modal components:
    +
    auto main_component = MainComponent(show_modal, exit);
    +
    auto modal_component = ModalComponent(do_nothing, hide_modal);
    +
    +
    // Use the `Modal` function to use together the main component and its modal
    +
    // window. The |modal_shown| boolean controls whether the modal is shown or
    +
    // not.
    +
    main_component |= Modal(modal_component, &modal_shown);
    +
    +
    screen.Loop(main_component);
    +
    return 0;
    +
    }
    +
    auto button_style
    +
    Component ModalComponent(std::function< void()> do_nothing, std::function< void()> hide_modal)
    +
    Component MainComponent(std::function< void()> show_modal, std::function< void()> exit)
    +

    +modal_dialog_custom

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <memory> // for allocator, shared_ptr, __shared_ptr_access
    +
    #include <string> // for string, basic_string, char_traits, operator+
    +
    #include <vector> // for vector
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Button, Renderer, Horizontal, Tab
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for operator|, Element, filler, text, hbox, separator, center, vbox, bold, border, clear_under, dbox, size, GREATER_THAN, HEIGHT
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    auto screen = ScreenInteractive::TerminalOutput();
    +
    +
    // There are two layers. One at depth = 0 and the modal window at depth = 1;
    +
    int depth = 0;
    +
    +
    // The current rating of FTXUI.
    +
    std::string rating = "3/5 stars";
    +
    +
    // At depth=0, two buttons. One for rating FTXUI and one for quitting.
    +
    auto button_rate_ftxui = Button("Rate FTXUI", [&] { depth = 1; });
    +
    auto button_quit = Button("Quit", screen.ExitLoopClosure());
    +
    +
    auto depth_0_container = Container::Horizontal({
    +
    button_rate_ftxui,
    +
    button_quit,
    +
    });
    +
    auto depth_0_renderer = Renderer(depth_0_container, [&] {
    +
    return vbox({
    +
    text("Modal dialog example"),
    +
    separator(),
    +
    text("☆☆☆ FTXUI:" + rating + " ☆☆☆") | bold,
    +
    filler(),
    +
    hbox({
    +
    button_rate_ftxui->Render(),
    +
    filler(),
    +
    button_quit->Render(),
    +
    }),
    +
    }) |
    +
    border | size(HEIGHT, GREATER_THAN, 18) | center;
    +
    });
    +
    +
    // At depth=1, The "modal" window.
    +
    std::vector<std::string> rating_labels = {
    +
    "1/5 stars", "2/5 stars", "3/5 stars", "4/5 stars", "5/5 stars",
    +
    };
    +
    auto on_rating = [&](std::string new_rating) {
    +
    rating = new_rating;
    +
    depth = 0;
    +
    };
    +
    auto depth_1_container = Container::Horizontal({
    +
    Button(&rating_labels[0], [&] { on_rating(rating_labels[0]); }),
    +
    Button(&rating_labels[1], [&] { on_rating(rating_labels[1]); }),
    +
    Button(&rating_labels[2], [&] { on_rating(rating_labels[2]); }),
    +
    Button(&rating_labels[3], [&] { on_rating(rating_labels[3]); }),
    +
    Button(&rating_labels[4], [&] { on_rating(rating_labels[4]); }),
    +
    });
    +
    +
    auto depth_1_renderer = Renderer(depth_1_container, [&] {
    +
    return vbox({
    +
    text("Do you like FTXUI?"),
    +
    separator(),
    +
    hbox(depth_1_container->Render()),
    +
    }) |
    +
    border;
    +
    });
    +
    +
    auto main_container = Container::Tab(
    +
    {
    +
    depth_0_renderer,
    +
    depth_1_renderer,
    +
    },
    +
    &depth);
    +
    +
    auto main_renderer = Renderer(main_container, [&] {
    +
    Element document = depth_0_renderer->Render();
    +
    +
    if (depth == 1) {
    +
    document = dbox({
    +
    document,
    +
    depth_1_renderer->Render() | clear_under | center,
    +
    });
    +
    }
    +
    return document;
    +
    });
    +
    +
    screen.Loop(main_renderer);
    +
    return 0;
    +
    }
    +

    +nested_screen

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <memory> // for allocator, shared_ptr, __shared_ptr_access
    +
    #include <string> // for operator+, string, char_traits, basic_string
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Button, Vertical, Renderer
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for separator, text, Element, operator|, vbox, border
    +
    +
    using namespace ftxui;
    +
    +
    void Nested(std::string path) {
    +
    auto screen = ScreenInteractive::FitComponent();
    +
    auto back_button = Button("Back", screen.ExitLoopClosure());
    +
    auto goto_1 = Button("Goto /1", [path] { Nested(path + "/1"); });
    +
    auto goto_2 = Button("Goto /2", [path] { Nested(path + "/2"); });
    +
    auto goto_3 = Button("Goto /3", [path] { Nested(path + "/3"); });
    +
    auto layout = Container::Vertical({
    +
    back_button,
    +
    goto_1,
    +
    goto_2,
    +
    goto_3,
    +
    });
    +
    auto renderer = Renderer(layout, [&] {
    +
    return vbox({
    +
    text("path: " + path),
    +
    separator(),
    +
    back_button->Render(),
    +
    goto_1->Render(),
    +
    goto_2->Render(),
    +
    goto_3->Render(),
    +
    }) |
    +
    border;
    +
    });
    +
    screen.Loop(renderer);
    +
    }
    +
    +
    int main() {
    +
    auto screen = ScreenInteractive::FitComponent();
    +
    auto button_quit = Button("Quit", screen.ExitLoopClosure());
    +
    auto button_nested = Button("Nested", [] { Nested(""); });
    +
    screen.Loop(Container::Vertical({
    +
    button_quit,
    +
    button_nested,
    +
    }));
    +
    return 0;
    +
    }
    +
    void Nested(std::string path)
    +

    +print_key_press

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    +
    #include <stddef.h> // for size_t
    +
    #include <algorithm> // for max
    +
    #include <memory> // for allocator, shared_ptr
    +
    #include <string> // for char_traits, operator+, string, basic_string, to_string
    +
    #include <utility> // for move
    +
    #include <vector> // for vector
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for CatchEvent, Renderer
    +
    #include "ftxui/component/event.hpp" // for Event
    +
    #include "ftxui/component/mouse.hpp" // for Mouse, Mouse::Left, Mouse::Middle, Mouse::None, Mouse::Pressed, Mouse::Released, Mouse::Right, Mouse::WheelDown, Mouse::WheelUp
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for text, vbox, window, Element, Elements
    +
    +
    using namespace ftxui;
    +
    +
    std::string Code(Event event) {
    +
    std::string codes;
    +
    for (auto& it : event.input()) {
    +
    codes += " " + std::to_string((unsigned int)it);
    +
    }
    +
    return codes;
    +
    }
    +
    +
    int main() {
    +
    auto screen = ScreenInteractive::TerminalOutput();
    +
    +
    std::vector<Event> keys;
    +
    +
    auto left_column = Renderer([&] {
    +
    Elements children = {
    +
    text("Codes"),
    +
    separator(),
    +
    };
    +
    for (size_t i = std::max(0, (int)keys.size() - 20); i < keys.size(); ++i) {
    +
    children.push_back(text(Code(keys[i])));
    +
    }
    +
    return vbox(children);
    +
    });
    +
    +
    auto right_column = Renderer([&] {
    +
    Elements children = {
    +
    text("Event"),
    +
    separator(),
    +
    };
    +
    for (size_t i = std::max(0, (int)keys.size() - 20); i < keys.size(); ++i) {
    +
    children.push_back(text(keys[i].DebugString()));
    +
    }
    +
    return vbox(children);
    +
    });
    +
    +
    int split_size = 40;
    +
    auto component = ResizableSplitLeft(left_column, right_column, &split_size);
    +
    component |= border;
    +
    +
    component |= CatchEvent([&](Event event) {
    +
    keys.push_back(event);
    +
    return false;
    +
    });
    +
    +
    screen.Loop(component);
    +
    }
    +
    const std::string & input() const
    Definition event.hpp:104
    +
    std::string Code(Event event)
    +

    +radiobox

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <string> // for string, allocator, basic_string
    +
    #include <vector> // for vector
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Radiobox
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    +
    using namespace ftxui;
    +
    +
    int main() {
    +
    std::vector<std::string> radiobox_list = {
    +
    "Use gcc",
    +
    "Use clang",
    +
    "Use emscripten",
    +
    "Use tcc",
    +
    };
    +
    int selected = 0;
    +
    +
    auto screen = ScreenInteractive::TerminalOutput();
    +
    screen.Loop(Radiobox(&radiobox_list, &selected));
    +
    return 0;
    +
    }
    +

    +radiobox_in_frame

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <memory> // for shared_ptr, __shared_ptr_access
    +
    #include <string> // for string, basic_string, operator+, to_string
    +
    #include <vector> // for vector
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Radiobox, Renderer
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, HEIGHT, LESS_THAN
    +
    +
    using namespace ftxui;
    +
    +
    int main() {
    +
    std::vector<std::string> entries;
    +
    int selected = 0;
    +
    +
    for (int i = 0; i < 30; ++i) {
    +
    entries.push_back("RadioBox " + std::to_string(i));
    +
    }
    +
    auto radiobox = Radiobox(&entries, &selected);
    +
    auto renderer = Renderer(radiobox, [&] {
    +
    return radiobox->Render() | vscroll_indicator | frame |
    +
    size(HEIGHT, LESS_THAN, 10) | border;
    +
    });
    +
    +
    auto screen = ScreenInteractive::FitComponent();
    +
    screen.Loop(renderer);
    +
    +
    return 0;
    +
    }
    +

    +renderer

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <memory> // for shared_ptr, allocator, __shared_ptr_access
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Renderer, Button, Vertical
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for operator|, Element, text, bold, border, center, color
    +
    #include "ftxui/screen/color.hpp" // for Color, Color::Red
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    auto screen = ScreenInteractive::FitComponent();
    +
    +
    // A Renderer() is a component using a lambda function as a parameter to
    +
    // render itself.
    +
    +
    // 1. Example of focusable renderer:
    +
    auto renderer_focusable = Renderer([](bool focused) {
    +
    if (focused) {
    +
    return text("FOCUSABLE RENDERER()") | center | bold | border;
    +
    } else {
    +
    return text(" Focusable renderer() ") | center | border;
    +
    }
    +
    });
    +
    +
    // 2. Examples of a non focusable renderer.
    +
    auto renderer_non_focusable = Renderer([&] {
    +
    return text("~~~~~ Non Focusable renderer() ~~~~~"); //
    +
    });
    +
    +
    // 3. Renderer can wrap other components to redefine their Render() function.
    +
    auto button = Button("Wrapped quit button", screen.ExitLoopClosure());
    +
    auto renderer_wrap = Renderer(button, [&] {
    +
    if (button->Focused()) {
    +
    return button->Render() | bold | color(Color::Red);
    +
    } else {
    +
    return button->Render();
    +
    }
    +
    });
    +
    +
    // Let's renderer everyone:
    +
    screen.Loop(Container::Vertical({
    +
    renderer_focusable,
    +
    renderer_non_focusable,
    +
    renderer_wrap,
    +
    }));
    +
    }
    +

    +resizable_split

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <memory> // for shared_ptr, allocator, __shared_ptr_access
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Renderer, ResizableSplitBottom, ResizableSplitLeft, ResizableSplitRight, ResizableSplitTop
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for Element, operator|, text, center, border
    +
    +
    using namespace ftxui;
    +
    +
    int main() {
    +
    auto screen = ScreenInteractive::Fullscreen();
    +
    +
    auto middle = Renderer([] { return text("middle") | center; });
    +
    auto left = Renderer([] { return text("Left") | center; });
    +
    auto right = Renderer([] { return text("right") | center; });
    +
    auto top = Renderer([] { return text("top") | center; });
    +
    auto bottom = Renderer([] { return text("bottom") | center; });
    +
    +
    int left_size = 20;
    +
    int right_size = 20;
    +
    int top_size = 10;
    +
    int bottom_size = 10;
    +
    +
    auto container = middle;
    +
    container = ResizableSplitLeft(left, container, &left_size);
    +
    container = ResizableSplitRight(right, container, &right_size);
    +
    container = ResizableSplitTop(top, container, &top_size);
    +
    container = ResizableSplitBottom(bottom, container, &bottom_size);
    +
    +
    auto renderer =
    +
    Renderer(container, [&] { return container->Render() | border; });
    +
    +
    screen.Loop(renderer);
    +
    }
    +
    std::uint8_t top
    Definition screen.cpp:131
    +
    std::uint8_t left
    Definition screen.cpp:130
    +
    std::uint8_t right
    Definition screen.cpp:132
    +

    +scrollbar

    +

    Demo

    // Copyright 2023 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    + + +
    #include <string>
    +
    +
    using namespace ftxui;
    +
    + +
    class Impl : public ComponentBase {
    +
    private:
    +
    float scroll_x = 0.1;
    +
    float scroll_y = 0.1;
    +
    +
    public:
    +
    Impl() {
    +
    auto content = Renderer([=] {
    +
    const std::string lorem =
    +
    "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed "
    +
    "do eiusmod tempor incididunt ut labore et dolore magna "
    +
    "aliqua. Ut enim ad minim veniam, quis nostrud exercitation "
    +
    "ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis "
    +
    "aute irure dolor in reprehenderit in voluptate velit esse "
    +
    "cillum dolore eu fugiat nulla pariatur. Excepteur sint "
    +
    "occaecat cupidatat non proident, sunt in culpa qui officia "
    +
    "deserunt mollit anim id est laborum.";
    +
    return vbox({
    +
    text(lorem.substr(0, -1)), text(lorem.substr(5, -1)), text(""),
    +
    text(lorem.substr(10, -1)), text(lorem.substr(15, -1)), text(""),
    +
    text(lorem.substr(20, -1)), text(lorem.substr(25, -1)), text(""),
    +
    text(lorem.substr(30, -1)), text(lorem.substr(35, -1)), text(""),
    +
    text(lorem.substr(40, -1)), text(lorem.substr(45, -1)), text(""),
    +
    text(lorem.substr(50, -1)), text(lorem.substr(55, -1)), text(""),
    +
    text(lorem.substr(60, -1)), text(lorem.substr(65, -1)), text(""),
    +
    text(lorem.substr(70, -1)), text(lorem.substr(75, -1)), text(""),
    +
    text(lorem.substr(80, -1)), text(lorem.substr(85, -1)), text(""),
    +
    text(lorem.substr(90, -1)), text(lorem.substr(95, -1)), text(""),
    +
    text(lorem.substr(100, -1)), text(lorem.substr(105, -1)), text(""),
    +
    text(lorem.substr(110, -1)), text(lorem.substr(115, -1)), text(""),
    +
    text(lorem.substr(120, -1)), text(lorem.substr(125, -1)), text(""),
    +
    text(lorem.substr(130, -1)), text(lorem.substr(135, -1)), text(""),
    +
    text(lorem.substr(140, -1)),
    +
    });
    +
    });
    +
    +
    auto scrollable_content = Renderer(content, [&, content] {
    +
    return content->Render() | focusPositionRelative(scroll_x, scroll_y) |
    +
    frame | flex;
    +
    });
    +
    + +
    option_x.value = &scroll_x;
    +
    option_x.min = 0.f;
    +
    option_x.max = 1.f;
    +
    option_x.increment = 0.1f;
    +
    option_x.direction = Direction::Right;
    +
    option_x.color_active = Color::Blue;
    +
    option_x.color_inactive = Color::BlueLight;
    +
    auto scrollbar_x = Slider(option_x);
    +
    + +
    option_y.value = &scroll_y;
    +
    option_y.min = 0.f;
    +
    option_y.max = 1.f;
    +
    option_y.increment = 0.1f;
    +
    option_y.direction = Direction::Down;
    +
    option_y.color_active = Color::Yellow;
    +
    option_y.color_inactive = Color::YellowLight;
    +
    auto scrollbar_y = Slider(option_y);
    +
    +
    Add(Container::Vertical({
    +
    Container::Horizontal({
    +
    scrollable_content,
    +
    scrollbar_y,
    +
    }) | flex,
    +
    Container::Horizontal({
    +
    scrollbar_x,
    +
    Renderer([] { return text(L"x"); }),
    +
    }),
    +
    }));
    +
    }
    +
    };
    +
    return Make<Impl>();
    +
    }
    +
    +
    int main() {
    +
    auto window_1 = Window({
    +
    .inner = DummyWindowContent(),
    +
    .title = "First window",
    +
    .width = 80,
    +
    .height = 30,
    +
    });
    +
    +
    auto window_2 = Window({
    +
    .inner = DummyWindowContent(),
    +
    .title = "My window",
    +
    .left = 40,
    +
    .top = 20,
    +
    .width = 80,
    +
    .height = 30,
    +
    });
    +
    +
    auto window_container = Container::Stacked({
    +
    window_1,
    +
    window_2,
    +
    });
    +
    +
    auto screen = ScreenInteractive::Fullscreen();
    +
    screen.Loop(window_container);
    +
    +
    return EXIT_SUCCESS;
    +
    }
    +
    It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ft...
    +
    Component DummyWindowContent()
    Definition scrollbar.cpp:10
    + + + + + + + + +

    +selection

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <string> // for char_traits, operator+, string, basic_string
    +
    +
    #include "ftxui/component/component.hpp" // for Input, Renderer, Vertical
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/component_options.hpp" // for InputOption
    +
    #include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for text, hbox, separator, Element, operator|, vbox, border
    +
    #include "ftxui/util/ref.hpp" // for Ref
    +
    +
    using namespace ftxui;
    +
    + +
    return vbox({
    +
    text("FTXUI: A powerful library for building user interfaces."),
    +
    text("Enjoy a rich set of components and a declarative style."),
    +
    text("Create beautiful and responsive UIs with minimal effort."),
    +
    text("Join the community and experience the power of FTXUI."),
    +
    });
    +
    }
    +
    +
    int main() {
    +
    auto screen = ScreenInteractive::TerminalOutput();
    +
    +
    auto quit =
    +
    Button("Quit", screen.ExitLoopClosure(), ButtonOption::Animated());
    +
    +
    int selection_change_counter = 0;
    +
    std::string selection_content = "";
    +
    screen.SelectionChange([&] {
    +
    selection_change_counter++;
    +
    selection_content = screen.GetSelection();
    +
    });
    +
    +
    // The components:
    +
    auto renderer = Renderer(quit, [&] {
    +
    return vbox({
    +
    text("Select changed: " + std::to_string(selection_change_counter) +
    +
    " times"),
    +
    text("Currently selected: "),
    +
    paragraph(selection_content) | vscroll_indicator | frame | border |
    +
    size(HEIGHT, EQUAL, 10),
    +
    window(text("Horizontal split"), hbox({
    + +
    separator(),
    + +
    separator(),
    + +
    })),
    +
    window(text("Vertical split"), vbox({
    + +
    separator(),
    + +
    separator(),
    + +
    })),
    +
    window(text("Grid split with different style"),
    +
    vbox({
    +
    hbox({
    + +
    separator(),
    + +
    | selectionBackgroundColor(Color::Yellow) //
    +
    | selectionColor(Color::Black) //
    +
    | selectionStyleReset,
    +
    separator(),
    +
    LoremIpsum() | selectionColor(Color::Blue),
    +
    }),
    +
    separator(),
    +
    hbox({
    +
    LoremIpsum() | selectionColor(Color::Red),
    +
    separator(),
    +
    LoremIpsum() | selectionStyle([](Pixel& pixel) {
    +
    pixel.underlined_double = true;
    +
    }),
    +
    separator(),
    + +
    }),
    +
    })),
    +
    quit->Render(),
    +
    });
    +
    });
    +
    +
    screen.Loop(renderer);
    +
    }
    +
    Element LoremIpsum()
    +
    bool underlined_double
    Definition pixel.hpp:34
    +

    +slider

    +

    Demo

    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Slider
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    +
    using namespace ftxui;
    +
    +
    int main() {
    +
    auto screen = ScreenInteractive::TerminalOutput();
    +
    int value = 50;
    +
    auto slider = Slider("Value:", &value, 0, 100, 1);
    +
    screen.Loop(slider);
    +
    }
    +
    +
    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +

    +slider_direction

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <array> // for array
    +
    #include <cmath> // for sin
    +
    #include <ftxui/component/component_base.hpp> // for ComponentBase
    +
    #include <ftxui/component/component_options.hpp> // for SliderOption
    +
    #include <ftxui/dom/direction.hpp> // for Direction, Direction::Up
    +
    #include <ftxui/dom/elements.hpp> // for size, GREATER_THAN, HEIGHT
    +
    #include <ftxui/util/ref.hpp> // for ConstRef, Ref
    +
    #include <memory> // for shared_ptr, __shared_ptr_access
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Horizontal, Slider, operator|=
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    +
    using namespace ftxui;
    +
    +
    int main() {
    +
    auto screen = ScreenInteractive::TerminalOutput();
    +
    std::array<int, 30> values;
    +
    for (size_t i = 0; i < values.size(); ++i) {
    +
    values[i] = 50 + 20 * std::sin(i * 0.3);
    +
    }
    +
    +
    auto layout_horizontal = Container::Horizontal({});
    +
    for (auto& value : values) {
    +
    // In C++17:
    + +
    option.value = &value;
    +
    option.max = 100;
    +
    option.increment = 5;
    +
    option.direction = Direction::Up;
    +
    layout_horizontal->Add(Slider<int>(option));
    +
    +
    /* In C++20:
    +
    layout_horizontal->Add(Slider<int>({
    +
    .value = &values[i],
    +
    .max = 100,
    +
    .increment = 5,
    +
    .direction = Direction::Up,
    +
    }));
    +
    */
    +
    }
    +
    +
    layout_horizontal |= size(HEIGHT, GREATER_THAN, 20);
    +
    +
    screen.Loop(layout_horizontal);
    +
    }
    + +

    +slider_rgb

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <memory> // for allocator, shared_ptr, __shared_ptr_access
    +
    #include <string> // for char_traits, operator+, to_string
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Slider, Renderer, Vertical
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for separator, operator|, Element, size, text, vbox, xflex, bgcolor, hbox, GREATER_THAN, WIDTH, border, HEIGHT, LESS_THAN
    +
    #include "ftxui/screen/color.hpp" // for Color
    +
    +
    using namespace ftxui;
    +
    +
    Element ColorTile(int red, int green, int blue) {
    +
    return text("") | size(WIDTH, GREATER_THAN, 14) |
    +
    size(HEIGHT, GREATER_THAN, 7) | bgcolor(Color::RGB(red, green, blue));
    +
    }
    +
    +
    Element ColorString(int red, int green, int blue) {
    +
    return text("RGB = (" + //
    +
    std::to_string(red) + "," + //
    +
    std::to_string(green) + "," + //
    +
    std::to_string(blue) + ")" //
    +
    );
    +
    }
    +
    +
    int main() {
    +
    int red = 128;
    +
    int green = 25;
    +
    int blue = 100;
    +
    auto slider_red = Slider("Red :", &red, 0, 255, 1);
    +
    auto slider_green = Slider("Green:", &green, 0, 255, 1);
    +
    auto slider_blue = Slider("Blue :", &blue, 0, 255, 1);
    +
    +
    auto container = Container::Vertical({
    +
    slider_red,
    +
    slider_green,
    +
    slider_blue,
    +
    });
    +
    +
    auto renderer = Renderer(container, [&] {
    +
    return hbox({
    +
    ColorTile(red, green, blue),
    +
    separator(),
    +
    vbox({
    +
    slider_red->Render(),
    +
    separator(),
    +
    slider_green->Render(),
    +
    separator(),
    +
    slider_blue->Render(),
    +
    separator(),
    +
    ColorString(red, green, blue),
    +
    }) | xflex,
    +
    }) |
    +
    border | size(WIDTH, LESS_THAN, 80);
    +
    });
    +
    auto screen = ScreenInteractive::TerminalOutput();
    +
    screen.Loop(renderer);
    +
    }
    +
    Element ColorTile(int red, int green, int blue)
    +
    Element ColorString(int red, int green, int blue)
    +

    +tab_horizontal

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <memory> // for allocator, __shared_ptr_access, shared_ptr
    +
    #include <string> // for string, basic_string
    +
    #include <vector> // for vector
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Radiobox, Renderer, Tab, Toggle, Vertical
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for Element, separator, operator|, vbox, border
    +
    +
    using namespace ftxui;
    +
    +
    int main() {
    +
    std::vector<std::string> tab_values{
    +
    "tab_1",
    +
    "tab_2",
    +
    "tab_3",
    +
    };
    +
    int tab_selected = 0;
    +
    auto tab_toggle = Toggle(&tab_values, &tab_selected);
    +
    +
    std::vector<std::string> tab_1_entries{
    +
    "Forest",
    +
    "Water",
    +
    "I don't know",
    +
    };
    +
    int tab_1_selected = 0;
    +
    +
    std::vector<std::string> tab_2_entries{
    +
    "Hello",
    +
    "Hi",
    +
    "Hay",
    +
    };
    +
    int tab_2_selected = 0;
    +
    +
    std::vector<std::string> tab_3_entries{
    +
    "Table",
    +
    "Nothing",
    +
    "Is",
    +
    "Empty",
    +
    };
    +
    int tab_3_selected = 0;
    +
    auto tab_container = Container::Tab(
    +
    {
    +
    Radiobox(&tab_1_entries, &tab_1_selected),
    +
    Radiobox(&tab_2_entries, &tab_2_selected),
    +
    Radiobox(&tab_3_entries, &tab_3_selected),
    +
    },
    +
    &tab_selected);
    +
    +
    auto container = Container::Vertical({
    +
    tab_toggle,
    +
    tab_container,
    +
    });
    +
    +
    auto renderer = Renderer(container, [&] {
    +
    return vbox({
    +
    tab_toggle->Render(),
    +
    separator(),
    +
    tab_container->Render(),
    +
    }) |
    +
    border;
    +
    });
    +
    +
    auto screen = ScreenInteractive::TerminalOutput();
    +
    screen.Loop(renderer);
    +
    }
    +

    +tab_vertical

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <memory> // for allocator, __shared_ptr_access, shared_ptr
    +
    #include <string> // for string, basic_string
    +
    #include <vector> // for vector
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Radiobox, Horizontal, Menu, Renderer, Tab
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for Element, separator, hbox, operator|, border
    +
    +
    using namespace ftxui;
    +
    +
    int main() {
    +
    std::vector<std::string> tab_values{
    +
    "tab_1",
    +
    "tab_2",
    +
    "tab_3",
    +
    };
    +
    int tab_selected = 0;
    +
    auto tab_menu = Menu(&tab_values, &tab_selected);
    +
    +
    std::vector<std::string> tab_1_entries{
    +
    "Forest",
    +
    "Water",
    +
    "I don't know",
    +
    };
    +
    int tab_1_selected = 0;
    +
    +
    std::vector<std::string> tab_2_entries{
    +
    "Hello",
    +
    "Hi",
    +
    "Hay",
    +
    };
    +
    int tab_2_selected = 0;
    +
    +
    std::vector<std::string> tab_3_entries{
    +
    "Table",
    +
    "Nothing",
    +
    "Is",
    +
    "Empty",
    +
    };
    +
    int tab_3_selected = 0;
    +
    auto tab_container = Container::Tab(
    +
    {
    +
    Radiobox(&tab_1_entries, &tab_1_selected),
    +
    Radiobox(&tab_2_entries, &tab_2_selected),
    +
    Radiobox(&tab_3_entries, &tab_3_selected),
    +
    },
    +
    &tab_selected);
    +
    +
    auto container = Container::Horizontal({
    +
    tab_menu,
    +
    tab_container,
    +
    });
    +
    +
    auto renderer = Renderer(container, [&] {
    +
    return hbox({
    +
    tab_menu->Render(),
    +
    separator(),
    +
    tab_container->Render(),
    +
    }) |
    +
    border;
    +
    });
    +
    +
    auto screen = ScreenInteractive::TerminalOutput();
    +
    screen.Loop(renderer);
    +
    }
    +

    +textarea

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <memory> // for allocator, __shared_ptr_access, shared_ptr
    +
    #include <string> // for string
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Input, Renderer, ResizableSplitLeft
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase, Component
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for operator|, separator, text, Element, flex, vbox, border
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    +
    std::string content_1;
    +
    std::string content_2;
    +
    auto textarea_1 = Input(&content_1);
    +
    auto textarea_2 = Input(&content_2);
    +
    int size = 50;
    +
    auto layout = ResizableSplitLeft(textarea_1, textarea_2, &size);
    +
    +
    auto component = Renderer(layout, [&] {
    +
    return vbox({
    +
    text("Input:"),
    +
    separator(),
    +
    layout->Render() | flex,
    +
    }) |
    +
    border;
    +
    });
    +
    +
    auto screen = ScreenInteractive::Fullscreen();
    +
    screen.Loop(component);
    +
    }
    +

    +toggle

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <memory> // for allocator, __shared_ptr_access
    +
    #include <string> // for string, basic_string
    +
    #include <vector> // for vector
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Toggle, Renderer, Vertical
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for text, hbox, vbox, Element
    +
    +
    using namespace ftxui;
    +
    +
    int main() {
    +
    std::vector<std::string> toggle_1_entries = {
    +
    "On",
    +
    "Off",
    +
    };
    +
    std::vector<std::string> toggle_2_entries = {
    +
    "Enabled",
    +
    "Disabled",
    +
    };
    +
    std::vector<std::string> toggle_3_entries = {
    +
    "10€",
    +
    "0€",
    +
    };
    +
    std::vector<std::string> toggle_4_entries = {
    +
    "Nothing",
    +
    "One element",
    +
    "Several elements",
    +
    };
    +
    +
    int toggle_1_selected = 0;
    +
    int toggle_2_selected = 0;
    +
    int toggle_3_selected = 0;
    +
    int toggle_4_selected = 0;
    +
    Component toggle_1 = Toggle(&toggle_1_entries, &toggle_1_selected);
    +
    Component toggle_2 = Toggle(&toggle_2_entries, &toggle_2_selected);
    +
    Component toggle_3 = Toggle(&toggle_3_entries, &toggle_3_selected);
    +
    Component toggle_4 = Toggle(&toggle_4_entries, &toggle_4_selected);
    +
    +
    auto container = Container::Vertical({
    +
    toggle_1,
    +
    toggle_2,
    +
    toggle_3,
    +
    toggle_4,
    +
    });
    +
    +
    auto renderer = Renderer(container, [&] {
    +
    return vbox({
    +
    text("Choose your options:"),
    +
    text(""),
    +
    hbox(text(" * Poweroff on startup : "), toggle_1->Render()),
    +
    hbox(text(" * Out of process : "), toggle_2->Render()),
    +
    hbox(text(" * Price of the information : "), toggle_3->Render()),
    +
    hbox(text(" * Number of elements : "), toggle_4->Render()),
    +
    });
    +
    });
    +
    +
    auto screen = ScreenInteractive::TerminalOutput();
    +
    screen.Loop(renderer);
    +
    }
    +

    +window

    +

    Demo

    // Copyright 2023 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    + + +
    #include <string>
    +
    +
    using namespace ftxui;
    +
    + +
    class Impl : public ComponentBase {
    +
    private:
    +
    bool checked[3] = {false, false, false};
    +
    float slider = 50;
    +
    +
    public:
    +
    Impl() {
    +
    Add(Container::Vertical({
    +
    Checkbox("Check me", &checked[0]),
    +
    Checkbox("Check me", &checked[1]),
    +
    Checkbox("Check me", &checked[2]),
    +
    Slider("Slider", &slider, 0.f, 100.f),
    +
    }));
    +
    }
    +
    };
    +
    return Make<Impl>();
    +
    }
    +
    +
    int main() {
    +
    int window_1_left = 20;
    +
    int window_1_top = 10;
    +
    int window_1_width = 40;
    +
    int window_1_height = 20;
    +
    +
    auto window_1 = Window({
    +
    .inner = DummyWindowContent(),
    +
    .title = "First window",
    +
    .left = &window_1_left,
    +
    .top = &window_1_top,
    +
    .width = &window_1_width,
    +
    .height = &window_1_height,
    +
    });
    +
    +
    auto window_2 = Window({
    +
    .inner = DummyWindowContent(),
    +
    .title = "My window",
    +
    .left = 40,
    +
    .top = 20,
    +
    });
    +
    +
    auto window_3 = Window({
    +
    .inner = DummyWindowContent(),
    +
    .title = "My window",
    +
    .left = 60,
    +
    .top = 30,
    +
    });
    +
    +
    auto window_4 = Window({
    +
    .inner = DummyWindowContent(),
    +
    });
    +
    +
    auto window_5 = Window({});
    +
    +
    auto window_container = Container::Stacked({
    +
    window_1,
    +
    window_2,
    +
    window_3,
    +
    window_4,
    +
    window_5,
    +
    });
    +
    +
    auto display_win_1 = Renderer([&] {
    +
    return text("window_1: " + //
    +
    std::to_string(window_1_width) + "x" +
    +
    std::to_string(window_1_height) + " + " +
    +
    std::to_string(window_1_left) + "," +
    +
    std::to_string(window_1_top));
    +
    });
    +
    +
    auto layout = Container::Vertical({
    +
    display_win_1,
    +
    window_container,
    +
    });
    +
    +
    auto screen = ScreenInteractive::Fullscreen();
    +
    screen.Loop(layout);
    +
    +
    return EXIT_SUCCESS;
    +
    }
    +

    +with_restored_io

    +

    Demo

    // Copyright 2022 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <cstdlib> // for system, EXIT_SUCCESS
    +
    #include <iostream> // for operator<<, basic_ostream, basic_ostream::operator<<, cout, endl, flush, ostream, basic_ostream<>::__ostream_type, cin
    +
    #include <memory> // for shared_ptr, __shared_ptr_access, allocator
    +
    #include <string> // for getline, string
    +
    +
    #include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    #include "ftxui/component/component.hpp" // for Button, Horizontal, Renderer
    +
    #include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    #include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    #include "ftxui/dom/elements.hpp" // for operator|, filler, Element, borderEmpty, hbox, size, paragraph, vbox, LESS_THAN, border, center, HEIGHT, WIDTH
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    +
    auto screen = ScreenInteractive::Fullscreen();
    +
    +
    // When pressing this button, "screen.WithRestoredIO" will execute the
    +
    // temporarily uninstall the terminal hook and execute the provided callback
    +
    // function. This allow running the application in a non-interactive mode.
    +
    auto btn_run = Button("Execute with restored IO", screen.WithRestoredIO([] {
    +
    std::cout << "This is a child program using stdin/stdout." << std::endl;
    +
    for (int i = 0; i < 10; ++i) {
    +
    std::cout << "Please enter 10 strings (" << i << "/10)" << std::flush;
    +
    std::string input;
    +
    std::getline(std::cin, input);
    +
    }
    +
    }));
    +
    +
    auto btn_quit = Button("Quit", screen.ExitLoopClosure());
    +
    +
    auto layout = Container::Horizontal({
    +
    btn_run,
    +
    btn_quit,
    +
    });
    +
    +
    auto renderer = Renderer(layout, [&] {
    +
    auto explanation = paragraph(
    +
    "After clicking this button, the ScreenInteractive will be "
    +
    "suspended and access to stdin/stdout will temporarilly be "
    +
    "restore for running a function.");
    +
    auto element = vbox({
    +
    explanation | borderEmpty,
    +
    hbox({
    +
    btn_run->Render(),
    +
    filler(),
    +
    btn_quit->Render(),
    +
    }),
    +
    });
    +
    +
    element = element | borderEmpty | border | size(WIDTH, LESS_THAN, 80) |
    +
    size(HEIGHT, LESS_THAN, 20) | center;
    +
    return element;
    +
    });
    +
    +
    screen.Loop(renderer);
    +
    return EXIT_SUCCESS;
    +
    }
    +
    +
    +
    + + + + + diff --git a/module-component.html b/module-component.html new file mode 100644 index 000000000..e00873c33 --- /dev/null +++ b/module-component.html @@ -0,0 +1,627 @@ + + + + + + + + +FTXUI: ftxui / component + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    ftxui / component
    +
    +
    +

    Table of Contents

    + +
    +

    title-img

    +

    The ftxui::component module defines the logic that produces interactive components that respond to user events (keyboard, mouse, etc.).

    +

    The Example section provides a collection of examples.

    +

    A ftxui::ScreenInteractive defines a main loop that renders a component.

    +

    A ftxui::Component is a shared pointer to a ftxui::ComponentBase. The latter defines:

    +

    ftxui::Element are used to render a single frame.

    +

    ftxui::Component are used to render dynamic user interface, producing multiple frame, and updating its state on events.

    +

    Gallery of multiple components. (demo)

    +

    image

    +

    All predefined components are available in "ftxui/dom/component.hpp"

    +
    // Copyright 2021 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #ifndef FTXUI_COMPONENT_HPP
    +
    #define FTXUI_COMPONENT_HPP
    +
    +
    #include <functional> // for function
    +
    #include <memory> // for make_shared, shared_ptr
    +
    #include <utility> // for forward
    +
    + +
    #include "ftxui/component/component_base.hpp" // for Component, Components
    +
    #include "ftxui/component/component_options.hpp" // for ButtonOption, CheckboxOption, MenuOption
    +
    #include "ftxui/dom/elements.hpp" // for Element
    +
    #include "ftxui/util/ref.hpp" // for ConstRef, Ref, ConstStringRef, ConstStringListRef, StringRef
    +
    +
    namespace ftxui {
    +
    struct ButtonOption;
    +
    struct CheckboxOption;
    +
    struct Event;
    +
    struct InputOption;
    +
    struct MenuOption;
    +
    struct RadioboxOption;
    +
    struct MenuEntryOption;
    +
    +
    template <class T, class... Args>
    +
    std::shared_ptr<T> Make(Args&&... args) {
    +
    return std::make_shared<T>(std::forward<Args>(args)...);
    +
    }
    +
    +
    // Pipe operator to decorate components.
    +
    using ComponentDecorator = std::function<Component(Component)>;
    +
    using ElementDecorator = std::function<Element(Element)>;
    + + + + +
    +
    namespace Container {
    + +
    Component Vertical(Components children, int* selector);
    + +
    Component Horizontal(Components children, int* selector);
    +
    Component Tab(Components children, int* selector);
    + +
    } // namespace Container
    +
    +
    Component Button(ButtonOption options);
    +
    Component Button(ConstStringRef label,
    +
    std::function<void()> on_click,
    +
    ButtonOption options = ButtonOption::Simple());
    +
    +
    Component Checkbox(CheckboxOption options);
    +
    Component Checkbox(ConstStringRef label,
    +
    bool* checked,
    +
    CheckboxOption options = CheckboxOption::Simple());
    +
    +
    Component Input(InputOption options = {});
    +
    Component Input(StringRef content, InputOption options = {});
    +
    Component Input(StringRef content,
    +
    StringRef placeholder,
    +
    InputOption options = {});
    +
    +
    Component Menu(MenuOption options);
    +
    Component Menu(ConstStringListRef entries,
    +
    int* selected_,
    +
    MenuOption options = MenuOption::Vertical());
    +
    Component MenuEntry(MenuEntryOption options);
    +
    Component MenuEntry(ConstStringRef label, MenuEntryOption options = {});
    +
    +
    Component Radiobox(RadioboxOption options);
    +
    Component Radiobox(ConstStringListRef entries,
    +
    int* selected_,
    +
    RadioboxOption options = {});
    +
    +
    Component Dropdown(ConstStringListRef entries, int* selected);
    +
    Component Dropdown(DropdownOption options);
    +
    +
    Component Toggle(ConstStringListRef entries, int* selected);
    +
    +
    // General slider constructor:
    +
    template <typename T>
    +
    Component Slider(SliderOption<T> options);
    +
    +
    // Shorthand without the `SliderOption` constructor:
    +
    Component Slider(ConstStringRef label,
    +
    Ref<int> value,
    +
    ConstRef<int> min = 0,
    +
    ConstRef<int> max = 100,
    +
    ConstRef<int> increment = 5);
    +
    Component Slider(ConstStringRef label,
    +
    Ref<float> value,
    +
    ConstRef<float> min = 0.f,
    +
    ConstRef<float> max = 100.f,
    +
    ConstRef<float> increment = 5.f);
    +
    Component Slider(ConstStringRef label,
    +
    Ref<long> value,
    +
    ConstRef<long> min = 0L,
    +
    ConstRef<long> max = 100L,
    +
    ConstRef<long> increment = 5L);
    +
    +
    Component ResizableSplit(ResizableSplitOption options);
    + + + + +
    +
    Component Renderer(Component child, std::function<Element()>);
    +
    Component Renderer(std::function<Element()>);
    +
    Component Renderer(std::function<Element(bool /* focused */)>);
    + +
    +
    Component CatchEvent(Component child, std::function<bool(Event)>);
    +
    ComponentDecorator CatchEvent(std::function<bool(Event)> on_event);
    +
    +
    Component Maybe(Component, const bool* show);
    +
    Component Maybe(Component, std::function<bool()>);
    +
    ComponentDecorator Maybe(const bool* show);
    +
    ComponentDecorator Maybe(std::function<bool()>);
    +
    +
    Component Modal(Component main, Component modal, const bool* show_modal);
    +
    ComponentDecorator Modal(Component modal, const bool* show_modal);
    +
    +
    Component Collapsible(ConstStringRef label,
    +
    Component child,
    +
    Ref<bool> show = false);
    +
    +
    Component Hoverable(Component component, bool* hover);
    + +
    std::function<void()> on_enter,
    +
    std::function<void()> on_leave);
    + +
    std::function<void(bool)> on_change);
    + +
    ComponentDecorator Hoverable(std::function<void()> on_enter,
    +
    std::function<void()> on_leave);
    +
    ComponentDecorator Hoverable(std::function<void(bool)> on_change);
    +
    +
    Component Window(WindowOptions option);
    +
    +
    } // namespace ftxui
    +
    +
    #endif /* end of include guard: FTXUI_COMPONENT_HPP */
    + + + + +
    static CheckboxOption Simple()
    Option for standard Checkbox.
    +
    static ButtonOption Simple()
    Create a ButtonOption, inverted when focused.
    +
    static MenuOption Vertical()
    Standard options for a vertical menu. This can be useful to implement a list of selectable items.
    +
    Component Horizontal(Components children)
    A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow...
    +
    Component Maybe(Component, const bool *show)
    Decorate a component |child|. It is shown only when |show| is true.
    +
    Component ResizableSplitTop(Component main, Component back, int *main_size)
    An vertical split in between two components, configurable using the mouse.
    +
    Component Menu(MenuOption options)
    A list of text. The focused element is selected.
    +
    Component MenuEntry(MenuEntryOption options)
    A specific menu entry. They can be put into a Container::Vertical to form a menu.
    +
    Component Toggle(ConstStringListRef entries, int *selected)
    An horizontal list of elements. The user can navigate through them.
    +
    Component Radiobox(RadioboxOption options)
    A list of element, where only one can be selected.
    +
    Component Button(ButtonOption options)
    Draw a button. Execute a function when clicked.
    +
    Component Modal(Component main, Component modal, const bool *show_modal)
    Definition modal.cpp:18
    +
    Component Renderer(Component child, std::function< Element()>)
    Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
    +
    Component Hoverable(Component component, bool *hover)
    Wrap a component. Gives the ability to know if it is hovered by the mouse.
    Definition hoverable.cpp:43
    +
    Component Window(WindowOptions option)
    A draggeable / resizeable window. To use multiple of them, they must be stacked using Container::Stac...
    +
    Component Vertical(Components children)
    A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
    +
    Component Input(InputOption options={})
    An input box for editing text.
    +
    Component ResizableSplitRight(Component main, Component back, int *main_size)
    An horizontal split in between two components, configurable using the mouse.
    +
    Component Dropdown(ConstStringListRef entries, int *selected)
    A dropdown menu.
    +
    Component Stacked(Components children)
    A list of components to be stacked on top of each other. Events are propagated to the first component...
    +
    Component ResizableSplitBottom(Component main, Component back, int *main_size)
    An vertical split in between two components, configurable using the mouse.
    +
    Component Checkbox(CheckboxOption options)
    Draw checkable element.
    +
    Component ResizableSplitLeft(Component main, Component back, int *main_size)
    An horizontal split in between two components, configurable using the mouse.
    +
    Component Tab(Components children, int *selector)
    A list of components, where only one is drawn and interacted with at a time. The |selector| gives the...
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::shared_ptr< T > Make(Args &&... args)
    Definition component.hpp:27
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    std::function< Element(Element)> ElementDecorator
    Definition component.hpp:33
    +
    std::vector< Component > Components
    +
    Component ResizableSplit(ResizableSplitOption options)
    A split in between two components.
    +
    Component operator|(Component component, ComponentDecorator decorator)
    +
    Component Collapsible(ConstStringRef label, Component child, Ref< bool > show=false)
    A collapsible component. It displays a checkbox with an arrow. Once activated, the child is displayed...
    +
    Component Slider(SliderOption< T > options)
    A slider in any direction.
    +
    Component & operator|=(Component &component, ComponentDecorator decorator)
    +
    std::function< Component(Component)> ComponentDecorator
    Definition component.hpp:32
    +
    std::shared_ptr< ComponentBase > Component
    +
    Component CatchEvent(Component child, std::function< bool(Event)>)
    + + +

    +Input

    +

    Example:

    +

    image

    +

    Produced by: ftxui::Input() from "ftxui/component/component.hpp"

    +

    + +

    +

    +Filtered input

    +

    One can filter out the characters received by the input component, using ftxui::CatchEvent.

    +
    std::string phone_number;
    +
    Component input = Input(&phone_number, "phone number");
    +
    +
    // Filter out non-digit characters.
    +
    input |= CatchEvent([&](Event event) {
    +
    return event.is_character() && !std::isdigit(event.character()[0]);
    +
    });
    +
    +
    // Filter out characters past the 10th one.
    +
    input |= CatchEvent([&](Event event) {
    +
    return event.is_character() && phone_number.size() >= 10;
    +
    });
    +

    +Menu

    +

    Defines a menu object. It contains a list of entries, one of them is selected.

    +

    Example:

    +

    image

    +

    Produced by: ftxui::Menu() from "ftxui/component/component.hpp"

    +

    + +

    +

    +Toggle 

    +

    A special kind of menu. The entries are displayed horizontally.

    +

    Example:

    +

    image

    +

    Produced by: ftxui::Toggle() from "ftxui/component/component.hpp"

    +

    + +

    +

    +CheckBox

    +

    This component defines a checkbox. It is a single entry that can be turned on/off.

    +

    Example:

    +

    image

    +

    Produced by: ftxui::Checkbox() from "ftxui/component/component.hpp"

    +

    + +

    +

    +RadioBox

    +

    A radiobutton component. This is a list of entries, where one can be turned on.

    +

    Example:

    +

    image

    +

    Produced by: ftxui::Radiobox() from "ftxui/component/component.hpp"

    +

    + +

    +

    +Dropdown

    +

    A drop-down menu is a component that, when opened, displays a list of elements for the user to select from.

    +

    Example:

    +

    youtube-video-gif (3)

    +

    Produced by: ftxui::Dropdown() from "ftxui/component/component.hpp"

    +

    +Slider

    +

    Represents a slider object that consists of a range with binned intermediate intervals. It can be created by ftxui::Slider().

    +

    Example:

    +

    image

    +

    Produced by: ftxui::Slider() from "ftxui/component/component.hpp"

    +

    +Renderer

    +

    Produced by: ftxui::Renderer() from ftxui/component/component.hpp. This component decorate another one by using a different function to render an interface.

    +

    Example:

    auto inner = [...]
    +
    +
    auto renderer = Renderer(inner, [&] {
    +
    return inner->Render() | border
    +
    });
    +

    ftxui::Renderer also supports the component decorator pattern:

    auto component = [...]
    +
    component = component
    +
    | Renderer([](Element e) { return e | border))
    +
    | Renderer(bold)
    +

    As a short hand, you can also compose a component with an element decorator:

    auto component = [...]
    +
    component = component | border | bold;
    +

    +CatchEvent

    +

    Produced by: ftxui::CatchEvent() from ftxui/component/component.hpp. This component decorate others, catching events before the underlying component.

    +

    Examples:

    auto screen = ScreenInteractive::TerminalOutput();
    +
    auto renderer = Renderer([] {
    +
    return text("My interface");
    +
    });
    +
    auto component = CatchEvent(renderer, [&](Event event) {
    +
    if (event == Event::Character('q')) {
    +
    screen.ExitLoopClosure()();
    +
    return true;
    +
    }
    +
    return false;
    +
    });
    +
    screen.Loop(component);
    +

    The ftxui::CatchEvent can also be used as a decorator:

    component = component
    +
    | CatchEvent(handler_1)
    +
    | CatchEvent(handler_2)
    +
    | CatchEvent(handler_3)
    +
    ;
    +

    +Collapsible

    +

    Useful for visual elements whose visibility can be toggled on or off by the user. Essentially, this is the combination of the ftxui::Checkbox() and ftxui::Maybe() components.

    +
    auto collapsible = Collapsible("Show more", inner_element);
    +

    +Maybe

    +

    Produced by: ftxui::Maybe() from ftxui/component/component.hpp. This component can be utilized to show/hide any other component via a boolean or a predicate.

    +

    Example with a boolean:

    bool show = true;
    +
    auto component = Renderer([]{ return "Hello World!"; });
    +
    auto maybe_component = Maybe(component, &show)
    +

    Example with a predicate:

    auto component = Renderer([]{ return "Hello World!"; });
    +
    auto maybe_component = Maybe(component, [&] { return time > 10; })
    +

    As usual, ftxui::Maybe can also be used as a decorator:

    component = component
    +
    | Maybe(&a_boolean)
    +
    | Maybe([&] { return time > 10; })
    +
    ;
    +

    +Container

    +

    +Horizontal

    +

    Produced by: ftxui::Container::Horizontal() from "ftxui/component/component.hpp". It displays a list of components horizontally and handles keyboard/mouse navigation.

    +

    +Vertical

    +

    Produced by: ftxui::Container::Vertical() from "ftxui/component/component.hpp". It displays a list of components vertically and handles keyboard/mouse navigation.

    +

    +Tab

    +

    Produced by: ftxui::Container::Tab() from "ftxui/component/component.hpp". It takes a list of components and displays only one of them. This is useful for implementing a tab bar.

    +

    Vertical:

    +

    ezgif com-gif-maker (1)

    +

    Horizontal:

    +

    ezgif com-gif-maker (2)

    +

    +ResizableSplit

    +

    It defines a horizontal or vertical separation between two children components. The position of the split is variable and controllable using the mouse. There are four possible splits:

    +

    Example:

    +

    ezgif com-gif-maker
    +

    +

    + +

    +

    +Force a frame redraw.

    +

    Typically, ftxui::ScreenInteractive::Loop() is responsible for drawing a new frame whenever a new group of events (e.g keyboard, mouse, window resize, etc.) has been processed. However, you might want to react to arbitrary events that are unknown to FTXUI. To accomplish this, you must post events using ftxui::ScreenInteractive::PostEvent (this is thread safe) via a thread. You will have to post the event ftxui::Event::Custom.

    +

    Example:

    screen->PostEvent(Event::Custom);
    +

    If you don't need to process a new Event, you can use:

    screen->RequestAnimationFrame();
    +

    instead.

    +
    +
    +
    + + + + + diff --git a/module-component.js b/module-component.js new file mode 100644 index 000000000..1ee793e0b --- /dev/null +++ b/module-component.js @@ -0,0 +1,75 @@ +var module_component = +[ + [ "Input", "module-component.html#component-input", [ + [ "Filtered input", "module-component.html#filtered-input", null ] + ] ], + [ "Menu", "module-component.html#component-menu", null ], + [ "Toggle ", "module-component.html#component-toggle", null ], + [ "CheckBox", "module-component.html#component-checkbox", null ], + [ "RadioBox", "module-component.html#component-radiobox", null ], + [ "Dropdown", "module-component.html#component-dropdown", null ], + [ "Slider", "module-component.html#component-slider", null ], + [ "Renderer", "module-component.html#component-renderer", null ], + [ "CatchEvent", "module-component.html#component-catchevent", null ], + [ "Collapsible", "module-component.html#component-collapsible", null ], + [ "Maybe", "module-component.html#component-maybe", null ], + [ "Container", "module-component.html#component-container", [ + [ "Horizontal", "module-component.html#component-horizontal", null ], + [ "Vertical", "module-component.html#component-vertical", null ], + [ "Tab", "module-component.html#component-tab", null ] + ] ], + [ "ResizableSplit", "module-component.html#component-resizable-split", null ], + [ "Force a frame redraw.", "module-component.html#component-force-redraw", null ], + [ "Example", "module-component-examples.html", [ + [ "button", "module-component-examples.html#button", null ], + [ "button_animated", "module-component-examples.html#button_animated", null ], + [ "button_in_frame", "module-component-examples.html#button_in_frame", null ], + [ "button_style", "module-component-examples.html#button_style", null ], + [ "canvas_animated", "module-component-examples.html#canvas_animated", null ], + [ "checkbox", "module-component-examples.html#checkbox", null ], + [ "checkbox_in_frame", "module-component-examples.html#checkbox_in_frame", null ], + [ "collapsible", "module-component-examples.html#collapsible", null ], + [ "composition", "module-component-examples.html#composition", null ], + [ "custom_loop", "module-component-examples.html#custom_loop", null ], + [ "dropdown", "module-component-examples.html#dropdown", null ], + [ "dropdown_custom", "module-component-examples.html#dropdown_custom", null ], + [ "flexbox_gallery", "module-component-examples.html#flexbox_gallery", null ], + [ "focus", "module-component-examples.html#focus", null ], + [ "focus_cursor", "module-component-examples.html#focus_cursor", null ], + [ "gallery", "module-component-examples.html#gallery", null ], + [ "homescreen", "module-component-examples.html#homescreen", null ], + [ "input", "module-component-examples.html#input", null ], + [ "input_in_frame", "module-component-examples.html#input_in_frame", null ], + [ "input_style", "module-component-examples.html#input_style", null ], + [ "linear_gradient_gallery", "module-component-examples.html#linear_gradient_gallery", null ], + [ "maybe", "module-component-examples.html#maybe", null ], + [ "menu", "module-component-examples.html#menu", null ], + [ "menu2", "module-component-examples.html#menu2", null ], + [ "menu_entries", "module-component-examples.html#menu_entries", null ], + [ "menu_entries_animated", "module-component-examples.html#menu_entries_animated", null ], + [ "menu_in_frame", "module-component-examples.html#menu_in_frame", null ], + [ "menu_in_frame_horizontal", "module-component-examples.html#menu_in_frame_horizontal", null ], + [ "menu_multiple", "module-component-examples.html#menu_multiple", null ], + [ "menu_style", "module-component-examples.html#menu_style", null ], + [ "menu_underline_animated_gallery", "module-component-examples.html#menu_underline_animated_gallery", null ], + [ "modal_dialog", "module-component-examples.html#modal_dialog", null ], + [ "modal_dialog_custom", "module-component-examples.html#modal_dialog_custom", null ], + [ "nested_screen", "module-component-examples.html#nested_screen", null ], + [ "print_key_press", "module-component-examples.html#print_key_press", null ], + [ "radiobox", "module-component-examples.html#radiobox", null ], + [ "radiobox_in_frame", "module-component-examples.html#radiobox_in_frame", null ], + [ "renderer", "module-component-examples.html#renderer", null ], + [ "resizable_split", "module-component-examples.html#resizable_split", null ], + [ "scrollbar", "module-component-examples.html#scrollbar", null ], + [ "selection", "module-component-examples.html#selection", null ], + [ "slider", "module-component-examples.html#slider", null ], + [ "slider_direction", "module-component-examples.html#slider_direction", null ], + [ "slider_rgb", "module-component-examples.html#slider_rgb", null ], + [ "tab_horizontal", "module-component-examples.html#tab_horizontal", null ], + [ "tab_vertical", "module-component-examples.html#tab_vertical", null ], + [ "textarea", "module-component-examples.html#textarea", null ], + [ "toggle", "module-component-examples.html#toggle", null ], + [ "window", "module-component-examples.html#window", null ], + [ "with_restored_io", "module-component-examples.html#with_restored_io", null ] + ] ] +]; \ No newline at end of file diff --git a/module-component_8md.html b/module-component_8md.html new file mode 100644 index 000000000..d97ca02df --- /dev/null +++ b/module-component_8md.html @@ -0,0 +1,209 @@ + + + + + + + + +FTXUI: module-component.md File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    module-component.md File Reference
    +
    +
    +
    +
    + + + + + diff --git a/module-dom-examples.html b/module-dom-examples.html new file mode 100644 index 000000000..a860df440 --- /dev/null +++ b/module-dom-examples.html @@ -0,0 +1,2089 @@ + + + + + + + + +FTXUI: Example + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Example
    +
    +
    +

    Table of Contents

    + +
    +

    +border

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <stdlib.h> // for EXIT_SUCCESS
    +
    #include <ftxui/dom/elements.hpp> // for text, operator|, vbox, border, Element, Fit, hbox
    +
    #include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    #include <memory> // for allocator
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    auto document = //
    +
    hbox({
    +
    vbox({
    +
    text("Line 1"),
    +
    text("Line 2"),
    +
    text("Line 3"),
    +
    }) | border,
    +
    +
    vbox({
    +
    text("Line 4"),
    +
    text("Line 5"),
    +
    text("Line 6"),
    +
    }) | border,
    +
    +
    vbox({
    +
    text("Line 7"),
    +
    text("Line 8"),
    +
    text("Line 9"),
    +
    }) | border,
    +
    });
    +
    auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    Render(screen, document);
    +
    screen.Print();
    +
    return EXIT_SUCCESS;
    +
    }
    + + + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + + +

    +border_colored

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <ftxui/dom/elements.hpp> // for operator|, text, Element, Fit, borderDouble, borderHeavy, borderLight, borderRounded, vbox
    +
    #include <ftxui/screen/screen.hpp> // for Screen
    +
    #include <iostream> // for endl, cout, ostream
    +
    #include <memory> // for allocator
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    +
    auto make_boxed = [] {
    +
    return vbox({
    +
    text("borderLight") | borderStyled(LIGHT, Color::Red),
    +
    text("borderDashed") | borderStyled(DASHED, Color::Green),
    +
    text("borderHeavy") | borderStyled(HEAVY, Color::Blue),
    +
    text("borderDouble") | borderStyled(DOUBLE, Color::Yellow),
    +
    text("borderRounded") | borderStyled(ROUNDED, Color::Cyan),
    +
    });
    +
    };
    +
    +
    auto document = hbox({
    +
    make_boxed(),
    +
    separator() | color(Color::Red),
    +
    make_boxed(),
    +
    separator() | color(Color::Red),
    +
    make_boxed(),
    +
    }) |
    +
    borderStyled(ROUNDED, Color::Red);
    +
    +
    auto screen =
    +
    Screen::Create(Dimension::Fit(document), Dimension::Fit(document));
    +
    Render(screen, document);
    +
    screen.Print();
    +
    std::cout << std::endl;
    +
    }
    +

    +border_style

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <ftxui/dom/elements.hpp> // for operator|, text, Element, Fit, borderDouble, borderHeavy, borderLight, borderRounded, vbox
    +
    #include <ftxui/screen/screen.hpp> // for Screen
    +
    #include <iostream> // for endl, cout, ostream
    +
    #include <memory> // for allocator
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    +
    auto document = vbox({
    +
    text("borderLight") | borderLight,
    +
    text("borderDashed") | borderDashed,
    +
    text("borderHeavy") | borderHeavy,
    +
    text("borderDouble") | borderDouble,
    +
    text("borderRounded") | borderRounded,
    +
    });
    +
    +
    auto screen =
    +
    Screen::Create(Dimension::Fit(document), Dimension::Fit(document));
    +
    Render(screen, document);
    +
    screen.Print();
    +
    std::cout << std::endl;
    +
    }
    +

    +canvas

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <stdio.h> // for getchar
    +
    #include <cmath> // for cos
    +
    #include <ftxui/dom/elements.hpp> // for Fit, canvas, operator|, border, Element
    +
    #include <ftxui/screen/screen.hpp> // for Pixel, Screen
    +
    #include <vector> // for vector, allocator
    +
    +
    #include "ftxui/dom/canvas.hpp" // for Canvas
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for Color, Color::Red, Color::Blue, Color::Green, ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    +
    auto c = Canvas(100, 100);
    +
    +
    c.DrawText(0, 0, "This is a canvas", [](Pixel& p) {
    +
    p.foreground_color = Color::Red;
    +
    p.underlined = true;
    +
    });
    +
    +
    // Triangle:
    +
    c.DrawPointLine(10, 10, 80, 10, Color::Red);
    +
    c.DrawPointLine(80, 10, 80, 40, Color::Blue);
    +
    c.DrawPointLine(80, 40, 10, 10, Color::Green);
    +
    +
    // Circle, not filled and filled:
    +
    c.DrawPointCircle(30, 50, 20);
    +
    c.DrawPointCircleFilled(40, 40, 10);
    +
    +
    // Plot a function:
    +
    std::vector<int> ys(100);
    +
    for (int x = 0; x < 100; x++) {
    +
    ys[x] = int(80 + 20 * cos(x * 0.2));
    +
    }
    +
    for (int x = 0; x < 99; x++) {
    +
    c.DrawPointLine(x, ys[x], x + 1, ys[x + 1], Color::Red);
    +
    }
    +
    +
    auto document = canvas(&c) | border;
    +
    +
    auto screen = Screen::Create(Dimension::Fit(document));
    +
    Render(screen, document);
    +
    screen.Print();
    +
    getchar();
    +
    +
    return 0;
    +
    }
    + +
    Canvas is a drawable buffer associated with drawing operations.
    Definition canvas.hpp:38
    +
    Color foreground_color
    Definition pixel.hpp:49
    +
    bool underlined
    Definition pixel.hpp:33
    +
    A Unicode character and its associated style.
    Definition pixel.hpp:15
    +

    +color_gallery

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <ftxui/screen/color_info.hpp> // for ColorInfo
    +
    #include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    #include <ftxui/screen/terminal.hpp> // for ColorSupport, Color, Palette16, Palette256, TrueColor
    +
    #include <memory> // for allocator, shared_ptr
    +
    #include <utility> // for move
    +
    #include <vector> // for vector
    +
    +
    #include "ftxui/dom/elements.hpp" // for text, bgcolor, color, vbox, hbox, separator, operator|, Elements, Element, Fit, border
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for Color, Color::Black, Color::Blue, Color::BlueLight, Color::Cyan, Color::CyanLight, Color::Default, Color::GrayDark, Color::GrayLight, Color::Green, Color::GreenLight, Color::Magenta, Color::MagentaLight, Color::Red, Color::RedLight, Color::White, Color::Yellow, Color::YellowLight, Color::Palette256, ftxui
    +
    +
    using namespace ftxui;
    +
    #include "./color_info_sorted_2d.ipp" // for ColorInfoSorted2D
    +
    +
    int main() {
    +
    // clang-format off
    +
    auto basic_color_display =
    +
    vbox(
    +
    text("16 color palette:"),
    +
    separator(),
    +
    hbox(
    +
    vbox(
    +
    color(Color::Default, text("Default")),
    +
    color(Color::Black, text("Black")),
    +
    color(Color::GrayDark, text("GrayDark")),
    +
    color(Color::GrayLight, text("GrayLight")),
    +
    color(Color::White, text("White")),
    +
    color(Color::Blue, text("Blue")),
    +
    color(Color::BlueLight, text("BlueLight")),
    +
    color(Color::Cyan, text("Cyan")),
    +
    color(Color::CyanLight, text("CyanLight")),
    +
    color(Color::Green, text("Green")),
    +
    color(Color::GreenLight, text("GreenLight")),
    +
    color(Color::Magenta, text("Magenta")),
    +
    color(Color::MagentaLight, text("MagentaLight")),
    +
    color(Color::Red, text("Red")),
    +
    color(Color::RedLight, text("RedLight")),
    +
    color(Color::Yellow, text("Yellow")),
    +
    color(Color::YellowLight, text("YellowLight"))
    +
    ),
    +
    vbox(
    +
    bgcolor(Color::Default, text("Default")),
    +
    bgcolor(Color::Black, text("Black")),
    +
    bgcolor(Color::GrayDark, text("GrayDark")),
    +
    bgcolor(Color::GrayLight, text("GrayLight")),
    +
    bgcolor(Color::White, text("White")),
    +
    bgcolor(Color::Blue, text("Blue")),
    +
    bgcolor(Color::BlueLight, text("BlueLight")),
    +
    bgcolor(Color::Cyan, text("Cyan")),
    +
    bgcolor(Color::CyanLight, text("CyanLight")),
    +
    bgcolor(Color::Green, text("Green")),
    +
    bgcolor(Color::GreenLight, text("GreenLight")),
    +
    bgcolor(Color::Magenta, text("Magenta")),
    +
    bgcolor(Color::MagentaLight, text("MagentaLight")),
    +
    bgcolor(Color::Red, text("Red")),
    +
    bgcolor(Color::RedLight, text("RedLight")),
    +
    bgcolor(Color::Yellow, text("Yellow")),
    +
    bgcolor(Color::YellowLight, text("YellowLight"))
    +
    )
    +
    )
    +
    );
    +
    +
    // clang-format on
    +
    auto palette_256_color_display = text("256 colors palette:");
    +
    {
    +
    std::vector<std::vector<ColorInfo>> info_columns = ColorInfoSorted2D();
    +
    Elements columns;
    +
    for (auto& column : info_columns) {
    +
    Elements column_elements;
    +
    for (auto& it : column) {
    +
    column_elements.push_back(
    +
    text(" ") | bgcolor(Color(Color::Palette256(it.index_256))));
    +
    }
    +
    columns.push_back(hbox(std::move(column_elements)));
    +
    }
    +
    palette_256_color_display = vbox({
    +
    palette_256_color_display,
    +
    separator(),
    +
    vbox(columns),
    +
    });
    +
    }
    +
    +
    // True color display.
    +
    auto true_color_display = text("TrueColors: 24bits:");
    +
    {
    +
    const int max_value = 255;
    +
    const int value_increment = 8;
    +
    const int hue_increment = 6;
    +
    int saturation = max_value;
    +
    Elements array;
    +
    for (int value = 0; value < max_value; value += 2 * value_increment) {
    +
    Elements line;
    +
    for (int hue = 0; hue < max_value; hue += hue_increment) {
    +
    line.push_back(
    +
    text("▀") //
    +
    | color(Color::HSV(hue, saturation, value)) //
    +
    | bgcolor(Color::HSV(hue, saturation, value + value_increment)));
    +
    }
    +
    array.push_back(hbox(std::move(line)));
    +
    }
    +
    true_color_display = vbox({
    +
    true_color_display,
    +
    separator(),
    +
    vbox(std::move(array)),
    +
    });
    +
    }
    +
    +
    auto terminal_info =
    +
    vbox({
    +
    Terminal::ColorSupport() >= Terminal::Color::Palette16
    +
    ? text(" 16 color palette support : Yes")
    +
    : text(" 16 color palette support : No"),
    +
    Terminal::ColorSupport() >= Terminal::Color::Palette256
    +
    ? text("256 color palette support : Yes")
    +
    : text("256 color palette support : No"),
    +
    Terminal::ColorSupport() >= Terminal::Color::TrueColor
    +
    ? text(" True color support : Yes")
    +
    : text(" True color support : No"),
    +
    }) |
    +
    border;
    +
    +
    auto document = vbox({hbox({
    +
    basic_color_display,
    +
    text(" "),
    +
    palette_256_color_display,
    +
    text(" "),
    +
    true_color_display,
    +
    }),
    +
    terminal_info});
    +
    // clang-format on
    +
    +
    auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    Render(screen, document);
    +
    +
    screen.Print();
    +
    +
    return 0;
    +
    }
    + + +
    std::vector< std::vector< ftxui::ColorInfo > > ColorInfoSorted2D()
    + +
    Color is a class that represents a color in the terminal user interface.
    Definition color.hpp:22
    + + +
    std::vector< Element > Elements
    Definition elements.hpp:23
    + +

    +color_info_palette256

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <ftxui/dom/elements.hpp> // for text, bgcolor, hbox, operator|, Elements, Fit, vbox, Element
    +
    #include <ftxui/screen/color_info.hpp> // for ColorInfo
    +
    #include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    #include <utility> // for move
    +
    #include <vector> // for vector, allocator
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for Color, Color::Palette256, ftxui
    +
    +
    using namespace ftxui;
    +
    #include "./color_info_sorted_2d.ipp" // for ColorInfoSorted2D
    +
    +
    int main() {
    +
    std::vector<std::vector<ColorInfo>> info_columns = ColorInfoSorted2D();
    +
    +
    // Draw every columns
    +
    Elements columns_elements;
    +
    for (auto& column : info_columns) {
    +
    Elements column_elements;
    +
    for (auto& it : column) {
    +
    column_elements.push_back(hbox({
    +
    text(" ") | bgcolor(Color(Color::Palette256(it.index_256))),
    +
    text(it.name),
    +
    }));
    +
    }
    +
    columns_elements.push_back(vbox(std::move(column_elements)));
    +
    }
    +
    auto document = hbox(std::move(columns_elements));
    +
    +
    auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    Render(screen, document);
    +
    +
    screen.Print();
    +
    +
    return 0;
    +
    }
    +

    +color_truecolor_HSV

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <ftxui/dom/elements.hpp> // for operator|, Elements, Fit, bgcolor, color, hbox, text, vbox, Element
    +
    #include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    #include <memory> // for allocator
    +
    #include <utility> // for move
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for Color, ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    +
    int saturation = 255;
    +
    Elements array;
    +
    for (int value = 0; value < 255; value += 20) {
    +
    Elements line;
    +
    for (int hue = 0; hue < 255; hue += 2) {
    +
    line.push_back(text("▀") //
    +
    | color(Color::HSV(hue, saturation, value)) //
    +
    | bgcolor(Color::HSV(hue, saturation, value + 10)));
    +
    }
    +
    array.push_back(hbox(std::move(line)));
    +
    }
    +
    +
    auto document = vbox(std::move(array));
    +
    +
    auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    Render(screen, document);
    +
    +
    screen.Print();
    +
    +
    return 0;
    +
    }
    +

    +color_truecolor_RGB

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <ftxui/dom/elements.hpp> // for hbox, text, bgcolor, operator|, vbox, Elements, window, Element, Fit
    +
    #include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    #include <memory> // for allocator
    +
    #include <utility> // for move
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for Color, ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    +
    Elements red_line;
    +
    Elements green_line;
    +
    Elements blue_line;
    +
    Elements cyan_line;
    +
    Elements magenta_line;
    +
    Elements yellow_line;
    +
    +
    for (int value = 0; value < 255; value += 3) {
    +
    int v = value * value / 255;
    +
    red_line.push_back(text(" ") | bgcolor(Color::RGB(v, 0, 0)));
    +
    green_line.push_back(text(" ") | bgcolor(Color::RGB(0, v, 0)));
    +
    blue_line.push_back(text(" ") | bgcolor(Color::RGB(0, 0, v)));
    +
    cyan_line.push_back(text(" ") | bgcolor(Color::RGB(0, v, v)));
    +
    magenta_line.push_back(text(" ") | bgcolor(Color::RGB(v, 0, v)));
    +
    yellow_line.push_back(text(" ") | bgcolor(Color::RGB(v, v, 0)));
    +
    }
    +
    +
    auto document = vbox({
    +
    window(text("Primary colors"),
    +
    vbox({
    +
    hbox({text("Red line :"), hbox(std::move(red_line))}),
    +
    hbox({text("Green line :"), hbox(std::move(green_line))}),
    +
    hbox({text("Blue line :"), hbox(std::move(blue_line))}),
    +
    })),
    +
    window(text("Secondary colors"),
    +
    vbox({
    +
    hbox({text("cyan line :"), hbox(std::move(cyan_line))}),
    +
    hbox({text("magenta line:"), hbox(std::move(magenta_line))}),
    +
    hbox({text("Yellow line :"), hbox(std::move(yellow_line))}),
    +
    })),
    +
    });
    +
    +
    auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    Render(screen, document);
    +
    +
    screen.Print();
    +
    +
    return 0;
    +
    }
    +

    +dbox

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <ftxui/dom/elements.hpp> // for text, operator|, border, Element, vbox, center, Fit, dbox
    +
    #include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    #include <memory> // for allocator
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    auto document = dbox({
    +
    vbox({
    +
    text("line_1"),
    +
    text("line_2"),
    +
    text("line_3"),
    +
    text("line_4"),
    +
    text("line_5"),
    +
    }) | border,
    +
    text("overlay") | border | center,
    +
    });
    +
    auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    Render(screen, document);
    +
    +
    screen.Print();
    +
    +
    return 0;
    +
    }
    +

    +gauge

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <chrono> // for operator""s, chrono_literals
    +
    #include <ftxui/dom/elements.hpp> // for text, gauge, operator|, flex, hbox, Element
    +
    #include <ftxui/screen/screen.hpp> // for Screen
    +
    #include <iostream> // for cout, endl, ostream
    +
    #include <string> // for allocator, char_traits, operator+, operator<<, string, to_string, basic_string
    +
    #include <thread> // for sleep_for
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    using namespace std::chrono_literals;
    +
    +
    std::string reset_position;
    +
    for (float percentage = 0.0f; percentage <= 1.0f; percentage += 0.002f) {
    +
    std::string data_downloaded =
    +
    std::to_string(int(percentage * 5000)) + "/5000";
    +
    auto document = hbox({
    +
    text("downloading:"),
    +
    gauge(percentage) | flex,
    +
    text(" " + data_downloaded),
    +
    });
    +
    auto screen = Screen(100, 1);
    +
    Render(screen, document);
    +
    std::cout << reset_position;
    +
    screen.Print();
    +
    reset_position = screen.ResetPosition();
    +
    +
    std::this_thread::sleep_for(0.01s);
    +
    }
    +
    std::cout << std::endl;
    +
    }
    +
    A rectangular grid of Pixel.
    Definition screen.hpp:26
    +

    +gauge_direction

    +

    Demo

    // Copyright 2022 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <chrono> // for operator""s, chrono_literals
    +
    #include <ftxui/dom/elements.hpp> // for filler, operator|, separator, text, border, Element, vbox, vtext, hbox, center, gaugeDown, gaugeLeft, gaugeRight, gaugeUp
    +
    #include <ftxui/screen/screen.hpp> // for Screen
    +
    #include <iostream> // for cout, endl, ostream
    +
    #include <string> // for allocator, operator+, operator<<, string, to_string
    +
    #include <thread> // for sleep_for
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    using namespace std::chrono_literals;
    +
    +
    std::string reset_position;
    +
    for (float percentage = 0.0f; percentage <= 1.0f; percentage += 0.002f) {
    +
    std::string data_downloaded =
    +
    std::to_string(int(percentage * 5000)) + "/5000";
    +
    +
    auto gauge_up = //
    +
    hbox({
    +
    vtext("gauge vertical"),
    +
    separator(),
    +
    gaugeUp(percentage),
    +
    }) |
    +
    border;
    +
    +
    auto gauge_down = //
    +
    hbox({
    +
    vtext("gauge vertical"),
    +
    separator(),
    +
    gaugeDown(percentage),
    +
    }) |
    +
    border;
    +
    +
    auto gauge_right = //
    +
    vbox({
    +
    text("gauge horizontal"),
    +
    separator(),
    +
    gaugeRight(percentage),
    +
    }) |
    +
    border;
    +
    +
    auto gauge_left = //
    +
    vbox({
    +
    text("gauge horizontal"),
    +
    separator(),
    +
    gaugeLeft(percentage),
    +
    }) |
    +
    border;
    +
    +
    auto document = hbox({
    +
    gauge_up,
    +
    filler(),
    +
    vbox({
    +
    gauge_right,
    +
    filler(),
    +
    text(data_downloaded) | border | center,
    +
    filler(),
    +
    gauge_left,
    +
    }),
    +
    filler(),
    +
    gauge_down,
    +
    });
    +
    +
    auto screen = Screen(32, 16);
    +
    Render(screen, document);
    +
    std::cout << reset_position;
    +
    screen.Print();
    +
    reset_position = screen.ResetPosition();
    +
    +
    std::this_thread::sleep_for(0.01s);
    +
    }
    +
    std::cout << std::endl;
    +
    }
    +

    +graph

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <chrono> // for operator""s, chrono_literals
    +
    #include <cmath> // for sin
    +
    #include <ftxui/dom/elements.hpp> // for graph, operator|, separator, color, Element, vbox, flex, inverted, operator|=, Fit, hbox, size, border, GREATER_THAN, HEIGHT
    +
    #include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    #include <functional> // for ref, reference_wrapper
    +
    #include <iostream> // for cout, ostream
    +
    #include <memory> // for shared_ptr
    +
    #include <string> // for operator<<, string
    +
    #include <thread> // for sleep_for
    +
    #include <utility> // for ignore
    +
    #include <vector> // for vector
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for Color, Color::BlueLight, Color::RedLight, Color::YellowLight, ftxui
    +
    +
    class Graph {
    +
    public:
    +
    std::vector<int> operator()(int width, int height) const {
    +
    std::vector<int> output(width);
    +
    for (int i = 0; i < width; ++i) {
    +
    float v = 0;
    +
    v += 0.1f * sin((i + shift) * 0.1f); // NOLINT
    +
    v += 0.2f * sin((i + shift + 10) * 0.15f); // NOLINT
    +
    v += 0.1f * sin((i + shift) * 0.03f); // NOLINT
    +
    v *= height; // NOLINT
    +
    v += 0.5f * height; // NOLINT
    +
    output[i] = static_cast<int>(v);
    +
    }
    +
    return output;
    +
    }
    +
    int shift = 0;
    +
    };
    +
    +
    std::vector<int> triangle(int width, int height) {
    +
    std::vector<int> output(width);
    +
    for (int i = 0; i < width; ++i) {
    +
    output[i] = i % (height - 4) + 2;
    +
    }
    +
    return output;
    +
    }
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    using namespace std::chrono_literals;
    +
    +
    Graph my_graph;
    +
    +
    std::string reset_position;
    +
    for (int i = 0;; ++i) {
    +
    std::ignore = i;
    +
    auto document = hbox({
    +
    vbox({
    +
    graph(std::ref(my_graph)),
    +
    separator(),
    +
    graph(triangle) | inverted,
    +
    }) | flex,
    +
    separator(),
    +
    vbox({
    +
    graph(std::ref(my_graph)) | color(Color::BlueLight),
    +
    separator(),
    +
    graph(std::ref(my_graph)) | color(Color::RedLight),
    +
    separator(),
    +
    graph(std::ref(my_graph)) | color(Color::YellowLight),
    +
    }) | flex,
    +
    });
    +
    +
    document |= border;
    +
    +
    const int min_width = 40;
    +
    document |= size(HEIGHT, GREATER_THAN, min_width);
    +
    +
    auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    Render(screen, document);
    +
    std::cout << reset_position;
    +
    screen.Print();
    +
    reset_position = screen.ResetPosition();
    +
    +
    const auto sleep_time = 0.03s;
    +
    std::this_thread::sleep_for(sleep_time);
    +
    my_graph.shift++;
    +
    }
    +
    +
    return 0;
    +
    }
    +
    std::vector< int > triangle(int width, int height)
    +

    +gridbox

    +

    Demo

    // Copyright 2021 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <stdio.h> // for getchar
    +
    #include <ftxui/dom/elements.hpp> // for Elements, gridbox, Fit, operator|, text, border, Element
    +
    #include <ftxui/screen/screen.hpp> // for Screen
    +
    #include <memory> // for allocator, shared_ptr
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    auto cell = [](const char* t) { return text(t) | border; };
    +
    auto document = //
    +
    gridbox({
    +
    {
    +
    cell("north-west"),
    +
    cell("north"),
    +
    cell("north-east"),
    +
    },
    +
    {
    +
    cell("center-west"),
    +
    gridbox({
    +
    {
    +
    cell("center-north-west"),
    +
    cell("center-north-east"),
    +
    },
    +
    {
    +
    cell("center-south-west"),
    +
    cell("center-south-east"),
    +
    },
    +
    }),
    +
    cell("center-east"),
    +
    },
    +
    {
    +
    cell("south-west"),
    +
    cell("south"),
    +
    cell("south-east"),
    +
    },
    +
    });
    +
    auto screen = Screen::Create(Dimension::Fit(document));
    +
    Render(screen, document);
    +
    screen.Print();
    +
    getchar();
    +
    +
    return 0;
    +
    }
    +

    +hflow

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <stdio.h> // for getchar
    +
    #include <ftxui/dom/elements.hpp> // for operator|, size, Element, text, hcenter, Decorator, Fit, WIDTH, hflow, window, EQUAL, GREATER_THAN, HEIGHT, bold, border, dim, LESS_THAN
    +
    #include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    #include <string> // for allocator, char_traits, operator+, to_string, string
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    auto make_box = [](int dimx, int dimy) {
    +
    std::string title = std::to_string(dimx) + "x" + std::to_string(dimy);
    +
    return window(text(title) | hcenter | bold,
    +
    text("content") | hcenter | dim) |
    +
    size(WIDTH, EQUAL, dimx) | size(HEIGHT, EQUAL, dimy);
    +
    };
    +
    +
    auto style = size(WIDTH, GREATER_THAN, 20) | border |
    +
    size(HEIGHT, GREATER_THAN, 30) | size(WIDTH, LESS_THAN, 50);
    +
    +
    auto document = hflow({
    +
    make_box(7, 7),
    +
    make_box(7, 5),
    +
    make_box(5, 7),
    +
    make_box(10, 4),
    +
    make_box(10, 4),
    +
    make_box(10, 4),
    +
    make_box(10, 4),
    +
    make_box(11, 4),
    +
    make_box(11, 4),
    +
    make_box(11, 4),
    +
    make_box(11, 4),
    +
    make_box(12, 4),
    +
    make_box(12, 5),
    +
    make_box(12, 4),
    +
    make_box(13, 4),
    +
    make_box(13, 3),
    +
    make_box(13, 3),
    +
    make_box(10, 3),
    +
    }) |
    +
    style;
    +
    +
    auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    Render(screen, document);
    +
    screen.Print();
    +
    getchar();
    +
    +
    return 0;
    +
    }
    +
    Element make_box(int x, int y)
    +

    +html_like

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <chrono> // for operator""s, chrono_literals
    +
    #include <ftxui/screen/screen.hpp> // for Screen
    +
    #include <iostream> // for cout, ostream
    +
    #include <string> // for allocator, operator<<, string
    +
    #include <thread> // for sleep_for
    +
    +
    #include "ftxui/dom/elements.hpp" // for paragraph, text, operator|, Element, border, Fit, color, hflow, spinner, vbox, bold, dim, underlined
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/box.hpp" // for ftxui
    +
    #include "ftxui/screen/color.hpp" // for Color, Color::Red
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    using namespace std::chrono_literals;
    +
    +
    auto img1 = []() { return text("img") | border; };
    +
    auto img2 = []() { return vbox({text("big"), text("image")}) | border; };
    +
    +
    std::string reset_position;
    +
    for (int i = 0;; ++i) {
    +
    auto document = //
    +
    hflow(
    +
    paragraph("Hello world! Here is an image:"), img1(),
    +
    paragraph(" Here is a text "), text("underlined ") | underlined,
    +
    paragraph(" Here is a text "), text("bold ") | bold,
    +
    paragraph("Hello world! Here is an image:"), img2(),
    +
    paragraph(
    +
    "Le Lorem Ipsum est simplement du faux texte employé dans la "
    +
    "composition et la mise en page avant impression. Le Lorem "
    +
    "Ipsum est le faux texte standard de l'imprimerie depuis les "
    +
    "années 1500, quand un imprimeur anonyme assembla ensemble "
    +
    "des morceaux de texte pour réaliser un livre spécimen de "
    +
    "polices de texte. Il n'a pas fait que survivre cinq siècles, "
    +
    "mais s'est aussi adapté à la bureautique informatique, sans "
    +
    "que son contenu n'en soit modifié. Il a été popularisé dans "
    +
    "les années 1960 grâce à la vente de feuilles Letraset "
    +
    "contenant des passages du Lorem Ipsum, et, plus récemment, "
    +
    "par son inclusion dans des applications de mise en page de "
    +
    "texte, comme Aldus PageMaker."),
    +
    paragraph(" Here is a text "), text("dim ") | dim,
    +
    paragraph("Hello world! Here is an image:"), img1(),
    +
    paragraph(" Here is a text "), text("red ") | color(Color::Red),
    +
    paragraph(" A spinner "), spinner(6, i / 10)) |
    +
    border;
    +
    +
    auto screen = Screen::Create(Dimension::Fit(document));
    +
    Render(screen, document);
    +
    std::cout << reset_position;
    +
    screen.Print();
    +
    reset_position = screen.ResetPosition();
    +
    +
    std::this_thread::sleep_for(0.01s);
    +
    }
    +
    +
    return 0;
    +
    }
    + +

    +linear_gradient

    +

    Demo

    // Copyright 2023 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <ftxui/dom/elements.hpp> // for bgcolor, operator|, operator|=, text, center, Element
    +
    #include <ftxui/dom/linear_gradient.hpp> // for LinearGradient::Stop, LinearGradient
    +
    #include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    #include <memory> // for allocator, shared_ptr
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for Color, Color::DeepPink1, Color::DeepSkyBlue1, Color::Yellow, ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    auto document = text("gradient") | center;
    +
    +
    document |= bgcolor(LinearGradient()
    +
    .Angle(45)
    +
    .Stop(Color::DeepPink1)
    +
    .Stop(Color::DeepSkyBlue1));
    +
    auto screen = Screen::Create(Dimension::Full(), Dimension::Full());
    +
    Render(screen, document);
    +
    screen.Print();
    +
    +
    return 0;
    +
    }
    +
    A class representing the settings for linear-gradient color effect.
    + +

    +package_manager

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <chrono> // for operator""s, chrono_literals
    +
    #include <ftxui/dom/elements.hpp> // for operator|, text, Element, hbox, bold, color, filler, separator, vbox, window, gauge, Fit, size, dim, EQUAL, WIDTH
    +
    #include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    #include <iostream> // for cout, endl, ostream
    +
    #include <list> // for list, operator==, _List_iterator, _List_iterator<>::_Self
    +
    #include <memory> // for allocator, shared_ptr, allocator_traits<>::value_type
    +
    #include <string> // for string, operator<<, to_string
    +
    #include <thread> // for sleep_for
    +
    #include <utility> // for move
    +
    #include <vector> // for vector
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for Color, Color::Green, Color::Red, Color::RedLight, ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    +
    struct Task {
    +
    std::string name;
    +
    int number_of_threads;
    +
    int downloaded;
    +
    int size;
    +
    };
    +
    +
    std::list<Task> remaining_tasks = {
    +
    {"contact server ", 10, 0, 6 * 25},
    +
    {"download index.html ", 10, 0, 9 * 25},
    +
    {"download script.js ", 1, 0, 3 * 25},
    +
    {"download style.js ", 1, 0, 4 * 25},
    +
    {"download image.png ", 1, 0, 5 * 25},
    +
    {"download big_1.png ", 1, 0, 30 * 25},
    +
    {"download icon_1.png ", 1, 0, 7 * 25},
    +
    {"download icon_2.png ", 1, 0, 8 * 25},
    +
    {"download big_2.png ", 1, 0, 30 * 25},
    +
    {"download small_1.png ", 1, 0, 10 * 25},
    +
    {"download small_2.png ", 1, 0, 11 * 25},
    +
    {"download small_3.png ", 1, 0, 12 * 25},
    +
    };
    +
    +
    std::list<Task> displayed_task;
    +
    +
    int remaining_threads = 12;
    +
    +
    int nb_queued = (int)remaining_tasks.size();
    +
    int nb_active = 0;
    +
    int nb_done = 0;
    +
    +
    auto to_text = [](int number) {
    +
    return text(std::to_string(number)) | size(WIDTH, EQUAL, 3);
    +
    };
    +
    +
    auto renderTask = [&](const Task& task) {
    +
    auto style = (task.downloaded == task.size) ? dim : bold;
    +
    return hbox({
    +
    text(task.name) | style,
    +
    separator(),
    +
    to_text(task.downloaded),
    +
    text("/"),
    +
    to_text(task.size),
    +
    separator(),
    +
    gauge(task.downloaded / float(task.size)),
    +
    });
    +
    };
    +
    +
    auto renderSummary = [&]() {
    +
    auto summary = vbox({
    +
    hbox({
    +
    text("- done: "),
    +
    to_text(nb_done) | bold,
    +
    }) | color(Color::Green),
    +
    hbox({
    +
    text("- active: "),
    +
    to_text(nb_active) | bold,
    +
    }) | color(Color::RedLight),
    +
    hbox({
    +
    text("- queue: "),
    +
    to_text(nb_queued) | bold,
    +
    }) | color(Color::Red),
    +
    });
    +
    +
    return window(text(" Summary "), summary);
    +
    };
    +
    +
    auto render = [&]() {
    +
    std::vector<Element> entries;
    +
    for (auto& task : displayed_task) {
    +
    entries.push_back(renderTask(task));
    +
    }
    +
    +
    return vbox({
    +
    // List of tasks.
    +
    window(text(" Task "), vbox(std::move(entries))),
    +
    +
    // Summary.
    +
    hbox({
    +
    renderSummary(),
    +
    filler(),
    +
    }),
    +
    });
    +
    };
    +
    +
    auto updateModel = [&]() {
    +
    for (auto& task : displayed_task) {
    +
    if (task.downloaded != task.size) {
    +
    task.downloaded++;
    +
    } else if (task.number_of_threads) {
    +
    remaining_threads += task.number_of_threads;
    +
    task.number_of_threads = 0;
    +
    nb_active--;
    +
    nb_done++;
    +
    }
    +
    }
    +
    +
    if (remaining_tasks.size() &&
    +
    remaining_tasks.front().number_of_threads <= remaining_threads) {
    +
    remaining_threads -= remaining_tasks.front().number_of_threads;
    +
    displayed_task.push_back(remaining_tasks.front());
    +
    remaining_tasks.pop_front();
    +
    nb_queued--;
    +
    nb_active++;
    +
    }
    +
    };
    +
    +
    std::string reset_position;
    +
    for (;;) {
    +
    // Draw.
    +
    auto document = render();
    +
    auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    Render(screen, document);
    +
    std::cout << reset_position;
    +
    screen.Print();
    +
    reset_position = screen.ResetPosition();
    +
    +
    // Simulate time.
    +
    using namespace std::chrono_literals;
    +
    std::this_thread::sleep_for(0.01s);
    +
    +
    // Exit
    +
    if (nb_active + nb_queued == 0) {
    +
    break;
    +
    }
    +
    +
    // Update the model for the next frame.
    +
    updateModel();
    +
    }
    +
    std::cout << std::endl;
    +
    }
    +
    std::variant< Event, Closure, AnimationTask > Task
    Definition task.hpp:14
    +

    +paragraph

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <chrono> // for operator""s, chrono_literals
    +
    #include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    #include <iostream> // for cout, ostream
    +
    #include <memory> // for allocator, shared_ptr
    +
    #include <string> // for string, operator<<
    +
    #include <thread> // for sleep_for
    +
    +
    #include "ftxui/dom/elements.hpp" // for hflow, paragraph, separator, hbox, vbox, filler, operator|, border, Element
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/box.hpp" // for ftxui
    +
    +
    using namespace std::chrono_literals;
    +
    int main() {
    +
    using namespace ftxui;
    +
    std::string p =
    +
    R"(In probability theory and statistics, Bayes' theorem (alternatively Bayes' law or Bayes' rule) describes the probability of an event, based on prior knowledge of conditions that might be related to the event. For example, if cancer is related to age, then, using Bayes' theorem, a person's age can be used to more accurately assess the probability that they have cancer, compared to the assessment of the probability of cancer made without knowledge of the person's age. One of the many applications of Bayes' theorem is Bayesian inference, a particular approach to statistical inference. When applied, the probabilities involved in Bayes' theorem may have different probability interpretations. With the Bayesian probability interpretation the theorem expresses how a subjective degree of belief should rationally change to account for availability of related evidence. Bayesian inference is fundamental to Bayesian statistics.)";
    +
    +
    std::string reset_position;
    +
    while (true) {
    +
    auto document = vbox({
    +
    hflow(paragraph(p)),
    +
    separator(),
    +
    hflow(paragraph(p)),
    +
    separator(),
    +
    hbox({
    +
    hflow(paragraph(p)),
    +
    separator(),
    +
    hflow(paragraph(p)),
    +
    }),
    +
    }) |
    +
    border;
    +
    +
    document = vbox(filler(), document);
    +
    +
    // auto screen = Screen::Create(Dimension::Fit(document));
    +
    // Render(screen, document);
    +
    // screen.Print();
    +
    // getchar();
    +
    +
    auto screen = Screen::Create(Dimension::Full());
    +
    Render(screen, document);
    +
    std::cout << reset_position;
    +
    screen.Print();
    +
    reset_position = screen.ResetPosition();
    +
    +
    std::this_thread::sleep_for(0.01s);
    +
    }
    +
    +
    return 0;
    +
    }
    +

    +separator

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <ftxui/dom/elements.hpp> // for text, center, separator, operator|, flex, Element, vbox, Fit, hbox, border
    +
    #include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    #include <memory> // for allocator
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    auto document = hbox({
    +
    text("left-column"),
    +
    separator(),
    +
    vbox({
    +
    center(text("top")) | flex,
    +
    separator(),
    +
    center(text("bottom")),
    +
    }) | flex,
    +
    separator(),
    +
    text("right-column"),
    +
    }) |
    +
    border;
    +
    auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    Render(screen, document);
    +
    screen.Print();
    +
    +
    return 0;
    +
    }
    +

    +separator_style

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <ftxui/screen/screen.hpp> // for Screen
    +
    #include <iostream> // for endl, cout, ostream
    +
    #include <memory> // for allocator
    +
    +
    #include "ftxui/dom/elements.hpp" // for text, hbox, separatorDouble, separatorHeavy, separatorLight, vbox, operator|, Element, Fit, borderDouble, borderHeavy, borderLight
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/box.hpp" // for ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    +
    auto document = vbox({
    +
    vbox({
    +
    text("separatorLight"),
    +
    separatorLight(),
    +
    hbox(text("left"), separatorLight(), text("right")),
    +
    }) | borderLight,
    +
    +
    vbox({
    +
    text("separatorDashed"),
    +
    separatorDashed(),
    +
    hbox(text("left"), separatorDashed(), text("right")),
    +
    }) | borderDashed,
    +
    +
    vbox({
    +
    text("separatorHeavy"),
    +
    separatorHeavy(),
    +
    hbox(text("left"), separatorHeavy(), text("right")),
    +
    }) | borderHeavy,
    +
    +
    vbox({
    +
    text("separatorDouble"),
    +
    separatorDouble(),
    +
    hbox(text("left"), separatorDouble(), text("right")),
    +
    }) | borderDouble,
    +
    });
    +
    +
    auto screen =
    +
    Screen::Create(Dimension::Fit(document), Dimension::Fit(document));
    +
    Render(screen, document);
    +
    screen.Print();
    +
    std::cout << std::endl;
    +
    }
    +

    +size

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <ftxui/dom/elements.hpp> // for operator|, text, Element, hcenter, Fit, hbox, size, window, Elements, bold, dim, EQUAL, WIDTH
    +
    #include <ftxui/screen/screen.hpp> // for Screen
    +
    #include <memory> // for allocator, shared_ptr
    +
    #include <string> // for string, to_string
    +
    #include <utility> // for move
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    auto make_box = [](const std::string& title) {
    +
    return window(text(title) | hcenter | bold,
    +
    text("content") | hcenter | dim);
    +
    };
    +
    +
    Elements content;
    +
    for (int x = 3; x < 30; ++x) {
    +
    content.push_back(make_box(std::to_string(x)) | size(WIDTH, EQUAL, x));
    +
    }
    +
    +
    auto document = hbox(std::move(content));
    +
    auto screen = Screen::Create(Dimension::Fit(document));
    +
    Render(screen, document);
    +
    screen.Print();
    +
    +
    return 0;
    +
    }
    +

    +spinner

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <chrono> // for operator""s, chrono_literals
    +
    #include <ftxui/dom/elements.hpp> // for Element, operator|, separator, filler, hbox, size, spinner, text, vbox, bold, border, Fit, EQUAL, WIDTH
    +
    #include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    #include <iostream> // for cout, endl, ostream
    +
    #include <string> // for to_string, operator<<, string
    +
    #include <thread> // for sleep_for
    +
    #include <utility> // for move
    +
    #include <vector> // for vector
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    using namespace std::chrono_literals;
    +
    +
    std::string reset_position;
    +
    for (int index = 0; index < 200; ++index) {
    +
    std::vector<Element> entries;
    +
    for (int i = 0; i < 23; ++i) {
    +
    if (i != 0) {
    +
    entries.push_back(separator());
    +
    }
    +
    entries.push_back( //
    +
    hbox({
    +
    text(std::to_string(i)) | size(WIDTH, EQUAL, 2),
    +
    separator(),
    +
    spinner(i, index) | bold,
    +
    }));
    +
    }
    +
    auto document = hbox({
    +
    vbox(std::move(entries)) | border,
    +
    filler(),
    +
    });
    +
    auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    Render(screen, document);
    +
    std::cout << reset_position;
    +
    screen.Print();
    +
    reset_position = screen.ResetPosition();
    +
    +
    std::this_thread::sleep_for(0.1s);
    +
    }
    +
    std::cout << std::endl;
    +
    }
    +

    +style_blink

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <ftxui/dom/elements.hpp> // for text, operator|, blink, Fit, hbox, Element
    +
    #include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    #include <memory> // for allocator
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    auto document = //
    +
    hbox({
    +
    text("This text is "),
    +
    text("blink") | blink,
    +
    text(". Do you like it?"),
    +
    });
    +
    auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    Render(screen, document);
    +
    screen.Print();
    +
    +
    return 0;
    +
    }
    +

    +style_bold

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <ftxui/dom/elements.hpp> // for text, operator|, bold, Fit, hbox, Element
    +
    #include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    #include <memory> // for allocator
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    auto document = //
    +
    hbox({
    +
    text("This text is "),
    +
    text("bold") | bold,
    +
    text(". Do you like it?"),
    +
    });
    +
    auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    Render(screen, document);
    +
    screen.Print();
    +
    +
    return 0;
    +
    }
    +

    +style_color

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <ftxui/dom/linear_gradient.hpp> // for LinearGradient
    +
    #include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    #include <memory> // for allocator
    +
    +
    #include "ftxui/dom/elements.hpp" // for text, bgcolor, color, vbox, filler, Fit, hbox
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for Color, operator""_rgb, Color::Black, Color::Blue, Color::BlueLight, Color::Cyan, Color::CyanLight, Color::DeepSkyBlue4, Color::Default, Color::GrayDark, Color::GrayLight, Color::Green, Color::GreenLight, Color::Magenta, Color::MagentaLight, Color::Red, Color::RedLight, Color::SkyBlue1, Color::White, Color::Yellow, Color::YellowLight, ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    auto document = hbox({
    +
    vbox({
    +
    color(Color::Default, text("Default")),
    +
    color(Color::Black, text("Black")),
    +
    color(Color::GrayDark, text("GrayDark")),
    +
    color(Color::GrayLight, text("GrayLight")),
    +
    color(Color::White, text("White")),
    +
    color(Color::Blue, text("Blue")),
    +
    color(Color::BlueLight, text("BlueLight")),
    +
    color(Color::Cyan, text("Cyan")),
    +
    color(Color::CyanLight, text("CyanLight")),
    +
    color(Color::Green, text("Green")),
    +
    color(Color::GreenLight, text("GreenLight")),
    +
    color(Color::Magenta, text("Magenta")),
    +
    color(Color::MagentaLight, text("MagentaLight")),
    +
    color(Color::Red, text("Red")),
    +
    color(Color::RedLight, text("RedLight")),
    +
    color(Color::Yellow, text("Yellow")),
    +
    color(Color::YellowLight, text("YellowLight")),
    +
    color(0x66ff66_rgb, text("Phosphor")),
    +
    color(LinearGradient(Color::SkyBlue1, Color::DeepSkyBlue4),
    +
    text("Skyblue to DeepSkyBlue")),
    +
    }),
    +
    vbox({
    +
    bgcolor(Color::Default, text("Default")),
    +
    bgcolor(Color::Black, text("Black")),
    +
    bgcolor(Color::GrayDark, text("GrayDark")),
    +
    bgcolor(Color::GrayLight, text("GrayLight")),
    +
    bgcolor(Color::White, text("White")),
    +
    bgcolor(Color::Blue, text("Blue")),
    +
    bgcolor(Color::BlueLight, text("BlueLight")),
    +
    bgcolor(Color::Cyan, text("Cyan")),
    +
    bgcolor(Color::CyanLight, text("CyanLight")),
    +
    bgcolor(Color::Green, text("Green")),
    +
    bgcolor(Color::GreenLight, text("GreenLight")),
    +
    bgcolor(Color::Magenta, text("Magenta")),
    +
    bgcolor(Color::MagentaLight, text("MagentaLight")),
    +
    bgcolor(Color::Red, text("Red")),
    +
    bgcolor(Color::RedLight, text("RedLight")),
    +
    bgcolor(Color::Yellow, text("Yellow")),
    +
    bgcolor(Color::YellowLight, text("YellowLight")),
    +
    bgcolor(0x66ff66_rgb, text("Phosphor")),
    +
    bgcolor(LinearGradient(Color::SkyBlue1, Color::DeepSkyBlue4),
    +
    text("Skyblue to DeepSkyBlue")),
    +
    }),
    +
    filler(),
    +
    });
    +
    +
    auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    Render(screen, document);
    +
    screen.Print();
    +
    +
    return 0;
    +
    }
    +

    +style_dim

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <ftxui/dom/elements.hpp> // for text, operator|, dim, Fit, hbox, Element
    +
    #include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    #include <memory> // for allocator
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    auto document = //
    +
    hbox({
    +
    text("This text is "),
    +
    text("dim") | dim,
    +
    text(". Do you like it?"),
    +
    });
    +
    auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    Render(screen, document);
    +
    screen.Print();
    +
    +
    return 0;
    +
    }
    +

    +style_gallery

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <ftxui/dom/elements.hpp> // for text, operator|, Element, bgcolor, color, blink, bold, dim, inverted, underlined, Fit, hbox
    +
    #include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    #include <memory> // for allocator
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for Color, Color::Blue, ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    // clang-format off
    +
    auto document =
    +
    hbox({
    +
    text("normal") , text(" ") ,
    +
    text("bold") | bold , text(" ") ,
    +
    text("italic") | italic , text(" ") ,
    +
    text("dim") | dim , text(" ") ,
    +
    text("inverted") | inverted , text(" ") ,
    +
    text("underlined") | underlined , text(" ") ,
    +
    text("underlinedDouble") | underlinedDouble , text(" ") ,
    +
    text("blink") | blink , text(" ") ,
    +
    text("strikethrough") | strikethrough , text(" ") ,
    +
    text("color") | color(Color::Blue) , text(" ") ,
    +
    text("bgcolor") | bgcolor(Color::Blue) , text(" ") ,
    +
    text("hyperlink") | hyperlink("https://github.com/ArthurSonzogni/FTXUI"),
    +
    });
    +
    // clang-format on
    +
    auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    Render(screen, document);
    +
    screen.Print();
    +
    +
    return 0;
    +
    }
    +

    +style_hyperlink

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <ftxui/dom/elements.hpp> // for text, operator|, bold, Fit, hbox, Element
    +
    #include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    #include <memory> // for allocator
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    auto document = //
    +
    hbox({
    +
    text("This text is an "),
    +
    text("hyperlink") | hyperlink("https://www.google.com"),
    +
    text(". Do you like it?"),
    +
    });
    +
    auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    Render(screen, document);
    +
    screen.Print();
    +
    +
    return 0;
    +
    }
    +

    +style_inverted

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <ftxui/dom/elements.hpp> // for text, operator|, inverted, Fit, hbox, Element
    +
    #include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    #include <memory> // for allocator
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    auto document = hbox({
    +
    text("This text is "),
    +
    text("inverted") | inverted,
    +
    text(". Do you like it?"),
    +
    });
    +
    auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    Render(screen, document);
    +
    screen.Print();
    +
    +
    return 0;
    +
    }
    +

    +style_italic

    +

    Demo

    // Copyright 2025 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <ftxui/dom/elements.hpp> // for text, operator|, inverted, Fit, hbox, Element
    +
    #include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    #include <memory> // for allocator
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    auto document = hbox({
    +
    text("This text is "),
    +
    text("italic") | italic,
    +
    text(". Do you like it?"),
    +
    });
    +
    auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    Render(screen, document);
    +
    screen.Print();
    +
    +
    return 0;
    +
    }
    +

    +style_strikethrough

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <ftxui/dom/elements.hpp> // for text, operator|, strikethrough, Fit, hbox, Element
    +
    #include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    #include <memory> // for allocator
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    auto document = //
    +
    hbox({
    +
    text("This text is "),
    +
    text("strikethrough") | strikethrough,
    +
    text(". Do you like it?"),
    +
    });
    +
    auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    Render(screen, document);
    +
    screen.Print();
    +
    +
    return 0;
    +
    }
    +

    +style_underlined

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <ftxui/dom/elements.hpp> // for text, operator|, underlined, Fit, hbox, Element
    +
    #include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    #include <memory> // for allocator
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    auto document = //
    +
    hbox({
    +
    text("This text is "),
    +
    text("underlined") | underlined,
    +
    text(". Do you like it?"),
    +
    });
    +
    auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    Render(screen, document);
    +
    screen.Print();
    +
    +
    return 0;
    +
    }
    +

    +style_underlined_double

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <ftxui/dom/elements.hpp> // for text, operator|, underlinedDouble, Fit, hbox, Element
    +
    #include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    #include <memory> // for allocator
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    auto document = //
    +
    hbox({
    +
    text("This text is "),
    +
    text("underlinedDouble") | underlinedDouble,
    +
    text(". Do you like it?"),
    +
    });
    +
    auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    Render(screen, document);
    +
    screen.Print();
    +
    +
    return 0;
    +
    }
    +

    +table

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <ftxui/dom/elements.hpp> // for color, Fit, LIGHT, align_right, bold, DOUBLE
    +
    #include <ftxui/dom/table.hpp> // for Table, TableSelection
    +
    #include <ftxui/screen/screen.hpp> // for Screen
    +
    #include <iostream> // for endl, cout, ostream
    +
    #include <string> // for basic_string, allocator, string
    +
    #include <vector> // for vector
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for Color, Color::Blue, Color::Cyan, Color::White, ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    +
    auto table = Table({
    +
    {"Version", "Marketing name", "Release date", "API level", "Runtime"},
    +
    {"2.3", "Gingerbread", "February 9 2011", "10", "Dalvik 1.4.0"},
    +
    {"4.0", "Ice Cream Sandwich", "October 19 2011", "15", "Dalvik"},
    +
    {"4.1", "Jelly Bean", "July 9 2012", "16", "Dalvik"},
    +
    {"4.2", "Jelly Bean", "November 13 2012", "17", "Dalvik"},
    +
    {"4.3", "Jelly Bean", "July 24 2013", "18", "Dalvik"},
    +
    {"4.4", "KitKat", "October 31 2013", "19", "Dalvik and ART"},
    +
    {"5.0", "Lollipop", "November 3 2014", "21", "ART"},
    +
    {"5.1", "Lollipop", "March 9 2015", "22", "ART"},
    +
    {"6.0", "Marshmallow", "October 5 2015", "23", "ART"},
    +
    {"7.0", "Nougat", "August 22 2016", "24", "ART"},
    +
    {"7.1", "Nougat", "October 4 2016", "25", "ART"},
    +
    {"8.0", "Oreo", "August 21 2017", "26", "ART"},
    +
    {"8.1", "Oreo", "December 5 2017", "27", "ART"},
    +
    {"9", "Pie", "August 6 2018", "28", "ART"},
    +
    {"10", "10", "September 3 2019", "29", "ART"},
    +
    {"11", "11", "September 8 2020", "30", "ART"},
    +
    });
    +
    +
    table.SelectAll().Border(LIGHT);
    +
    +
    // Add border around the first column.
    +
    table.SelectColumn(0).Border(LIGHT);
    +
    +
    // Make first row bold with a double border.
    +
    table.SelectRow(0).Decorate(bold);
    +
    table.SelectRow(0).SeparatorVertical(LIGHT);
    +
    table.SelectRow(0).Border(DOUBLE);
    +
    +
    // Align right the "Release date" column.
    +
    table.SelectColumn(2).DecorateCells(align_right);
    +
    +
    // Select row from the second to the last.
    +
    auto content = table.SelectRows(1, -1);
    +
    // Alternate in between 3 colors.
    +
    content.DecorateCellsAlternateRow(color(Color::Blue), 3, 0);
    +
    content.DecorateCellsAlternateRow(color(Color::Cyan), 3, 1);
    +
    content.DecorateCellsAlternateRow(color(Color::White), 3, 2);
    +
    +
    auto document = table.Render();
    +
    auto screen =
    +
    Screen::Create(Dimension::Fit(document, /*extend_beyond_screen=*/true));
    +
    Render(screen, document);
    +
    screen.Print();
    +
    std::cout << std::endl;
    +
    +
    return 0;
    +
    }
    +
    void Border(BorderStyle border=LIGHT)
    Apply a border around the selection.
    +
    TableSelection SelectAll()
    Select all the table.
    +
    Table is a utility to draw tables.
    Definition table.hpp:36
    + +

    +vbox_hbox

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <stdio.h> // for getchar
    +
    #include <ftxui/dom/elements.hpp> // for filler, text, hbox, vbox
    +
    #include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    #include <memory> // for allocator
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    auto document = //
    +
    vbox({
    +
    hbox({
    +
    text("north-west"),
    +
    filler(),
    +
    text("north-east"),
    +
    }),
    +
    filler(),
    +
    hbox({
    +
    filler(),
    +
    text("center"),
    +
    filler(),
    +
    }),
    +
    filler(),
    +
    hbox({
    +
    text("south-west"),
    +
    filler(),
    +
    text("south-east"),
    +
    }),
    +
    });
    +
    auto screen = Screen::Create(Dimension::Full());
    +
    Render(screen, document);
    +
    screen.Print();
    +
    getchar();
    +
    +
    return 0;
    +
    }
    +

    +vflow

    +

    Demo

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #include <stdio.h> // for getchar
    +
    #include <ftxui/dom/elements.hpp> // for operator|, Element, size, text, hcenter, Fit, vflow, window, EQUAL, bold, border, dim, HEIGHT, WIDTH
    +
    #include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    #include <string> // for allocator, char_traits, operator+, to_string, string
    +
    +
    #include "ftxui/dom/node.hpp" // for Render
    +
    #include "ftxui/screen/color.hpp" // for ftxui
    +
    +
    int main() {
    +
    using namespace ftxui;
    +
    auto make_box = [](int dimx, int dimy) {
    +
    std::string title = std::to_string(dimx) + "x" + std::to_string(dimy);
    +
    return window(text(title) | hcenter | bold,
    +
    text("content") | hcenter | dim) |
    +
    size(WIDTH, EQUAL, dimx) | size(HEIGHT, EQUAL, dimy);
    +
    };
    +
    +
    auto document = vflow({
    +
    make_box(7, 7),
    +
    make_box(7, 5),
    +
    make_box(5, 7),
    +
    make_box(10, 4),
    +
    make_box(10, 4),
    +
    make_box(10, 4),
    +
    make_box(10, 4),
    +
    make_box(11, 4),
    +
    make_box(11, 4),
    +
    make_box(11, 4),
    +
    make_box(11, 4),
    +
    make_box(12, 4),
    +
    make_box(12, 5),
    +
    make_box(12, 4),
    +
    make_box(13, 4),
    +
    make_box(13, 3),
    +
    make_box(13, 3),
    +
    make_box(10, 3),
    +
    }) |
    +
    border;
    +
    +
    auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    Render(screen, document);
    +
    screen.Print();
    +
    getchar();
    +
    +
    return 0;
    +
    }
    +
    +
    +
    + + + + + diff --git a/module-dom.html b/module-dom.html new file mode 100644 index 000000000..c56476074 --- /dev/null +++ b/module-dom.html @@ -0,0 +1,866 @@ + + + + + + + + +FTXUI: ftxui / dom + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    ftxui / dom
    +
    +
    +

    Table of Contents

    + +
    +

    title-img

    +

    This module defines a hierarchical set of ftxui::Element. An element manages the layout and can be responsive to the terminal dimension changes. Note the following example where this module is used to create a simple layout with a number of operators:

    +

    The Example section provides a collection of examples.

    +

    Example:

    namespace ftxui {
    +
    ...
    +
    +
    // Define the document
    +
    Element document = vbox({
    +
    text("The window") | bold | color(Color::Blue),
    +
    gauge(0.5)
    +
    text("The footer")
    +
    });
    +
    +
    // Add a border, by calling the `ftxui::border` decorator function.
    +
    document = border(document);
    +
    +
    // Add another border, using the pipe operator.
    +
    document = document | border.
    +
    +
    // Add another border, using the |= operator.
    +
    document |= border
    +
    +
    ...
    +
    }
    +
    Element text(std::wstring text)
    Display a piece of unicode text.
    Definition text.cpp:160
    +
    Element gauge(float progress)
    Draw a high definition progress bar.
    +
    Decorator color(Color)
    Decorate using a foreground color.
    +
    Element vbox(Elements)
    A container displaying elements vertically one by one.
    Definition vbox.cpp:96
    + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +

    List of elements

    +

    The list of all elements are included and can be accessed by including the corresponding header file:

    // Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    // Use of this source code is governed by the MIT license that can be found in
    +
    // the LICENSE file.
    +
    #ifndef FTXUI_DOM_ELEMENTS_HPP
    +
    #define FTXUI_DOM_ELEMENTS_HPP
    +
    +
    #include <functional>
    +
    #include <memory>
    +
    + + + + + + + + + +
    +
    namespace ftxui {
    +
    class Node;
    +
    using Element = std::shared_ptr<Node>;
    +
    using Elements = std::vector<Element>;
    +
    using Decorator = std::function<Element(Element)>;
    +
    using GraphFunction = std::function<std::vector<int>(int, int)>;
    +
    +
    /// @brief BorderStyle is an enumeration that represents the different styles
    +
    /// of borders that can be applied to elements in the terminal UI.
    +
    ///
    +
    /// BorderStyle is an enumeration that represents the different styles of
    +
    /// borders that can be applied to elements in the terminal UI.
    +
    /// It is used to define the visual appearance of borders around elements,
    +
    /// such as windows, frames, or separators.
    +
    /// @ingroup dom
    + + + + + + + +
    };
    +
    +
    // Pipe elements into decorator togethers.
    +
    // For instance the next lines are equivalents:
    +
    // -> text("ftxui") | bold | underlined
    +
    // -> underlined(bold(text("FTXUI")))
    + + + + +
    +
    // --- Widget ---
    +
    Element text(std::string text);
    +
    Element vtext(std::string text);
    + + + + + + + + + + +
    float right,
    +
    Color unselected_color,
    +
    Color selected_color);
    + +
    float down,
    +
    Color unselected_color,
    +
    Color selected_color);
    +
    Element gauge(float progress);
    +
    Element gaugeLeft(float progress);
    +
    Element gaugeRight(float progress);
    +
    Element gaugeUp(float progress);
    +
    Element gaugeDown(float progress);
    +
    Element gaugeDirection(float progress, Direction direction);
    + + + + + + + + + + +
    Decorator borderWith(const Pixel&);
    +
    Element window(Element title, Element content, BorderStyle border = ROUNDED);
    +
    Element spinner(int charset_index, size_t image_index);
    +
    Element paragraph(const std::string& text);
    +
    Element paragraphAlignLeft(const std::string& text);
    +
    Element paragraphAlignRight(const std::string& text);
    +
    Element paragraphAlignCenter(const std::string& text);
    +
    Element paragraphAlignJustify(const std::string& text);
    + + +
    Element canvas(ConstRef<Canvas>);
    +
    Element canvas(int width, int height, std::function<void(Canvas&)>);
    +
    Element canvas(std::function<void(Canvas&)>);
    +
    +
    // -- Decorator ---
    + + + + + + + + + + +
    Decorator color(const LinearGradient&);
    +
    Decorator bgcolor(const LinearGradient&);
    + + +
    Element color(const LinearGradient&, Element);
    +
    Element bgcolor(const LinearGradient&, Element);
    +
    Decorator focusPosition(int x, int y);
    +
    Decorator focusPositionRelative(float x, float y);
    + +
    Decorator hyperlink(std::string link);
    +
    Element hyperlink(std::string link, Element child);
    + +
    Decorator selectionColor(Color foreground);
    + + +
    Decorator selectionStyle(std::function<void(Pixel&)> style);
    +
    +
    // --- Layout is
    +
    // Horizontal, Vertical or stacked set of elements.
    + + + +
    Element flexbox(Elements, FlexboxConfig config = FlexboxConfig());
    +
    Element gridbox(std::vector<Elements> lines);
    +
    +
    Element hflow(Elements); // Helper: default flexbox with row direction.
    +
    Element vflow(Elements); // Helper: default flexbox with column direction.
    +
    +
    // -- Flexibility ---
    +
    // Define how to share the remaining space when not all of it is used inside a
    +
    // container.
    +
    Element flex(Element); // Expand/Minimize if possible/needed.
    +
    Element flex_grow(Element); // Expand element if possible.
    +
    Element flex_shrink(Element); // Minimize element if needed.
    +
    +
    Element xflex(Element); // Expand/Minimize if possible/needed on X axis.
    +
    Element xflex_grow(Element); // Expand element if possible on X axis.
    +
    Element xflex_shrink(Element); // Minimize element if needed on X axis.
    +
    +
    Element yflex(Element); // Expand/Minimize if possible/needed on Y axis.
    +
    Element yflex_grow(Element); // Expand element if possible on Y axis.
    +
    Element yflex_shrink(Element); // Minimize element if needed on Y axis.
    +
    +
    Element notflex(Element); // Reset the flex attribute.
    +
    Element filler(); // A blank expandable element.
    +
    +
    // -- Size override;
    + + + +
    +
    // --- Frame ---
    +
    // A frame is a scrollable area. The internal area is potentially larger than
    +
    // the external one. The internal area is scrolled in order to make visible the
    +
    // focused element.
    + + + + +
    Element select(Element e); // Deprecated - Alias for focus.
    +
    +
    // --- Cursor ---
    +
    // Those are similar to `focus`, but also change the shape of the cursor.
    + + + + + + +
    +
    // --- Misc ---
    + + +
    Decorator reflect(Box& box);
    +
    // Before drawing the |element| clear the pixel below. This is useful in
    +
    // combinaison with dbox.
    + +
    +
    // --- Util --------------------------------------------------------------------
    + + + + + +
    +
    namespace Dimension {
    +
    Dimensions Fit(Element&, bool extend_beyond_screen = false);
    +
    } // namespace Dimension
    +
    +
    } // namespace ftxui
    +
    +
    // Make container able to take any number of children as input.
    +
    #include "ftxui/dom/take_any_args.hpp"
    +
    +
    // Include old definitions using wstring.
    + +
    #endif // FTXUI_DOM_ELEMENTS_HPP
    + + + + + + +
    Decorator bgcolor(Color)
    Decorate using a background color.
    +
    Element window(Element title, Element content, BorderStyle border=ROUNDED)
    Draw window with a title and a border around the element.
    +
    Element borderDouble(Element)
    Draw a double border around the element.
    +
    Element focusCursorBarBlinking(Element)
    Same as focus, but set the cursor shape to be a blinking bar.
    Definition frame.cpp:189
    +
    Element xflex(Element)
    Expand/Minimize if possible/needed on the X axis.
    Definition flex.cpp:129
    +
    Element gaugeDirection(float progress, Direction direction)
    Draw a high definition progress bar progressing in specified direction.
    +
    Decorator focusPositionRelative(float x, float y)
    Used inside a frame, this force the view to be scrolled toward a a given position....
    +
    Element separatorStyled(BorderStyle)
    Draw a vertical or horizontal separation in between two other elements.
    +
    Element xflex_grow(Element)
    Expand if possible on the X axis.
    Definition flex.cpp:147
    +
    Element underlinedDouble(Element)
    Apply a underlinedDouble to text.
    +
    Element clear_under(Element element)
    Before drawing |child|, clear the pixels below. This is useful in combination with dbox.
    +
    Element borderDashed(Element)
    Draw a dashed border around the element.
    +
    Element separatorEmpty()
    Draw a vertical or horizontal separation in between two other elements, using the EMPTY style.
    +
    Element vscroll_indicator(Element)
    Display a vertical scrollbar on the right. Colors follow the content.
    +
    Element nothing(Element element)
    A decoration doing absolutely nothing.
    Definition dom/util.cpp:28
    +
    Decorator size(WidthOrHeight, Constraint, int value)
    Apply a constraint on the size of an element.
    +
    Direction
    Direction is an enumeration that represents the four cardinal directions.
    Definition direction.hpp:13
    +
    Element flex(Element)
    Make a child element to expand proportionally to the space left in a container.
    Definition flex.cpp:123
    +
    Element paragraphAlignRight(const std::string &text)
    Return an element drawing the paragraph on multiple lines, aligned on the right.
    +
    Element gaugeRight(float progress)
    Draw a high definition progress bar progressing from left to right.
    +
    Element focusCursorUnderlineBlinking(Element)
    Same as focus, but set the cursor shape to be a blinking underline.
    Definition frame.cpp:217
    +
    Element bold(Element)
    Use a bold font, for elements with more emphasis.
    Definition bold.cpp:33
    +
    Element separatorLight()
    Draw a vertical or horizontal separation in between two other elements, using the LIGHT style.
    +
    Element spinner(int charset_index, size_t image_index)
    Useful to represent the effect of time and/or events. This displays an ASCII art "video".
    +
    Element borderRounded(Element)
    Draw a rounded border around the element.
    +
    Element emptyElement()
    Definition dom/util.cpp:140
    +
    Element yflex(Element)
    Expand/Minimize if possible/needed on the Y axis.
    Definition flex.cpp:135
    +
    Element flex_shrink(Element)
    Minimize if needed.
    Definition flex.cpp:159
    +
    Element focusCursorBar(Element)
    Same as focus, but set the cursor shape to be a still block.
    Definition frame.cpp:175
    +
    Element focusCursorBlock(Element)
    Same as focus, but set the cursor shape to be a still block.
    Definition frame.cpp:147
    +
    Element underlined(Element)
    Underline the given element.
    +
    Element center(Element)
    Center an element horizontally and vertically.
    +
    Element focusCursorUnderline(Element)
    Same as focus, but set the cursor shape to be a still underline.
    Definition frame.cpp:203
    +
    Element borderHeavy(Element)
    Draw a heavy border around the element.
    +
    Element inverted(Element)
    Add a filter that will invert the foreground and the background colors.
    Definition inverted.cpp:34
    +
    Element paragraphAlignCenter(const std::string &text)
    Return an element drawing the paragraph on multiple lines, aligned on the center.
    +
    Element gaugeUp(float progress)
    Draw a high definition progress bar progressing from bottom to top.
    +
    Element align_right(Element)
    Align an element on the right side.
    +
    Decorator focusPosition(int x, int y)
    Used inside a frame, this force the view to be scrolled toward a a given position....
    +
    Element yflex_grow(Element)
    Expand if possible on the Y axis.
    Definition flex.cpp:153
    +
    Element hscroll_indicator(Element)
    Display a horizontal scrollbar at the bottom. Colors follow the content.
    +
    Element flex_grow(Element)
    Expand if possible.
    Definition flex.cpp:141
    +
    Element separatorDashed()
    Draw a vertical or horizontal separation in between two other elements, using the DASHED style.
    +
    Element notflex(Element)
    Make the element not flexible.
    Definition flex.cpp:177
    +
    Element strikethrough(Element)
    Apply a strikethrough to text.
    +
    Element italic(Element)
    Apply a underlinedDouble to text.
    Definition italic.cpp:17
    +
    Element dbox(Elements)
    Stack several element on top of each other.
    +
    Element xflex_shrink(Element)
    Minimize if needed on the X axis.
    Definition flex.cpp:165
    +
    Element gaugeLeft(float progress)
    Draw a high definition progress bar progressing from right to left.
    +
    Element separatorCharacter(std::string)
    Draw a vertical or horizontal separation in between two other elements.
    +
    Element vtext(std::wstring text)
    Display a piece unicode text vertically.
    Definition text.cpp:220
    +
    Element borderLight(Element)
    Draw a light border around the element.
    +
    Element focus(Element)
    Set the child to be the one focused among its siblings.
    Definition frame.cpp:101
    +
    Element paragraphAlignLeft(const std::string &text)
    Return an element drawing the paragraph on multiple lines, aligned on the left.
    +
    Decorator borderWith(const Pixel &)
    Same as border but with a constant Pixel around the element.
    +
    Decorator borderStyled(BorderStyle)
    Same as border but with different styles.
    +
    Element separator()
    Draw a vertical or horizontal separation in between two other elements.
    +
    Element filler()
    An element that will take expand proportionally to the space left in a container.
    Definition flex.cpp:98
    +
    Element dim(Element)
    Use a light font, for elements with less emphasis.
    Definition dim.cpp:33
    +
    Element automerge(Element child)
    Enable character to be automatically merged with others nearby.
    Definition automerge.cpp:17
    +
    Decorator hyperlink(std::string link)
    Decorate using a hyperlink. The link will be opened when the user clicks on it. This is supported onl...
    Definition hyperlink.cpp:70
    +
    Element blink(Element)
    The text drawn alternates in between visible and hidden.
    Definition blink.cpp:33
    +
    Element vcenter(Element)
    Center an element vertically.
    +
    Element separatorDouble()
    Draw a vertical or horizontal separation in between two other elements, using the DOUBLE style.
    +
    Element focusCursorBlockBlinking(Element)
    Same as focus, but set the cursor shape to be a blinking block.
    Definition frame.cpp:161
    +
    Element paragraphAlignJustify(const std::string &text)
    Return an element drawing the paragraph on multiple lines, aligned using a justified alignment....
    +
    Element border(Element)
    Draw a border around the element.
    +
    Element separatorHeavy()
    Draw a vertical or horizontal separation in between two other elements, using the HEAVY style.
    +
    Element borderEmpty(Element)
    Draw an empty border around the element.
    +
    Element yflex_shrink(Element)
    Minimize if needed on the Y axis.
    Definition flex.cpp:171
    +
    Element hcenter(Element)
    Center an element horizontally.
    +
    BorderStyle
    BorderStyle is an enumeration that represents the different styles of borders that can be applied to ...
    Definition elements.hpp:35
    +
    Element gaugeDown(float progress)
    Draw a high definition progress bar progressing from top to bottom.
    +
    @ EMPTY
    Definition elements.hpp:41
    +
    @ DOUBLE
    Definition elements.hpp:39
    +
    @ HEAVY
    Definition elements.hpp:38
    +
    @ ROUNDED
    Definition elements.hpp:40
    +
    @ DASHED
    Definition elements.hpp:37
    +
    @ LIGHT
    Definition elements.hpp:36
    + +
    Dimensions Fit(Element &, bool extend_beyond_screen=false)
    +
    WidthOrHeight
    Definition elements.hpp:161
    + + +
    std::function< Element(Element)> Decorator
    Definition elements.hpp:24
    +
    Element flexbox(Elements, FlexboxConfig config=FlexboxConfig())
    A container displaying elements on row/columns and capable of wrapping on the next column/row when fu...
    Definition flexbox.cpp:251
    +
    Element separatorVSelector(float up, float down, Color unselected_color, Color selected_color)
    Draw an vertical bar, with the area in between up/downcolored differently.
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    Element xframe(Element)
    Same as frame, but only on the x-axis.
    Definition frame.cpp:126
    +
    Element hflow(Elements)
    A container displaying elements in rows from left to right. When filled, it starts on a new row below...
    Definition flexbox.cpp:269
    +
    Decorator selectionStyle(std::function< void(Pixel &)> style)
    Set the style of an element when selected.
    +
    Element separatorHSelector(float left, float right, Color unselected_color, Color selected_color)
    Draw a horizontal bar, with the area in between left/right colored differently.
    +
    Element hbox(Elements)
    A container displaying elements horizontally one by one.
    Definition hbox.cpp:94
    +
    Element canvas(ConstRef< Canvas >)
    Produce an element from a Canvas, or a reference to a Canvas.
    +
    std::vector< Element > Elements
    Definition elements.hpp:23
    +
    Decorator selectionForegroundColor(Color foreground)
    Set the foreground color of an element when selected. Note that the style is applied on top of the ex...
    +
    Component operator|(Component component, ComponentDecorator decorator)
    +
    Decorator selectionBackgroundColor(Color foreground)
    Set the background color of an element when selected. Note that the style is applied on top of the ex...
    +
    Element yframe(Element)
    Same as frame, but only on the y-axis.
    Definition frame.cpp:134
    +
    Decorator selectionColor(Color foreground)
    Set the color of an element when selected.
    +
    Element select(Element e)
    Set the child to be the one focused among its siblings.
    Definition frame.cpp:108
    +
    Element selectionStyleReset(Element)
    Reset the selection style of an element.
    +
    Decorator reflect(Box &box)
    Definition reflect.cpp:43
    +
    std::function< std::vector< int >(int, int)> GraphFunction
    Definition elements.hpp:25
    +
    Element gridbox(std::vector< Elements > lines)
    A container displaying a grid of elements.
    +
    Elements paragraph(std::wstring text)
    +
    Element frame(Element)
    Allow an element to be displayed inside a 'virtual' area. It size can be larger than its container....
    Definition frame.cpp:118
    +
    Component & operator|=(Component &component, ComponentDecorator decorator)
    + +
    @ LESS_THAN
    Definition elements.hpp:162
    + +
    @ GREATER_THAN
    Definition elements.hpp:162
    +
    Element vflow(Elements)
    A container displaying elements in rows from top to bottom. When filled, it starts on a new columns o...
    Definition flexbox.cpp:289
    +
    Element graph(GraphFunction)
    Draw a graph using a GraphFunction.
    + + +
    std::uint8_t left
    Definition screen.cpp:130
    +
    std::uint8_t down
    Definition screen.cpp:133
    +
    std::uint8_t right
    Definition screen.cpp:132
    + +

    +text

    +

    The most simple widget. It displays a text.

    text("I am a piece of text");
    +
    I am a piece of text.
    +

    +vtext

    +

    Identical to ftxui::text, but displayed vertically.

    +

    Code:

    vtext("HELLO");
    +

    Terminal output:

    H
    +
    E
    +
    L
    +
    L
    +
    O
    +

    +paragraph 

    +

    Similar to ftxui::text, but the individual word are wrapped along multiple lines, depending on the width of its container.

    +

    Sample Code:

    paragraph("A very long text")
    +

    ezgif com-gif-maker (4)

    +

    For a more detailed example refer to detailed example. Paragraph also includes a number of other variants as shown below:

    namespace ftxui {
    +
    Element paragraph(std::string text);
    +
    Element paragraphAlignLeft(std::string text);
    +
    Element paragraphAlignRight(std::string text);
    +
    Element paragraphAlignCenter(std::string text);
    +
    Element paragraphAlignJustify(std::string text);
    +
    }
    +

    +border

    +

    Adds a border around an element.

    +

    Code:

    border(text("The element"))
    +

    Terminal output:

    ┌───────────┐
    +
    │The element│
    +
    └───────────┘
    +
    Note
    You can achieve the same behavior by using the pipe operator.
    +
    + Code:
    text("The element") | border
    +
    +

    Border also comes in a variety of styles as shown below:

    +window

    +

    A ftxui::window is a ftxui::border, but with an additional header. To add a window around an element, wrap it and specify a string as the header. Code:

    window("The window", text("The element"))
    +

    Terminal output:

    ┌The window─┐
    +
    │The element│
    +
    └───────────┘
    +

    +separator

    +

    Displays a vertical/horizontal line to visually split the content of a container in two.

    +

    Code:

    border(
    +
    hbox({
    +
    text("Left"),
    +
    separator(),
    +
    text("Right")
    +
    })
    +
    )
    +

    Terminal output:

    ┌────┬─────┐
    +
    │left│right│
    +
    └────┴─────┘
    +

    Separators come in a variety of flavors as shown below:

    namespace ftxui {
    + + + + + + + + + +
    float right,
    +
    Color background,
    +
    Color foreground);
    + +
    float down,
    +
    Color background,
    +
    Color foreground);
    +
    }
    +

    +gauge

    +

    This is a visual element that represents a ratio of progress.

    +

    Code:

    border(gauge(0.5))
    +

    Terminal output:

    ┌────────────────────────────────────────────────────────────────────────────┐
    +
    │██████████████████████████████████████ │
    +
    └────────────────────────────────────────────────────────────────────────────┘
    +

    Gauges can be displayed in many orientations as shown below:

    namespace {
    +
    Element gauge(float ratio);
    +
    Element gaugeLeft(float ratio);
    +
    Element gaugeRight(float ratio);
    +
    Element gaugeUp(float ratio);
    +
    Element gaugeDown(float ratio);
    +
    Element gaugeDirection(float ratio, GaugeDirection);
    +
    }
    +

    +graph

    +

    + +

    +

    See:

    Element graph(GraphFunction);
    +

    +Colors

    +

    Most terminal consoles can display colored text and colored backgrounds. FTXUI supports every color palette:

    Decorator color(Color);
    +
    Decorator bgcolor(Color);
    +

    Color gallery: image

    +

    +Palette16 

    +

    On most terminals the following colors are supported:

      +
    • Default
    • +
    • Black
    • +
    • GrayDark
    • +
    • GrayLight
    • +
    • White
    • +
    • Blue
    • +
    • BlueLight
    • +
    • Cyan
    • +
    • CyanLight
    • +
    • Green
    • +
    • GreenLight
    • +
    • Magenta
    • +
    • MagentaLight
    • +
    • Red
    • +
    • RedLight
    • +
    • Yellow
    • +
    • YellowLight
    • +
    +

    Example use of the above colors using the pipe operator:

    text("Blue foreground") | color(Color::Blue);
    +
    text("Blue background") | bgcolor(Color::Blue);
    +
    text("Black on white") | color(Color::Black) | bgcolor(Color::White);
    +

    +Palette256 

    +

    On terminal supporting 256 colors. + +

    +
    text("HotPink") | color(Color::HotPink);
    +

    +TrueColor

    +

    On terminal supporting trueColor, you can directly use the 24bit RGB color space:

    +

    Use the constructors below to specify the RGB or HSV values for your color:

    +

    There are two constructors:

    ftxui::Color::RGB(uint8_t red, uint8_t green, uint8_t blue);
    +
    ftxui::Color::HSV(uint8_t hue, uint8_t saturation, uint8_t value);
    +
    static Color HSV(uint8_t hue, uint8_t saturation, uint8_t value)
    Build a Color from its HSV representation. https://en.wikipedia.org/wiki/HSL_and_HSV.
    +
    static Color RGB(uint8_t red, uint8_t green, uint8_t blue)
    Build a Color from its RGB representation. https://en.wikipedia.org/wiki/RGB_color_model.
    +

    + + +

    +

    +LinearGradient

    +

    FTXUI supports linear gradient. Either on the foreground or the background.

    +
    Decorator color(const LinearGradient&);
    +
    Decorator bgcolor(const LinearGradient&);
    +

    A ftxui::LinearGradient is defined by an angle in degree, and a list of color stops.

    auto gradient = LinearGradient()
    +
    .Angle(45)
    +
    .AddStop(0.0, Color::Red)
    +
    .AddStop(0.5, Color::Green)
    +
    .AddStop(1.0, Color::Blue);
    +

    You can also use simplified constructors:

    LinearGradient(Color::Red, Color::Blue);
    +
    LinearGradient(45, Color::Red, Color::Blue);
    +

    See demo.

    +

    +Style

    +

    In addition to colored text and colored backgrounds. Many terminals support text effects such as: bold, italic, dim, underlined, inverted, blink.

    +
    Element bold(Element);
    +
    Element italic(Element);
    +
    Element dim(Element);
    +
    Element inverted(Element);
    +
    Element underlined(Element);
    +
    Element underlinedDouble(Element);
    +
    Element strikethrough(Element);
    +
    Element blink(Element);
    +
    Decorator color(Color);
    +
    Decorator bgcolor(Color);
    +
    Decorator colorgrad(LinearGradient);
    +
    Decorator bgcolorgrad(LinearGradient);
    +

    Example

    +

    image

    +

    To use these effects, simply wrap your elements with your desired effect:

    underlined(bold(text("This text is bold and underlined")))
    +

    Alternatively, use the pipe operator to chain it on your element:

    text("This text is bold") | bold | underlined
    +

    +Layout

    +

    Enables elements to be arranged in the following ways:

      +
    • Horizontally with ftxui::hbox
    • +
    • Vertically with ftxui::vbox
    • +
    • Inside a grid with ftxui::gridbox
    • +
    • Wrapped along one direction using the ftxui::flexbox.
    • +
    +

    Example using ftxui::hbox, ftxui::vbox and ftxui::filler.

    +

    image

    +

    Example using ftxui::gridbox:

    +

    image

    +

    Example using flexbox:

    +

    image

    +

    Checkout this example and the associated demo.

    +

    Element can also become flexible using the ftxui::flex decorator.

    +

    Code:

    hbox({
    +
    text("left") | border ,
    +
    text("middle") | border | flex,
    +
    text("right") | border,
    +
    });
    +

    Terminal output:

    ┌────┐┌─────────────────────────────────────────────────────┐┌─────┐
    +
    │left││middle ││right│
    +
    └────┘└─────────────────────────────────────────────────────┘└─────┘
    +

    Code:

    hbox({
    +
    text("left") | border ,
    +
    text("middle") | border | flex,
    +
    text("right") | border | flex,
    +
    });
    +

    Terminal output:

    ┌────┐┌───────────────────────────────┐┌───────────────────────────────┐
    +
    │left││middle ││right │
    +
    └────┘└───────────────────────────────┘└───────────────────────────────┘
    +

    +Table

    +

    Enables easy formatting of data into a neat table like visual form.

    +

    Code example:

    +

    image

    +

    +Canvas

    +

    See the API <ftxui/dom/canvas.hpp>

    +
    auto c = Canvas(100, 100);
    +
    c.DrawPointLine(10, 10, 80, 10, Color::Red);
    +
    auto element = canvas(c);
    +

    Drawing can be performed on a ftxui::Canvas, using braille, block, or simple characters:

    +

    Simple example:

    +

    image

    +

    Complex example:

    +

    ezgif com-gif-maker (3)

    +
    +
    +
    + + + + + diff --git a/module-dom.js b/module-dom.js new file mode 100644 index 000000000..956b2d927 --- /dev/null +++ b/module-dom.js @@ -0,0 +1,59 @@ +var module_dom = +[ + [ "text", "module-dom.html#dom-text", null ], + [ "vtext", "module-dom.html#dom-vtext", null ], + [ "paragraph ", "module-dom.html#dom-paragraph", null ], + [ "border", "module-dom.html#dom-border", null ], + [ "window", "module-dom.html#dom-window", null ], + [ "separator", "module-dom.html#dom-separator", null ], + [ "gauge", "module-dom.html#dom-gauge", null ], + [ "graph", "module-dom.html#dom-graph", null ], + [ "Colors", "module-dom.html#dom-colors", [ + [ "Palette16 ", "module-dom.html#dom-colors-palette-16", null ], + [ "Palette256 ", "module-dom.html#dom-colors-palette-256", null ], + [ "TrueColor", "module-dom.html#dom-colors-true-color", null ] + ] ], + [ "LinearGradient", "module-dom.html#dom-linear-gradient", null ], + [ "Style", "module-dom.html#dom-style", null ], + [ "Layout", "module-dom.html#dom-layout", null ], + [ "Table", "module-dom.html#dom-table", null ], + [ "Canvas", "module-dom.html#dom-canvas", null ], + [ "Example", "module-dom-examples.html", [ + [ "border", "module-dom-examples.html#border", null ], + [ "border_colored", "module-dom-examples.html#border_colored", null ], + [ "border_style", "module-dom-examples.html#border_style", null ], + [ "canvas", "module-dom-examples.html#canvas", null ], + [ "color_gallery", "module-dom-examples.html#color_gallery", null ], + [ "color_info_palette256", "module-dom-examples.html#color_info_palette256", null ], + [ "color_truecolor_HSV", "module-dom-examples.html#color_truecolor_hsv", null ], + [ "color_truecolor_RGB", "module-dom-examples.html#color_truecolor_rgb", null ], + [ "dbox", "module-dom-examples.html#dbox", null ], + [ "gauge", "module-dom-examples.html#gauge", null ], + [ "gauge_direction", "module-dom-examples.html#gauge_direction", null ], + [ "graph", "module-dom-examples.html#graph", null ], + [ "gridbox", "module-dom-examples.html#gridbox", null ], + [ "hflow", "module-dom-examples.html#hflow", null ], + [ "html_like", "module-dom-examples.html#html_like", null ], + [ "linear_gradient", "module-dom-examples.html#linear_gradient", null ], + [ "package_manager", "module-dom-examples.html#package_manager", null ], + [ "paragraph", "module-dom-examples.html#paragraph", null ], + [ "separator", "module-dom-examples.html#separator", null ], + [ "separator_style", "module-dom-examples.html#separator_style", null ], + [ "size", "module-dom-examples.html#size", null ], + [ "spinner", "module-dom-examples.html#spinner", null ], + [ "style_blink", "module-dom-examples.html#style_blink", null ], + [ "style_bold", "module-dom-examples.html#style_bold", null ], + [ "style_color", "module-dom-examples.html#style_color", null ], + [ "style_dim", "module-dom-examples.html#style_dim", null ], + [ "style_gallery", "module-dom-examples.html#style_gallery", null ], + [ "style_hyperlink", "module-dom-examples.html#style_hyperlink", null ], + [ "style_inverted", "module-dom-examples.html#style_inverted", null ], + [ "style_italic", "module-dom-examples.html#style_italic", null ], + [ "style_strikethrough", "module-dom-examples.html#style_strikethrough", null ], + [ "style_underlined", "module-dom-examples.html#style_underlined", null ], + [ "style_underlined_double", "module-dom-examples.html#style_underlined_double", null ], + [ "table", "module-dom-examples.html#table", null ], + [ "vbox_hbox", "module-dom-examples.html#vbox_hbox", null ], + [ "vflow", "module-dom-examples.html#vflow", null ] + ] ] +]; \ No newline at end of file diff --git a/module-dom_8md.html b/module-dom_8md.html new file mode 100644 index 000000000..07fb8b6c0 --- /dev/null +++ b/module-dom_8md.html @@ -0,0 +1,209 @@ + + + + + + + + +FTXUI: module-dom.md File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    module-dom.md File Reference
    +
    +
    +
    +
    + + + + + diff --git a/module-screen.html b/module-screen.html new file mode 100644 index 000000000..b78f91d94 --- /dev/null +++ b/module-screen.html @@ -0,0 +1,380 @@ + + + + + + + + +FTXUI: ftxui / screen + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    ftxui / screen
    +
    +
    +

    Table of Contents

    + +
    +

    title-img

    +

    The ftxui::screen module is the low-level foundation. It can be used standalone, but it is primarily designed to be used together by ftxui::dom and ftxui::component modules.

    +

    It provides a ftxui::Screen.

    +
    +

    +ftxui::Screen

    +

    The ftxui::Screen class represents a 2D grid of styled characters that can be rendered to a terminal.
    + It provides methods to create a screen, access pixels, and render elements.

    +

    You can access the individual cells (ftxui::Pixel) of the screen using the ftxui::Screen::PixelAt method, which returns a reference to the pixel at the specified coordinates.

    +

    Example

    + +
    +
    void main() {
    +
    auto screen = ftxui::Screen::Create(
    +
    ftxui::Dimension::Full(), // Use full terminal width
    +
    ftxui::Dimension::Fixed(10) // Fixed height of 10 rows
    +
    );
    +
    +
    // Access a specific pixel at (10, 5)
    +
    auto& pixel = screen.PixelAt(10, 5);
    +
    +
    // Set properties of the pixel.
    +
    pixel.character = U'X';
    +
    pixel.foreground_color = ftxui::Color::Red;
    +
    pixel.background_color = ftxui::Color::RGB(0, 255, 0);
    +
    pixel.bold = true; // Set bold style
    +
    screen.Print(); // Print the screen to the terminal
    +
    }
    + + +
    static Screen Create(Dimensions dimension)
    Create a screen with the given dimension.
    Definition screen.cpp:395
    +
    static Color RGB(uint8_t red, uint8_t green, uint8_t blue)
    Build a Color from its RGB representation. https://en.wikipedia.org/wiki/RGB_color_model.
    + + +
    Note
    If the coordinates are out of bounds, a dummy pixel is returned.
    +

    The screen can be printed to the terminal using ftxui::Screen::Print() or converted to a std::string with ftxui::Screen::ToString().

    +
      +
    • Print()
      auto screen = ...;
      +
      screen.Print();
      +
    • +
    • ToString()
      auto screen = ...;
      +
      std::cout << screen.ToString();
      +
    • +
    +

    Note that you can reset the cursor position to the top-left corner of the screen after printing by calling ftxui::Screen::ResetCursorPosition().

    +

    Example

    auto screen = ...;
    +
    while(true) {
    +
    // Drawing operations:
    +
    ...
    +
    +
    // Print the screen to the terminal. Then reset the cursor position and the
    +
    // screen content.
    +
    std::cout << screen.ToString();
    +
    std::cout << screen.ResetCursorPosition(/*clear=*/true);
    +
    std::cout << std::flush;
    +
    +
    // Sleep for a short duration to control the refresh rate.
    +
    std::this_thread::sleep_for(std::chrono::milliseconds(100));
    +
    }
    +

    +

    +ftxui::Dimension

    +

    The ftxui::Dimension utility controls screen sizing:

    +
      +
    • Dimension::Full() — use full terminal width or height
    • +
    • Dimension::Fit(element) — size to fit the rendered ftxui::Element
    • +
    • Dimension::Fixed(n) — use exactly n columns or rows
    • +
    +

    These values are to be passed to ftxui::Screen::Create().

    +

    ftxui::Screen::Create() provides two overloads:

    +
      +
    • Screen::Create(Dimension) sets both width and height to the same kind of dimension
    • +
    • Screen::Create(Dimension width, Dimension height) allows distinct control per axis
    • +
    +
    auto screen = ftxui::Screen::Create(
    +
    ftxui::Dimension::Full(), // width
    +
    ftxui::Dimension::Fixed(10) // height
    +
    );
    +

    Once created, render an element and display the result:

    +
    ftxui::Render(screen, element);
    +
    screen.Print();
    +
    void Render(Screen &screen, const Element &element)
    Display an element on a ftxui::Screen.
    Definition node.cpp:84
    +

    +

    +ftxui::Pixel

    +

    Each cell in the screen grid is a ftxui::Pixel, which holds:

    +
      +
    • Unicode codepoint.
        +
      • character
      • +
      +
    • +
    • ftxui::Color:
        +
      • foreground_color
      • +
      • background_color
      • +
      +
    • +
    • Booleans:
        +
      • blink
      • +
      • bold
      • +
      • dim
      • +
      • italic
      • +
      • inverted (swap foreground and background colors)
      • +
      • underlined
      • +
      • underlined_double
      • +
      • strikethrough
      • +
      +
    • +
    +
    auto screen = ftxui::Screen::Create(
    +
    ftxui::Dimension::Fixed(5),
    +
    ftxui::Dimension::Fixed(5),
    +
    );
    +
    +
    auto& pixel = screen.PixelAt(3, 3);
    +
    pixel.character = U'X';
    +
    pixel.bold = true;
    +
    pixel.foreground_color = ftxui::Color::Red;
    +
    pixel.background_color = ftxui::Color::RGB(0, 255, 0);
    +
    +
    screen.Print();
    +
    Note
    PixelAt(x, y) performs bounds checking and returns a reference to the pixel at the specified coordinate. If out-of-bounds, a dummy pixel reference is returned.
    +

    Each cell in the screen is a ftxui::Pixel. You can modify them using:

    +
    auto& pixel = screen.PixelAt(x, y);
    +
    pixel.character = U'X';
    +
    pixel.bold = true;
    +
    pixel.foreground_color = Color::Red;
    +

    +

    +ftxui::Color

    +

    The ftxui::Color class is used to define foreground and background colors for each ftxui::Pixel.

    +

    It supports various color spaces and predefined palettes. FTXUI will dynamically fallback to the closest available color in the terminal if the requested color is not supported by the terminal.

    +

    Color Spaces

    + +
    Note
    You can query the terminal capability using ftxui::Terminal::ColorSupport();
    +
    + This can manually be set using ftxui::Terminal::SetColorSupport().
    +
    +
    +
    + + + + + diff --git a/module-screen_8md.html b/module-screen_8md.html new file mode 100644 index 000000000..aa1c5a7c6 --- /dev/null +++ b/module-screen_8md.html @@ -0,0 +1,209 @@ + + + + + + + + +FTXUI: module-screen.md File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    module-screen.md File Reference
    +
    +
    +
    +
    + + + + + diff --git a/module_8md.html b/module_8md.html new file mode 100644 index 000000000..a4551cf60 --- /dev/null +++ b/module_8md.html @@ -0,0 +1,209 @@ + + + + + + + + +FTXUI: module.md File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    module.md File Reference
    +
    +
    +
    +
    + + + + + diff --git a/module__ftxui.html b/module__ftxui.html new file mode 100644 index 000000000..45c41b6aa --- /dev/null +++ b/module__ftxui.html @@ -0,0 +1,236 @@ + + + + + + + + +FTXUI: ftxui Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui Module Reference
    +
    +
    + +

    Module file re-exporting all FTXUI submodules. +More...

    + + + + + + + + + + + + + + +

    Detailed Description

    +

    Module file re-exporting all FTXUI submodules.

    +

    +Exported Modules

    module  ftxui.component
     Module file for FTXUI component operations.
     
    module  ftxui.dom
     Module file for FTXUI main operations.
     
    module  ftxui.screen
     Module file for FTXUI screen operations.
     
    module  ftxui.util
     Module file for FTXUI utility operations.
     
    + + + +

    +Files

    file  ftxui.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8component.html b/module__ftxui_8component.html new file mode 100644 index 000000000..f96264a89 --- /dev/null +++ b/module__ftxui_8component.html @@ -0,0 +1,257 @@ + + + + + + + + +FTXUI: ftxui.component Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.component Module Reference
    +
    +
    + +

    Module file for FTXUI component operations. +More...

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Detailed Description

    +

    Module file for FTXUI component operations.

    +

    +Exported Modules

    module  ftxui.component.animation
     C++20 module interface for the Animation namespace of the Component module.
     
    module  ftxui.component.mouse
     Module file for the Mouse struct of the Component module.
     
    module  ftxui.component.captured_mouse
     Module file for the CapturedMouseInterface class of the Component module.
     
    module  ftxui.component.component
     Module file for the Component classes of the Component module.
     
    module  ftxui.component.component_options
     Module file for options for the Component class of the Component module.
     
    module  ftxui.component.event
     Module file for the Event struct of the Component module.
     
    module  ftxui.component.loop
     Module file for the Loop class of the Component module.
     
    module  ftxui.component.receiver
     Module file for the Receiver class of the Component module.
     
    module  ftxui.component.screen_interactive
     Module file for the ScreenInteractive class of the Component module.
     
    module  ftxui.component.component_base
     Module file for the ComponentBase class of the Component module.
     
    module  ftxui.component.task
     Module file for the Task class of the Component module.
     
    + + + +

    +Files

    file  component.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8component_8animation.html b/module__ftxui_8component_8animation.html new file mode 100644 index 000000000..a40e5346e --- /dev/null +++ b/module__ftxui_8component_8animation.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.component.animation Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.component.animation Module Reference
    +
    +
    + +

    C++20 module interface for the Animation namespace of the Component module. +More...

    +

    Detailed Description

    +

    C++20 module interface for the Animation namespace of the Component module.

    +
    + + + +

    +Files

    file  animation.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8component_8captured__mouse.html b/module__ftxui_8component_8captured__mouse.html new file mode 100644 index 000000000..d0e683ee5 --- /dev/null +++ b/module__ftxui_8component_8captured__mouse.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.component.captured_mouse Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.component.captured_mouse Module Reference
    +
    +
    + +

    Module file for the CapturedMouseInterface class of the Component module. +More...

    +

    Detailed Description

    +

    Module file for the CapturedMouseInterface class of the Component module.

    +
    + + + +

    +Files

    file  captured_mouse.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8component_8component.html b/module__ftxui_8component_8component.html new file mode 100644 index 000000000..4d5a7190c --- /dev/null +++ b/module__ftxui_8component_8component.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.component.component Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.component.component Module Reference
    +
    +
    + +

    Module file for the Component classes of the Component module. +More...

    +

    Detailed Description

    +

    Module file for the Component classes of the Component module.

    +
    + + + +

    +Files

    file  component.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8component_8component__base.html b/module__ftxui_8component_8component__base.html new file mode 100644 index 000000000..04dd8efe4 --- /dev/null +++ b/module__ftxui_8component_8component__base.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.component.component_base Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.component.component_base Module Reference
    +
    +
    + +

    Module file for the ComponentBase class of the Component module. +More...

    +

    Detailed Description

    +

    Module file for the ComponentBase class of the Component module.

    +
    + + + +

    +Files

    file  component_base.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8component_8component__options.html b/module__ftxui_8component_8component__options.html new file mode 100644 index 000000000..0b28fb2f1 --- /dev/null +++ b/module__ftxui_8component_8component__options.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.component.component_options Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.component.component_options Module Reference
    +
    +
    + +

    Module file for options for the Component class of the Component module. +More...

    +

    Detailed Description

    +

    Module file for options for the Component class of the Component module.

    +
    + + + +

    +Files

    file  component_options.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8component_8event.html b/module__ftxui_8component_8event.html new file mode 100644 index 000000000..bb1c12253 --- /dev/null +++ b/module__ftxui_8component_8event.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.component.event Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.component.event Module Reference
    +
    +
    + +

    Module file for the Event struct of the Component module. +More...

    +

    Detailed Description

    +

    Module file for the Event struct of the Component module.

    +
    + + + +

    +Files

    file  event.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8component_8loop.html b/module__ftxui_8component_8loop.html new file mode 100644 index 000000000..52d2c3377 --- /dev/null +++ b/module__ftxui_8component_8loop.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.component.loop Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.component.loop Module Reference
    +
    +
    + +

    Module file for the Loop class of the Component module. +More...

    +

    Detailed Description

    +

    Module file for the Loop class of the Component module.

    +
    + + + +

    +Files

    file  loop.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8component_8mouse.html b/module__ftxui_8component_8mouse.html new file mode 100644 index 000000000..118577225 --- /dev/null +++ b/module__ftxui_8component_8mouse.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.component.mouse Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.component.mouse Module Reference
    +
    +
    + +

    Module file for the Mouse struct of the Component module. +More...

    +

    Detailed Description

    +

    Module file for the Mouse struct of the Component module.

    +
    + + + +

    +Files

    file  mouse.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8component_8receiver.html b/module__ftxui_8component_8receiver.html new file mode 100644 index 000000000..574da7384 --- /dev/null +++ b/module__ftxui_8component_8receiver.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.component.receiver Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.component.receiver Module Reference
    +
    +
    + +

    Module file for the Receiver class of the Component module. +More...

    +

    Detailed Description

    +

    Module file for the Receiver class of the Component module.

    +
    + + + +

    +Files

    file  receiver.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8component_8screen__interactive.html b/module__ftxui_8component_8screen__interactive.html new file mode 100644 index 000000000..dec2a6076 --- /dev/null +++ b/module__ftxui_8component_8screen__interactive.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.component.screen_interactive Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.component.screen_interactive Module Reference
    +
    +
    + +

    Module file for the ScreenInteractive class of the Component module. +More...

    +

    Detailed Description

    +

    Module file for the ScreenInteractive class of the Component module.

    +
    + + + +

    +Files

    file  screen_interactive.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8component_8task.html b/module__ftxui_8component_8task.html new file mode 100644 index 000000000..7fe495ecf --- /dev/null +++ b/module__ftxui_8component_8task.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.component.task Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.component.task Module Reference
    +
    +
    + +

    Module file for the Task class of the Component module. +More...

    +

    Detailed Description

    +

    Module file for the Task class of the Component module.

    +
    + + + +

    +Files

    file  task.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8dom.html b/module__ftxui_8dom.html new file mode 100644 index 000000000..aec1fd260 --- /dev/null +++ b/module__ftxui_8dom.html @@ -0,0 +1,254 @@ + + + + + + + + +FTXUI: ftxui.dom Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.dom Module Reference
    +
    +
    + +

    Module file for FTXUI main operations. +More...

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Detailed Description

    +

    Module file for FTXUI main operations.

    +

    +Exported Modules

    module  ftxui.dom.direction
     Module file for the Direction enum of the Dom module.
     
    module  ftxui.dom.deprecated
     Module file for deprecated parts of the Dom module.
     
    module  ftxui.dom.flexbox_config
     Module file for the FlexboxConfig struct of the Dom module.
     
    module  ftxui.dom.linear_gradient
     Module file for the LinearGradient struct of the Dom module.
     
    module  ftxui.dom.selection
     Module file for the Selection class of the Dom module.
     
    module  ftxui.dom.node
     Module file for the Node class of the Dom module.
     
    module  ftxui.dom.requirement
     Module file for the Requirement struct of the Dom module.
     
    module  ftxui.dom.canvas
     Module file for the Canvas struct of the Dom module.
     
    module  ftxui.dom.elements
     Module file for the Element classes and functions of the Dom module.
     
    module  ftxui.dom.table
     Module file for the Table class of the Dom module.
     
    + + + +

    +Files

    file  dom.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8dom_8canvas.html b/module__ftxui_8dom_8canvas.html new file mode 100644 index 000000000..be617981c --- /dev/null +++ b/module__ftxui_8dom_8canvas.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.dom.canvas Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.dom.canvas Module Reference
    +
    +
    + +

    Module file for the Canvas struct of the Dom module. +More...

    +

    Detailed Description

    +

    Module file for the Canvas struct of the Dom module.

    +
    + + + +

    +Files

    file  canvas.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8dom_8deprecated.html b/module__ftxui_8dom_8deprecated.html new file mode 100644 index 000000000..15380a724 --- /dev/null +++ b/module__ftxui_8dom_8deprecated.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.dom.deprecated Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.dom.deprecated Module Reference
    +
    +
    + +

    Module file for deprecated parts of the Dom module. +More...

    +

    Detailed Description

    +

    Module file for deprecated parts of the Dom module.

    +
    + + + +

    +Files

    file  deprecated.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8dom_8direction.html b/module__ftxui_8dom_8direction.html new file mode 100644 index 000000000..59022f4c3 --- /dev/null +++ b/module__ftxui_8dom_8direction.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.dom.direction Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.dom.direction Module Reference
    +
    +
    + +

    Module file for the Direction enum of the Dom module. +More...

    +

    Detailed Description

    +

    Module file for the Direction enum of the Dom module.

    +
    + + + +

    +Files

    file  direction.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8dom_8elements.html b/module__ftxui_8dom_8elements.html new file mode 100644 index 000000000..fafefb7e3 --- /dev/null +++ b/module__ftxui_8dom_8elements.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.dom.elements Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.dom.elements Module Reference
    +
    +
    + +

    Module file for the Element classes and functions of the Dom module. +More...

    +

    Detailed Description

    +

    Module file for the Element classes and functions of the Dom module.

    +
    + + + +

    +Files

    file  elements.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8dom_8flexbox__config.html b/module__ftxui_8dom_8flexbox__config.html new file mode 100644 index 000000000..ba6db2235 --- /dev/null +++ b/module__ftxui_8dom_8flexbox__config.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.dom.flexbox_config Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.dom.flexbox_config Module Reference
    +
    +
    + +

    Module file for the FlexboxConfig struct of the Dom module. +More...

    +

    Detailed Description

    +

    Module file for the FlexboxConfig struct of the Dom module.

    +
    + + + +

    +Files

    file  flexbox_config.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8dom_8linear__gradient.html b/module__ftxui_8dom_8linear__gradient.html new file mode 100644 index 000000000..901692d7d --- /dev/null +++ b/module__ftxui_8dom_8linear__gradient.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.dom.linear_gradient Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.dom.linear_gradient Module Reference
    +
    +
    + +

    Module file for the LinearGradient struct of the Dom module. +More...

    +

    Detailed Description

    +

    Module file for the LinearGradient struct of the Dom module.

    +
    + + + +

    +Files

    file  linear_gradient.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8dom_8node.html b/module__ftxui_8dom_8node.html new file mode 100644 index 000000000..5205fb7df --- /dev/null +++ b/module__ftxui_8dom_8node.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.dom.node Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.dom.node Module Reference
    +
    +
    + +

    Module file for the Node class of the Dom module. +More...

    +

    Detailed Description

    +

    Module file for the Node class of the Dom module.

    +
    + + + +

    +Files

    file  node.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8dom_8requirement.html b/module__ftxui_8dom_8requirement.html new file mode 100644 index 000000000..bba5f6b65 --- /dev/null +++ b/module__ftxui_8dom_8requirement.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.dom.requirement Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.dom.requirement Module Reference
    +
    +
    + +

    Module file for the Requirement struct of the Dom module. +More...

    +

    Detailed Description

    +

    Module file for the Requirement struct of the Dom module.

    +
    + + + +

    +Files

    file  requirement.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8dom_8selection.html b/module__ftxui_8dom_8selection.html new file mode 100644 index 000000000..e6dd0f76d --- /dev/null +++ b/module__ftxui_8dom_8selection.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.dom.selection Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.dom.selection Module Reference
    +
    +
    + +

    Module file for the Selection class of the Dom module. +More...

    +

    Detailed Description

    +

    Module file for the Selection class of the Dom module.

    +
    + + + +

    +Files

    file  selection.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8dom_8table.html b/module__ftxui_8dom_8table.html new file mode 100644 index 000000000..5e411e288 --- /dev/null +++ b/module__ftxui_8dom_8table.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.dom.table Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.dom.table Module Reference
    +
    +
    + +

    Module file for the Table class of the Dom module. +More...

    +

    Detailed Description

    +

    Module file for the Table class of the Dom module.

    +
    + + + +

    +Files

    file  table.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8screen.html b/module__ftxui_8screen.html new file mode 100644 index 000000000..4bcdb05a1 --- /dev/null +++ b/module__ftxui_8screen.html @@ -0,0 +1,251 @@ + + + + + + + + +FTXUI: ftxui.screen Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.screen Module Reference
    +
    +
    + +

    Module file for FTXUI screen operations. +More...

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    Detailed Description

    +

    Module file for FTXUI screen operations.

    +

    +Exported Modules

    module  ftxui.screen.color_info
     Module file for the ColorInfo struct of the Screen module.
     
    module  ftxui.screen.color
     Module file for the Color class of the Screen module.
     
    module  ftxui.screen.deprecated
     Module file for the deprecated parts of the Screen module.
     
    module  ftxui.screen.pixel
     Module file for the Pixel struct of the Screen module.
     
    module  ftxui.screen.box
     Module file for the Box struct of the Screen module.
     
    module  ftxui.screen.terminal
     Module file for the Terminal namespace of the Screen module.
     
    module  ftxui.screen.image
     Module file for the Image class of the Screen module.
     
    module  ftxui.screen.screen
     Module file for the Screen class of the Screen module.
     
    module  ftxui.screen.string
     Module file for string functions of the Screen module.
     
    + + + +

    +Files

    file  screen.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8screen_8box.html b/module__ftxui_8screen_8box.html new file mode 100644 index 000000000..996eefa0e --- /dev/null +++ b/module__ftxui_8screen_8box.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.screen.box Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.screen.box Module Reference
    +
    +
    + +

    Module file for the Box struct of the Screen module. +More...

    +

    Detailed Description

    +

    Module file for the Box struct of the Screen module.

    +
    + + + +

    +Files

    file  box.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8screen_8color.html b/module__ftxui_8screen_8color.html new file mode 100644 index 000000000..8db3abcd7 --- /dev/null +++ b/module__ftxui_8screen_8color.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.screen.color Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.screen.color Module Reference
    +
    +
    + +

    Module file for the Color class of the Screen module. +More...

    +

    Detailed Description

    +

    Module file for the Color class of the Screen module.

    +
    + + + +

    +Files

    file  color.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8screen_8color__info.html b/module__ftxui_8screen_8color__info.html new file mode 100644 index 000000000..83881bdd0 --- /dev/null +++ b/module__ftxui_8screen_8color__info.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.screen.color_info Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.screen.color_info Module Reference
    +
    +
    + +

    Module file for the ColorInfo struct of the Screen module. +More...

    +

    Detailed Description

    +

    Module file for the ColorInfo struct of the Screen module.

    +
    + + + +

    +Files

    file  color_info.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8screen_8deprecated.html b/module__ftxui_8screen_8deprecated.html new file mode 100644 index 000000000..7a3e9e08b --- /dev/null +++ b/module__ftxui_8screen_8deprecated.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.screen.deprecated Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.screen.deprecated Module Reference
    +
    +
    + +

    Module file for the deprecated parts of the Screen module. +More...

    +

    Detailed Description

    +

    Module file for the deprecated parts of the Screen module.

    +
    + + + +

    +Files

    file  deprecated.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8screen_8image.html b/module__ftxui_8screen_8image.html new file mode 100644 index 000000000..b786bfbf5 --- /dev/null +++ b/module__ftxui_8screen_8image.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.screen.image Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.screen.image Module Reference
    +
    +
    + +

    Module file for the Image class of the Screen module. +More...

    +

    Detailed Description

    +

    Module file for the Image class of the Screen module.

    +
    + + + +

    +Files

    file  image.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8screen_8pixel.html b/module__ftxui_8screen_8pixel.html new file mode 100644 index 000000000..678b49ba4 --- /dev/null +++ b/module__ftxui_8screen_8pixel.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.screen.pixel Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.screen.pixel Module Reference
    +
    +
    + +

    Module file for the Pixel struct of the Screen module. +More...

    +

    Detailed Description

    +

    Module file for the Pixel struct of the Screen module.

    +
    + + + +

    +Files

    file  pixel.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8screen_8screen.html b/module__ftxui_8screen_8screen.html new file mode 100644 index 000000000..af6d9b0d6 --- /dev/null +++ b/module__ftxui_8screen_8screen.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.screen.screen Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.screen.screen Module Reference
    +
    +
    + +

    Module file for the Screen class of the Screen module. +More...

    +

    Detailed Description

    +

    Module file for the Screen class of the Screen module.

    +
    + + + +

    +Files

    file  screen.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8screen_8string.html b/module__ftxui_8screen_8string.html new file mode 100644 index 000000000..738b6de79 --- /dev/null +++ b/module__ftxui_8screen_8string.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.screen.string Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.screen.string Module Reference
    +
    +
    + +

    Module file for string functions of the Screen module. +More...

    +

    Detailed Description

    +

    Module file for string functions of the Screen module.

    +
    + + + +

    +Files

    file  string.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8screen_8terminal.html b/module__ftxui_8screen_8terminal.html new file mode 100644 index 000000000..09d5ed30f --- /dev/null +++ b/module__ftxui_8screen_8terminal.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.screen.terminal Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.screen.terminal Module Reference
    +
    +
    + +

    Module file for the Terminal namespace of the Screen module. +More...

    +

    Detailed Description

    +

    Module file for the Terminal namespace of the Screen module.

    +
    + + + +

    +Files

    file  terminal.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8util.html b/module__ftxui_8util.html new file mode 100644 index 000000000..868d15867 --- /dev/null +++ b/module__ftxui_8util.html @@ -0,0 +1,230 @@ + + + + + + + + +FTXUI: ftxui.util Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.util Module Reference
    +
    +
    + +

    Module file for FTXUI utility operations. +More...

    + + + + + + + + +

    Detailed Description

    +

    Module file for FTXUI utility operations.

    +

    +Exported Modules

    module  ftxui.util.autoreset
     Module file for the AutoReset class of the Util module.
     
    module  ftxui.util.ref
     Module file for the Ref classes of the Util module.
     
    + + + +

    +Files

    file  util.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8util_8autoreset.html b/module__ftxui_8util_8autoreset.html new file mode 100644 index 000000000..a6297a23b --- /dev/null +++ b/module__ftxui_8util_8autoreset.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.util.autoreset Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.util.autoreset Module Reference
    +
    +
    + +

    Module file for the AutoReset class of the Util module. +More...

    +

    Detailed Description

    +

    Module file for the AutoReset class of the Util module.

    +
    + + + +

    +Files

    file  autoreset.cppm
     
    +
    +
    + + + + + diff --git a/module__ftxui_8util_8ref.html b/module__ftxui_8util_8ref.html new file mode 100644 index 000000000..5e4740168 --- /dev/null +++ b/module__ftxui_8util_8ref.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: ftxui.util.ref Module Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui.util.ref Module Reference
    +
    +
    + +

    Module file for the Ref classes of the Util module. +More...

    +

    Detailed Description

    +

    Module file for the Ref classes of the Util module.

    +
    + + + +

    +Files

    file  ref.cppm
     
    +
    +
    + + + + + diff --git a/modules.html b/modules.html new file mode 100644 index 000000000..b095e8fda --- /dev/null +++ b/modules.html @@ -0,0 +1,249 @@ + + + + + + + + +FTXUI: Modules List + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Modules List
    +
    +
    +
    Here is a list of all modules with brief descriptions:
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
     Mftxui.componentModule file for FTXUI component operations
     Mftxui.component.animationC++20 module interface for the Animation namespace of the Component module
     Mftxui.component.captured_mouseModule file for the CapturedMouseInterface class of the Component module
     Mftxui.component.componentModule file for the Component classes of the Component module
     Mftxui.component.component_baseModule file for the ComponentBase class of the Component module
     Mftxui.component.component_optionsModule file for options for the Component class of the Component module
     Mftxui.component.eventModule file for the Event struct of the Component module
     Mftxui.component.loopModule file for the Loop class of the Component module
     Mftxui.component.mouseModule file for the Mouse struct of the Component module
     Mftxui.component.screen_interactiveModule file for the ScreenInteractive class of the Component module
     Mftxui.component.receiverModule file for the Receiver class of the Component module
     Mftxui.component.taskModule file for the Task class of the Component module
     Mftxui.domModule file for FTXUI main operations
     Mftxui.dom.canvasModule file for the Canvas struct of the Dom module
     Mftxui.dom.deprecatedModule file for deprecated parts of the Dom module
     Mftxui.dom.directionModule file for the Direction enum of the Dom module
     Mftxui.dom.elementsModule file for the Element classes and functions of the Dom module
     Mftxui.dom.flexbox_configModule file for the FlexboxConfig struct of the Dom module
     Mftxui.dom.linear_gradientModule file for the LinearGradient struct of the Dom module
     Mftxui.dom.nodeModule file for the Node class of the Dom module
     Mftxui.dom.requirementModule file for the Requirement struct of the Dom module
     Mftxui.dom.selectionModule file for the Selection class of the Dom module
     Mftxui.dom.tableModule file for the Table class of the Dom module
     MftxuiModule file re-exporting all FTXUI submodules
     Mftxui.screen.boxModule file for the Box struct of the Screen module
     Mftxui.screenModule file for FTXUI screen operations
     Mftxui.screen.colorModule file for the Color class of the Screen module
     Mftxui.screen.color_infoModule file for the ColorInfo struct of the Screen module
     Mftxui.screen.deprecatedModule file for the deprecated parts of the Screen module
     Mftxui.screen.imageModule file for the Image class of the Screen module
     Mftxui.screen.screenModule file for the Screen class of the Screen module
     Mftxui.screen.pixelModule file for the Pixel struct of the Screen module
     Mftxui.screen.stringModule file for string functions of the Screen module
     Mftxui.screen.terminalModule file for the Terminal namespace of the Screen module
     Mftxui.utilModule file for FTXUI utility operations
     Mftxui.util.autoresetModule file for the AutoReset class of the Util module
     Mftxui.util.refModule file for the Ref classes of the Util module
    +
    +
    +
    + + + + + diff --git a/modules_dup.js b/modules_dup.js new file mode 100644 index 000000000..d0137bc54 --- /dev/null +++ b/modules_dup.js @@ -0,0 +1,40 @@ +var modules_dup = +[ + [ "ftxui.component", "module__ftxui_8component.html", null ], + [ "ftxui.component.animation", "module__ftxui_8component_8animation.html", null ], + [ "ftxui.component.captured_mouse", "module__ftxui_8component_8captured__mouse.html", null ], + [ "ftxui.component.component", "module__ftxui_8component_8component.html", null ], + [ "ftxui.component.component_base", "module__ftxui_8component_8component__base.html", null ], + [ "ftxui.component.component_options", "module__ftxui_8component_8component__options.html", null ], + [ "ftxui.component.event", "module__ftxui_8component_8event.html", null ], + [ "ftxui.component.loop", "module__ftxui_8component_8loop.html", null ], + [ "ftxui.component.mouse", "module__ftxui_8component_8mouse.html", null ], + [ "ftxui.component.screen_interactive", "module__ftxui_8component_8screen__interactive.html", null ], + [ "ftxui.component.receiver", "module__ftxui_8component_8receiver.html", null ], + [ "ftxui.component.task", "module__ftxui_8component_8task.html", null ], + [ "ftxui.dom", "module__ftxui_8dom.html", null ], + [ "ftxui.dom.canvas", "module__ftxui_8dom_8canvas.html", null ], + [ "ftxui.dom.deprecated", "module__ftxui_8dom_8deprecated.html", null ], + [ "ftxui.dom.direction", "module__ftxui_8dom_8direction.html", null ], + [ "ftxui.dom.elements", "module__ftxui_8dom_8elements.html", null ], + [ "ftxui.dom.flexbox_config", "module__ftxui_8dom_8flexbox__config.html", null ], + [ "ftxui.dom.linear_gradient", "module__ftxui_8dom_8linear__gradient.html", null ], + [ "ftxui.dom.node", "module__ftxui_8dom_8node.html", null ], + [ "ftxui.dom.requirement", "module__ftxui_8dom_8requirement.html", null ], + [ "ftxui.dom.selection", "module__ftxui_8dom_8selection.html", null ], + [ "ftxui.dom.table", "module__ftxui_8dom_8table.html", null ], + [ "ftxui", "module__ftxui.html", null ], + [ "ftxui.screen.box", "module__ftxui_8screen_8box.html", null ], + [ "ftxui.screen", "module__ftxui_8screen.html", null ], + [ "ftxui.screen.color", "module__ftxui_8screen_8color.html", null ], + [ "ftxui.screen.color_info", "module__ftxui_8screen_8color__info.html", null ], + [ "ftxui.screen.deprecated", "module__ftxui_8screen_8deprecated.html", null ], + [ "ftxui.screen.image", "module__ftxui_8screen_8image.html", null ], + [ "ftxui.screen.screen", "module__ftxui_8screen_8screen.html", null ], + [ "ftxui.screen.pixel", "module__ftxui_8screen_8pixel.html", null ], + [ "ftxui.screen.string", "module__ftxui_8screen_8string.html", null ], + [ "ftxui.screen.terminal", "module__ftxui_8screen_8terminal.html", null ], + [ "ftxui.util", "module__ftxui_8util.html", null ], + [ "ftxui.util.autoreset", "module__ftxui_8util_8autoreset.html", null ], + [ "ftxui.util.ref", "module__ftxui_8util_8ref.html", null ] +]; \ No newline at end of file diff --git a/mouse_8cppm.html b/mouse_8cppm.html new file mode 100644 index 000000000..f915acbbb --- /dev/null +++ b/mouse_8cppm.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: mouse.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    mouse.cppm File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    +
    +
    + + + + + diff --git a/mouse_8cppm_source.html b/mouse_8cppm_source.html new file mode 100644 index 000000000..86363a48a --- /dev/null +++ b/mouse_8cppm_source.html @@ -0,0 +1,229 @@ + + + + + + + + +FTXUI: mouse.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    mouse.cppm
    +
    +
    +Go to the documentation of this file.
    1/// @module ftxui.component.mouse
    +
    2/// @brief Module file for the Mouse struct of the Component module
    +
    3
    +
    4module;
    +
    5
    + +
    7
    +
    8export module ftxui.component.mouse;
    +
    9
    +
    10/**
    +
    11 * @namespace ftxui
    +
    12 * @brief The FTXUI ftxui:: namespace
    +
    13 */
    +
    14export namespace ftxui {
    +
    15 using ftxui::Mouse;
    +
    16}
    +
    A mouse event. It contains the coordinate of the mouse, the button pressed and the modifier (shift,...
    Definition mouse.hpp:11
    +
    Module file for the Mouse struct of the Component module.
    + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    +
    + + + + + diff --git a/mouse_8hpp.html b/mouse_8hpp.html new file mode 100644 index 000000000..db26004d6 --- /dev/null +++ b/mouse_8hpp.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: mouse.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    mouse.hpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Classes

    struct  Mouse
     A mouse event. It contains the coordinate of the mouse, the button pressed and the modifier (shift, ctrl, meta). More...
     
    + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    +
    +
    + + + + + diff --git a/mouse_8hpp_source.html b/mouse_8hpp_source.html new file mode 100644 index 000000000..5361f4bb8 --- /dev/null +++ b/mouse_8hpp_source.html @@ -0,0 +1,284 @@ + + + + + + + + +FTXUI: mouse.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    mouse.hpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#ifndef FTXUI_COMPONENT_MOUSE_HPP
    +
    5#define FTXUI_COMPONENT_MOUSE_HPP
    +
    6namespace ftxui {
    +
    7
    +
    8/// @brief A mouse event. It contains the coordinate of the mouse, the button
    +
    9/// pressed and the modifier (shift, ctrl, meta).
    +
    10/// @ingroup component
    +
    +
    11struct Mouse {
    +
    +
    12 enum Button {
    +
    13 Left = 0,
    +
    14 Middle = 1,
    +
    15 Right = 2,
    +
    16 None = 3,
    + + +
    19 WheelLeft = 6, /// Supported terminal only.
    +
    20 WheelRight = 7, /// Supported terminal only.
    +
    21 };
    +
    +
    22
    +
    +
    23 enum Motion {
    + + +
    26 Moved = 2,
    +
    27 };
    +
    +
    28
    +
    29 // Button
    + +
    31
    +
    32 // Motion
    + +
    34
    +
    35 // Modifiers:
    +
    36 bool shift = false;
    +
    37 bool meta = false;
    +
    38 bool control = false;
    +
    39
    +
    40 // Coordinates:
    +
    41 int x = 0;
    +
    42 int y = 0;
    +
    43};
    +
    +
    44
    +
    45} // namespace ftxui
    +
    46
    +
    47#endif /* end of include guard: FTXUI_COMPONENT_MOUSE_HPP */
    + + + + + + + +
    @ WheelRight
    Supported terminal only.
    Definition mouse.hpp:20
    + + + + + + +
    bool meta
    Definition mouse.hpp:37
    + +
    Button button
    Definition mouse.hpp:30
    +
    bool shift
    Definition mouse.hpp:36
    +
    bool control
    Definition mouse.hpp:38
    +
    Motion motion
    Definition mouse.hpp:33
    +
    A mouse event. It contains the coordinate of the mouse, the button pressed and the modifier (shift,...
    Definition mouse.hpp:11
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    +
    + + + + + diff --git a/namespaceeasing.html b/namespaceeasing.html new file mode 100644 index 000000000..d563c283e --- /dev/null +++ b/namespaceeasing.html @@ -0,0 +1,214 @@ + + + + + + + + +FTXUI: easing Namespace Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    easing Namespace Referenceexport
    +
    +
    + +

    The FTXUI sf::animation::easing:: namespace. +More...

    +

    Detailed Description

    +

    The FTXUI sf::animation::easing:: namespace.

    +
    +
    + + + + + diff --git a/namespaceftxui.html b/namespaceftxui.html new file mode 100644 index 000000000..a87107cbc --- /dev/null +++ b/namespaceftxui.html @@ -0,0 +1,3154 @@ + + + + + + + + +FTXUI: ftxui Namespace Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui Namespace Reference
    +
    +
    + +

    The FTXUI ftxui:: namespace. +More...

    + + + + + + + + + + + + + + + + + + + + + + +

    +Namespaces

    namespace  animation
     The FTXUI ftxui::animation:: namespace.
     
    namespace  box_helper
     
    namespace  Container
     
    namespace  Dimension
     Define how the Screen's dimensions should look like.
     
    namespace  flexbox_helper
     
    namespace  literals
     
    namespace  task
     
    namespace  Terminal
     
    namespace  util
     
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Classes

    struct  AnimatedColorOption
     Option about a potentially animated color. More...
     
    struct  AnimatedColorsOption
     
    class  AnimationTask
     
    class  AutoReset
     Assign a value to a variable, reset its old value when going out of scope. More...
     
    struct  Box
     Box is a structure that represents a rectangular area in a 2D space. More...
     
    struct  ButtonOption
     Option for the AnimatedButton component. More...
     
    struct  Canvas
     Canvas is a drawable buffer associated with drawing operations. More...
     
    class  CapturedMouseInterface
     
    struct  CheckboxOption
     Option for the Checkbox component. More...
     
    class  Color
     Color is a class that represents a color in the terminal user interface. More...
     
    struct  ColorInfo
     ColorInfo is a structure that contains information about the terminal color palette. More...
     
    class  ComponentBase
     It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ftxui::Event. More...
     
    class  ConstRef
     An adapter. Own or reference an immutable object. More...
     
    class  ConstStringListRef
     An adapter. Reference a list of strings. More...
     
    class  ConstStringRef
     An adapter. Own or reference a constant string. For convenience, this class convert multiple immutable string toward a shared representation. More...
     
    struct  Dimensions
     Dimensions is a structure that represents the size of the terminal. More...
     
    struct  DropdownOption
     Option for the Dropdown component.A dropdown menu is a checkbox opening/closing a radiobox. More...
     
    struct  EntryState
     arguments for transform from |ButtonOption|, |CheckboxOption|, |RadioboxOption|, |MenuEntryOption|, |MenuOption|. More...
     
    struct  Event
     Represent an event. It can be key press event, a terminal resize, or more ... More...
     
    struct  FlexboxConfig
     FlexboxConfig is a configuration structure that defines the layout properties for a flexbox container. More...
     
    class  Image
     A rectangular grid of Pixel. More...
     
    struct  InputOption
     Option for the Input component. More...
     
    struct  InputState
     Used to define style for the Input component. More...
     
    struct  LinearGradient
     A class representing the settings for linear-gradient color effect. More...
     
    class  Loop
     Loop is a class that manages the event loop for a component. More...
     
    struct  MenuEntryOption
     Option for the MenuEntry component. More...
     
    struct  MenuOption
     Option for the Menu component. More...
     
    struct  Mouse
     A mouse event. It contains the coordinate of the mouse, the button pressed and the modifier (shift, ctrl, meta). More...
     
    class  Node
     Node is the base class for all elements in the DOM tree. More...
     
    class  NodeDecorator
     
    struct  Pixel
     A Unicode character and its associated style. More...
     
    struct  RadioboxOption
     Option for the Radiobox component. More...
     
    class  ReceiverImpl
     
    class  Ref
     An adapter. Own or reference an mutable object. More...
     
    struct  Requirement
     Requirement is a structure that defines the layout requirements for a Node in the terminal user interface. More...
     
    struct  ResizableSplitOption
     
    class  Screen
     A rectangular grid of Pixel. More...
     
    class  ScreenInteractive
     ScreenInteractive is a Screen that can handle events, run a main loop, and manage components. More...
     
    class  Selection
     Represents a selection in a terminal user interface. More...
     
    class  SenderImpl
     
    struct  SliderOption
     
    class  StringRef
     An adapter. Own or reference a constant string. For convenience, this class convert multiple mutable string toward a shared representation. More...
     
    class  Table
     Table is a utility to draw tables. More...
     
    class  TableSelection
     
    class  TerminalInputParser
     
    struct  UnderlineOption
     Option for the underline effect. More...
     
    struct  WindowOptions
     
    struct  WindowRenderState
     State passed to the Window component's render function. More...
     
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Typedefs

    using CapturedMouse = std::unique_ptr<CapturedMouseInterface>
     
    using ComponentDecorator = std::function<Component(Component)>
     
    using ElementDecorator = std::function<Element(Element)>
     
    using Component = std::shared_ptr<ComponentBase>
     
    using Components = std::vector<Component>
     
    template<class T >
    using Sender = std::unique_ptr<SenderImpl<T>>
     
    template<class T >
    using Receiver = std::unique_ptr<ReceiverImpl<T>>
     
    using Closure = std::function<void()>
     
    using Task = std::variant<Event, Closure, AnimationTask>
     
    using Element = std::shared_ptr<Node>
     
    using Elements = std::vector<Element>
     
    using Decorator = std::function<Element(Element)>
     
    using GraphFunction = std::function<std::vector<int>(int, int)>
     
    + + + + + + + + + + + + + +

    +Enumerations

    enum class  Direction {
    +  Up = 0 +,
    +  Down = 1 +,
    +  Left = 2 +,
    +  Right = 3 +
    + }
     Direction is an enumeration that represents the four cardinal directions. More...
     
    enum  BorderStyle {
    +  LIGHT +,
    +  DASHED +,
    +  HEAVY +,
    +  DOUBLE +,
    +  ROUNDED +,
    +  EMPTY +
    + }
     BorderStyle is an enumeration that represents the different styles of borders that can be applied to elements in the terminal UI. More...
     
    enum  WidthOrHeight {
    +  WIDTH +,
    +  HEIGHT +
    + }
     
    enum  Constraint {
    +  LESS_THAN +,
    +  EQUAL +,
    +  GREATER_THAN +
    + }
     
    enum class  WordBreakProperty : int8_t {
    +  ALetter +,
    +  CR +,
    +  Double_Quote +,
    +  Extend +,
    +  ExtendNumLet +,
    +  Format +,
    +  Hebrew_Letter +,
    +  Katakana +,
    +  LF +,
    +  MidLetter +,
    +  MidNum +,
    +  MidNumLet +,
    +  Newline +,
    +  Numeric +,
    +  Regional_Indicator +,
    +  Single_Quote +,
    +  WSegSpace +,
    +  ZWJ +
    + }
     
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Functions

    template<class T , class... Args>
    std::shared_ptr< T > Make (Args &&... args)
     
    Component operator| (Component component, ComponentDecorator decorator)
     
    Component operator| (Component component, ElementDecorator decorator)
     
    Componentoperator|= (Component &component, ComponentDecorator decorator)
     
    Componentoperator|= (Component &component, ElementDecorator decorator)
     
    Component Button (ButtonOption option)
     Draw a button. Execute a function when clicked.
     
    Component Button (ConstStringRef label, std::function< void()> on_click, ButtonOption option)
     Draw a button. Execute a function when clicked.
     
    Component Checkbox (CheckboxOption option)
     Draw checkable element.
     
    Component Checkbox (ConstStringRef label, bool *checked, CheckboxOption option)
     Draw checkable element.
     
    Component Input (InputOption option)
     An input box for editing text.
     
    Component Input (StringRef content, InputOption option)
     An input box for editing text.
     
    Component Input (StringRef content, StringRef placeholder, InputOption option)
     An input box for editing text.
     
    Component Menu (MenuOption option)
     A list of text. The focused element is selected.
     
    Component Menu (ConstStringListRef entries, int *selected, MenuOption option)
     A list of text. The focused element is selected.
     
    Component MenuEntry (MenuEntryOption option)
     A specific menu entry. They can be put into a Container::Vertical to form a menu.
     
    Component MenuEntry (ConstStringRef label, MenuEntryOption option)
     A specific menu entry. They can be put into a Container::Vertical to form a menu.
     
    Component Radiobox (RadioboxOption option)
     A list of element, where only one can be selected.
     
    Component Radiobox (ConstStringListRef entries, int *selected, RadioboxOption option)
     A list of element, where only one can be selected.
     
    Component Dropdown (ConstStringListRef entries, int *selected)
     A dropdown menu.
     
    Component Dropdown (DropdownOption option)
     A dropdown menu.
     
    Component Toggle (ConstStringListRef entries, int *selected)
     An horizontal list of elements. The user can navigate through them.
     
    template<typename T >
    Component Slider (SliderOption< T > options)
     A slider in any direction.
     
    Component Slider (ConstStringRef label, Ref< int > value, ConstRef< int > min, ConstRef< int > max, ConstRef< int > increment)
     An horizontal slider.
     
    Component Slider (ConstStringRef label, Ref< float > value, ConstRef< float > min=0.f, ConstRef< float > max=100.f, ConstRef< float > increment=5.f)
     
    Component Slider (ConstStringRef label, Ref< long > value, ConstRef< long > min=0L, ConstRef< long > max=100L, ConstRef< long > increment=5L)
     
    Component ResizableSplit (ResizableSplitOption options)
     A split in between two components.
     
    Component ResizableSplitLeft (Component main, Component back, int *main_size)
     An horizontal split in between two components, configurable using the mouse.
     
    Component ResizableSplitRight (Component main, Component back, int *main_size)
     An horizontal split in between two components, configurable using the mouse.
     
    Component ResizableSplitTop (Component main, Component back, int *main_size)
     An vertical split in between two components, configurable using the mouse.
     
    Component ResizableSplitBottom (Component main, Component back, int *main_size)
     An vertical split in between two components, configurable using the mouse.
     
    Component Renderer (Component child, std::function< Element()> render)
     Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
     
    Component Renderer (std::function< Element()> render)
     Return a component, using |render| to render its interface.
     
    Component Renderer (std::function< Element(bool)> render)
     Return a focusable component, using |render| to render its interface.
     
    ComponentDecorator Renderer (ElementDecorator decorator)
     Decorate a component, by decorating what it renders.
     
    Component CatchEvent (Component child, std::function< bool(Event)>)
     
    ComponentDecorator CatchEvent (std::function< bool(Event)> on_event)
     Decorate a component, using |on_event| to catch events. This function must returns true when the event has been handled, false otherwise.
     
    Component Maybe (Component child, const bool *show)
     Decorate a component |child|. It is shown only when |show| is true.
     
    Component Maybe (Component child, std::function< bool()> show)
     Decorate a component |child|. It is shown only when |show| returns true.
     
    ComponentDecorator Maybe (const bool *show)
     Decorate a component. It is shown only when |show| is true.
     
    ComponentDecorator Maybe (std::function< bool()> show)
     Decorate a component. It is shown only when the |show| function returns true.
     
    Component Modal (Component main, Component modal, const bool *show_modal)
     
    ComponentDecorator Modal (Component modal, const bool *show_modal)
     
    Component Collapsible (ConstStringRef label, Component child, Ref< bool > show)
     A collapsible component. It displays a checkbox with an arrow. Once activated, the child is displayed.
     
    Component Hoverable (Component component, bool *hover)
     Wrap a component. Gives the ability to know if it is hovered by the mouse.
     
    Component Hoverable (Component component, std::function< void()> on_enter, std::function< void()> on_leave)
     Wrap a component. Uses callbacks.
     
    Component Hoverable (Component component, std::function< void(bool)> on_change)
     Wrap a component. Gives the ability to know if it is hovered by the mouse.
     
    ComponentDecorator Hoverable (bool *hover)
     Wrap a component. Gives the ability to know if it is hovered by the mouse.
     
    ComponentDecorator Hoverable (std::function< void()> on_enter, std::function< void()> on_leave)
     Wrap a component. Gives the ability to know if it is hovered by the mouse.
     
    ComponentDecorator Hoverable (std::function< void(bool)> on_change)
     Wrap a component. Gives the ability to know if it is hovered by the mouse.
     
    Component Window (WindowOptions option)
     A draggeable / resizeable window. To use multiple of them, they must be stacked using Container::Stacked({...}) component;.
     
    template<class T >
    Receiver< T > MakeReceiver ()
     
    Element text (std::wstring text)
     Display a piece of unicode text.
     
    Element vtext (std::wstring text)
     Display a piece unicode text vertically.
     
    Elements paragraph (std::wstring text)
     
    Element operator| (Element element, Decorator decorator)
     From an element, apply a decorator.
     
    Elementoperator|= (Element &e, Decorator d)
     Apply a decorator to an element.
     
    Elements operator| (Elements elements, Decorator decorator)
     From a set of element, apply a decorator to every elements.
     
    Decorator operator| (Decorator a, Decorator b)
     Compose two decorator into one.
     
    Element text (std::string text)
     Display a piece of UTF8 encoded unicode text.
     
    Element vtext (std::string text)
     Display a piece of unicode text vertically.
     
    Element separator ()
     Draw a vertical or horizontal separation in between two other elements.
     
    Element separatorLight ()
     Draw a vertical or horizontal separation in between two other elements, using the LIGHT style.
     
    Element separatorDashed ()
     Draw a vertical or horizontal separation in between two other elements, using the DASHED style.
     
    Element separatorHeavy ()
     Draw a vertical or horizontal separation in between two other elements, using the HEAVY style.
     
    Element separatorDouble ()
     Draw a vertical or horizontal separation in between two other elements, using the DOUBLE style.
     
    Element separatorEmpty ()
     Draw a vertical or horizontal separation in between two other elements, using the EMPTY style.
     
    Element separatorStyled (BorderStyle style)
     Draw a vertical or horizontal separation in between two other elements.
     
    Element separator (Pixel pixel)
     Draw a separator in between two element filled with a given pixel.
     
    Element separatorCharacter (std::string value)
     Draw a vertical or horizontal separation in between two other elements.
     
    Element separatorHSelector (float left, float right, Color unselected_color, Color selected_color)
     Draw a horizontal bar, with the area in between left/right colored differently.
     
    Element separatorVSelector (float up, float down, Color unselected_color, Color selected_color)
     Draw an vertical bar, with the area in between up/downcolored differently.
     
    Element gauge (float progress)
     Draw a high definition progress bar.
     
    Element gaugeLeft (float progress)
     Draw a high definition progress bar progressing from right to left.
     
    Element gaugeRight (float progress)
     Draw a high definition progress bar progressing from left to right.
     
    Element gaugeUp (float progress)
     Draw a high definition progress bar progressing from bottom to top.
     
    Element gaugeDown (float progress)
     Draw a high definition progress bar progressing from top to bottom.
     
    Element gaugeDirection (float progress, Direction direction)
     Draw a high definition progress bar progressing in specified direction.
     
    Element border (Element child)
     Draw a border around the element.
     
    Element borderLight (Element child)
     Draw a light border around the element.
     
    Element borderDashed (Element child)
     Draw a dashed border around the element.
     
    Element borderHeavy (Element child)
     Draw a heavy border around the element.
     
    Element borderDouble (Element child)
     Draw a double border around the element.
     
    Element borderRounded (Element child)
     Draw a rounded border around the element.
     
    Element borderEmpty (Element child)
     Draw an empty border around the element.
     
    Decorator borderStyled (BorderStyle style)
     Same as border but with different styles.
     
    Decorator borderStyled (BorderStyle style, Color foreground_color)
     Same as border but with a foreground color and a different style.
     
    Decorator borderStyled (Color foreground_color)
     Same as border but with a foreground color.
     
    Decorator borderWith (const Pixel &pixel)
     Same as border but with a constant Pixel around the element.
     
    Element window (Element title, Element content, BorderStyle border)
     Draw window with a title and a border around the element.
     
    Element spinner (int charset_index, size_t image_index)
     Useful to represent the effect of time and/or events. This displays an ASCII art "video".
     
    Element paragraph (const std::string &the_text)
     Return an element drawing the paragraph on multiple lines.
     
    Element paragraphAlignLeft (const std::string &the_text)
     Return an element drawing the paragraph on multiple lines, aligned on the left.
     
    Element paragraphAlignRight (const std::string &the_text)
     Return an element drawing the paragraph on multiple lines, aligned on the right.
     
    Element paragraphAlignCenter (const std::string &the_text)
     Return an element drawing the paragraph on multiple lines, aligned on the center.
     
    Element paragraphAlignJustify (const std::string &the_text)
     Return an element drawing the paragraph on multiple lines, aligned using a justified alignment. the center.
     
    Element graph (GraphFunction graph_function)
     Draw a graph using a GraphFunction.
     
    Element emptyElement ()
     
    Element canvas (ConstRef< Canvas > canvas)
     Produce an element from a Canvas, or a reference to a Canvas.
     
    Element canvas (int width, int height, std::function< void(Canvas &)> fn)
     Produce an element drawing a canvas of requested size.
     
    Element canvas (std::function< void(Canvas &)> fn)
     Produce an element drawing a canvas.
     
    Element bold (Element child)
     Use a bold font, for elements with more emphasis.
     
    Element dim (Element child)
     Use a light font, for elements with less emphasis.
     
    Element italic (Element child)
     Apply a underlinedDouble to text.
     
    Element inverted (Element child)
     Add a filter that will invert the foreground and the background colors.
     
    Element underlined (Element child)
     Underline the given element.
     
    Element underlinedDouble (Element child)
     Apply a underlinedDouble to text.
     
    Element blink (Element child)
     The text drawn alternates in between visible and hidden.
     
    Element strikethrough (Element child)
     Apply a strikethrough to text.
     
    Decorator color (Color c)
     Decorate using a foreground color.
     
    Decorator bgcolor (Color color)
     Decorate using a background color.
     
    Decorator color (const LinearGradient &gradient)
     Decorate using a linear-gradient effect on the foreground color.
     
    Decorator bgcolor (const LinearGradient &gradient)
     Decorate using a linear-gradient effect on the background color.
     
    Element color (Color color, Element child)
     Set the foreground color of an element.
     
    Element bgcolor (Color color, Element child)
     Set the background color of an element.
     
    Element color (const LinearGradient &gradient, Element child)
     Set the foreground color of an element with linear-gradient effect.
     
    Element bgcolor (const LinearGradient &gradient, Element child)
     Set the background color of an element with linear-gradient effect.
     
    Decorator focusPosition (int x, int y)
     Used inside a frame, this force the view to be scrolled toward a a given position. The position is expressed in the numbers of cells.
     
    Decorator focusPositionRelative (float x, float y)
     Used inside a frame, this force the view to be scrolled toward a a given position. The position is expressed in proportion of the requested size.
     
    Element automerge (Element child)
     Enable character to be automatically merged with others nearby.
     
    Decorator hyperlink (std::string link)
     Decorate using a hyperlink. The link will be opened when the user clicks on it. This is supported only on a limited set of terminal emulators. List: https://github.com/Alhadis/OSC8-Adoption/.
     
    Element hyperlink (std::string link, Element child)
     Make the rendered area clickable using a web browser. The link will be opened when the user clicks on it. This is supported only on a limited set of terminal emulators. List: https://github.com/Alhadis/OSC8-Adoption/.
     
    Element selectionStyleReset (Element child)
     Reset the selection style of an element.
     
    Decorator selectionColor (Color foreground)
     Set the color of an element when selected.
     
    Decorator selectionBackgroundColor (Color foreground)
     Set the background color of an element when selected. Note that the style is applied on top of the existing style.
     
    Decorator selectionForegroundColor (Color foreground)
     Set the foreground color of an element when selected. Note that the style is applied on top of the existing style.
     
    Decorator selectionStyle (std::function< void(Pixel &)> style)
     Set the style of an element when selected.
     
    Element hbox (Elements children)
     A container displaying elements horizontally one by one.
     
    Element vbox (Elements children)
     A container displaying elements vertically one by one.
     
    Element dbox (Elements children_)
     Stack several element on top of each other.
     
    Element flexbox (Elements children, FlexboxConfig config)
     A container displaying elements on row/columns and capable of wrapping on the next column/row when full.
     
    Element gridbox (std::vector< Elements > lines)
     A container displaying a grid of elements.
     
    Element hflow (Elements children)
     A container displaying elements in rows from left to right. When filled, it starts on a new row below.
     
    Element vflow (Elements children)
     A container displaying elements in rows from top to bottom. When filled, it starts on a new columns on the right. filled, it starts on a new row. is full, it starts a new row.
     
    Element flex (Element child)
     Make a child element to expand proportionally to the space left in a container.
     
    Element flex_grow (Element child)
     Expand if possible.
     
    Element flex_shrink (Element child)
     Minimize if needed.
     
    Element xflex (Element child)
     Expand/Minimize if possible/needed on the X axis.
     
    Element xflex_grow (Element child)
     Expand if possible on the X axis.
     
    Element xflex_shrink (Element child)
     Minimize if needed on the X axis.
     
    Element yflex (Element child)
     Expand/Minimize if possible/needed on the Y axis.
     
    Element yflex_grow (Element child)
     Expand if possible on the Y axis.
     
    Element yflex_shrink (Element child)
     Minimize if needed on the Y axis.
     
    Element notflex (Element child)
     Make the element not flexible.
     
    Element filler ()
     An element that will take expand proportionally to the space left in a container.
     
    Decorator size (WidthOrHeight direction, Constraint constraint, int value)
     Apply a constraint on the size of an element.
     
    Element frame (Element child)
     Allow an element to be displayed inside a 'virtual' area. It size can be larger than its container. In this case only a smaller portion is displayed. The view is scrollable to make the focused element visible.
     
    Element xframe (Element child)
     Same as frame, but only on the x-axis.
     
    Element yframe (Element child)
     Same as frame, but only on the y-axis.
     
    Element focus (Element child)
     Set the child to be the one focused among its siblings.
     
    Element select (Element child)
     Set the child to be the one focused among its siblings.
     
    Element focusCursorBlock (Element child)
     Same as focus, but set the cursor shape to be a still block.
     
    Element focusCursorBlockBlinking (Element child)
     Same as focus, but set the cursor shape to be a blinking block.
     
    Element focusCursorBar (Element child)
     Same as focus, but set the cursor shape to be a still block.
     
    Element focusCursorBarBlinking (Element child)
     Same as focus, but set the cursor shape to be a blinking bar.
     
    Element focusCursorUnderline (Element child)
     Same as focus, but set the cursor shape to be a still underline.
     
    Element focusCursorUnderlineBlinking (Element child)
     Same as focus, but set the cursor shape to be a blinking underline.
     
    Element vscroll_indicator (Element child)
     Display a vertical scrollbar on the right. Colors follow the content.
     
    Element hscroll_indicator (Element child)
     Display a horizontal scrollbar at the bottom. Colors follow the content.
     
    Decorator reflect (Box &box)
     
    Element clear_under (Element element)
     Before drawing |child|, clear the pixels below. This is useful in combination with dbox.
     
    Element hcenter (Element child)
     Center an element horizontally.
     
    Element vcenter (Element child)
     Center an element vertically.
     
    Element center (Element child)
     Center an element horizontally and vertically.
     
    Element align_right (Element child)
     Align an element on the right side.
     
    Element nothing (Element element)
     A decoration doing absolutely nothing.
     
    void Render (Screen &screen, const Element &element)
     Display an element on a ftxui::Screen.
     
    void Render (Screen &screen, Node *node)
     Display an element on a ftxui::Screen.
     
    void Render (Screen &screen, Node *node, Selection &selection)
     
    std::string GetNodeSelectedContent (Screen &screen, Node *node, Selection &selection)
     
    Color operator""_rgb (unsigned long long int combined)
     Creates a color from a combined hex RGB representation, e.g. 0x808000_rgb.
     
    ColorInfo GetColorInfo (Color::Palette256 index)
     
    ColorInfo GetColorInfo (Color::Palette16 index)
     
    int wchar_width (wchar_t)
     
    int wstring_width (const std::wstring &)
     
    std::string to_string (const std::wstring &s)
     Convert a std::wstring into a UTF8 std::string.
     
    std::wstring to_wstring (const std::string &s)
     Convert a UTF8 std::string into a std::wstring.
     
    template<typename T >
    std::wstring to_wstring (T s)
     
    int string_width (const std::string &)
     
    std::vector< std::string > Utf8ToGlyphs (const std::string &input)
     
    std::vector< int > CellToGlyphIndex (const std::string &input)
     
    Component CatchEvent (Component child, std::function< bool(Event event)> on_event)
     Return a component, using |on_event| to catch events. This function must returns true when the event has been handled, false otherwise.
     
    template Component Slider (SliderOption< int8_t >)
     
    template Component Slider (SliderOption< int16_t >)
     
    template Component Slider (SliderOption< int32_t >)
     
    template Component Slider (SliderOption< int64_t >)
     
    template Component Slider (SliderOption< uint8_t >)
     
    template Component Slider (SliderOption< uint16_t >)
     
    template Component Slider (SliderOption< uint32_t >)
     
    template Component Slider (SliderOption< uint64_t >)
     
    template Component Slider (SliderOption< float >)
     
    template Component Slider (SliderOption< double >)
     
    bool EatCodePoint (const std::string &input, size_t start, size_t *end, uint32_t *ucs)
     
    bool EatCodePoint (const std::wstring &input, size_t start, size_t *end, uint32_t *ucs)
     
    bool IsCombining (uint32_t ucs)
     
    bool IsFullWidth (uint32_t ucs)
     
    bool IsControl (uint32_t ucs)
     
    WordBreakProperty CodepointToWordBreakProperty (uint32_t codepoint)
     
    size_t GlyphPrevious (const std::string &input, size_t start)
     
    size_t GlyphNext (const std::string &input, size_t start)
     
    size_t GlyphIterate (const std::string &input, int glyph_offset, size_t start)
     
    int GlyphCount (const std::string &input)
     
    std::vector< WordBreakPropertyUtf8ToWordBreakProperty (const std::string &input)
     
    bool IsWordBreakingCharacter (const std::string &input, size_t glyph_index)
     
    + + + + + +

    +Variables

    const std::map< std::string, std::string > g_uniformize
     
    const std::array< ColorInfo, 256 > palette256
     
    +

    Detailed Description

    +

    The FTXUI ftxui:: namespace.

    +

    Typedef Documentation

    + +

    ◆ CapturedMouse

    + +
    +
    + + + + +
    using CapturedMouse = std::unique_ptr<CapturedMouseInterface>
    +
    + +

    Definition at line 20 of file captured_mouse.hpp.

    + +
    +
    + +

    ◆ ComponentDecorator

    + +
    +
    + + + + +
    using ComponentDecorator = std::function<Component(Component)>
    +
    + +

    Definition at line 32 of file component.hpp.

    + +
    +
    + +

    ◆ ElementDecorator

    + +
    +
    + + + + +
    using ElementDecorator = std::function<Element(Element)>
    +
    + +

    Definition at line 33 of file component.hpp.

    + +
    +
    + +

    ◆ Component

    + +
    +
    + + + + +
    typedef std::shared_ptr< ComponentBase > Component = std::shared_ptr<ComponentBase>
    +
    + +

    Definition at line 24 of file component_base.hpp.

    + +
    +
    + +

    ◆ Components

    + +
    +
    + + + + +
    using Components = std::vector<Component>
    +
    + +

    Definition at line 25 of file component_base.hpp.

    + +
    +
    + +

    ◆ Sender

    + +
    +
    +
    +template<class T >
    + + + + +
    using Sender = std::unique_ptr<SenderImpl<T>>
    +
    + +

    Definition at line 52 of file receiver.hpp.

    + +
    +
    + +

    ◆ Receiver

    + +
    +
    +
    +template<class T >
    + + + + +
    using Receiver = std::unique_ptr<ReceiverImpl<T>>
    +
    + +

    Definition at line 54 of file receiver.hpp.

    + +
    +
    + +

    ◆ Closure

    + +
    +
    + + + + +
    using Closure = std::function<void()>
    +
    + +

    Definition at line 13 of file task.hpp.

    + +
    +
    + +

    ◆ Task

    + +
    +
    + + + + +
    using Task = std::variant<Event, Closure, AnimationTask>
    +
    + +

    Definition at line 14 of file task.hpp.

    + +
    +
    + +

    ◆ Element

    + +
    +
    + + + + +
    typedef std::shared_ptr< Node > Element = std::shared_ptr<Node>
    +
    + +

    Definition at line 22 of file elements.hpp.

    + +
    +
    + +

    ◆ Elements

    + +
    +
    + + + + +
    typedef std::vector< Element > Elements = std::vector<Element>
    +
    + +

    Definition at line 23 of file elements.hpp.

    + +
    +
    + +

    ◆ Decorator

    + +
    +
    + + + + +
    using Decorator = std::function<Element(Element)>
    +
    + +

    Definition at line 24 of file elements.hpp.

    + +
    +
    + +

    ◆ GraphFunction

    + +
    +
    + + + + +
    using GraphFunction = std::function<std::vector<int>(int, int)>
    +
    + +

    Definition at line 25 of file elements.hpp.

    + +
    +
    +

    Enumeration Type Documentation

    + +

    ◆ WidthOrHeight

    + +
    +
    + + + + +
    enum WidthOrHeight
    +
    + + + +
    Enumerator
    WIDTH 
    HEIGHT 
    + +

    Definition at line 161 of file elements.hpp.

    + +
    +
    + +

    ◆ Constraint

    + +
    +
    + + + + +
    enum Constraint
    +
    + + + + +
    Enumerator
    LESS_THAN 
    EQUAL 
    GREATER_THAN 
    + +

    Definition at line 162 of file elements.hpp.

    + +
    +
    + +

    ◆ WordBreakProperty

    + +
    +
    + + + + + +
    + + + + +
    enum class WordBreakProperty : int8_t
    +
    +strong
    +
    + + + + + + + + + + + + + + + + + + + +
    Enumerator
    ALetter 
    CR 
    Double_Quote 
    Extend 
    ExtendNumLet 
    Format 
    Hebrew_Letter 
    Katakana 
    LF 
    MidLetter 
    MidNum 
    MidNumLet 
    Newline 
    Numeric 
    Regional_Indicator 
    Single_Quote 
    WSegSpace 
    ZWJ 
    + +

    Definition at line 40 of file string_internal.hpp.

    + +
    +
    +

    Function Documentation

    + +

    ◆ Make()

    + +
    +
    +
    +template<class T , class... Args>
    + + + + + + + +
    std::shared_ptr< T > Make (Args &&... args)
    +
    + +

    Definition at line 27 of file component.hpp.

    + +
    +
    + +

    ◆ operator|() [1/2]

    + +
    +
    + + + + + + + + + + + +
    Component operator| (Component component,
    ComponentDecorator decorator )
    +
    + +

    Definition at line 12 of file component/util.cpp.

    + +
    +
    + +

    ◆ operator|() [2/2]

    + +
    +
    + + + + + + + + + + + +
    Component operator| (Component component,
    ElementDecorator decorator )
    +
    + +

    Definition at line 17 of file component/util.cpp.

    + +
    +
    + +

    ◆ operator|=() [1/2]

    + +
    +
    + + + + + + + + + + + +
    Component & operator|= (Component & component,
    ComponentDecorator decorator )
    +
    + +

    Definition at line 22 of file component/util.cpp.

    + +
    +
    + +

    ◆ operator|=() [2/2]

    + +
    +
    + + + + + + + + + + + +
    Component & operator|= (Component & component,
    ElementDecorator decorator )
    +
    + +

    Definition at line 28 of file component/util.cpp.

    + +
    +
    + +

    ◆ Slider() [1/13]

    + +
    +
    +
    +template<typename T >
    + + + + + + + +
    Component Slider (SliderOption< T > options)
    +
    + +

    A slider in any direction.

    +
    Parameters
    + + +
    optionsThe options
    +
    +
    +

    +Example

    +
    +
    int value = 50;
    +
    auto slider = Slider({
    +
    .value = &value,
    +
    .min = 0,
    +
    .max = 100,
    +
    .increment= 20,
    +
    });
    +
    screen.Loop(slider);
    +
    static ScreenInteractive TerminalOutput()
    +
    Component Slider(SliderOption< T > options)
    A slider in any direction.
    +
    +

    Definition at line 316 of file src/ftxui/component/slider.cpp.

    + +
    +
    + +

    ◆ Slider() [2/13]

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Component Slider (ConstStringRef label,
    Ref< float > value,
    ConstRef< float > min = 0.f,
    ConstRef< float > max = 100.f,
    ConstRef< float > increment = 5.f )
    +
    + +

    Definition at line 273 of file src/ftxui/component/slider.cpp.

    + +
    +
    + +

    ◆ Slider() [3/13]

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Component Slider (ConstStringRef label,
    Ref< long > value,
    ConstRef< long > min = 0L,
    ConstRef< long > max = 100L,
    ConstRef< long > increment = 5L )
    +
    + +

    Definition at line 286 of file src/ftxui/component/slider.cpp.

    + +
    +
    + +

    ◆ ResizableSplit()

    + +
    +
    + + + + + + + +
    Component ResizableSplit (ResizableSplitOption options)
    +
    + +

    A split in between two components.

    +
    Parameters
    + + +
    optionsall the parameters.
    +
    +
    +

    +Example

    +
    auto left = Renderer([] { return text("Left") | center;});
    +
    auto right = Renderer([] { return text("right") | center;});
    +
    int left_size = 10;
    +
    auto component = ResizableSplit({
    +
    .main = left,
    +
    .back = right,
    +
    .direction = Direction::Left,
    +
    .main_size = &left_size,
    +
    .separator_func = [] { return separatorDouble(); },
    +
    });
    +
    Component Renderer(Component child, std::function< Element()>)
    Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
    +
    Element center(Element)
    Center an element horizontally and vertically.
    +
    Element text(std::wstring text)
    Display a piece of unicode text.
    Definition text.cpp:160
    +
    Element separatorDouble()
    Draw a vertical or horizontal separation in between two other elements, using the DOUBLE style.
    + +
    Component ResizableSplit(ResizableSplitOption options)
    A split in between two components.
    +
    std::uint8_t left
    Definition screen.cpp:130
    +
    std::uint8_t right
    Definition screen.cpp:132
    +

    +Output

    +
    +
    left ║ right
    +
    +
    +

    Definition at line 186 of file src/ftxui/component/resizable_split.cpp.

    + +
    +
    + +

    ◆ CatchEvent()

    + +
    +
    + + + + + + + + + + + +
    Component CatchEvent (Component child,
    std::function< bool(Event)>  )
    +
    + +
    +
    + +

    ◆ Collapsible()

    + +
    +
    + + + + + + + + + + + + + + + + +
    Component Collapsible (ConstStringRef label,
    Component child,
    Ref< bool > show )
    +
    + +

    A collapsible component. It displays a checkbox with an arrow. Once activated, the child is displayed.

    +
    Parameters
    + + + + +
    labelThe label of the checkbox.
    childThe child to display.
    showHold the state about whether the child is displayed or not.
    +
    +
    +

    +Example

    +
    auto component = Collapsible("Show details", details);
    +
    Component Collapsible(ConstStringRef label, Component child, Ref< bool > show=false)
    A collapsible component. It displays a checkbox with an arrow. Once activated, the child is displayed...
    +

    +Output

    +
    ▼ Show details
    +
    <details component>
    +
    +

    Definition at line 33 of file src/ftxui/component/collapsible.cpp.

    + +
    +
    + +

    ◆ MakeReceiver()

    + +
    +
    +
    +template<class T >
    + + + + + + + +
    Receiver< T > MakeReceiver ()
    +
    + +

    Definition at line 149 of file receiver.hpp.

    + +
    +
    + +

    ◆ paragraph()

    + +
    +
    + + + + + + + +
    Elements paragraph (std::wstring text)
    +
    + +
    +
    + +

    ◆ separatorHSelector()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + +
    Element separatorHSelector (float left,
    float right,
    Color unselected_color,
    Color selected_color )
    +
    + +

    Draw a horizontal bar, with the area in between left/right colored differently.

    +
    Parameters
    + + + + + +
    leftthe left limit of the active area.
    rightthe right limit of the active area.
    selected_colorthe color of the selected area.
    unselected_colorthe color of the unselected area.
    +
    +
    +

    +Example

    +
    + + +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    Element separatorHSelector(float left, float right, Color unselected_color, Color selected_color)
    Draw a horizontal bar, with the area in between left/right colored differently.
    +
    +

    Definition at line 442 of file src/ftxui/dom/separator.cpp.

    + +
    +
    + +

    ◆ separatorVSelector()

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + +
    Element separatorVSelector (float up,
    float down,
    Color unselected_color,
    Color selected_color )
    +
    + +

    Draw an vertical bar, with the area in between up/downcolored differently.

    +
    Parameters
    + + + + + +
    upthe left limit of the active area.
    downthe right limit of the active area.
    selected_colorthe color of the selected area.
    unselected_colorthe color of the unselected area.
    +
    +
    +

    +Example

    + +

    Definition at line 512 of file src/ftxui/dom/separator.cpp.

    + +
    +
    + +

    ◆ graph()

    + +
    +
    + + + + + + + +
    Element graph (GraphFunction graph_function)
    +
    + +

    Draw a graph using a GraphFunction.

    +
    Parameters
    + + +
    graph_functionthe function to be called to get the data.
    +
    +
    + +

    Definition at line 71 of file src/ftxui/dom/graph.cpp.

    + +
    +
    + +

    ◆ canvas() [1/3]

    + +
    +
    + + + + + + + +
    Element canvas (ConstRef< Canvas > canvas)
    +
    + +

    Produce an element from a Canvas, or a reference to a Canvas.

    + +

    Definition at line 891 of file src/ftxui/dom/canvas.cpp.

    + +
    +
    + +

    ◆ canvas() [2/3]

    + +
    +
    + + + + + + + + + + + + + + + + +
    Element canvas (int width,
    int height,
    std::function< void(Canvas &)> fn )
    +
    + +

    Produce an element drawing a canvas of requested size.

    +
    Parameters
    + + + + +
    widththe width of the canvas.
    heightthe height of the canvas.
    fna function drawing the canvas.
    +
    +
    + +

    Definition at line 908 of file src/ftxui/dom/canvas.cpp.

    + +
    +
    + +

    ◆ canvas() [3/3]

    + +
    +
    + + + + + + + +
    Element canvas (std::function< void(Canvas &)> fn)
    +
    + +

    Produce an element drawing a canvas.

    +
    Parameters
    + + +
    fna function drawing the canvas.
    +
    +
    + +

    Definition at line 938 of file src/ftxui/dom/canvas.cpp.

    + +
    +
    + +

    ◆ selectionStyleReset()

    + +
    +
    + + + + + + + +
    Element selectionStyleReset (Element child)
    +
    + +

    Reset the selection style of an element.

    +
    Parameters
    + + +
    childThe input element.
    +
    +
    +
    Returns
    The output element with the selection style reset.
    + +

    Definition at line 55 of file selection_style.cpp.

    + +
    +
    + +

    ◆ selectionColor()

    + +
    +
    + + + + + + + +
    Decorator selectionColor (Color foreground)
    +
    + +

    Set the color of an element when selected.

    +
    Parameters
    + + +
    foregroundThe color to be applied. Note that the style is applied on top of the existing style.
    +
    +
    + +

    Definition at line 78 of file selection_style.cpp.

    + +
    +
    + +

    ◆ selectionBackgroundColor()

    + +
    +
    + + + + + + + +
    Decorator selectionBackgroundColor (Color foreground)
    +
    + +

    Set the background color of an element when selected. Note that the style is applied on top of the existing style.

    + +

    Definition at line 61 of file selection_style.cpp.

    + +
    +
    + +

    ◆ selectionForegroundColor()

    + +
    +
    + + + + + + + +
    Decorator selectionForegroundColor (Color foreground)
    +
    + +

    Set the foreground color of an element when selected. Note that the style is applied on top of the existing style.

    + +

    Definition at line 69 of file selection_style.cpp.

    + +
    +
    + +

    ◆ selectionStyle()

    + +
    +
    + + + + + + + +
    Decorator selectionStyle (std::function< void(Pixel &)> style)
    +
    + +

    Set the style of an element when selected.

    +
    Parameters
    + + +
    styleThe style to be applied. Note that the style is applied on top of the existing style.
    +
    +
    + +

    Definition at line 86 of file selection_style.cpp.

    + +
    +
    + +

    ◆ hbox()

    + +
    +
    + + + + + + + +
    Element hbox (Elements children)
    +
    + +

    A container displaying elements horizontally one by one.

    +
    Parameters
    + + +
    childrenThe elements in the container
    +
    +
    +
    Returns
    The container.
    +

    +Example

    +
    +
    text("Left"),
    +
    text("Right"),
    +
    });
    +
    Element hbox(Elements)
    A container displaying elements horizontally one by one.
    Definition hbox.cpp:94
    +
    +

    Definition at line 94 of file hbox.cpp.

    + +
    +
    + +

    ◆ flexbox()

    + +
    +
    + + + + + + + + + + + +
    Element flexbox (Elements children,
    FlexboxConfig config )
    +
    + +

    A container displaying elements on row/columns and capable of wrapping on the next column/row when full.

    +
    Parameters
    + + + +
    childrenThe elements in the container
    configThe option
    +
    +
    +
    Returns
    The container.
    +

    +Example

    +
    +
    text("element 1"),
    +
    text("element 2"),
    +
    text("element 3"),
    +
    }, FlexboxConfig()
    + + +
    .SetGapMainAxis(1)
    +
    .SetGapCrossAxis(1)
    +
    )
    +
    @ Column
    Flex items are laid out in a column.
    + +
    Element flexbox(Elements, FlexboxConfig config=FlexboxConfig())
    A container displaying elements on row/columns and capable of wrapping on the next column/row when fu...
    Definition flexbox.cpp:251
    +
    +

    Definition at line 251 of file flexbox.cpp.

    + +
    +
    + +

    ◆ gridbox()

    + +
    +
    + + + + + + + +
    Element gridbox (std::vector< Elements > lines)
    +
    + +

    A container displaying a grid of elements.

    +
    Parameters
    + + +
    linesA list of lines, each line being a list of elements.
    +
    +
    +
    Returns
    The container.
    +

    +Example

    +
    auto cell = [](const char* t) { return text(t) | border; };
    +
    auto document = gridbox({
    +
    {cell("north-west") , cell("north") , cell("north-east")} ,
    +
    {cell("west") , cell("center") , cell("east")} ,
    +
    {cell("south-west") , cell("south") , cell("south-east")} ,
    +
    });
    +
    Element border(Element)
    Draw a border around the element.
    +
    Element gridbox(std::vector< Elements > lines)
    A container displaying a grid of elements.
    +

    Output:

    ╭──────────╮╭──────╮╭──────────╮
    +
    │north-west││north ││north-east│
    +
    ╰──────────╯╰──────╯╰──────────╯
    +
    ╭──────────╮╭──────╮╭──────────╮
    +
    │west ││center││east │
    +
    ╰──────────╯╰──────╯╰──────────╯
    +
    ╭──────────╮╭──────╮╭──────────╮
    +
    │south-west││south ││south-east│
    +
    ╰──────────╯╰──────╯╰──────────╯
    +
    +

    Definition at line 173 of file src/ftxui/dom/gridbox.cpp.

    + +
    +
    + +

    ◆ hflow()

    + +
    +
    + + + + + + + +
    Element hflow (Elements children)
    +
    + +

    A container displaying elements in rows from left to right. When filled, it starts on a new row below.

    +
    Parameters
    + + +
    childrenThe elements in the container
    +
    +
    +
    Returns
    The container.
    +

    +Example

    +
    +
    text("element 1"),
    +
    text("element 2"),
    +
    text("element 3"),
    +
    });
    +
    Element hflow(Elements)
    A container displaying elements in rows from left to right. When filled, it starts on a new row below...
    Definition flexbox.cpp:269
    +
    +

    Definition at line 269 of file flexbox.cpp.

    + +
    +
    + +

    ◆ vflow()

    + +
    +
    + + + + + + + +
    Element vflow (Elements children)
    +
    + +

    A container displaying elements in rows from top to bottom. When filled, it starts on a new columns on the right. filled, it starts on a new row. is full, it starts a new row.

    +
    Parameters
    + + +
    childrenThe elements in the container
    +
    +
    +
    Returns
    The container.
    +

    +Example

    +
    +
    text("element 1"),
    +
    text("element 2"),
    +
    text("element 3"),
    +
    });
    +
    Element vflow(Elements)
    A container displaying elements in rows from top to bottom. When filled, it starts on a new columns o...
    Definition flexbox.cpp:289
    +
    +

    Definition at line 289 of file flexbox.cpp.

    + +
    +
    + +

    ◆ frame()

    + +
    +
    + + + + + + + +
    Element frame (Element child)
    +
    + +

    Allow an element to be displayed inside a 'virtual' area. It size can be larger than its container. In this case only a smaller portion is displayed. The view is scrollable to make the focused element visible.

    +
    See also
    frame
    +
    +xframe
    +
    +yframe
    + +

    Definition at line 118 of file frame.cpp.

    + +
    +
    + +

    ◆ xframe()

    + +
    +
    + + + + + + + +
    Element xframe (Element child)
    +
    + +

    Same as frame, but only on the x-axis.

    +
    See also
    frame
    +
    +xframe
    +
    +yframe
    + +

    Definition at line 126 of file frame.cpp.

    + +
    +
    + +

    ◆ yframe()

    + +
    +
    + + + + + + + +
    Element yframe (Element child)
    +
    + +

    Same as frame, but only on the y-axis.

    +
    See also
    frame
    +
    +xframe
    +
    +yframe
    + +

    Definition at line 134 of file frame.cpp.

    + +
    +
    + +

    ◆ select()

    + +
    +
    + + + + + + + +
    Element select (Element child)
    +
    + +

    Set the child to be the one focused among its siblings.

    +

    This is deprecated. Use focus instead.

    Parameters
    + + +
    childThe element to be focused.
    +
    +
    + +

    Definition at line 108 of file frame.cpp.

    + +
    +
    + +

    ◆ reflect()

    + +
    +
    + + + + + + + +
    Decorator reflect (Box & box)
    +
    + +

    Definition at line 43 of file reflect.cpp.

    + +
    +
    + +

    ◆ Render()

    + +
    +
    + + + + + + + + + + + + + + + + +
    void Render (Screen & screen,
    Node * node,
    Selection & selection )
    +
    + +

    Definition at line 96 of file node.cpp.

    + +
    +
    + +

    ◆ GetNodeSelectedContent()

    + +
    +
    + + + + + + + + + + + + + + + + +
    std::string GetNodeSelectedContent (Screen & screen,
    Node * node,
    Selection & selection )
    +
    + +

    Definition at line 168 of file node.cpp.

    + +
    +
    + +

    ◆ GetColorInfo() [1/2]

    + +
    +
    + + + + + + + +
    ColorInfo GetColorInfo (Color::Palette256 index)
    +
    + +

    Definition at line 272 of file color_info.cpp.

    + +
    +
    + +

    ◆ GetColorInfo() [2/2]

    + +
    +
    + + + + + + + +
    ColorInfo GetColorInfo (Color::Palette16 index)
    +
    + +

    Definition at line 276 of file color_info.cpp.

    + +
    +
    + +

    ◆ wchar_width()

    + +
    +
    + + + + + + + +
    int wchar_width (wchar_t ucs)
    +
    + +

    Definition at line 1314 of file string.cpp.

    + +
    +
    + +

    ◆ wstring_width()

    + +
    +
    + + + + + + + +
    int wstring_width (const std::wstring & text)
    +
    + +

    Definition at line 1318 of file string.cpp.

    + +
    +
    + +

    ◆ to_string()

    + +
    +
    + + + + + + + +
    std::string to_string (const std::wstring & s)
    +
    + +

    Convert a std::wstring into a UTF8 std::string.

    + +

    Definition at line 1566 of file string.cpp.

    + +
    +
    + +

    ◆ to_wstring() [1/2]

    + +
    +
    + + + + + + + +
    std::wstring to_wstring (const std::string & s)
    +
    + +

    Convert a UTF8 std::string into a std::wstring.

    + +

    Definition at line 1638 of file string.cpp.

    + +
    +
    + +

    ◆ to_wstring() [2/2]

    + +
    +
    +
    +template<typename T >
    + + + + + + + +
    std::wstring to_wstring (T s)
    +
    + +

    Definition at line 15 of file string.hpp.

    + +
    +
    + +

    ◆ string_width()

    + +
    +
    + + + + + + + +
    int string_width (const std::string & input)
    +
    + +

    Definition at line 1331 of file string.cpp.

    + +
    +
    + +

    ◆ Utf8ToGlyphs()

    + +
    +
    + + + + + + + +
    std::vector< std::string > Utf8ToGlyphs (const std::string & input)
    +
    + +

    Definition at line 1358 of file string.cpp.

    + +
    +
    + +

    ◆ CellToGlyphIndex()

    + +
    +
    + + + + + + + +
    std::vector< int > CellToGlyphIndex (const std::string & input)
    +
    + +

    Definition at line 1465 of file string.cpp.

    + +
    +
    + +

    ◆ Slider() [4/13]

    + +
    +
    + + + + + + + +
    template Component Slider (SliderOption< int8_t > )
    +
    + +
    +
    + +

    ◆ Slider() [5/13]

    + +
    +
    + + + + + + + +
    template Component Slider (SliderOption< int16_t > )
    +
    + +
    +
    + +

    ◆ Slider() [6/13]

    + +
    +
    + + + + + + + +
    template Component Slider (SliderOption< int32_t > )
    +
    + +
    +
    + +

    ◆ Slider() [7/13]

    + +
    +
    + + + + + + + +
    template Component Slider (SliderOption< int64_t > )
    +
    + +
    +
    + +

    ◆ Slider() [8/13]

    + +
    +
    + + + + + + + +
    template Component Slider (SliderOption< uint8_t > )
    +
    + +
    +
    + +

    ◆ Slider() [9/13]

    + +
    +
    + + + + + + + +
    template Component Slider (SliderOption< uint16_t > )
    +
    + +
    +
    + +

    ◆ Slider() [10/13]

    + +
    +
    + + + + + + + +
    template Component Slider (SliderOption< uint32_t > )
    +
    + +
    +
    + +

    ◆ Slider() [11/13]

    + +
    +
    + + + + + + + +
    template Component Slider (SliderOption< uint64_t > )
    +
    + +
    +
    + +

    ◆ Slider() [12/13]

    + +
    +
    + + + + + + + +
    template Component Slider (SliderOption< float > )
    +
    + +
    +
    + +

    ◆ Slider() [13/13]

    + +
    +
    + + + + + + + +
    template Component Slider (SliderOption< double > )
    +
    + +
    +
    + +

    ◆ EatCodePoint() [1/2]

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + +
    bool EatCodePoint (const std::string & input,
    size_t start,
    size_t * end,
    uint32_t * ucs )
    +
    + +

    Definition at line 1174 of file string.cpp.

    + +
    +
    + +

    ◆ EatCodePoint() [2/2]

    + +
    +
    + + + + + + + + + + + + + + + + + + + + + +
    bool EatCodePoint (const std::wstring & input,
    size_t start,
    size_t * end,
    uint32_t * ucs )
    +
    + +

    Definition at line 1244 of file string.cpp.

    + +
    +
    + +

    ◆ IsCombining()

    + +
    +
    + + + + + + + +
    bool IsCombining (uint32_t ucs)
    +
    + +

    Definition at line 1282 of file string.cpp.

    + +
    +
    + +

    ◆ IsFullWidth()

    + +
    +
    + + + + + + + +
    bool IsFullWidth (uint32_t ucs)
    +
    + +

    Definition at line 1286 of file string.cpp.

    + +
    +
    + +

    ◆ IsControl()

    + +
    +
    + + + + + + + +
    bool IsControl (uint32_t ucs)
    +
    + +

    Definition at line 1294 of file string.cpp.

    + +
    +
    + +

    ◆ CodepointToWordBreakProperty()

    + +
    +
    + + + + + + + +
    WordBreakProperty CodepointToWordBreakProperty (uint32_t codepoint)
    +
    + +

    Definition at line 1308 of file string.cpp.

    + +
    +
    + +

    ◆ GlyphPrevious()

    + +
    +
    + + + + + + + + + + + +
    size_t GlyphPrevious (const std::string & input,
    size_t start )
    +
    + +

    Definition at line 1400 of file string.cpp.

    + +
    +
    + +

    ◆ GlyphNext()

    + +
    +
    + + + + + + + + + + + +
    size_t GlyphNext (const std::string & input,
    size_t start )
    +
    + +

    Definition at line 1425 of file string.cpp.

    + +
    +
    + +

    ◆ GlyphIterate()

    + +
    +
    + + + + + + + + + + + + + + + + +
    size_t GlyphIterate (const std::string & input,
    int glyph_offset,
    size_t start )
    +
    + +

    Definition at line 1451 of file string.cpp.

    + +
    +
    + +

    ◆ GlyphCount()

    + +
    +
    + + + + + + + +
    int GlyphCount (const std::string & input)
    +
    + +

    Definition at line 1506 of file string.cpp.

    + +
    +
    + +

    ◆ Utf8ToWordBreakProperty()

    + +
    +
    + + + + + + + +
    std::vector< WordBreakProperty > Utf8ToWordBreakProperty (const std::string & input)
    +
    + +

    Definition at line 1534 of file string.cpp.

    + +
    +
    + +

    ◆ IsWordBreakingCharacter()

    + +
    +
    + + + + + + + + + + + +
    bool IsWordBreakingCharacter (const std::string & input,
    size_t glyph_index )
    +
    + +
    +
    +

    Variable Documentation

    + +

    ◆ g_uniformize

    + +
    +
    + + + + +
    const std::map<std::string, std::string> g_uniformize
    +
    + +

    Definition at line 19 of file terminal_input_parser.cpp.

    + +
    +
    + +

    ◆ palette256

    + +
    +
    + + + + +
    const std::array<ColorInfo, 256> palette256
    +
    + +

    Definition at line 13 of file color_info.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/namespaceftxui_1_1Container.html b/namespaceftxui_1_1Container.html new file mode 100644 index 000000000..c7faba4d2 --- /dev/null +++ b/namespaceftxui_1_1Container.html @@ -0,0 +1,233 @@ + + + + + + + + +FTXUI: ftxui::Container Namespace Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui::Container Namespace Reference
    +
    +
    + + + + + + + + + + + + + + + + + + + + +

    +Functions

    Component Vertical (Components children)
     A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or 'j'/'k' keys.
     
    Component Vertical (Components children, int *selector)
     A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or 'j'/'k' keys. This is useful for implementing a Menu for instance.
     
    Component Horizontal (Components children)
     A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow key or 'h'/'l' keys.
     
    Component Horizontal (Components children, int *selector)
     A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow key or 'h'/'l' keys.
     
    Component Tab (Components children, int *selector)
     A list of components, where only one is drawn and interacted with at a time. The |selector| gives the index of the selected component. This is useful to implement tabs.
     
    Component Stacked (Components children)
     A list of components to be stacked on top of each other. Events are propagated to the first component, then the second if not handled, etc. The components are drawn in the reverse order they are given. When a component take focus, it is put at the front, without changing the relative order of the other elements.
     
    +
    +
    + + + + + diff --git a/namespaceftxui_1_1Dimension.html b/namespaceftxui_1_1Dimension.html new file mode 100644 index 000000000..01daef812 --- /dev/null +++ b/namespaceftxui_1_1Dimension.html @@ -0,0 +1,282 @@ + + + + + + + + +FTXUI: ftxui::Dimension Namespace Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui::Dimension Namespace Reference
    +
    +
    + +

    Define how the Screen's dimensions should look like. +More...

    + + + + + + + + +

    +Functions

    Dimensions Fit (Element &, bool extend_beyond_screen=false)
     
    Dimensions Fixed (int)
     
    Dimensions Full ()
     
    +

    Detailed Description

    +

    Define how the Screen's dimensions should look like.

    +

    Function Documentation

    + +

    ◆ Fit()

    + +
    +
    + + + + + + + + + + + +
    Dimensions Fit (Element & ,
    bool extend_beyond_screen = false )
    +
    + +
    +
    + +

    ◆ Fixed()

    + +
    +
    + + + + + + + +
    Dimensions Fixed (int )
    +
    + +
    +
    + +

    ◆ Full()

    + +
    +
    + + + + + + + +
    Dimensions Full ()
    +
    + +
    +
    +
    +
    + + + + + diff --git a/namespaceftxui_1_1Terminal.html b/namespaceftxui_1_1Terminal.html new file mode 100644 index 000000000..03f902127 --- /dev/null +++ b/namespaceftxui_1_1Terminal.html @@ -0,0 +1,271 @@ + + + + + + + + +FTXUI: ftxui::Terminal Namespace Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui::Terminal Namespace Reference
    +
    +
    + + + + + +

    +Enumerations

    enum  Color {
    +  Palette1 +,
    +  Palette16 +,
    +  Palette256 +,
    +  TrueColor +
    + }
     Color is an enumeration that represents the color support of the terminal. More...
     
    + + + + + + + + + + + + + +

    +Functions

    Dimensions Size ()
     Get the terminal size.
     
    void SetFallbackSize (const Dimensions &fallbackSize)
     Override terminal size in case auto-detection fails.
     
    Color ColorSupport ()
     Get the color support of the terminal.
     
    void SetColorSupport (Color color)
     Override terminal color support in case auto-detection fails.
     
    +

    Function Documentation

    + +

    ◆ SetFallbackSize()

    + +
    +
    + + + + + + + +
    void SetFallbackSize (const Dimensions & fallbackSize)
    +
    + +

    Override terminal size in case auto-detection fails.

    +
    Parameters
    + + +
    fallbackSizeTerminal dimensions to fallback to
    +
    +
    + +

    Definition at line 124 of file terminal.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/namespaceftxui_1_1animation.html b/namespaceftxui_1_1animation.html new file mode 100644 index 000000000..048acb07b --- /dev/null +++ b/namespaceftxui_1_1animation.html @@ -0,0 +1,296 @@ + + + + + + + + +FTXUI: ftxui::animation Namespace Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui::animation Namespace Reference
    +
    +
    + +

    The FTXUI ftxui::animation:: namespace. +More...

    + + + + +

    +Namespaces

    namespace  easing
     
    + + + + + +

    +Classes

    class  Animator
     
    class  Params
     
    + + + + + + + +

    +Typedefs

    using Clock = std::chrono::steady_clock
     
    using TimePoint = std::chrono::time_point<Clock>
     
    using Duration = std::chrono::duration<float>
     
    + + + + +

    +Functions

    void RequestAnimationFrame ()
     RequestAnimationFrame is a function that requests a new frame to be drawn in the next animation cycle.
     
    +

    Detailed Description

    +

    The FTXUI ftxui::animation:: namespace.

    +

    Typedef Documentation

    + +

    ◆ Clock

    + +
    +
    + + + + +
    using Clock = std::chrono::steady_clock
    +
    + +

    Definition at line 28 of file animation.hpp.

    + +
    +
    + +

    ◆ TimePoint

    + +
    +
    + + + + +
    using TimePoint = std::chrono::time_point<Clock>
    +
    + +

    Definition at line 29 of file animation.hpp.

    + +
    +
    + +

    ◆ Duration

    + +
    +
    + + + + +
    using Duration = std::chrono::duration<float>
    +
    + +

    Definition at line 30 of file animation.hpp.

    + +
    +
    +
    +
    + + + + + diff --git a/namespaceftxui_1_1animation_1_1easing.html b/namespaceftxui_1_1animation_1_1easing.html new file mode 100644 index 000000000..17e471537 --- /dev/null +++ b/namespaceftxui_1_1animation_1_1easing.html @@ -0,0 +1,896 @@ + + + + + + + + +FTXUI: ftxui::animation::easing Namespace Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui::animation::easing Namespace Reference
    +
    +
    + + + + +

    +Typedefs

    using Function = std::function<float(float)>
     
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Functions

    float Linear (float p)
     Modeled after the line y = x.
     
    float QuadraticIn (float p)
     Modeled after the parabola y = x^2.
     
    float QuadraticOut (float p)
     
    float QuadraticInOut (float p)
     
    float CubicIn (float p)
     
    float CubicOut (float p)
     
    float CubicInOut (float p)
     
    float QuarticIn (float p)
     
    float QuarticOut (float p)
     
    float QuarticInOut (float p)
     
    float QuinticIn (float p)
     
    float QuinticOut (float p)
     
    float QuinticInOut (float p)
     
    float SineIn (float p)
     
    float SineOut (float p)
     
    float SineInOut (float p)
     
    float CircularIn (float p)
     
    float CircularOut (float p)
     
    float CircularInOut (float p)
     
    float ExponentialIn (float p)
     
    float ExponentialOut (float p)
     
    float ExponentialInOut (float p)
     
    float ElasticIn (float p)
     
    float ElasticOut (float p)
     
    float ElasticInOut (float p)
     
    float BackIn (float p)
     
    float BackOut (float p)
     
    float BackInOut (float p)
     
    float BounceIn (float p)
     
    float BounceOut (float p)
     
    float BounceInOut (float p)
     
    +

    Typedef Documentation

    + +

    ◆ Function

    + +
    +
    + + + + +
    using Function = std::function<float(float)>
    +
    + +

    Definition at line 45 of file animation.hpp.

    + +
    +
    +

    Function Documentation

    + +

    ◆ Linear()

    + +
    +
    + + + + + + + +
    float Linear (float p)
    +
    + +

    Modeled after the line y = x.

    + +

    Definition at line 29 of file animation.cpp.

    + +
    +
    + +

    ◆ QuadraticIn()

    + +
    +
    + + + + + + + +
    float QuadraticIn (float p)
    +
    + +

    Modeled after the parabola y = x^2.

    + +

    Definition at line 34 of file animation.cpp.

    + +
    +
    + +

    ◆ QuadraticOut()

    + +
    +
    + + + + + + + +
    float QuadraticOut (float p)
    +
    + +

    Definition at line 39 of file animation.cpp.

    + +
    +
    + +

    ◆ QuadraticInOut()

    + +
    +
    + + + + + + + +
    float QuadraticInOut (float p)
    +
    + +

    Definition at line 46 of file animation.cpp.

    + +
    +
    + +

    ◆ CubicIn()

    + +
    +
    + + + + + + + +
    float CubicIn (float p)
    +
    + +

    Definition at line 51 of file animation.cpp.

    + +
    +
    + +

    ◆ CubicOut()

    + +
    +
    + + + + + + + +
    float CubicOut (float p)
    +
    + +

    Definition at line 56 of file animation.cpp.

    + +
    +
    + +

    ◆ CubicInOut()

    + +
    +
    + + + + + + + +
    float CubicInOut (float p)
    +
    + +

    Definition at line 64 of file animation.cpp.

    + +
    +
    + +

    ◆ QuarticIn()

    + +
    +
    + + + + + + + +
    float QuarticIn (float p)
    +
    + +

    Definition at line 73 of file animation.cpp.

    + +
    +
    + +

    ◆ QuarticOut()

    + +
    +
    + + + + + + + +
    float QuarticOut (float p)
    +
    + +

    Definition at line 78 of file animation.cpp.

    + +
    +
    + +

    ◆ QuarticInOut()

    + +
    +
    + + + + + + + +
    float QuarticInOut (float p)
    +
    + +

    Definition at line 86 of file animation.cpp.

    + +
    +
    + +

    ◆ QuinticIn()

    + +
    +
    + + + + + + + +
    float QuinticIn (float p)
    +
    + +

    Definition at line 95 of file animation.cpp.

    + +
    +
    + +

    ◆ QuinticOut()

    + +
    +
    + + + + + + + +
    float QuinticOut (float p)
    +
    + +

    Definition at line 100 of file animation.cpp.

    + +
    +
    + +

    ◆ QuinticInOut()

    + +
    +
    + + + + + + + +
    float QuinticInOut (float p)
    +
    + +

    Definition at line 108 of file animation.cpp.

    + +
    +
    + +

    ◆ SineIn()

    + +
    +
    + + + + + + + +
    float SineIn (float p)
    +
    + +

    Definition at line 117 of file animation.cpp.

    + +
    +
    + +

    ◆ SineOut()

    + +
    +
    + + + + + + + +
    float SineOut (float p)
    +
    + +

    Definition at line 122 of file animation.cpp.

    + +
    +
    + +

    ◆ SineInOut()

    + +
    +
    + + + + + + + +
    float SineInOut (float p)
    +
    + +

    Definition at line 127 of file animation.cpp.

    + +
    +
    + +

    ◆ CircularIn()

    + +
    +
    + + + + + + + +
    float CircularIn (float p)
    +
    + +

    Definition at line 132 of file animation.cpp.

    + +
    +
    + +

    ◆ CircularOut()

    + +
    +
    + + + + + + + +
    float CircularOut (float p)
    +
    + +

    Definition at line 137 of file animation.cpp.

    + +
    +
    + +

    ◆ CircularInOut()

    + +
    +
    + + + + + + + +
    float CircularInOut (float p)
    +
    + +

    Definition at line 144 of file animation.cpp.

    + +
    +
    + +

    ◆ ExponentialIn()

    + +
    +
    + + + + + + + +
    float ExponentialIn (float p)
    +
    + +

    Definition at line 152 of file animation.cpp.

    + +
    +
    + +

    ◆ ExponentialOut()

    + +
    +
    + + + + + + + +
    float ExponentialOut (float p)
    +
    + +

    Definition at line 157 of file animation.cpp.

    + +
    +
    + +

    ◆ ExponentialInOut()

    + +
    +
    + + + + + + + +
    float ExponentialInOut (float p)
    +
    + +

    Definition at line 164 of file animation.cpp.

    + +
    +
    + +

    ◆ ElasticIn()

    + +
    +
    + + + + + + + +
    float ElasticIn (float p)
    +
    + +

    Definition at line 177 of file animation.cpp.

    + +
    +
    + +

    ◆ ElasticOut()

    + +
    +
    + + + + + + + +
    float ElasticOut (float p)
    +
    + +

    Definition at line 184 of file animation.cpp.

    + +
    +
    + +

    ◆ ElasticInOut()

    + +
    +
    + + + + + + + +
    float ElasticInOut (float p)
    +
    + +

    Definition at line 191 of file animation.cpp.

    + +
    +
    + +

    ◆ BackIn()

    + +
    +
    + + + + + + + +
    float BackIn (float p)
    +
    + +

    Definition at line 202 of file animation.cpp.

    + +
    +
    + +

    ◆ BackOut()

    + +
    +
    + + + + + + + +
    float BackOut (float p)
    +
    + +

    Definition at line 207 of file animation.cpp.

    + +
    +
    + +

    ◆ BackInOut()

    + +
    +
    + + + + + + + +
    float BackInOut (float p)
    +
    + +

    Definition at line 215 of file animation.cpp.

    + +
    +
    + +

    ◆ BounceIn()

    + +
    +
    + + + + + + + +
    float BounceIn (float p)
    +
    + +

    Definition at line 224 of file animation.cpp.

    + +
    +
    + +

    ◆ BounceOut()

    + +
    +
    + + + + + + + +
    float BounceOut (float p)
    +
    + +

    Definition at line 228 of file animation.cpp.

    + +
    +
    + +

    ◆ BounceInOut()

    + +
    +
    + + + + + + + +
    float BounceInOut (float p)
    +
    + +

    Definition at line 244 of file animation.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/namespaceftxui_1_1box__helper.html b/namespaceftxui_1_1box__helper.html new file mode 100644 index 000000000..e5c5636fc --- /dev/null +++ b/namespaceftxui_1_1box__helper.html @@ -0,0 +1,247 @@ + + + + + + + + +FTXUI: ftxui::box_helper Namespace Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui::box_helper Namespace Reference
    +
    +
    + + + + +

    +Classes

    struct  Element
     
    + + + +

    +Functions

    void Compute (std::vector< Element > *elements, int target_size)
     
    +

    Function Documentation

    + +

    ◆ Compute()

    + +
    +
    + + + + + + + + + + + +
    void Compute (std::vector< Element > * elements,
    int target_size )
    +
    + +

    Definition at line 65 of file box_helper.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/namespaceftxui_1_1flexbox__helper.html b/namespaceftxui_1_1flexbox__helper.html new file mode 100644 index 000000000..9caeb1cf4 --- /dev/null +++ b/namespaceftxui_1_1flexbox__helper.html @@ -0,0 +1,247 @@ + + + + + + + + +FTXUI: ftxui::flexbox_helper Namespace Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui::flexbox_helper Namespace Reference
    +
    +
    + + + + + + + + +

    +Classes

    struct  Block
     
    struct  Global
     
    struct  Line
     
    + + + +

    +Functions

    void Compute (Global &global)
     
    +

    Function Documentation

    + +

    ◆ Compute()

    + +
    +
    + + + + + + + +
    void Compute (Global & global)
    +
    + +

    Definition at line 369 of file flexbox_helper.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/namespaceftxui_1_1literals.html b/namespaceftxui_1_1literals.html new file mode 100644 index 000000000..64e5bbd79 --- /dev/null +++ b/namespaceftxui_1_1literals.html @@ -0,0 +1,240 @@ + + + + + + + + +FTXUI: ftxui::literals Namespace Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui::literals Namespace Reference
    +
    +
    + + + + + +

    +Functions

    Color operator""_rgb (unsigned long long int combined)
     Creates a color from a combined hex RGB representation, e.g. 0x808000_rgb.
     
    +

    Function Documentation

    + +

    ◆ operator""_rgb()

    + +
    +
    + + + + + + + +
    Color operator""_rgb (unsigned long long int combined)
    +
    + +

    Creates a color from a combined hex RGB representation, e.g. 0x808000_rgb.

    + +

    Definition at line 280 of file screen/color.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/namespaceftxui_1_1task.html b/namespaceftxui_1_1task.html new file mode 100644 index 000000000..846db816b --- /dev/null +++ b/namespaceftxui_1_1task.html @@ -0,0 +1,247 @@ + + + + + + + + +FTXUI: ftxui::task Namespace Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui::task Namespace Reference
    +
    +
    + + + + + + + + +

    +Classes

    struct  PendingTask
     
    struct  TaskQueue
     
    class  TaskRunner
     
    + + + + +

    +Typedefs

    using Task = std::function<void()>
     A task represents a unit of work.
     
    +

    Typedef Documentation

    + +

    ◆ Task

    + +
    +
    + + + + +
    using Task = std::function<void()>
    +
    + +

    A task represents a unit of work.

    + +

    Definition at line 14 of file task_internal.hpp.

    + +
    +
    +
    +
    + + + + + diff --git a/namespaceftxui_1_1util.html b/namespaceftxui_1_1util.html new file mode 100644 index 000000000..a6198c549 --- /dev/null +++ b/namespaceftxui_1_1util.html @@ -0,0 +1,257 @@ + + + + + + + + +FTXUI: ftxui::util Namespace Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ftxui::util Namespace Reference
    +
    +
    + + + + + +

    +Functions

    template<class T >
    constexpr const T & clamp (const T &v, const T &lo, const T &hi)
     
    +

    Function Documentation

    + +

    ◆ clamp()

    + +
    +
    +
    +template<class T >
    + + + + + +
    + + + + + + + + + + + + + + + + +
    const T & clamp (const T & v,
    const T & lo,
    const T & hi )
    +
    +constexpr
    +
    + +

    Definition at line 11 of file util.hpp.

    + +
    +
    +
    +
    + + + + + diff --git a/namespacemembers.html b/namespacemembers.html new file mode 100644 index 000000000..4c4b517b6 --- /dev/null +++ b/namespacemembers.html @@ -0,0 +1,211 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace members with links to the namespace documentation for each member:
    + +

    - a -

      +
    • align_right() : ftxui
    • +
    • automerge() : ftxui
    • +
    +
    +
    + + + + + diff --git a/namespacemembers_b.html b/namespacemembers_b.html new file mode 100644 index 000000000..da1fe42a8 --- /dev/null +++ b/namespacemembers_b.html @@ -0,0 +1,229 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace members with links to the namespace documentation for each member:
    + +

    - b -

    +
    +
    + + + + + diff --git a/namespacemembers_c.html b/namespacemembers_c.html new file mode 100644 index 000000000..bf559378b --- /dev/null +++ b/namespacemembers_c.html @@ -0,0 +1,235 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace members with links to the namespace documentation for each member:
    + +

    - c -

    +
    +
    + + + + + diff --git a/namespacemembers_d.html b/namespacemembers_d.html new file mode 100644 index 000000000..ad539acfb --- /dev/null +++ b/namespacemembers_d.html @@ -0,0 +1,217 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace members with links to the namespace documentation for each member:
    + +

    - d -

    +
    +
    + + + + + diff --git a/namespacemembers_dup.js b/namespacemembers_dup.js new file mode 100644 index 000000000..144a80f56 --- /dev/null +++ b/namespacemembers_dup.js @@ -0,0 +1,26 @@ +var namespacemembers_dup = +[ + [ "a", "namespacemembers.html", null ], + [ "b", "namespacemembers_b.html", null ], + [ "c", "namespacemembers_c.html", null ], + [ "d", "namespacemembers_d.html", null ], + [ "e", "namespacemembers_e.html", null ], + [ "f", "namespacemembers_f.html", null ], + [ "g", "namespacemembers_g.html", null ], + [ "h", "namespacemembers_h.html", null ], + [ "i", "namespacemembers_i.html", null ], + [ "l", "namespacemembers_l.html", null ], + [ "m", "namespacemembers_m.html", null ], + [ "n", "namespacemembers_n.html", null ], + [ "o", "namespacemembers_o.html", null ], + [ "p", "namespacemembers_p.html", null ], + [ "q", "namespacemembers_q.html", null ], + [ "r", "namespacemembers_r.html", null ], + [ "s", "namespacemembers_s.html", null ], + [ "t", "namespacemembers_t.html", null ], + [ "u", "namespacemembers_u.html", null ], + [ "v", "namespacemembers_v.html", null ], + [ "w", "namespacemembers_w.html", null ], + [ "x", "namespacemembers_x.html", null ], + [ "y", "namespacemembers_y.html", null ] +]; \ No newline at end of file diff --git a/namespacemembers_e.html b/namespacemembers_e.html new file mode 100644 index 000000000..50e19bfd7 --- /dev/null +++ b/namespacemembers_e.html @@ -0,0 +1,222 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace members with links to the namespace documentation for each member:
    + +

    - e -

    +
    +
    + + + + + diff --git a/namespacemembers_enum.html b/namespacemembers_enum.html new file mode 100644 index 000000000..6301a3ed5 --- /dev/null +++ b/namespacemembers_enum.html @@ -0,0 +1,213 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace enums with links to the namespace documentation for each enum:
    +
    +
    + + + + + diff --git a/namespacemembers_eval.html b/namespacemembers_eval.html new file mode 100644 index 000000000..fd2151293 --- /dev/null +++ b/namespacemembers_eval.html @@ -0,0 +1,222 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace enum values with links to the namespace documentation for each enum value:
    +
    +
    + + + + + diff --git a/namespacemembers_f.html b/namespacemembers_f.html new file mode 100644 index 000000000..617a2441d --- /dev/null +++ b/namespacemembers_f.html @@ -0,0 +1,228 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace members with links to the namespace documentation for each member:
    + +

    - f -

    +
    +
    + + + + + diff --git a/namespacemembers_func.html b/namespacemembers_func.html new file mode 100644 index 000000000..fb1949dce --- /dev/null +++ b/namespacemembers_func.html @@ -0,0 +1,211 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace functions with links to the namespace documentation for each function:
    + +

    - a -

      +
    • align_right() : ftxui
    • +
    • automerge() : ftxui
    • +
    +
    +
    + + + + + diff --git a/namespacemembers_func.js b/namespacemembers_func.js new file mode 100644 index 000000000..426b196f1 --- /dev/null +++ b/namespacemembers_func.js @@ -0,0 +1,26 @@ +var namespacemembers_func = +[ + [ "a", "namespacemembers_func.html", null ], + [ "b", "namespacemembers_func_b.html", null ], + [ "c", "namespacemembers_func_c.html", null ], + [ "d", "namespacemembers_func_d.html", null ], + [ "e", "namespacemembers_func_e.html", null ], + [ "f", "namespacemembers_func_f.html", null ], + [ "g", "namespacemembers_func_g.html", null ], + [ "h", "namespacemembers_func_h.html", null ], + [ "i", "namespacemembers_func_i.html", null ], + [ "l", "namespacemembers_func_l.html", null ], + [ "m", "namespacemembers_func_m.html", null ], + [ "n", "namespacemembers_func_n.html", null ], + [ "o", "namespacemembers_func_o.html", null ], + [ "p", "namespacemembers_func_p.html", null ], + [ "q", "namespacemembers_func_q.html", null ], + [ "r", "namespacemembers_func_r.html", null ], + [ "s", "namespacemembers_func_s.html", null ], + [ "t", "namespacemembers_func_t.html", null ], + [ "u", "namespacemembers_func_u.html", null ], + [ "v", "namespacemembers_func_v.html", null ], + [ "w", "namespacemembers_func_w.html", null ], + [ "x", "namespacemembers_func_x.html", null ], + [ "y", "namespacemembers_func_y.html", null ] +]; \ No newline at end of file diff --git a/namespacemembers_func_b.html b/namespacemembers_func_b.html new file mode 100644 index 000000000..00c1567fd --- /dev/null +++ b/namespacemembers_func_b.html @@ -0,0 +1,228 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace functions with links to the namespace documentation for each function:
    + +

    - b -

    +
    +
    + + + + + diff --git a/namespacemembers_func_c.html b/namespacemembers_func_c.html new file mode 100644 index 000000000..5a7a3c453 --- /dev/null +++ b/namespacemembers_func_c.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace functions with links to the namespace documentation for each function:
    + +

    - c -

    +
    +
    + + + + + diff --git a/namespacemembers_func_d.html b/namespacemembers_func_d.html new file mode 100644 index 000000000..b6a4a41b2 --- /dev/null +++ b/namespacemembers_func_d.html @@ -0,0 +1,212 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace functions with links to the namespace documentation for each function:
    + +

    - d -

    +
    +
    + + + + + diff --git a/namespacemembers_func_e.html b/namespacemembers_func_e.html new file mode 100644 index 000000000..020189367 --- /dev/null +++ b/namespacemembers_func_e.html @@ -0,0 +1,217 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace functions with links to the namespace documentation for each function:
    + +

    - e -

    +
    +
    + + + + + diff --git a/namespacemembers_func_f.html b/namespacemembers_func_f.html new file mode 100644 index 000000000..0783073b2 --- /dev/null +++ b/namespacemembers_func_f.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace functions with links to the namespace documentation for each function:
    + +

    - f -

    +
    +
    + + + + + diff --git a/namespacemembers_func_g.html b/namespacemembers_func_g.html new file mode 100644 index 000000000..47448b6c3 --- /dev/null +++ b/namespacemembers_func_g.html @@ -0,0 +1,223 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace functions with links to the namespace documentation for each function:
    + +

    - g -

    +
    +
    + + + + + diff --git a/namespacemembers_func_h.html b/namespacemembers_func_h.html new file mode 100644 index 000000000..0461035dd --- /dev/null +++ b/namespacemembers_func_h.html @@ -0,0 +1,216 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace functions with links to the namespace documentation for each function:
    + +

    - h -

    +
    +
    + + + + + diff --git a/namespacemembers_func_i.html b/namespacemembers_func_i.html new file mode 100644 index 000000000..f4558dcb6 --- /dev/null +++ b/namespacemembers_func_i.html @@ -0,0 +1,216 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace functions with links to the namespace documentation for each function:
    + +

    - i -

    +
    +
    + + + + + diff --git a/namespacemembers_func_l.html b/namespacemembers_func_l.html new file mode 100644 index 000000000..c4eb3a316 --- /dev/null +++ b/namespacemembers_func_l.html @@ -0,0 +1,210 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace functions with links to the namespace documentation for each function:
    + +

    - l -

    +
    +
    + + + + + diff --git a/namespacemembers_func_m.html b/namespacemembers_func_m.html new file mode 100644 index 000000000..33fa4df1b --- /dev/null +++ b/namespacemembers_func_m.html @@ -0,0 +1,215 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace functions with links to the namespace documentation for each function:
    + +

    - m -

    +
    +
    + + + + + diff --git a/namespacemembers_func_n.html b/namespacemembers_func_n.html new file mode 100644 index 000000000..1a3a07acb --- /dev/null +++ b/namespacemembers_func_n.html @@ -0,0 +1,211 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace functions with links to the namespace documentation for each function:
    + +

    - n -

    +
    +
    + + + + + diff --git a/namespacemembers_func_o.html b/namespacemembers_func_o.html new file mode 100644 index 000000000..cbd5629fc --- /dev/null +++ b/namespacemembers_func_o.html @@ -0,0 +1,212 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace functions with links to the namespace documentation for each function:
    + +

    - o -

    +
    +
    + + + + + diff --git a/namespacemembers_func_p.html b/namespacemembers_func_p.html new file mode 100644 index 000000000..bdc0bbb67 --- /dev/null +++ b/namespacemembers_func_p.html @@ -0,0 +1,214 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace functions with links to the namespace documentation for each function:
    + +

    - p -

      +
    • paragraph() : ftxui
    • +
    • paragraphAlignCenter() : ftxui
    • +
    • paragraphAlignJustify() : ftxui
    • +
    • paragraphAlignLeft() : ftxui
    • +
    • paragraphAlignRight() : ftxui
    • +
    +
    +
    + + + + + diff --git a/namespacemembers_func_q.html b/namespacemembers_func_q.html new file mode 100644 index 000000000..6fa62eb0d --- /dev/null +++ b/namespacemembers_func_q.html @@ -0,0 +1,218 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace functions with links to the namespace documentation for each function:
    + +

    - q -

    +
    +
    + + + + + diff --git a/namespacemembers_func_r.html b/namespacemembers_func_r.html new file mode 100644 index 000000000..4620a830f --- /dev/null +++ b/namespacemembers_func_r.html @@ -0,0 +1,219 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace functions with links to the namespace documentation for each function:
    + +

    - r -

    +
    +
    + + + + + diff --git a/namespacemembers_func_s.html b/namespacemembers_func_s.html new file mode 100644 index 000000000..37502cd03 --- /dev/null +++ b/namespacemembers_func_s.html @@ -0,0 +1,237 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace functions with links to the namespace documentation for each function:
    + +

    - s -

    +
    +
    + + + + + diff --git a/namespacemembers_func_t.html b/namespacemembers_func_t.html new file mode 100644 index 000000000..082dea3cb --- /dev/null +++ b/namespacemembers_func_t.html @@ -0,0 +1,214 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace functions with links to the namespace documentation for each function:
    + +

    - t -

    +
    +
    + + + + + diff --git a/namespacemembers_func_u.html b/namespacemembers_func_u.html new file mode 100644 index 000000000..e03349dc8 --- /dev/null +++ b/namespacemembers_func_u.html @@ -0,0 +1,213 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace functions with links to the namespace documentation for each function:
    + +

    - u -

      +
    • underlined() : ftxui
    • +
    • underlinedDouble() : ftxui
    • +
    • Utf8ToGlyphs() : ftxui
    • +
    • Utf8ToWordBreakProperty() : ftxui
    • +
    +
    +
    + + + + + diff --git a/namespacemembers_func_v.html b/namespacemembers_func_v.html new file mode 100644 index 000000000..d72865d4f --- /dev/null +++ b/namespacemembers_func_v.html @@ -0,0 +1,215 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace functions with links to the namespace documentation for each function:
    + +

    - v -

    +
    +
    + + + + + diff --git a/namespacemembers_func_w.html b/namespacemembers_func_w.html new file mode 100644 index 000000000..a58f338ec --- /dev/null +++ b/namespacemembers_func_w.html @@ -0,0 +1,213 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace functions with links to the namespace documentation for each function:
    + +

    - w -

    +
    +
    + + + + + diff --git a/namespacemembers_func_x.html b/namespacemembers_func_x.html new file mode 100644 index 000000000..e5b45bbf7 --- /dev/null +++ b/namespacemembers_func_x.html @@ -0,0 +1,213 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace functions with links to the namespace documentation for each function:
    + +

    - x -

    +
    +
    + + + + + diff --git a/namespacemembers_func_y.html b/namespacemembers_func_y.html new file mode 100644 index 000000000..d144d7052 --- /dev/null +++ b/namespacemembers_func_y.html @@ -0,0 +1,213 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace functions with links to the namespace documentation for each function:
    + +

    - y -

    +
    +
    + + + + + diff --git a/namespacemembers_g.html b/namespacemembers_g.html new file mode 100644 index 000000000..1719109f0 --- /dev/null +++ b/namespacemembers_g.html @@ -0,0 +1,226 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace members with links to the namespace documentation for each member:
    + +

    - g -

    +
    +
    + + + + + diff --git a/namespacemembers_h.html b/namespacemembers_h.html new file mode 100644 index 000000000..f848cb87c --- /dev/null +++ b/namespacemembers_h.html @@ -0,0 +1,218 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace members with links to the namespace documentation for each member:
    + +

    - h -

    +
    +
    + + + + + diff --git a/namespacemembers_i.html b/namespacemembers_i.html new file mode 100644 index 000000000..f8a88481a --- /dev/null +++ b/namespacemembers_i.html @@ -0,0 +1,216 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace members with links to the namespace documentation for each member:
    + +

    - i -

    +
    +
    + + + + + diff --git a/namespacemembers_l.html b/namespacemembers_l.html new file mode 100644 index 000000000..024a11cb5 --- /dev/null +++ b/namespacemembers_l.html @@ -0,0 +1,212 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace members with links to the namespace documentation for each member:
    + +

    - l -

    +
    +
    + + + + + diff --git a/namespacemembers_m.html b/namespacemembers_m.html new file mode 100644 index 000000000..b9412ae8a --- /dev/null +++ b/namespacemembers_m.html @@ -0,0 +1,215 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace members with links to the namespace documentation for each member:
    + +

    - m -

    +
    +
    + + + + + diff --git a/namespacemembers_n.html b/namespacemembers_n.html new file mode 100644 index 000000000..d661eef0e --- /dev/null +++ b/namespacemembers_n.html @@ -0,0 +1,211 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace members with links to the namespace documentation for each member:
    + +

    - n -

    +
    +
    + + + + + diff --git a/namespacemembers_o.html b/namespacemembers_o.html new file mode 100644 index 000000000..4b975e907 --- /dev/null +++ b/namespacemembers_o.html @@ -0,0 +1,212 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace members with links to the namespace documentation for each member:
    + +

    - o -

    +
    +
    + + + + + diff --git a/namespacemembers_p.html b/namespacemembers_p.html new file mode 100644 index 000000000..24ad66d9f --- /dev/null +++ b/namespacemembers_p.html @@ -0,0 +1,218 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace members with links to the namespace documentation for each member:
    + +

    - p -

    +
    +
    + + + + + diff --git a/namespacemembers_q.html b/namespacemembers_q.html new file mode 100644 index 000000000..86ed57e58 --- /dev/null +++ b/namespacemembers_q.html @@ -0,0 +1,218 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace members with links to the namespace documentation for each member:
    + +

    - q -

    +
    +
    + + + + + diff --git a/namespacemembers_r.html b/namespacemembers_r.html new file mode 100644 index 000000000..48eebc36b --- /dev/null +++ b/namespacemembers_r.html @@ -0,0 +1,221 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace members with links to the namespace documentation for each member:
    + +

    - r -

    +
    +
    + + + + + diff --git a/namespacemembers_s.html b/namespacemembers_s.html new file mode 100644 index 000000000..d331996b1 --- /dev/null +++ b/namespacemembers_s.html @@ -0,0 +1,238 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace members with links to the namespace documentation for each member:
    + +

    - s -

    +
    +
    + + + + + diff --git a/namespacemembers_t.html b/namespacemembers_t.html new file mode 100644 index 000000000..c994abf90 --- /dev/null +++ b/namespacemembers_t.html @@ -0,0 +1,217 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace members with links to the namespace documentation for each member:
    + +

    - t -

    +
    +
    + + + + + diff --git a/namespacemembers_type.html b/namespacemembers_type.html new file mode 100644 index 000000000..3858682a8 --- /dev/null +++ b/namespacemembers_type.html @@ -0,0 +1,224 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace typedefs with links to the namespace documentation for each typedef:
    +
    +
    + + + + + diff --git a/namespacemembers_u.html b/namespacemembers_u.html new file mode 100644 index 000000000..745f9f38c --- /dev/null +++ b/namespacemembers_u.html @@ -0,0 +1,213 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace members with links to the namespace documentation for each member:
    + +

    - u -

      +
    • underlined() : ftxui
    • +
    • underlinedDouble() : ftxui
    • +
    • Utf8ToGlyphs() : ftxui
    • +
    • Utf8ToWordBreakProperty() : ftxui
    • +
    +
    +
    + + + + + diff --git a/namespacemembers_v.html b/namespacemembers_v.html new file mode 100644 index 000000000..c5eefbaf0 --- /dev/null +++ b/namespacemembers_v.html @@ -0,0 +1,215 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace members with links to the namespace documentation for each member:
    + +

    - v -

    +
    +
    + + + + + diff --git a/namespacemembers_vars.html b/namespacemembers_vars.html new file mode 100644 index 000000000..7249e98c0 --- /dev/null +++ b/namespacemembers_vars.html @@ -0,0 +1,209 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace variables with links to the namespace documentation for each variable:
    +
    +
    + + + + + diff --git a/namespacemembers_w.html b/namespacemembers_w.html new file mode 100644 index 000000000..cda6d7161 --- /dev/null +++ b/namespacemembers_w.html @@ -0,0 +1,216 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace members with links to the namespace documentation for each member:
    + +

    - w -

    +
    +
    + + + + + diff --git a/namespacemembers_x.html b/namespacemembers_x.html new file mode 100644 index 000000000..4f20b54c0 --- /dev/null +++ b/namespacemembers_x.html @@ -0,0 +1,213 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace members with links to the namespace documentation for each member:
    + +

    - x -

    +
    +
    + + + + + diff --git a/namespacemembers_y.html b/namespacemembers_y.html new file mode 100644 index 000000000..7993fb319 --- /dev/null +++ b/namespacemembers_y.html @@ -0,0 +1,213 @@ + + + + + + + + +FTXUI: Namespace Members + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Here is a list of all namespace members with links to the namespace documentation for each member:
    + +

    - y -

    +
    +
    + + + + + diff --git a/nav_f.png b/nav_f.png new file mode 100644 index 000000000..eb013475b Binary files /dev/null and b/nav_f.png differ diff --git a/nav_fd.png b/nav_fd.png new file mode 100644 index 000000000..68adf3c31 Binary files /dev/null and b/nav_fd.png differ diff --git a/nav_g.png b/nav_g.png new file mode 100644 index 000000000..2093a237a Binary files /dev/null and b/nav_g.png differ diff --git a/nav_h.png b/nav_h.png new file mode 100644 index 000000000..24018b997 Binary files /dev/null and b/nav_h.png differ diff --git a/nav_hd.png b/nav_hd.png new file mode 100644 index 000000000..1de9c2407 Binary files /dev/null and b/nav_hd.png differ diff --git a/navtree.css b/navtree.css new file mode 100644 index 000000000..418c78534 --- /dev/null +++ b/navtree.css @@ -0,0 +1,149 @@ +#nav-tree .children_ul { + margin:0; + padding:4px; +} + +#nav-tree ul { + list-style:none outside none; + margin:0px; + padding:0px; +} + +#nav-tree li { + white-space:nowrap; + margin:0px; + padding:0px; +} + +#nav-tree .plus { + margin:0px; +} + +#nav-tree .selected { + background-image: url('tab_a.png'); + background-repeat:repeat-x; + color: white; + text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); +} + +#nav-tree .selected .arrow { + color: #80A5EF; + text-shadow: none; +} + +#nav-tree img { + margin:0px; + padding:0px; + border:0px; + vertical-align: middle; +} + +#nav-tree a { + text-decoration:none; + padding:0px; + margin:0px; +} + +#nav-tree .label { + margin:0px; + padding:0px; + font: 12px 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; +} + +#nav-tree .label a { + padding:2px; +} + +#nav-tree .selected a { + text-decoration:none; + color:white; +} + +#nav-tree .children_ul { + margin:0px; + padding:0px; +} + +#nav-tree .item { + margin:0px; + padding:0px; +} + +#nav-tree { + padding: 0px 0px; + font-size:14px; + overflow:auto; +} + +#doc-content { + overflow:auto; + display:block; + padding:0px; + margin:0px; + -webkit-overflow-scrolling : touch; /* iOS 5+ */ +} + +#side-nav { + padding:0 6px 0 0; + margin: 0px; + display:block; + position: absolute; + left: 0px; + width: $width; + overflow : hidden; +} + +.ui-resizable .ui-resizable-handle { + display:block; +} + +.ui-resizable-e { + background-image:url('splitbar.png'); + background-size:100%; + background-repeat:repeat-y; + background-attachment: scroll; + cursor:ew-resize; + height:100%; + right:0; + top:0; + width:6px; +} + +.ui-resizable-handle { + display:none; + font-size:0.1px; + position:absolute; + z-index:1; +} + +#nav-tree-contents { + margin: 6px 0px 0px 0px; +} + +#nav-tree { + background-repeat:repeat-x; + background-color: #F7F9FE; + -webkit-overflow-scrolling : touch; /* iOS 5+ */ +} + +#nav-sync { + position:absolute; + top:5px; + right:24px; + z-index:0; +} + +#nav-sync img { + opacity:0.3; +} + +#nav-sync img:hover { + opacity:0.9; +} + +@media print +{ + #nav-tree { display: none; } + div.ui-resizable-handle { display: none; position: relative; } +} + diff --git a/navtree.js b/navtree.js new file mode 100644 index 000000000..9027ce6ac --- /dev/null +++ b/navtree.js @@ -0,0 +1,483 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ + +function initNavTree(toroot,relpath) { + let navTreeSubIndices = []; + const ARROW_DOWN = '▼'; + const ARROW_RIGHT = '►'; + const NAVPATH_COOKIE_NAME = ''+'navpath'; + + const getData = function(varName) { + const i = varName.lastIndexOf('/'); + const n = i>=0 ? varName.substring(i+1) : varName; + return eval(n.replace(/-/g,'_')); + } + + const stripPath = function(uri) { + return uri.substring(uri.lastIndexOf('/')+1); + } + + const stripPath2 = function(uri) { + const i = uri.lastIndexOf('/'); + const s = uri.substring(i+1); + const m = uri.substring(0,i+1).match(/\/d\w\/d\w\w\/$/); + return m ? uri.substring(i-6) : s; + } + + const hashValue = function() { + return $(location).attr('hash').substring(1).replace(/[^\w-]/g,''); + } + + const hashUrl = function() { + return '#'+hashValue(); + } + + const pathName = function() { + return $(location).attr('pathname').replace(/[^-A-Za-z0-9+&@#/%?=~_|!:,.;()]/g, ''); + } + + const storeLink = function(link) { + if (!$("#nav-sync").hasClass('sync')) { + Cookie.writeSetting(NAVPATH_COOKIE_NAME,link,0); + } + } + + const deleteLink = function() { + Cookie.eraseSetting(NAVPATH_COOKIE_NAME); + } + + const cachedLink = function() { + return Cookie.readSetting(NAVPATH_COOKIE_NAME,''); + } + + const getScript = function(scriptName,func) { + const head = document.getElementsByTagName("head")[0]; + const script = document.createElement('script'); + script.id = scriptName; + script.type = 'text/javascript'; + script.onload = func; + script.src = scriptName+'.js'; + head.appendChild(script); + } + + const createIndent = function(o,domNode,node) { + let level=-1; + let n = node; + while (n.parentNode) { level++; n=n.parentNode; } + if (node.childrenData) { + const imgNode = document.createElement("span"); + imgNode.className = 'arrow'; + imgNode.style.paddingLeft=(16*level).toString()+'px'; + imgNode.innerHTML=ARROW_RIGHT; + node.plus_img = imgNode; + node.expandToggle = document.createElement("a"); + node.expandToggle.href = "javascript:void(0)"; + node.expandToggle.onclick = function() { + if (node.expanded) { + $(node.getChildrenUL()).slideUp("fast"); + node.plus_img.innerHTML=ARROW_RIGHT; + node.expanded = false; + } else { + expandNode(o, node, false, true); + } + } + node.expandToggle.appendChild(imgNode); + domNode.appendChild(node.expandToggle); + } else { + let span = document.createElement("span"); + span.className = 'arrow'; + span.style.width = 16*(level+1)+'px'; + span.innerHTML = ' '; + domNode.appendChild(span); + } + } + + let animationInProgress = false; + + const gotoAnchor = function(anchor,aname) { + let pos, docContent = $('#doc-content'); + let ancParent = $(anchor.parent()); + if (ancParent.hasClass('memItemLeft') || ancParent.hasClass('memtitle') || + ancParent.hasClass('fieldname') || ancParent.hasClass('fieldtype') || + ancParent.is(':header')) { + pos = ancParent.position().top; + } else if (anchor.position()) { + pos = anchor.position().top; + } + if (pos) { + const dcOffset = docContent.offset().top; + const dcHeight = docContent.height(); + const dcScrHeight = docContent[0].scrollHeight + const dcScrTop = docContent.scrollTop(); + let dist = Math.abs(Math.min(pos-dcOffset,dcScrHeight-dcHeight-dcScrTop)); + animationInProgress = true; + docContent.animate({ + scrollTop: pos + dcScrTop - dcOffset + },Math.max(50,Math.min(500,dist)),function() { + animationInProgress=false; + if (anchor.parent().attr('class')=='memItemLeft') { + let rows = $('.memberdecls tr[class$="'+hashValue()+'"]'); + glowEffect(rows.children(),300); // member without details + } else if (anchor.parent().attr('class')=='fieldname') { + glowEffect(anchor.parent().parent(),1000); // enum value + } else if (anchor.parent().attr('class')=='fieldtype') { + glowEffect(anchor.parent().parent(),1000); // struct field + } else if (anchor.parent().is(":header")) { + glowEffect(anchor.parent(),1000); // section header + } else { + glowEffect(anchor.next(),1000); // normal member + } + }); + } + } + + const newNode = function(o, po, text, link, childrenData, lastNode) { + const node = { + children : [], + childrenData : childrenData, + depth : po.depth + 1, + relpath : po.relpath, + isLast : lastNode, + li : document.createElement("li"), + parentNode : po, + itemDiv : document.createElement("div"), + labelSpan : document.createElement("span"), + label : document.createTextNode(text), + expanded : false, + childrenUL : null, + getChildrenUL : function() { + if (!this.childrenUL) { + this.childrenUL = document.createElement("ul"); + this.childrenUL.className = "children_ul"; + this.childrenUL.style.display = "none"; + this.li.appendChild(node.childrenUL); + } + return node.childrenUL; + }, + }; + + node.itemDiv.className = "item"; + node.labelSpan.className = "label"; + createIndent(o,node.itemDiv,node); + node.itemDiv.appendChild(node.labelSpan); + node.li.appendChild(node.itemDiv); + + const a = document.createElement("a"); + node.labelSpan.appendChild(a); + po.getChildrenUL().appendChild(node.li); + a.appendChild(node.label); + if (link) { + let url; + if (link.substring(0,1)=='^') { + url = link.substring(1); + link = url; + } else { + url = node.relpath+link; + } + a.className = stripPath(link.replace('#',':')); + if (link.indexOf('#')!=-1) { + const aname = '#'+link.split('#')[1]; + const srcPage = stripPath(pathName()); + const targetPage = stripPath(link.split('#')[0]); + a.href = srcPage!=targetPage ? url : aname; + a.onclick = function() { + storeLink(link); + aPPar = $(a).parent().parent(); + if (!aPPar.hasClass('selected')) { + $('.item').removeClass('selected'); + $('.item').removeAttr('id'); + aPPar.addClass('selected'); + aPPar.attr('id','selected'); + } + const anchor = $(aname); + gotoAnchor(anchor,aname); + }; + } else { + a.href = url; + a.onclick = () => storeLink(link); + } + } else if (childrenData != null) { + a.className = "nolink"; + a.href = "javascript:void(0)"; + a.onclick = node.expandToggle.onclick; + } + return node; + } + + const showRoot = function() { + const headerHeight = $("#top").height(); + const footerHeight = $("#nav-path").height(); + const windowHeight = $(window).height() - headerHeight - footerHeight; + (function() { // retry until we can scroll to the selected item + try { + const navtree=$('#nav-tree'); + navtree.scrollTo('#selected',100,{offset:-windowHeight/2}); + } catch (err) { + setTimeout(arguments.callee, 0); + } + })(); + } + + const expandNode = function(o, node, imm, setFocus) { + if (node.childrenData && !node.expanded) { + if (typeof(node.childrenData)==='string') { + const varName = node.childrenData; + getScript(node.relpath+varName,function() { + node.childrenData = getData(varName); + expandNode(o, node, imm, setFocus); + }); + } else { + if (!node.childrenVisited) { + getNode(o, node); + } + $(node.getChildrenUL()).slideDown("fast"); + node.plus_img.innerHTML = ARROW_DOWN; + node.expanded = true; + if (setFocus) { + $(node.expandToggle).focus(); + } + } + } + } + + const glowEffect = function(n,duration) { + n.addClass('glow').delay(duration).queue(function(next) { + $(this).removeClass('glow');next(); + }); + } + + const highlightAnchor = function() { + const aname = hashUrl(); + const anchor = $(aname); + gotoAnchor(anchor,aname); + } + + const selectAndHighlight = function(hash,n) { + let a; + if (hash) { + const link=stripPath(pathName())+':'+hash.substring(1); + a=$('.item a[class$="'+link+'"]'); + } + if (a && a.length) { + a.parent().parent().addClass('selected'); + a.parent().parent().attr('id','selected'); + highlightAnchor(); + } else if (n) { + $(n.itemDiv).addClass('selected'); + $(n.itemDiv).attr('id','selected'); + } + let topOffset=5; + if ($('#nav-tree-contents .item:first').hasClass('selected')) { + topOffset+=25; + } + $('#nav-sync').css('top',topOffset+'px'); + showRoot(); + } + + const showNode = function(o, node, index, hash) { + if (node && node.childrenData) { + if (typeof(node.childrenData)==='string') { + const varName = node.childrenData; + getScript(node.relpath+varName,function() { + node.childrenData = getData(varName); + showNode(o,node,index,hash); + }); + } else { + if (!node.childrenVisited) { + getNode(o, node); + } + $(node.getChildrenUL()).css({'display':'block'}); + node.plus_img.innerHTML = ARROW_DOWN; + node.expanded = true; + const n = node.children[o.breadcrumbs[index]]; + if (index+11 ? '#'+parts[1].replace(/[^\w-]/g,'') : ''; + } + if (hash.match(/^#l\d+$/)) { + const anchor=$('a[name='+hash.substring(1)+']'); + glowEffect(anchor.parent(),1000); // line number + hash=''; // strip line number anchors + } + const url=root+hash; + let i=-1; + while (NAVTREEINDEX[i+1]<=url) i++; + if (i==-1) { i=0; root=NAVTREE[0][1]; } // fallback: show index + if (navTreeSubIndices[i]) { + gotoNode(o,i,root,hash,relpath) + } else { + getScript(relpath+'navtreeindex'+i,function() { + navTreeSubIndices[i] = eval('NAVTREEINDEX'+i); + if (navTreeSubIndices[i]) { + gotoNode(o,i,root,hash,relpath); + } + }); + } + } + + const showSyncOff = function(n,relpath) { + n.html(''); + } + + const showSyncOn = function(n,relpath) { + n.html(''); + } + + const o = { + toroot : toroot, + node : { + childrenData : NAVTREE, + children : [], + childrenUL : document.createElement("ul"), + getChildrenUL : function() { return this.childrenUL }, + li : document.getElementById("nav-tree-contents"), + depth : 0, + relpath : relpath, + expanded : false, + isLast : true, + plus_img : document.createElement("span"), + }, + }; + o.node.li.appendChild(o.node.childrenUL); + o.node.plus_img.className = 'arrow'; + o.node.plus_img.innerHTML = ARROW_RIGHT; + + const navSync = $('#nav-sync'); + if (cachedLink()) { + showSyncOff(navSync,relpath); + navSync.removeClass('sync'); + } else { + showSyncOn(navSync,relpath); + } + + navSync.click(() => { + const navSync = $('#nav-sync'); + if (navSync.hasClass('sync')) { + navSync.removeClass('sync'); + showSyncOff(navSync,relpath); + storeLink(stripPath2(pathName())+hashUrl()); + } else { + navSync.addClass('sync'); + showSyncOn(navSync,relpath); + deleteLink(); + } + }); + + navTo(o,toroot,hashUrl(),relpath); + showRoot(); + + $(window).bind('hashchange', () => { + if (!animationInProgress) { + if (window.location.hash && window.location.hash.length>1) { + let a; + if ($(location).attr('hash')) { + const clslink=stripPath(pathName())+':'+hashValue(); + a=$('.item a[class$="'+clslink.replace(/ + + + + + + + +FTXUI: nested_screen.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    nested_screen.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + + +

    +Functions

    void Nested (std::string path)
     
    int main ()
     
    +

    Function Documentation

    + +

    ◆ Nested()

    + +
    +
    + + + + + + + +
    void Nested (std::string path)
    +
    +
    Examples
    examples/component/nested_screen.cpp.
    +
    + +

    Definition at line 15 of file nested_screen.cpp.

    + +
    +
    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 41 of file nested_screen.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/nested__screen_8cpp.js b/nested__screen_8cpp.js new file mode 100644 index 000000000..853794ce6 --- /dev/null +++ b/nested__screen_8cpp.js @@ -0,0 +1,5 @@ +var nested__screen_8cpp = +[ + [ "Nested", "nested__screen_8cpp.html#a77fdac0113a8c43983469efa26ce7276", null ], + [ "main", "nested__screen_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/nested__screen_8cpp_source.html b/nested__screen_8cpp_source.html new file mode 100644 index 000000000..05a92f0b1 --- /dev/null +++ b/nested__screen_8cpp_source.html @@ -0,0 +1,279 @@ + + + + + + + + +FTXUI: nested_screen.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    nested_screen.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <memory> // for allocator, shared_ptr, __shared_ptr_access
    +
    5#include <string> // for operator+, string, char_traits, basic_string
    +
    6
    +
    7#include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    8#include "ftxui/component/component.hpp" // for Button, Vertical, Renderer
    +
    9#include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    10#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    11#include "ftxui/dom/elements.hpp" // for separator, text, Element, operator|, vbox, border
    +
    12
    +
    13using namespace ftxui;
    +
    14
    +
    +
    15void Nested(std::string path) {
    +
    16 auto screen = ScreenInteractive::FitComponent();
    +
    17 auto back_button = Button("Back", screen.ExitLoopClosure());
    +
    18 auto goto_1 = Button("Goto /1", [path] { Nested(path + "/1"); });
    +
    19 auto goto_2 = Button("Goto /2", [path] { Nested(path + "/2"); });
    +
    20 auto goto_3 = Button("Goto /3", [path] { Nested(path + "/3"); });
    +
    21 auto layout = Container::Vertical({
    +
    22 back_button,
    +
    23 goto_1,
    +
    24 goto_2,
    +
    25 goto_3,
    +
    26 });
    +
    27 auto renderer = Renderer(layout, [&] {
    +
    28 return vbox({
    +
    29 text("path: " + path),
    +
    30 separator(),
    +
    31 back_button->Render(),
    +
    32 goto_1->Render(),
    +
    33 goto_2->Render(),
    +
    34 goto_3->Render(),
    +
    35 }) |
    +
    36 border;
    +
    37 });
    +
    38 screen.Loop(renderer);
    +
    39}
    +
    +
    40
    +
    +
    41int main() {
    +
    42 auto screen = ScreenInteractive::FitComponent();
    +
    43 auto button_quit = Button("Quit", screen.ExitLoopClosure());
    +
    44 auto button_nested = Button("Nested", [] { Nested(""); });
    +
    45 screen.Loop(Container::Vertical({
    +
    46 button_quit,
    +
    47 button_nested,
    +
    48 }));
    +
    49 return 0;
    +
    50}
    +
    + + + + +
    static ScreenInteractive FitComponent()
    +
    Component Button(ButtonOption options)
    Draw a button. Execute a function when clicked.
    +
    Component Renderer(Component child, std::function< Element()>)
    Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
    +
    Component Vertical(Components children)
    A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
    +
    virtual void Render(Screen &screen)
    Display an element on a ftxui::Screen.
    Definition node.cpp:59
    +
    Element text(std::wstring text)
    Display a piece of unicode text.
    Definition text.cpp:160
    +
    Element separator()
    Draw a vertical or horizontal separation in between two other elements.
    +
    Element vbox(Elements)
    A container displaying elements vertically one by one.
    Definition vbox.cpp:96
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    void Nested(std::string path)
    +
    int main()
    + +
    +
    + + + + + diff --git a/node_8cpp.html b/node_8cpp.html new file mode 100644 index 000000000..139a939db --- /dev/null +++ b/node_8cpp.html @@ -0,0 +1,234 @@ + + + + + + + + +FTXUI: node.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    node.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + + + + + + + + +

    +Functions

    void Render (Screen &screen, const Element &element)
     Display an element on a ftxui::Screen.
     
    void Render (Screen &screen, Node *node)
     Display an element on a ftxui::Screen.
     
    void Render (Screen &screen, Node *node, Selection &selection)
     
    std::string GetNodeSelectedContent (Screen &screen, Node *node, Selection &selection)
     
    +
    +
    + + + + + diff --git a/node_8cpp.js b/node_8cpp.js new file mode 100644 index 000000000..679c7d81c --- /dev/null +++ b/node_8cpp.js @@ -0,0 +1,7 @@ +var node_8cpp = +[ + [ "Render", "node_8cpp.html#gad4b8aa9392f56ba41e2b421e046a7d83", null ], + [ "Render", "node_8cpp.html#ga32a24db985fa1b37bf686b00f7e1b4ff", null ], + [ "Render", "node_8cpp.html#ab35030b64136afa183d474d11bd1f6dd", null ], + [ "GetNodeSelectedContent", "node_8cpp.html#a1a3d5804148186b3d4bcc07391ba5f30", null ] +]; \ No newline at end of file diff --git a/node_8cpp_source.html b/node_8cpp_source.html new file mode 100644 index 000000000..347e7aa63 --- /dev/null +++ b/node_8cpp_source.html @@ -0,0 +1,476 @@ + + + + + + + + +FTXUI: node.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    node.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <ftxui/screen/box.hpp> // for Box
    +
    5#include <string>
    +
    6#include <utility> // for move
    +
    7
    +
    8#include <cstddef>
    +
    9#include "ftxui/dom/node.hpp"
    +
    10#include "ftxui/dom/selection.hpp" // for Selection
    +
    11#include "ftxui/screen/screen.hpp" // for Screen
    +
    12
    +
    13namespace ftxui {
    +
    14
    +
    15Node::Node() = default;
    +
    16Node::Node(Elements children) : children_(std::move(children)) {}
    +
    17Node::~Node() = default;
    +
    18
    +
    19/// @brief Compute how much space an element needs.
    +
    + +
    21 if (children_.empty()) {
    +
    22 return;
    +
    23 }
    +
    24 for (auto& child : children_) {
    +
    25 child->ComputeRequirement();
    +
    26 }
    +
    27
    +
    28 // By default, the requirement is the one of the first child.
    +
    29 requirement_ = children_[0]->requirement();
    +
    30
    +
    31 // Propagate the focused requirement.
    +
    32 for (size_t i = 1; i < children_.size(); ++i) {
    + +
    34 children_[i]->requirement().focused.enabled) {
    +
    35 requirement_.focused = children_[i]->requirement().focused;
    +
    36 }
    +
    37 }
    +
    38}
    +
    +
    39
    +
    40/// @brief Assign a position and a dimension to an element for drawing.
    +
    +
    41void Node::SetBox(Box box) {
    +
    42 box_ = box;
    +
    43}
    +
    +
    44
    +
    45/// @brief Compute the selection of an element.
    +
    +
    46void Node::Select(Selection& selection) {
    +
    47 // If this Node box_ doesn't intersect with the selection, then no selection.
    +
    48 if (Box::Intersection(selection.GetBox(), box_).IsEmpty()) {
    +
    49 return;
    +
    50 }
    +
    51
    +
    52 // By default we defer the selection to the children.
    +
    53 for (auto& child : children_) {
    +
    54 child->Select(selection);
    +
    55 }
    +
    56}
    +
    +
    57
    +
    58/// @brief Display an element on a ftxui::Screen.
    +
    +
    59void Node::Render(Screen& screen) {
    +
    60 for (auto& child : children_) {
    +
    61 child->Render(screen);
    +
    62 }
    +
    63}
    +
    +
    64
    +
    +
    65void Node::Check(Status* status) {
    +
    66 for (auto& child : children_) {
    +
    67 child->Check(status);
    +
    68 }
    +
    69 status->need_iteration |= (status->iteration == 0);
    +
    70}
    +
    +
    71
    +
    +
    72std::string Node::GetSelectedContent(Selection& selection) {
    +
    73 std::string content;
    +
    74
    +
    75 for (auto& child : children_) {
    +
    76 content += child->GetSelectedContent(selection);
    +
    77 }
    +
    78
    +
    79 return content;
    +
    80}
    +
    +
    81
    +
    82/// @brief Display an element on a ftxui::Screen.
    +
    83/// @ingroup dom
    +
    +
    84void Render(Screen& screen, const Element& element) {
    +
    85 Selection selection;
    +
    86 Render(screen, element.get(), selection);
    +
    87}
    +
    +
    88
    +
    89/// @brief Display an element on a ftxui::Screen.
    +
    90/// @ingroup dom
    +
    +
    91void Render(Screen& screen, Node* node) {
    +
    92 Selection selection;
    +
    93 Render(screen, node, selection);
    +
    94}
    +
    +
    95
    +
    +
    96void Render(Screen& screen, Node* node, Selection& selection) {
    +
    97 Box box;
    +
    98 box.x_min = 0;
    +
    99 box.y_min = 0;
    +
    100 box.x_max = screen.dimx() - 1;
    +
    101 box.y_max = screen.dimy() - 1;
    +
    102
    +
    103 Node::Status status;
    +
    104 node->Check(&status);
    +
    105 const int max_iterations = 20;
    +
    106 while (status.need_iteration && status.iteration < max_iterations) {
    +
    107 // Step 1: Find what dimension this elements wants to be.
    +
    108 node->ComputeRequirement();
    +
    109
    +
    110 // Step 2: Assign a dimension to the element.
    +
    111 node->SetBox(box);
    +
    112
    +
    113 // Check if the element needs another iteration of the layout algorithm.
    +
    114 status.need_iteration = false;
    +
    115 status.iteration++;
    +
    116 node->Check(&status);
    +
    117 }
    +
    118
    +
    119 // Step 3: Selection
    +
    120 if (!selection.IsEmpty()) {
    +
    121 node->Select(selection);
    +
    122 }
    +
    123
    +
    124 if (node->requirement().focused.enabled
    +
    125#if defined(FTXUI_MICROSOFT_TERMINAL_FALLBACK)
    +
    126 // Setting the cursor to the right position allow folks using CJK (China,
    +
    127 // Japanese, Korean, ...) characters to see their [input method editor]
    +
    128 // displayed at the right location. See [issue].
    +
    129 //
    +
    130 // [input method editor]:
    +
    131 // https://en.wikipedia.org/wiki/Input_method
    +
    132 //
    +
    133 // [issue]:
    +
    134 // https://github.com/ArthurSonzogni/FTXUI/issues/2#issuecomment-505282355
    +
    135 //
    +
    136 // Unfortunately, Microsoft terminal do not handle properly hiding the
    +
    137 // cursor. Instead the character under the cursor is hidden, which is a
    +
    138 // big problem. As a result, we can't enable setting cursor to the right
    +
    139 // location. It will be displayed at the bottom right corner.
    +
    140 // See:
    +
    141 // https://github.com/microsoft/terminal/issues/1203
    +
    142 // https://github.com/microsoft/terminal/issues/3093
    +
    143 &&
    + +
    145#endif
    +
    146 ) {
    + + + + +
    151 });
    +
    152 } else {
    + +
    154 screen.dimx() - 1,
    +
    155 screen.dimy() - 1,
    + +
    157 });
    +
    158 }
    +
    159
    +
    160 // Step 4: Draw the element.
    +
    161 screen.stencil = box;
    +
    162 node->Render(screen);
    +
    163
    +
    164 // Step 5: Apply shaders
    +
    165 screen.ApplyShader();
    +
    166}
    +
    +
    167
    +
    +
    168std::string GetNodeSelectedContent(Screen& screen,
    +
    169 Node* node,
    +
    170 Selection& selection) {
    +
    171 Box box;
    +
    172 box.x_min = 0;
    +
    173 box.y_min = 0;
    +
    174 box.x_max = screen.dimx() - 1;
    +
    175 box.y_max = screen.dimy() - 1;
    +
    176
    +
    177 Node::Status status;
    +
    178 node->Check(&status);
    +
    179 const int max_iterations = 20;
    +
    180 while (status.need_iteration && status.iteration < max_iterations) {
    +
    181 // Step 1: Find what dimension this elements wants to be.
    +
    182 node->ComputeRequirement();
    +
    183
    +
    184 // Step 2: Assign a dimension to the element.
    +
    185 node->SetBox(box);
    +
    186
    +
    187 // Check if the element needs another iteration of the layout algorithm.
    +
    188 status.need_iteration = false;
    +
    189 status.iteration++;
    +
    190 node->Check(&status);
    +
    191 }
    +
    192
    +
    193 // Step 3: Selection
    +
    194 node->Select(selection);
    +
    195
    +
    196 // Step 4: get the selected content.
    +
    197 return node->GetSelectedContent(selection);
    +
    198}
    +
    +
    199
    +
    200} // namespace ftxui
    + +
    const Box & GetBox() const
    Get the box of the selection.
    +
    virtual void Select(Selection &selection)
    Compute the selection of an element.
    Definition node.cpp:46
    + +
    Elements children_
    Definition node.hpp:79
    +
    virtual std::string GetSelectedContent(Selection &selection)
    Definition node.cpp:72
    +
    virtual void SetBox(Box box)
    Assign a position and a dimension to an element for drawing.
    Definition node.cpp:41
    +
    Requirement requirement_
    Definition node.hpp:80
    +
    Requirement requirement()
    Definition node.hpp:52
    +
    virtual void ComputeRequirement()
    Compute how much space an element needs.
    Definition node.cpp:20
    +
    virtual void Check(Status *status)
    Definition node.cpp:65
    +
    virtual ~Node()
    +
    virtual void Render(Screen &screen)
    Display an element on a ftxui::Screen.
    Definition node.cpp:59
    +
    bool IsEmpty() const
    Definition selection.hpp:31
    + +
    Box box_
    Definition node.hpp:81
    +
    friend void Render(Screen &screen, Node *node, Selection &selection)
    Definition node.cpp:96
    +
    Node is the base class for all elements in the DOM tree.
    Definition node.hpp:37
    +
    Represents a selection in a terminal user interface.
    Definition selection.hpp:22
    +
    void Render(Screen &screen, const Element &element)
    Display an element on a ftxui::Screen.
    Definition node.cpp:84
    +
    void ApplyShader()
    Definition screen.cpp:507
    +
    int dimy() const
    Definition image.hpp:36
    +
    void SetCursor(Cursor cursor)
    Definition screen.hpp:67
    +
    int x_max
    Definition box.hpp:18
    +
    int y_min
    Definition box.hpp:19
    +
    static auto Intersection(Box a, Box b) -> Box
    Definition box.cpp:11
    +
    Box stencil
    Definition image.hpp:41
    +
    int y_max
    Definition box.hpp:20
    +
    int x_min
    Definition box.hpp:17
    +
    int dimx() const
    Definition image.hpp:35
    +
    A rectangular grid of Pixel.
    Definition screen.hpp:26
    +
    Box is a structure that represents a rectangular area in a 2D space.
    Definition box.hpp:16
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::string GetNodeSelectedContent(Screen &screen, Node *node, Selection &selection)
    Definition node.cpp:168
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    std::vector< Element > Elements
    Definition elements.hpp:23
    + + + + + + +
    Screen::Cursor::Shape cursor_shape
    + + + + +
    +
    + + + + + diff --git a/node_8cppm.html b/node_8cppm.html new file mode 100644 index 000000000..f6e7c2bb0 --- /dev/null +++ b/node_8cppm.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: node.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    node.cppm File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    +
    +
    + + + + + diff --git a/node_8cppm_source.html b/node_8cppm_source.html new file mode 100644 index 000000000..3cd242bf5 --- /dev/null +++ b/node_8cppm_source.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: node.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    node.cppm
    +
    +
    +Go to the documentation of this file.
    1/// @module ftxui.dom.node
    +
    2/// @brief Module file for the Node class of the Dom module
    +
    3
    +
    4module;
    +
    5
    +
    6#include <ftxui/dom/node.hpp>
    +
    7
    +
    8export module ftxui.dom.node;
    +
    9
    +
    10/**
    +
    11 * @namespace ftxui
    +
    12 * @brief The FTXUI ftxui:: namespace
    +
    13 */
    +
    14export namespace ftxui {
    +
    15 using ftxui::Node;
    +
    16 using ftxui::Screen;
    +
    17
    +
    18 using ftxui::Element;
    +
    19 using ftxui::Elements;
    +
    20
    +
    21 using ftxui::Render;
    +
    22 using ftxui::GetNodeSelectedContent;
    +
    23}
    +
    Node is the base class for all elements in the DOM tree.
    Definition node.hpp:37
    +
    A rectangular grid of Pixel.
    Definition screen.hpp:26
    +
    Module file for the Node class of the Dom module.
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    std::vector< Element > Elements
    Definition elements.hpp:23
    + +
    +
    + + + + + diff --git a/node_8hpp.html b/node_8hpp.html new file mode 100644 index 000000000..84462c831 --- /dev/null +++ b/node_8hpp.html @@ -0,0 +1,243 @@ + + + + + + + + +FTXUI: node.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    node.hpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + + + +

    +Classes

    class  Node
     Node is the base class for all elements in the DOM tree. More...
     
    struct  Node::Status
     
    + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + + + + + + + + +

    +Functions

    void Render (Screen &screen, const Element &element)
     Display an element on a ftxui::Screen.
     
    void Render (Screen &screen, Node *node)
     Display an element on a ftxui::Screen.
     
    void Render (Screen &screen, Node *node, Selection &selection)
     
    std::string GetNodeSelectedContent (Screen &screen, Node *node, Selection &selection)
     
    +
    +
    + + + + + diff --git a/node_8hpp.js b/node_8hpp.js new file mode 100644 index 000000000..fe13d51be --- /dev/null +++ b/node_8hpp.js @@ -0,0 +1,8 @@ +var node_8hpp = +[ + [ "Status", "structftxui_1_1Node_1_1Status.html", "structftxui_1_1Node_1_1Status" ], + [ "Render", "node_8hpp.html#gad4b8aa9392f56ba41e2b421e046a7d83", null ], + [ "Render", "node_8hpp.html#ga32a24db985fa1b37bf686b00f7e1b4ff", null ], + [ "Render", "node_8hpp.html#ab35030b64136afa183d474d11bd1f6dd", null ], + [ "GetNodeSelectedContent", "node_8hpp.html#a1a3d5804148186b3d4bcc07391ba5f30", null ] +]; \ No newline at end of file diff --git a/node_8hpp_source.html b/node_8hpp_source.html new file mode 100644 index 000000000..d91f84050 --- /dev/null +++ b/node_8hpp_source.html @@ -0,0 +1,339 @@ + + + + + + + + +FTXUI: node.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    node.hpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#ifndef FTXUI_DOM_NODE_HPP
    +
    5#define FTXUI_DOM_NODE_HPP
    +
    6
    +
    7#include <memory> // for shared_ptr
    +
    8#include <vector> // for vector
    +
    9
    +
    10#include "ftxui/dom/requirement.hpp" // for Requirement
    +
    11#include "ftxui/dom/selection.hpp" // for Selection
    +
    12#include "ftxui/screen/box.hpp" // for Box
    + +
    14
    +
    15namespace ftxui {
    +
    16
    +
    17class Node;
    +
    18class Screen;
    +
    19
    +
    20using Element = std::shared_ptr<Node>;
    +
    21using Elements = std::vector<Element>;
    +
    22
    +
    23/// @brief Node is the base class for all elements in the DOM tree.
    +
    24///
    +
    25/// It represents a single node in the document object model (DOM) and provides
    +
    26/// the basic structure for layout and rendering.
    +
    27/// It contains methods for computing layout requirements, setting the box
    +
    28/// dimensions, selecting content, rendering to the screen, and checking the
    +
    29/// layout status.
    +
    30/// It typically contains child elements, which are also instances of Node.
    +
    31///
    +
    32/// Users are expected to derive from this class to create custom elements.
    +
    33///
    +
    34/// A list of builtin elements can be found in the `elements.hpp` file.
    +
    35///
    +
    36/// @ingroup dom
    +
    +
    37class Node {
    +
    38 public:
    + +
    40 explicit Node(Elements children);
    +
    41 Node(const Node&) = delete;
    +
    42 Node(const Node&&) = delete;
    +
    43 Node& operator=(const Node&) = delete;
    +
    44 Node& operator=(const Node&&) = delete;
    +
    45
    +
    46 virtual ~Node();
    +
    47
    +
    48 // Step 1: Compute layout requirement. Tell parent what dimensions this
    +
    49 // element wants to be.
    +
    50 // Propagated from Children to Parents.
    +
    51 virtual void ComputeRequirement();
    + +
    53
    +
    54 // Step 2: Assign this element its final dimensions.
    +
    55 // Propagated from Parents to Children.
    +
    56 virtual void SetBox(Box box);
    +
    57
    +
    58 // Step 3: (optional) Selection
    +
    59 // Propagated from Parents to Children.
    +
    60 virtual void Select(Selection& selection);
    +
    61
    +
    62 // Step 4: Draw this element.
    +
    63 virtual void Render(Screen& screen);
    +
    64
    +
    65 virtual std::string GetSelectedContent(Selection& selection);
    +
    66
    +
    67 // Layout may not resolve within a single iteration for some elements. This
    +
    68 // allows them to request additionnal iterations. This signal must be
    +
    69 // forwarded to children at least once.
    +
    +
    70 struct Status {
    +
    71 int iteration = 0;
    +
    72 bool need_iteration = false;
    +
    73 };
    +
    +
    74 virtual void Check(Status* status);
    +
    75
    +
    76 friend void Render(Screen& screen, Node* node, Selection& selection);
    +
    77
    +
    78 protected:
    + + + +
    82};
    +
    +
    83
    +
    84void Render(Screen& screen, const Element& element);
    +
    85void Render(Screen& screen, Node* node);
    +
    86void Render(Screen& screen, Node* node, Selection& selection);
    +
    87std::string GetNodeSelectedContent(Screen& screen,
    +
    88 Node* node,
    +
    89 Selection& selection);
    +
    90
    +
    91} // namespace ftxui
    +
    92
    +
    93#endif // FTXUI_DOM_NODE_HPP
    + +
    virtual void Select(Selection &selection)
    Compute the selection of an element.
    Definition node.cpp:46
    + +
    Elements children_
    Definition node.hpp:79
    +
    virtual std::string GetSelectedContent(Selection &selection)
    Definition node.cpp:72
    +
    virtual void SetBox(Box box)
    Assign a position and a dimension to an element for drawing.
    Definition node.cpp:41
    +
    Requirement requirement_
    Definition node.hpp:80
    +
    Requirement requirement()
    Definition node.hpp:52
    +
    virtual void ComputeRequirement()
    Compute how much space an element needs.
    Definition node.cpp:20
    +
    virtual void Check(Status *status)
    Definition node.cpp:65
    +
    virtual ~Node()
    +
    Node & operator=(const Node &)=delete
    +
    Node(const Node &)=delete
    +
    Box box_
    Definition node.hpp:81
    +
    friend void Render(Screen &screen, Node *node, Selection &selection)
    Definition node.cpp:96
    +
    Node & operator=(const Node &&)=delete
    +
    Node(const Node &&)=delete
    +
    Node is the base class for all elements in the DOM tree.
    Definition node.hpp:37
    +
    Represents a selection in a terminal user interface.
    Definition selection.hpp:22
    +
    void Render(Screen &screen, const Element &element)
    Display an element on a ftxui::Screen.
    Definition node.cpp:84
    +
    Requirement is a structure that defines the layout requirements for a Node in the terminal user inter...
    +
    A rectangular grid of Pixel.
    Definition screen.hpp:26
    +
    Box is a structure that represents a rectangular area in a 2D space.
    Definition box.hpp:16
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::string GetNodeSelectedContent(Screen &screen, Node *node, Selection &selection)
    Definition node.cpp:168
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    std::vector< Element > Elements
    Definition elements.hpp:23
    + + + + + + +
    +
    + + + + + diff --git a/node__decorator_8cpp.html b/node__decorator_8cpp.html new file mode 100644 index 000000000..cad802131 --- /dev/null +++ b/node__decorator_8cpp.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: node_decorator.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    node_decorator.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    +
    +
    + + + + + diff --git a/node__decorator_8cpp_source.html b/node__decorator_8cpp_source.html new file mode 100644 index 000000000..84736225d --- /dev/null +++ b/node__decorator_8cpp_source.html @@ -0,0 +1,247 @@ + + + + + + + + +FTXUI: node_decorator.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    node_decorator.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <ftxui/dom/node.hpp> // for Node, Elements
    +
    5
    + +
    7#include "ftxui/dom/requirement.hpp" // for Requirement
    +
    8#include "ftxui/screen/box.hpp" // for Box
    +
    9
    +
    10namespace ftxui {
    +
    11
    +
    + + +
    14 requirement_ = children_[0]->requirement();
    +
    15}
    +
    +
    16
    +
    + +
    18 Node::SetBox(box);
    +
    19 children_[0]->SetBox(box);
    +
    20}
    +
    +
    21
    +
    22} // namespace ftxui
    + +
    void SetBox(Box box) override
    Assign a position and a dimension to an element for drawing.
    +
    void ComputeRequirement() override
    Compute how much space an element needs.
    +
    Elements children_
    Definition node.hpp:79
    +
    virtual void SetBox(Box box)
    Assign a position and a dimension to an element for drawing.
    Definition node.cpp:41
    +
    Requirement requirement_
    Definition node.hpp:80
    +
    virtual void ComputeRequirement()
    Compute how much space an element needs.
    Definition node.cpp:20
    +
    Box is a structure that represents a rectangular area in a 2D space.
    Definition box.hpp:16
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + + + +
    +
    + + + + + diff --git a/node__decorator_8hpp.html b/node__decorator_8hpp.html new file mode 100644 index 000000000..724a58695 --- /dev/null +++ b/node__decorator_8hpp.html @@ -0,0 +1,226 @@ + + + + + + + + +FTXUI: node_decorator.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    node_decorator.hpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Classes

    class  NodeDecorator
     
    + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    +
    +
    + + + + + diff --git a/node__decorator_8hpp.js b/node__decorator_8hpp.js new file mode 100644 index 000000000..96df9f0b2 --- /dev/null +++ b/node__decorator_8hpp.js @@ -0,0 +1,4 @@ +var node__decorator_8hpp = +[ + [ "NodeDecorator", "classftxui_1_1NodeDecorator.html", "classftxui_1_1NodeDecorator" ] +]; \ No newline at end of file diff --git a/node__decorator_8hpp_source.html b/node__decorator_8hpp_source.html new file mode 100644 index 000000000..0b427b213 --- /dev/null +++ b/node__decorator_8hpp_source.html @@ -0,0 +1,246 @@ + + + + + + + + +FTXUI: node_decorator.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    node_decorator.hpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#ifndef FTXUI_DOM_NODE_DECORATOR_H_
    +
    5#define FTXUI_DOM_NODE_DECORATOR_H_
    +
    6
    +
    7#include <utility> // for move
    +
    8
    +
    9#include "ftxui/dom/elements.hpp" // for Element, unpack
    +
    10#include "ftxui/dom/node.hpp" // for Node
    +
    11
    +
    12namespace ftxui {
    +
    13struct Box;
    +
    14
    +
    15// Helper class.
    +
    +
    16class NodeDecorator : public Node {
    +
    17 public:
    +
    18 explicit NodeDecorator(Element child) : Node(unpack(std::move(child))) {}
    +
    19 void ComputeRequirement() override;
    +
    20 void SetBox(Box box) override;
    +
    21};
    +
    +
    22
    +
    23} // namespace ftxui
    +
    24
    +
    25#endif /* end of include guard: FTXUI_DOM_NODE_DECORATOR_H_ */
    + +
    NodeDecorator(Element child)
    +
    void SetBox(Box box) override
    Assign a position and a dimension to an element for drawing.
    +
    void ComputeRequirement() override
    Compute how much space an element needs.
    + +
    Node is the base class for all elements in the DOM tree.
    Definition node.hpp:37
    +
    Box is a structure that represents a rectangular area in a 2D space.
    Definition box.hpp:16
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    + +
    +
    + + + + + diff --git a/open.png b/open.png new file mode 100644 index 000000000..62bca9072 Binary files /dev/null and b/open.png differ diff --git a/package__manager_8cpp.html b/package__manager_8cpp.html new file mode 100644 index 000000000..456c41e0d --- /dev/null +++ b/package__manager_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: package_manager.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    package_manager.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Functions

    int main ()
     
    +

    Function Documentation

    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 18 of file package_manager.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/package__manager_8cpp.js b/package__manager_8cpp.js new file mode 100644 index 000000000..548cf8f59 --- /dev/null +++ b/package__manager_8cpp.js @@ -0,0 +1,4 @@ +var package__manager_8cpp = +[ + [ "main", "package__manager_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/package__manager_8cpp_source.html b/package__manager_8cpp_source.html new file mode 100644 index 000000000..42ae94bf4 --- /dev/null +++ b/package__manager_8cpp_source.html @@ -0,0 +1,368 @@ + + + + + + + + +FTXUI: package_manager.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    package_manager.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <chrono> // for operator""s, chrono_literals
    +
    5#include <ftxui/dom/elements.hpp> // for operator|, text, Element, hbox, bold, color, filler, separator, vbox, window, gauge, Fit, size, dim, EQUAL, WIDTH
    +
    6#include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    7#include <iostream> // for cout, endl, ostream
    +
    8#include <list> // for list, operator==, _List_iterator, _List_iterator<>::_Self
    +
    9#include <memory> // for allocator, shared_ptr, allocator_traits<>::value_type
    +
    10#include <string> // for string, operator<<, to_string
    +
    11#include <thread> // for sleep_for
    +
    12#include <utility> // for move
    +
    13#include <vector> // for vector
    +
    14
    +
    15#include "ftxui/dom/node.hpp" // for Render
    +
    16#include "ftxui/screen/color.hpp" // for Color, Color::Green, Color::Red, Color::RedLight, ftxui
    +
    17
    +
    +
    18int main() {
    +
    19 using namespace ftxui;
    +
    20
    +
    21 struct Task {
    +
    22 std::string name;
    +
    23 int number_of_threads;
    +
    24 int downloaded;
    +
    25 int size;
    +
    26 };
    +
    27
    +
    28 std::list<Task> remaining_tasks = {
    +
    29 {"contact server ", 10, 0, 6 * 25},
    +
    30 {"download index.html ", 10, 0, 9 * 25},
    +
    31 {"download script.js ", 1, 0, 3 * 25},
    +
    32 {"download style.js ", 1, 0, 4 * 25},
    +
    33 {"download image.png ", 1, 0, 5 * 25},
    +
    34 {"download big_1.png ", 1, 0, 30 * 25},
    +
    35 {"download icon_1.png ", 1, 0, 7 * 25},
    +
    36 {"download icon_2.png ", 1, 0, 8 * 25},
    +
    37 {"download big_2.png ", 1, 0, 30 * 25},
    +
    38 {"download small_1.png ", 1, 0, 10 * 25},
    +
    39 {"download small_2.png ", 1, 0, 11 * 25},
    +
    40 {"download small_3.png ", 1, 0, 12 * 25},
    +
    41 };
    +
    42
    +
    43 std::list<Task> displayed_task;
    +
    44
    +
    45 int remaining_threads = 12;
    +
    46
    +
    47 int nb_queued = (int)remaining_tasks.size();
    +
    48 int nb_active = 0;
    +
    49 int nb_done = 0;
    +
    50
    +
    51 auto to_text = [](int number) {
    +
    52 return text(std::to_string(number)) | size(WIDTH, EQUAL, 3);
    +
    53 };
    +
    54
    +
    55 auto renderTask = [&](const Task& task) {
    +
    56 auto style = (task.downloaded == task.size) ? dim : bold;
    +
    57 return hbox({
    +
    58 text(task.name) | style,
    +
    59 separator(),
    +
    60 to_text(task.downloaded),
    +
    61 text("/"),
    +
    62 to_text(task.size),
    +
    63 separator(),
    +
    64 gauge(task.downloaded / float(task.size)),
    +
    65 });
    +
    66 };
    +
    67
    +
    68 auto renderSummary = [&]() {
    +
    69 auto summary = vbox({
    +
    70 hbox({
    +
    71 text("- done: "),
    +
    72 to_text(nb_done) | bold,
    +
    73 }) | color(Color::Green),
    +
    74 hbox({
    +
    75 text("- active: "),
    +
    76 to_text(nb_active) | bold,
    +
    77 }) | color(Color::RedLight),
    +
    78 hbox({
    +
    79 text("- queue: "),
    +
    80 to_text(nb_queued) | bold,
    +
    81 }) | color(Color::Red),
    +
    82 });
    +
    83
    +
    84 return window(text(" Summary "), summary);
    +
    85 };
    +
    86
    +
    87 auto render = [&]() {
    +
    88 std::vector<Element> entries;
    +
    89 for (auto& task : displayed_task) {
    +
    90 entries.push_back(renderTask(task));
    +
    91 }
    +
    92
    +
    93 return vbox({
    +
    94 // List of tasks.
    +
    95 window(text(" Task "), vbox(std::move(entries))),
    +
    96
    +
    97 // Summary.
    +
    98 hbox({
    +
    99 renderSummary(),
    +
    100 filler(),
    +
    101 }),
    +
    102 });
    +
    103 };
    +
    104
    +
    105 auto updateModel = [&]() {
    +
    106 for (auto& task : displayed_task) {
    +
    107 if (task.downloaded != task.size) {
    +
    108 task.downloaded++;
    +
    109 } else if (task.number_of_threads) {
    +
    110 remaining_threads += task.number_of_threads;
    +
    111 task.number_of_threads = 0;
    +
    112 nb_active--;
    +
    113 nb_done++;
    +
    114 }
    +
    115 }
    +
    116
    +
    117 if (remaining_tasks.size() &&
    +
    118 remaining_tasks.front().number_of_threads <= remaining_threads) {
    +
    119 remaining_threads -= remaining_tasks.front().number_of_threads;
    +
    120 displayed_task.push_back(remaining_tasks.front());
    +
    121 remaining_tasks.pop_front();
    +
    122 nb_queued--;
    +
    123 nb_active++;
    +
    124 }
    +
    125 };
    +
    126
    +
    127 std::string reset_position;
    +
    128 for (;;) {
    +
    129 // Draw.
    +
    130 auto document = render();
    +
    131 auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    132 Render(screen, document);
    +
    133 std::cout << reset_position;
    +
    134 screen.Print();
    +
    135 reset_position = screen.ResetPosition();
    +
    136
    +
    137 // Simulate time.
    +
    138 using namespace std::chrono_literals;
    +
    139 std::this_thread::sleep_for(0.01s);
    +
    140
    +
    141 // Exit
    +
    142 if (nb_active + nb_queued == 0) {
    +
    143 break;
    +
    144 }
    +
    145
    +
    146 // Update the model for the next frame.
    +
    147 updateModel();
    +
    148 }
    +
    149 std::cout << std::endl;
    +
    150}
    +
    + + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::variant< Event, Closure, AnimationTask > Task
    Definition task.hpp:14
    + +
    int main()
    + +
    +
    + + + + + diff --git a/pages.html b/pages.html new file mode 100644 index 000000000..f12b5a102 --- /dev/null +++ b/pages.html @@ -0,0 +1,232 @@ + + + + + + + + +FTXUI: Pages + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Pages
    +
    +
    +
    Here is a list of all related documentation pages:
    +
    +
    + + + + + diff --git a/pixel_8cppm.html b/pixel_8cppm.html new file mode 100644 index 000000000..2c67e7e12 --- /dev/null +++ b/pixel_8cppm.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: pixel.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    pixel.cppm File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    +
    +
    + + + + + diff --git a/pixel_8cppm_source.html b/pixel_8cppm_source.html new file mode 100644 index 000000000..4c223f2c8 --- /dev/null +++ b/pixel_8cppm_source.html @@ -0,0 +1,229 @@ + + + + + + + + +FTXUI: pixel.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    pixel.cppm
    +
    +
    +Go to the documentation of this file.
    1/// @module ftxui.screen.pixel
    +
    2/// @brief Module file for the Pixel struct of the Screen module
    +
    3
    +
    4module;
    +
    5
    + +
    7
    +
    8export module ftxui.screen.pixel;
    +
    9
    +
    10/**
    +
    11 * @namespace ftxui
    +
    12 * @brief The FTXUI ftxui:: namespace
    +
    13 */
    +
    14export namespace ftxui {
    +
    15 using ftxui::Pixel;
    +
    16}
    +
    A Unicode character and its associated style.
    Definition pixel.hpp:15
    +
    Module file for the Pixel struct of the Screen module.
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + +
    +
    + + + + + diff --git a/pixel_8hpp.html b/pixel_8hpp.html new file mode 100644 index 000000000..840c12ef5 --- /dev/null +++ b/pixel_8hpp.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: pixel.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    pixel.hpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Classes

    struct  Pixel
     A Unicode character and its associated style. More...
     
    + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    +
    +
    + + + + + diff --git a/pixel_8hpp_source.html b/pixel_8hpp_source.html new file mode 100644 index 000000000..1363fc584 --- /dev/null +++ b/pixel_8hpp_source.html @@ -0,0 +1,285 @@ + + + + + + + + +FTXUI: pixel.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    pixel.hpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2024 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#ifndef FTXUI_SCREEN_PIXEL_HPP
    +
    5#define FTXUI_SCREEN_PIXEL_HPP
    +
    6
    +
    7#include <cstdint> // for uint8_t
    +
    8#include <string> // for string, basic_string, allocator
    +
    9#include "ftxui/screen/color.hpp" // for Color, Color::Default
    +
    10
    +
    11namespace ftxui {
    +
    12
    +
    13/// @brief A Unicode character and its associated style.
    +
    14/// @ingroup screen
    +
    +
    15struct Pixel {
    +
    + +
    17 : blink(false),
    +
    18 bold(false),
    +
    19 dim(false),
    +
    20 italic(false),
    +
    21 inverted(false),
    +
    22 underlined(false),
    +
    23 underlined_double(false),
    +
    24 strikethrough(false),
    +
    25 automerge(false) {}
    +
    +
    26
    +
    27 // A bit field representing the style:
    +
    28 bool blink : 1;
    +
    29 bool bold : 1;
    +
    30 bool dim : 1;
    +
    31 bool italic : 1;
    +
    32 bool inverted : 1;
    +
    33 bool underlined : 1;
    + +
    35 bool strikethrough : 1;
    +
    36 bool automerge : 1;
    +
    37
    +
    38 // The hyperlink associated with the pixel.
    +
    39 // 0 is the default value, meaning no hyperlink.
    +
    40 // It's an index for accessing Screen meta data
    +
    41 uint8_t hyperlink = 0;
    +
    42
    +
    43 // The graphemes stored into the pixel. To support combining characters,
    +
    44 // like: a?, this can potentially contain multiple codepoints.
    +
    45 std::string character = "";
    +
    46
    +
    47 // Colors:
    + + +
    50};
    +
    +
    51
    +
    52} // namespace ftxui
    +
    53
    +
    54#endif // FTXUI_SCREEN_PIXEL_HPP
    + +
    bool inverted
    Definition pixel.hpp:32
    +
    bool strikethrough
    Definition pixel.hpp:35
    +
    Color foreground_color
    Definition pixel.hpp:49
    +
    bool blink
    Definition pixel.hpp:28
    +
    Color background_color
    Definition pixel.hpp:48
    +
    std::string character
    Definition pixel.hpp:45
    + + +
    bool bold
    Definition pixel.hpp:29
    +
    bool underlined
    Definition pixel.hpp:33
    + +
    bool italic
    Definition pixel.hpp:31
    +
    bool automerge
    Definition pixel.hpp:36
    +
    bool underlined_double
    Definition pixel.hpp:34
    +
    Color is a class that represents a color in the terminal user interface.
    Definition color.hpp:22
    +
    A Unicode character and its associated style.
    Definition pixel.hpp:15
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    +
    + + + + + diff --git a/plus.svg b/plus.svg new file mode 100644 index 000000000..075201655 --- /dev/null +++ b/plus.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/plusd.svg b/plusd.svg new file mode 100644 index 000000000..0c65bfe94 --- /dev/null +++ b/plusd.svg @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/print__key__press_8cpp.html b/print__key__press_8cpp.html new file mode 100644 index 000000000..ddd9b7ed7 --- /dev/null +++ b/print__key__press_8cpp.html @@ -0,0 +1,262 @@ + + + + + + + + +FTXUI: print_key_press.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    print_key_press.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + + +

    +Functions

    std::string Code (Event event)
     
    int main ()
     
    +

    Function Documentation

    + +

    ◆ Code()

    + +
    +
    + + + + + + + +
    std::string Code (Event event)
    +
    +
    Examples
    examples/component/print_key_press.cpp.
    +
    + +

    Definition at line 21 of file print_key_press.cpp.

    + +
    +
    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 29 of file print_key_press.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/print__key__press_8cpp.js b/print__key__press_8cpp.js new file mode 100644 index 000000000..9082e2b19 --- /dev/null +++ b/print__key__press_8cpp.js @@ -0,0 +1,5 @@ +var print__key__press_8cpp = +[ + [ "Code", "print__key__press_8cpp.html#a1bbdd0071095abee0e28134bd4ad9213", null ], + [ "main", "print__key__press_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/print__key__press_8cpp_source.html b/print__key__press_8cpp_source.html new file mode 100644 index 000000000..9b81ca58d --- /dev/null +++ b/print__key__press_8cpp_source.html @@ -0,0 +1,299 @@ + + + + + + + + +FTXUI: print_key_press.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    print_key_press.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4
    +
    5#include <stddef.h> // for size_t
    +
    6#include <algorithm> // for max
    +
    7#include <memory> // for allocator, shared_ptr
    +
    8#include <string> // for char_traits, operator+, string, basic_string, to_string
    +
    9#include <utility> // for move
    +
    10#include <vector> // for vector
    +
    11
    +
    12#include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    13#include "ftxui/component/component.hpp" // for CatchEvent, Renderer
    +
    14#include "ftxui/component/event.hpp" // for Event
    +
    15#include "ftxui/component/mouse.hpp" // for Mouse, Mouse::Left, Mouse::Middle, Mouse::None, Mouse::Pressed, Mouse::Released, Mouse::Right, Mouse::WheelDown, Mouse::WheelUp
    +
    16#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    17#include "ftxui/dom/elements.hpp" // for text, vbox, window, Element, Elements
    +
    18
    +
    19using namespace ftxui;
    +
    20
    +
    +
    21std::string Code(Event event) {
    +
    22 std::string codes;
    +
    23 for (auto& it : event.input()) {
    +
    24 codes += " " + std::to_string((unsigned int)it);
    +
    25 }
    +
    26 return codes;
    +
    27}
    +
    +
    28
    +
    +
    29int main() {
    + +
    31
    +
    32 std::vector<Event> keys;
    +
    33
    +
    34 auto left_column = Renderer([&] {
    +
    35 Elements children = {
    +
    36 text("Codes"),
    +
    37 separator(),
    +
    38 };
    +
    39 for (size_t i = std::max(0, (int)keys.size() - 20); i < keys.size(); ++i) {
    +
    40 children.push_back(text(Code(keys[i])));
    +
    41 }
    +
    42 return vbox(children);
    +
    43 });
    +
    44
    +
    45 auto right_column = Renderer([&] {
    +
    46 Elements children = {
    +
    47 text("Event"),
    +
    48 separator(),
    +
    49 };
    +
    50 for (size_t i = std::max(0, (int)keys.size() - 20); i < keys.size(); ++i) {
    +
    51 children.push_back(text(keys[i].DebugString()));
    +
    52 }
    +
    53 return vbox(children);
    +
    54 });
    +
    55
    +
    56 int split_size = 40;
    +
    57 auto component = ResizableSplitLeft(left_column, right_column, &split_size);
    +
    58 component |= border;
    +
    59
    +
    60 component |= CatchEvent([&](Event event) {
    +
    61 keys.push_back(event);
    +
    62 return false;
    +
    63 });
    +
    64
    +
    65 screen.Loop(component);
    +
    66}
    +
    + + + + +
    static ScreenInteractive TerminalOutput()
    +
    const std::string & input() const
    Definition event.hpp:104
    +
    Component Renderer(Component child, std::function< Element()>)
    Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
    +
    Component ResizableSplitLeft(Component main, Component back, int *main_size)
    An horizontal split in between two components, configurable using the mouse.
    +
    Represent an event. It can be key press event, a terminal resize, or more ...
    Definition event.hpp:29
    +
    Element text(std::wstring text)
    Display a piece of unicode text.
    Definition text.cpp:160
    +
    Element separator()
    Draw a vertical or horizontal separation in between two other elements.
    +
    Element border(Element)
    Draw a border around the element.
    +
    Element vbox(Elements)
    A container displaying elements vertically one by one.
    Definition vbox.cpp:96
    + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::vector< Element > Elements
    Definition elements.hpp:23
    +
    Component CatchEvent(Component child, std::function< bool(Event)>)
    +
    std::string Code(Event event)
    +
    int main()
    + +
    +
    + + + + + diff --git a/radiobox__in__frame_8cpp.html b/radiobox__in__frame_8cpp.html new file mode 100644 index 000000000..058feffc0 --- /dev/null +++ b/radiobox__in__frame_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: radiobox_in_frame.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    radiobox_in_frame.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Functions

    int main ()
     
    +

    Function Documentation

    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 16 of file radiobox_in_frame.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/radiobox__in__frame_8cpp.js b/radiobox__in__frame_8cpp.js new file mode 100644 index 000000000..15f25dab0 --- /dev/null +++ b/radiobox__in__frame_8cpp.js @@ -0,0 +1,4 @@ +var radiobox__in__frame_8cpp = +[ + [ "main", "radiobox__in__frame_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/radiobox__in__frame_8cpp_source.html b/radiobox__in__frame_8cpp_source.html new file mode 100644 index 000000000..6d4b7d2cf --- /dev/null +++ b/radiobox__in__frame_8cpp_source.html @@ -0,0 +1,258 @@ + + + + + + + + +FTXUI: radiobox_in_frame.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    radiobox_in_frame.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <memory> // for shared_ptr, __shared_ptr_access
    +
    5#include <string> // for string, basic_string, operator+, to_string
    +
    6#include <vector> // for vector
    +
    7
    +
    8#include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    9#include "ftxui/component/component.hpp" // for Radiobox, Renderer
    +
    10#include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    11#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    12#include "ftxui/dom/elements.hpp" // for operator|, Element, size, border, frame, HEIGHT, LESS_THAN
    +
    13
    +
    14using namespace ftxui;
    +
    15
    +
    +
    16int main() {
    +
    17 std::vector<std::string> entries;
    +
    18 int selected = 0;
    +
    19
    +
    20 for (int i = 0; i < 30; ++i) {
    +
    21 entries.push_back("RadioBox " + std::to_string(i));
    +
    22 }
    +
    23 auto radiobox = Radiobox(&entries, &selected);
    +
    24 auto renderer = Renderer(radiobox, [&] {
    +
    25 return radiobox->Render() | vscroll_indicator | frame |
    + +
    27 });
    +
    28
    +
    29 auto screen = ScreenInteractive::FitComponent();
    +
    30 screen.Loop(renderer);
    +
    31
    +
    32 return 0;
    +
    33}
    +
    + + + + +
    static ScreenInteractive FitComponent()
    +
    Component Radiobox(RadioboxOption options)
    A list of element, where only one can be selected.
    +
    Component Renderer(Component child, std::function< Element()>)
    Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
    +
    Decorator size(WidthOrHeight, Constraint, int value)
    Apply a constraint on the size of an element.
    +
    Element border(Element)
    Draw a border around the element.
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + +
    @ LESS_THAN
    Definition elements.hpp:162
    +
    int main()
    + +
    +
    + + + + + diff --git a/receiver_8cppm.html b/receiver_8cppm.html new file mode 100644 index 000000000..37546c456 --- /dev/null +++ b/receiver_8cppm.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: receiver.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    receiver.cppm File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    +
    +
    + + + + + diff --git a/receiver_8cppm_source.html b/receiver_8cppm_source.html new file mode 100644 index 000000000..f4eda3f38 --- /dev/null +++ b/receiver_8cppm_source.html @@ -0,0 +1,242 @@ + + + + + + + + +FTXUI: receiver.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    receiver.cppm
    +
    +
    +Go to the documentation of this file.
    1/// @module ftxui.component.receiver
    +
    2/// @brief Module file for the Receiver class of the Component module
    +
    3
    +
    4module;
    +
    5
    + +
    7
    +
    8export module ftxui.component.receiver;
    +
    9
    +
    10/**
    +
    11 * @namespace ftxui
    +
    12 * @brief The FTXUI ftxui:: namespace
    +
    13 */
    +
    14export namespace ftxui {
    +
    15 // Deprecated:
    + +
    17 // Deprecated:
    + +
    19 // Deprecated:
    +
    20 using ftxui::Sender;
    +
    21 // Deprecated:
    +
    22 using ftxui::Receiver;
    +
    23 // Deprecated:
    +
    24 using ftxui::MakeReceiver;
    +
    25 // Deprecated:
    +
    26}
    + + +
    Module file for the Receiver class of the Component module.
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::unique_ptr< ReceiverImpl< T > > Receiver
    Definition receiver.hpp:54
    +
    std::unique_ptr< SenderImpl< T > > Sender
    Definition receiver.hpp:52
    + +
    +
    + + + + + diff --git a/receiver_8hpp.html b/receiver_8hpp.html new file mode 100644 index 000000000..d2cce475f --- /dev/null +++ b/receiver_8hpp.html @@ -0,0 +1,245 @@ + + + + + + + + +FTXUI: receiver.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    receiver.hpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + + +

    +Classes

    class  SenderImpl< T >
     
    class  ReceiverImpl< T >
     
    + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + + + + +

    +Typedefs

    template<class T >
    using Sender = std::unique_ptr<SenderImpl<T>>
     
    template<class T >
    using Receiver = std::unique_ptr<ReceiverImpl<T>>
     
    + + + + +

    +Functions

    template<class T >
    Receiver< T > MakeReceiver ()
     
    +
    +
    + + + + + diff --git a/receiver_8hpp.js b/receiver_8hpp.js new file mode 100644 index 000000000..284c4ea47 --- /dev/null +++ b/receiver_8hpp.js @@ -0,0 +1,8 @@ +var receiver_8hpp = +[ + [ "SenderImpl< T >", "classftxui_1_1SenderImpl.html", "classftxui_1_1SenderImpl" ], + [ "ReceiverImpl< T >", "classftxui_1_1ReceiverImpl.html", "classftxui_1_1ReceiverImpl" ], + [ "Sender", "receiver_8hpp.html#a8f713c247c551bd416c4697ed9ab871c", null ], + [ "Receiver", "receiver_8hpp.html#a7abbe763f26611fbf3902861863b7659", null ], + [ "MakeReceiver", "receiver_8hpp.html#a57abe3e11733b1d3ebacc56692d3537c", null ] +]; \ No newline at end of file diff --git a/receiver_8hpp_source.html b/receiver_8hpp_source.html new file mode 100644 index 000000000..ca066581e --- /dev/null +++ b/receiver_8hpp_source.html @@ -0,0 +1,402 @@ + + + + + + + + +FTXUI: receiver.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    receiver.hpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#ifndef FTXUI_COMPONENT_RECEIVER_HPP_
    +
    5#define FTXUI_COMPONENT_RECEIVER_HPP_
    +
    6
    + +
    8#include <algorithm> // for copy, max
    +
    9#include <atomic> // for atomic, __atomic_base
    +
    10#include <condition_variable> // for condition_variable
    +
    11#include <memory> // for unique_ptr, make_unique
    +
    12#include <mutex> // for mutex, unique_lock
    +
    13#include <queue> // for queue
    +
    14#include <utility> // for move
    +
    15
    +
    16namespace ftxui {
    +
    17
    +
    18// Deprecated
    +
    19//
    +
    20// Usage:
    +
    21//
    +
    22// Initialization:
    +
    23// ---------------
    +
    24//
    +
    25// auto receiver = MakeReceiver<std:string>();
    +
    26// auto sender_1= receiver->MakeSender();
    +
    27// auto sender_2 = receiver->MakeSender();
    +
    28//
    +
    29// Then move the senders elsewhere, potentially in a different thread.
    +
    30//
    +
    31// On the producer side:
    +
    32// ----------------------
    +
    33// [thread 1] sender_1->Send("hello");
    +
    34// [thread 2] sender_2->Send("world");
    +
    35//
    +
    36// On the consumer side:
    +
    37// ---------------------
    +
    38// char c;
    +
    39// while(receiver->Receive(&c)) // Return true as long as there is a producer.
    +
    40// print(c)
    +
    41//
    +
    42// Receiver::Receive() returns true when there are no more senders.
    +
    43
    +
    44// clang-format off
    +
    45// Deprecated:
    +
    46template<class T> class SenderImpl;
    +
    47// Deprecated:
    +
    48template<class T> class ReceiverImpl;
    +
    49// Deprecated:
    +
    50
    +
    51// Deprecated:
    +
    52template<class T> using Sender = std::unique_ptr<SenderImpl<T>>;
    +
    53// Deprecated:
    +
    54template<class T> using Receiver = std::unique_ptr<ReceiverImpl<T>>;
    +
    55// Deprecated:
    +
    56template<class T> Receiver<T> MakeReceiver();
    +
    57// clang-format on
    +
    58
    +
    59// ---- Implementation part ----
    +
    60
    +
    61template <class T>
    +
    62// Deprecated:
    +
    + +
    64 public:
    +
    65 SenderImpl(const SenderImpl&) = delete;
    + +
    67 SenderImpl& operator=(const SenderImpl&) = delete;
    + +
    69 void Send(T t) { receiver_->Receive(std::move(t)); }
    +
    70 ~SenderImpl() { receiver_->ReleaseSender(); }
    +
    71
    +
    72 Sender<T> Clone() { return receiver_->MakeSender(); }
    +
    73
    +
    74 private:
    +
    75 friend class ReceiverImpl<T>;
    +
    76 explicit SenderImpl(ReceiverImpl<T>* consumer) : receiver_(consumer) {}
    +
    77 ReceiverImpl<T>* receiver_;
    +
    78};
    +
    +
    79
    +
    80template <class T>
    +
    + +
    82 public:
    +
    + +
    84 std::unique_lock<std::mutex> lock(mutex_);
    +
    85 senders_++;
    +
    86 return std::unique_ptr<SenderImpl<T>>(new SenderImpl<T>(this));
    +
    87 }
    +
    +
    88 ReceiverImpl() = default;
    +
    89
    +
    +
    90 bool Receive(T* t) {
    +
    91 while (senders_ || !queue_.empty()) {
    +
    92 std::unique_lock<std::mutex> lock(mutex_);
    +
    93 if (queue_.empty()) {
    +
    94 notifier_.wait(lock);
    +
    95 }
    +
    96 if (queue_.empty()) {
    +
    97 continue;
    +
    98 }
    +
    99 *t = std::move(queue_.front());
    +
    100 queue_.pop();
    +
    101 return true;
    +
    102 }
    +
    103 return false;
    +
    104 }
    +
    +
    105
    +
    + +
    107 std::unique_lock<std::mutex> lock(mutex_);
    +
    108 if (queue_.empty()) {
    +
    109 return false;
    +
    110 }
    +
    111 *t = queue_.front();
    +
    112 queue_.pop();
    +
    113 return true;
    +
    114 }
    +
    +
    115
    +
    +
    116 bool HasPending() {
    +
    117 std::unique_lock<std::mutex> lock(mutex_);
    +
    118 return !queue_.empty();
    +
    119 }
    +
    +
    120
    +
    +
    121 bool HasQuitted() {
    +
    122 std::unique_lock<std::mutex> lock(mutex_);
    +
    123 return queue_.empty() && !senders_;
    +
    124 }
    +
    +
    125
    +
    126 private:
    +
    127 friend class SenderImpl<T>;
    +
    128
    +
    129 void Receive(T t) {
    +
    130 {
    +
    131 std::unique_lock<std::mutex> lock(mutex_);
    +
    132 queue_.push(std::move(t));
    +
    133 }
    +
    134 notifier_.notify_one();
    +
    135 }
    +
    136
    +
    137 void ReleaseSender() {
    +
    138 senders_--;
    +
    139 notifier_.notify_one();
    +
    140 }
    +
    141
    +
    142 std::mutex mutex_;
    +
    143 std::queue<T> queue_;
    +
    144 std::condition_variable notifier_;
    +
    145 std::atomic<int> senders_{0};
    +
    146};
    +
    +
    147
    +
    148template <class T>
    +
    + +
    150 return std::make_unique<ReceiverImpl<T>>();
    +
    151}
    +
    +
    152
    +
    153} // namespace ftxui
    +
    154
    +
    155#endif // FTXUI_COMPONENT_RECEIVER_HPP_
    + +
    ReceiverImpl()=default
    + +
    bool Receive(T *t)
    Definition receiver.hpp:90
    +
    bool ReceiveNonBlocking(T *t)
    Definition receiver.hpp:106
    + +
    friend class SenderImpl< T >
    Definition receiver.hpp:127
    +
    Sender< T > MakeSender()
    Definition receiver.hpp:83
    + +
    friend class ReceiverImpl< T >
    Definition receiver.hpp:75
    +
    SenderImpl & operator=(const SenderImpl &)=delete
    +
    Sender< T > Clone()
    Definition receiver.hpp:72
    +
    SenderImpl(SenderImpl &&)=delete
    +
    SenderImpl(const SenderImpl &)=delete
    + +
    SenderImpl & operator=(SenderImpl &&)=delete
    + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    Receiver< T > MakeReceiver()
    Definition receiver.hpp:149
    +
    std::unique_ptr< ReceiverImpl< T > > Receiver
    Definition receiver.hpp:54
    +
    std::unique_ptr< SenderImpl< T > > Sender
    Definition receiver.hpp:52
    + +
    +
    + + + + + diff --git a/ref_8cppm.html b/ref_8cppm.html new file mode 100644 index 000000000..0abe8d1de --- /dev/null +++ b/ref_8cppm.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: ref.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ref.cppm File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    +
    +
    + + + + + diff --git a/ref_8cppm_source.html b/ref_8cppm_source.html new file mode 100644 index 000000000..aefc2502a --- /dev/null +++ b/ref_8cppm_source.html @@ -0,0 +1,237 @@ + + + + + + + + +FTXUI: ref.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    ref.cppm
    +
    +
    +Go to the documentation of this file.
    1/// @module ftxui.util.ref
    +
    2/// @brief Module file for the Ref classes of the Util module
    +
    3
    +
    4module;
    +
    5
    +
    6#include <ftxui/util/ref.hpp>
    +
    7
    +
    8export module ftxui.util.ref;
    +
    9
    +
    10/**
    +
    11 * @namespace ftxui
    +
    12 * @brief The FTXUI ftxui:: namespace
    +
    13 */
    +
    14export namespace ftxui {
    +
    15 using ftxui::ConstRef;
    +
    16 using ftxui::Ref;
    +
    17 using ftxui::StringRef;
    + + +
    20}
    +
    An adapter. Own or reference an immutable object.
    Definition ref.hpp:17
    +
    An adapter. Reference a list of strings.
    Definition ref.hpp:116
    +
    An adapter. Own or reference a constant string. For convenience, this class convert multiple immutabl...
    Definition ref.hpp:94
    +
    An adapter. Own or reference an mutable object.
    Definition ref.hpp:46
    +
    An adapter. Own or reference a constant string. For convenience, this class convert multiple mutable ...
    Definition ref.hpp:82
    +
    Module file for the Ref classes of the Util module.
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + +
    +
    + + + + + diff --git a/ref_8hpp.html b/ref_8hpp.html new file mode 100644 index 000000000..8f2aa1277 --- /dev/null +++ b/ref_8hpp.html @@ -0,0 +1,241 @@ + + + + + + + + +FTXUI: ref.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ref.hpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + + + + + + + + + + + + + + + +

    +Classes

    class  ConstRef< T >
     An adapter. Own or reference an immutable object. More...
     
    class  Ref< T >
     An adapter. Own or reference an mutable object. More...
     
    class  StringRef
     An adapter. Own or reference a constant string. For convenience, this class convert multiple mutable string toward a shared representation. More...
     
    class  ConstStringRef
     An adapter. Own or reference a constant string. For convenience, this class convert multiple immutable string toward a shared representation. More...
     
    class  ConstStringListRef
     An adapter. Reference a list of strings. More...
     
    class  ConstStringListRef::Adapter
     
    + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    +
    +
    + + + + + diff --git a/ref_8hpp.js b/ref_8hpp.js new file mode 100644 index 000000000..1a68c3850 --- /dev/null +++ b/ref_8hpp.js @@ -0,0 +1,9 @@ +var ref_8hpp = +[ + [ "ConstRef< T >", "classftxui_1_1ConstRef.html", "classftxui_1_1ConstRef" ], + [ "Ref< T >", "classftxui_1_1Ref.html", "classftxui_1_1Ref" ], + [ "StringRef", "classftxui_1_1StringRef.html", "classftxui_1_1StringRef" ], + [ "ConstStringRef", "classftxui_1_1ConstStringRef.html", "classftxui_1_1ConstStringRef" ], + [ "ConstStringListRef", "classftxui_1_1ConstStringListRef.html", "classftxui_1_1ConstStringListRef" ], + [ "Adapter", "classftxui_1_1ConstStringListRef_1_1Adapter.html", "classftxui_1_1ConstStringListRef_1_1Adapter" ] +]; \ No newline at end of file diff --git a/ref_8hpp_source.html b/ref_8hpp_source.html new file mode 100644 index 000000000..d0692d865 --- /dev/null +++ b/ref_8hpp_source.html @@ -0,0 +1,516 @@ + + + + + + + + +FTXUI: ref.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    ref.hpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#ifndef FTXUI_UTIL_REF_HPP
    +
    5#define FTXUI_UTIL_REF_HPP
    +
    6
    + +
    8#include <memory>
    +
    9#include <string>
    +
    10#include <variant>
    +
    11#include <vector>
    +
    12
    +
    13namespace ftxui {
    +
    14
    +
    15/// @brief An adapter. Own or reference an immutable object.
    +
    16template <typename T>
    +
    +
    17class ConstRef {
    +
    18 public:
    +
    19 ConstRef() = default;
    +
    20 ConstRef(T t) : variant_(std::move(t)) {} // NOLINT
    +
    21 ConstRef(const T* t) : variant_(t) {} // NOLINT
    +
    22 ConstRef& operator=(ConstRef&&) noexcept = default;
    +
    23 ConstRef(const ConstRef<T>&) = default;
    +
    24 ConstRef(ConstRef<T>&&) noexcept = default;
    +
    25 ~ConstRef() = default;
    +
    26
    +
    27 // Make a "reseatable" reference
    +
    28 ConstRef<T>& operator=(const ConstRef<T>&) = default;
    +
    29
    +
    30 // Accessors:
    +
    31 const T& operator()() const { return *Address(); }
    +
    32 const T& operator*() const { return *Address(); }
    +
    33 const T* operator->() const { return Address(); }
    +
    34
    +
    35 private:
    +
    36 std::variant<T, const T*> variant_ = T{};
    +
    37
    +
    38 const T* Address() const {
    +
    39 return std::holds_alternative<T>(variant_) ? &std::get<T>(variant_)
    +
    40 : std::get<const T*>(variant_);
    +
    41 }
    +
    42};
    +
    +
    43
    +
    44/// @brief An adapter. Own or reference an mutable object.
    +
    45template <typename T>
    +
    +
    46class Ref {
    +
    47 public:
    +
    48 Ref() = default;
    +
    49 Ref(T t) : variant_(std::move(t)) {} // NOLINT
    +
    50 Ref(T* t) : variant_(t) {} // NOLINT
    +
    51 ~Ref() = default;
    +
    52 Ref& operator=(Ref&&) noexcept = default;
    +
    53 Ref(const Ref<T>&) = default;
    +
    54 Ref(Ref<T>&&) noexcept = default;
    +
    55
    +
    56 // Make a "reseatable" reference.
    +
    57 Ref<T>& operator=(const Ref<T>&) = default;
    +
    58
    +
    59 // Accessors:
    +
    60 T& operator()() { return *Address(); }
    +
    61 T& operator*() { return *Address(); }
    +
    62 T* operator->() { return Address(); }
    +
    63 const T& operator()() const { return *Address(); }
    +
    64 const T& operator*() const { return *Address(); }
    +
    65 const T* operator->() const { return Address(); }
    +
    66
    +
    67 private:
    +
    68 std::variant<T, T*> variant_ = T{};
    +
    69
    +
    70 const T* Address() const {
    +
    71 return std::holds_alternative<T>(variant_) ? &std::get<T>(variant_)
    +
    72 : std::get<T*>(variant_);
    +
    73 }
    +
    74 T* Address() {
    +
    75 return std::holds_alternative<T>(variant_) ? &std::get<T>(variant_)
    +
    76 : std::get<T*>(variant_);
    +
    77 }
    +
    78};
    +
    +
    79
    +
    80/// @brief An adapter. Own or reference a constant string. For convenience, this
    +
    81/// class convert multiple mutable string toward a shared representation.
    +
    +
    82class StringRef : public Ref<std::string> {
    +
    83 public:
    +
    84 using Ref<std::string>::Ref;
    +
    85
    +
    +
    86 StringRef(const wchar_t* ref) // NOLINT
    +
    87 : StringRef(to_string(std::wstring(ref))) {}
    +
    +
    +
    88 StringRef(const char* ref) // NOLINT
    +
    89 : StringRef(std::string(ref)) {}
    +
    +
    90};
    +
    +
    91
    +
    92/// @brief An adapter. Own or reference a constant string. For convenience, this
    +
    93/// class convert multiple immutable string toward a shared representation.
    +
    +
    94class ConstStringRef : public ConstRef<std::string> {
    +
    95 public:
    +
    96 using ConstRef<std::string>::ConstRef;
    +
    97
    +
    +
    98 ConstStringRef(const std::wstring* ref) // NOLINT
    +
    99 : ConstStringRef(to_string(*ref)) {}
    +
    +
    +
    100 ConstStringRef(const std::wstring ref) // NOLINT
    +
    101 : ConstStringRef(to_string(ref)) {}
    +
    +
    +
    102 ConstStringRef(const wchar_t* ref) // NOLINT
    +
    103 : ConstStringRef(to_string(std::wstring(ref))) {}
    +
    +
    +
    104 ConstStringRef(const char* ref) // NOLINT
    +
    105 : ConstStringRef(std::string(ref)) {}
    +
    +
    106};
    +
    +
    107
    +
    108/// @brief An adapter. Reference a list of strings.
    +
    109///
    +
    110/// Supported input:
    +
    111/// - `std::vector<std::string>`
    +
    112/// - `std::vector<std::string>*`
    +
    113/// - `std::vector<std::wstring>*`
    +
    114/// - `Adapter*`
    +
    115/// - `std::unique_ptr<Adapter>`
    +
    + +
    117 public:
    +
    118 // Bring your own adapter:
    +
    +
    119 class Adapter {
    +
    120 public:
    +
    121 Adapter() = default;
    +
    122 Adapter(const Adapter&) = default;
    +
    123 Adapter& operator=(const Adapter&) = default;
    +
    124 Adapter(Adapter&&) = default;
    +
    125 Adapter& operator=(Adapter&&) = default;
    +
    126 virtual ~Adapter() = default;
    +
    127 virtual size_t size() const = 0;
    +
    128 virtual std::string operator[](size_t i) const = 0;
    +
    129 };
    +
    +
    130 using Variant = std::variant<const std::vector<std::string>, //
    +
    131 const std::vector<std::string>*, //
    +
    132 const std::vector<std::wstring>*, //
    +
    133 Adapter*, //
    +
    134 std::unique_ptr<Adapter> //
    +
    135 >;
    +
    136
    + + + + + + +
    143
    +
    +
    144 ConstStringListRef(std::vector<std::string> value) // NOLINT
    +
    145 {
    +
    146 variant_ = std::make_shared<Variant>(value);
    +
    147 }
    +
    +
    +
    148 ConstStringListRef(const std::vector<std::string>* value) // NOLINT
    +
    149 {
    +
    150 variant_ = std::make_shared<Variant>(value);
    +
    151 }
    +
    +
    +
    152 ConstStringListRef(const std::vector<std::wstring>* value) // NOLINT
    +
    153 {
    +
    154 variant_ = std::make_shared<Variant>(value);
    +
    155 }
    +
    +
    +
    156 ConstStringListRef(Adapter* adapter) // NOLINT
    +
    157 {
    +
    158 variant_ = std::make_shared<Variant>(adapter);
    +
    159 }
    +
    +
    160 template <typename AdapterType>
    +
    +
    161 ConstStringListRef(std::unique_ptr<AdapterType> adapter) // NOLINT
    +
    162 {
    +
    163 variant_ = std::make_shared<Variant>(
    +
    164 static_cast<std::unique_ptr<Adapter>>(std::move(adapter)));
    +
    165 }
    +
    +
    166
    +
    +
    167 size_t size() const {
    +
    168 return variant_ ? std::visit(SizeVisitor(), *variant_) : 0;
    +
    169 }
    +
    +
    170
    +
    +
    171 std::string operator[](size_t i) const {
    +
    172 return variant_ ? std::visit(IndexedGetter(i), *variant_) : "";
    +
    173 }
    +
    +
    174
    +
    175 private:
    +
    176 struct SizeVisitor {
    +
    177 size_t operator()(const std::vector<std::string>& v) const {
    +
    178 return v.size();
    +
    179 }
    +
    180 size_t operator()(const std::vector<std::string>* v) const {
    +
    181 return v->size();
    +
    182 }
    +
    183 size_t operator()(const std::vector<std::wstring>* v) const {
    +
    184 return v->size();
    +
    185 }
    +
    186 size_t operator()(const Adapter* v) const { return v->size(); }
    +
    187 size_t operator()(const std::unique_ptr<Adapter>& v) const {
    +
    188 return v->size();
    +
    189 }
    +
    190 };
    +
    191
    +
    192 struct IndexedGetter {
    +
    193 IndexedGetter(size_t index) // NOLINT
    +
    194 : index_(index) {}
    +
    195 size_t index_;
    +
    196 std::string operator()(const std::vector<std::string>& v) const {
    +
    197 return v[index_];
    +
    198 }
    +
    199 std::string operator()(const std::vector<std::string>* v) const {
    +
    200 return (*v)[index_];
    +
    201 }
    +
    202 std::string operator()(const std::vector<std::wstring>* v) const {
    +
    203 return to_string((*v)[index_]);
    +
    204 }
    +
    205 std::string operator()(const Adapter* v) const { return (*v)[index_]; }
    +
    206 std::string operator()(const std::unique_ptr<Adapter>& v) const {
    +
    207 return (*v)[index_];
    +
    208 }
    +
    209 };
    +
    210
    +
    211 std::shared_ptr<Variant> variant_;
    +
    212};
    +
    +
    213
    +
    214} // namespace ftxui
    +
    215
    +
    216#endif /* end of include guard: FTXUI_UTIL_REF_HPP */
    +
    An adapter. Own or reference an immutable object.
    Definition ref.hpp:17
    +
    const T & operator*() const
    Definition ref.hpp:32
    +
    ConstRef()=default
    +
    ConstRef(const T *t)
    Definition ref.hpp:21
    +
    ConstRef(T t)
    Definition ref.hpp:20
    +
    const T * operator->() const
    Definition ref.hpp:33
    +
    ConstRef & operator=(ConstRef &&) noexcept=default
    + +
    Adapter & operator=(Adapter &&)=default
    + +
    Adapter & operator=(const Adapter &)=default
    +
    virtual size_t size() const =0
    +
    virtual std::string operator[](size_t i) const =0
    + + +
    Adapter(const Adapter &)=default
    +
    An adapter. Reference a list of strings.
    Definition ref.hpp:116
    +
    ConstStringListRef(std::vector< std::string > value)
    Definition ref.hpp:144
    +
    ConstStringListRef(const std::vector< std::string > *value)
    Definition ref.hpp:148
    +
    size_t size() const
    Definition ref.hpp:167
    + +
    ConstStringListRef(ConstStringListRef &&)=default
    +
    ConstStringListRef & operator=(ConstStringListRef &&)=default
    + +
    std::variant< const std::vector< std::string >, const std::vector< std::string > *, const std::vector< std::wstring > *, Adapter *, std::unique_ptr< Adapter > > Variant
    Definition ref.hpp:130
    +
    ConstStringListRef & operator=(const ConstStringListRef &)=default
    +
    ConstStringListRef(std::unique_ptr< AdapterType > adapter)
    Definition ref.hpp:161
    +
    ConstStringListRef(const std::vector< std::wstring > *value)
    Definition ref.hpp:152
    +
    ConstStringListRef(const ConstStringListRef &)=default
    +
    ConstStringListRef(Adapter *adapter)
    Definition ref.hpp:156
    +
    std::string operator[](size_t i) const
    Definition ref.hpp:171
    +
    An adapter. Own or reference a constant string. For convenience, this class convert multiple immutabl...
    Definition ref.hpp:94
    +
    ConstStringRef(const char *ref)
    Definition ref.hpp:104
    +
    ConstStringRef(const std::wstring ref)
    Definition ref.hpp:100
    +
    ConstStringRef(const std::wstring *ref)
    Definition ref.hpp:98
    +
    ConstStringRef(const wchar_t *ref)
    Definition ref.hpp:102
    +
    An adapter. Own or reference an mutable object.
    Definition ref.hpp:46
    +
    const T & operator*() const
    Definition ref.hpp:64
    +
    ~Ref()=default
    +
    T & operator*()
    Definition ref.hpp:61
    +
    T * operator->()
    Definition ref.hpp:62
    +
    Ref()=default
    +
    Ref(T t)
    Definition ref.hpp:49
    +
    const T * operator->() const
    Definition ref.hpp:65
    +
    Ref & operator=(Ref &&) noexcept=default
    +
    Ref(T *t)
    Definition ref.hpp:50
    +
    const T & operator()() const
    Definition ref.hpp:63
    +
    An adapter. Own or reference a constant string. For convenience, this class convert multiple mutable ...
    Definition ref.hpp:82
    +
    StringRef(const char *ref)
    Definition ref.hpp:88
    +
    StringRef(const wchar_t *ref)
    Definition ref.hpp:86
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::string to_string(const std::wstring &s)
    Convert a std::wstring into a UTF8 std::string.
    Definition string.cpp:1566
    + +
    +
    + + + + + diff --git a/reflect_8cpp.html b/reflect_8cpp.html new file mode 100644 index 000000000..978eae3dd --- /dev/null +++ b/reflect_8cpp.html @@ -0,0 +1,226 @@ + + + + + + + + +FTXUI: reflect.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    reflect.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + +

    +Functions

    Decorator reflect (Box &box)
     
    +
    +
    + + + + + diff --git a/reflect_8cpp.js b/reflect_8cpp.js new file mode 100644 index 000000000..f526afe91 --- /dev/null +++ b/reflect_8cpp.js @@ -0,0 +1,4 @@ +var reflect_8cpp = +[ + [ "reflect", "reflect_8cpp.html#aaff8245861617a3d9e846e99de582a63", null ] +]; \ No newline at end of file diff --git a/reflect_8cpp_source.html b/reflect_8cpp_source.html new file mode 100644 index 000000000..06b0719ff --- /dev/null +++ b/reflect_8cpp_source.html @@ -0,0 +1,275 @@ + + + + + + + + +FTXUI: reflect.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    reflect.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <memory> // for make_shared, __shared_ptr_access
    +
    5#include <utility> // for move
    +
    6
    +
    7#include "ftxui/dom/elements.hpp" // for Element, unpack, Decorator, reflect
    +
    8#include "ftxui/dom/node.hpp" // for Node, Elements
    +
    9#include "ftxui/dom/requirement.hpp" // for Requirement
    +
    10#include "ftxui/screen/box.hpp" // for Box
    +
    11#include "ftxui/screen/screen.hpp" // for Screen
    +
    12
    +
    13namespace ftxui {
    +
    14namespace {
    +
    15
    +
    16// Helper class.
    +
    17class Reflect : public Node {
    +
    18 public:
    +
    19 Reflect(Element child, Box& box)
    +
    20 : Node(unpack(std::move(child))), reflected_box_(box) {}
    +
    21
    +
    22 void ComputeRequirement() final {
    + +
    24 requirement_ = children_[0]->requirement();
    +
    25 }
    +
    26
    +
    27 void SetBox(Box box) final {
    +
    28 reflected_box_ = box;
    +
    29 Node::SetBox(box);
    +
    30 children_[0]->SetBox(box);
    +
    31 }
    +
    32
    +
    33 void Render(Screen& screen) final {
    +
    34 reflected_box_ = Box::Intersection(screen.stencil, reflected_box_);
    +
    35 Node::Render(screen);
    +
    36 }
    +
    37
    +
    38 private:
    +
    39 Box& reflected_box_;
    +
    40};
    +
    41} // namespace
    +
    42
    +
    + +
    44 return [&](Element child) -> Element {
    +
    45 return std::make_shared<Reflect>(std::move(child), box);
    +
    46 };
    +
    47}
    +
    +
    48
    +
    49} // namespace ftxui
    + + +
    virtual void SetBox(Box box)
    Assign a position and a dimension to an element for drawing.
    Definition node.cpp:41
    +
    virtual void ComputeRequirement()
    Compute how much space an element needs.
    Definition node.cpp:20
    +
    friend void Render(Screen &screen, Node *node, Selection &selection)
    Definition node.cpp:96
    +
    void Render(Screen &screen, const Element &element)
    Display an element on a ftxui::Screen.
    Definition node.cpp:84
    +
    static auto Intersection(Box a, Box b) -> Box
    Definition box.cpp:11
    +
    Box is a structure that represents a rectangular area in a 2D space.
    Definition box.hpp:16
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::function< Element(Element)> Decorator
    Definition elements.hpp:24
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    Decorator reflect(Box &box)
    Definition reflect.cpp:43
    + + + +
    +
    + + + + + diff --git a/requirement_8cppm.html b/requirement_8cppm.html new file mode 100644 index 000000000..fb8599570 --- /dev/null +++ b/requirement_8cppm.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: requirement.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    requirement.cppm File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    +
    +
    + + + + + diff --git a/requirement_8cppm_source.html b/requirement_8cppm_source.html new file mode 100644 index 000000000..31e9a0a02 --- /dev/null +++ b/requirement_8cppm_source.html @@ -0,0 +1,229 @@ + + + + + + + + +FTXUI: requirement.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    requirement.cppm
    +
    +
    +Go to the documentation of this file.
    1/// @module ftxui.dom.requirement
    +
    2/// @brief Module file for the Requirement struct of the Dom module
    +
    3
    +
    4module;
    +
    5
    + +
    7
    +
    8export module ftxui.dom.requirement;
    +
    9
    +
    10/**
    +
    11 * @namespace ftxui
    +
    12 * @brief The FTXUI ftxui:: namespace
    +
    13 */
    +
    14export namespace ftxui {
    + +
    16}
    +
    Requirement is a structure that defines the layout requirements for a Node in the terminal user inter...
    +
    Module file for the Requirement struct of the Dom module.
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + +
    +
    + + + + + diff --git a/requirement_8hpp.html b/requirement_8hpp.html new file mode 100644 index 000000000..a680b18a1 --- /dev/null +++ b/requirement_8hpp.html @@ -0,0 +1,229 @@ + + + + + + + + +FTXUI: requirement.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    requirement.hpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + + + +

    +Classes

    struct  Requirement
     Requirement is a structure that defines the layout requirements for a Node in the terminal user interface. More...
     
    struct  Requirement::Focused
     
    + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    +
    +
    + + + + + diff --git a/requirement_8hpp.js b/requirement_8hpp.js new file mode 100644 index 000000000..b41ecddee --- /dev/null +++ b/requirement_8hpp.js @@ -0,0 +1,4 @@ +var requirement_8hpp = +[ + [ "Focused", "structftxui_1_1Requirement_1_1Focused.html", "structftxui_1_1Requirement_1_1Focused" ] +]; \ No newline at end of file diff --git a/requirement_8hpp_source.html b/requirement_8hpp_source.html new file mode 100644 index 000000000..34f41dfd6 --- /dev/null +++ b/requirement_8hpp_source.html @@ -0,0 +1,293 @@ + + + + + + + + +FTXUI: requirement.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    requirement.hpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#ifndef FTXUI_DOM_REQUIREMENT_HPP
    +
    5#define FTXUI_DOM_REQUIREMENT_HPP
    +
    6
    + + +
    9
    +
    10namespace ftxui {
    +
    11class Node;
    +
    12
    +
    13/// @brief Requirement is a structure that defines the layout requirements for a
    +
    14/// Node in the terminal user interface.
    +
    15///
    +
    16/// It specifies the minimum size required to fully draw the element,
    +
    17/// @ingroup dom
    +
    + +
    19 // The required size to fully draw the element.
    +
    20 int min_x = 0;
    +
    21 int min_y = 0;
    +
    22
    +
    23 // How much flexibility is given to the component.
    +
    24 int flex_grow_x = 0;
    +
    25 int flex_grow_y = 0;
    + + +
    28
    +
    29 // Focus management to support the frame/focus/select element.
    +
    +
    30 struct Focused {
    +
    31 bool enabled = false;
    + +
    33 Node* node = nullptr;
    + +
    35
    +
    36 // Internal for interactions with components.
    +
    37 bool component_active = false;
    +
    38
    +
    39 // Return whether this requirement should be preferred over the other.
    +
    +
    40 bool Prefer(const Focused& other) const {
    +
    41 if (!other.enabled) {
    +
    42 return false;
    +
    43 }
    +
    44 if (!enabled) {
    +
    45 return true;
    +
    46 }
    +
    47
    +
    48 return other.component_active && !component_active;
    +
    49 }
    +
    +
    50 };
    +
    + +
    52};
    +
    +
    53
    +
    54} // namespace ftxui
    +
    55
    +
    56#endif // FTXUI_DOM_REQUIREMENT_HPP
    + + + + + + + + +
    Node is the base class for all elements in the DOM tree.
    Definition node.hpp:37
    +
    Requirement is a structure that defines the layout requirements for a Node in the terminal user inter...
    +
    Box is a structure that represents a rectangular area in a 2D space.
    Definition box.hpp:16
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + + +
    Screen::Cursor::Shape cursor_shape
    + +
    bool Prefer(const Focused &other) const
    + + + + + +
    +
    + + + + + diff --git a/resize.js b/resize.js new file mode 100644 index 000000000..178d03bcb --- /dev/null +++ b/resize.js @@ -0,0 +1,147 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ + +function initResizable(treeview) { + let sidenav,navtree,content,header,footer,barWidth=6; + const RESIZE_COOKIE_NAME = ''+'width'; + + function resizeWidth() { + const sidenavWidth = $(sidenav).outerWidth(); + content.css({marginLeft:parseInt(sidenavWidth)+"px"}); + if (typeof page_layout!=='undefined' && page_layout==1) { + footer.css({marginLeft:parseInt(sidenavWidth)+"px"}); + } + Cookie.writeSetting(RESIZE_COOKIE_NAME,sidenavWidth-barWidth); + } + + function restoreWidth(navWidth) { + content.css({marginLeft:parseInt(navWidth)+barWidth+"px"}); + if (typeof page_layout!=='undefined' && page_layout==1) { + footer.css({marginLeft:parseInt(navWidth)+barWidth+"px"}); + } + sidenav.css({width:navWidth + "px"}); + } + + function resizeHeight(treeview) { + const headerHeight = header.outerHeight(); + const windowHeight = $(window).height(); + let contentHeight; + if (treeview) + { + const footerHeight = footer.outerHeight(); + let navtreeHeight,sideNavHeight; + if (typeof page_layout==='undefined' || page_layout==0) { /* DISABLE_INDEX=NO */ + contentHeight = windowHeight - headerHeight - footerHeight; + navtreeHeight = contentHeight; + sideNavHeight = contentHeight; + } else if (page_layout==1) { /* DISABLE_INDEX=YES */ + contentHeight = windowHeight - footerHeight; + navtreeHeight = windowHeight - headerHeight; + sideNavHeight = windowHeight; + } + navtree.css({height:navtreeHeight + "px"}); + sidenav.css({height:sideNavHeight + "px"}); + } + else + { + contentHeight = windowHeight - headerHeight; + } + content.css({height:contentHeight + "px"}); + if (location.hash.slice(1)) { + (document.getElementById(location.hash.slice(1))||document.body).scrollIntoView(); + } + } + + function collapseExpand() { + let newWidth; + if (sidenav.width()>0) { + newWidth=0; + } else { + const width = Cookie.readSetting(RESIZE_COOKIE_NAME,250); + newWidth = (width>250 && width<$(window).width()) ? width : 250; + } + restoreWidth(newWidth); + const sidenavWidth = $(sidenav).outerWidth(); + Cookie.writeSetting(RESIZE_COOKIE_NAME,sidenavWidth-barWidth); + } + + header = $("#top"); + content = $("#doc-content"); + footer = $("#nav-path"); + sidenav = $("#side-nav"); + if (!treeview) { +// title = $("#titlearea"); +// titleH = $(title).height(); +// let animating = false; +// content.on("scroll", function() { +// slideOpts = { duration: 200, +// step: function() { +// contentHeight = $(window).height() - header.outerHeight(); +// content.css({ height : contentHeight + "px" }); +// }, +// done: function() { animating=false; } +// }; +// if (content.scrollTop()>titleH && title.css('display')!='none' && !animating) { +// title.slideUp(slideOpts); +// animating=true; +// } else if (content.scrollTop()<=titleH && title.css('display')=='none' && !animating) { +// title.slideDown(slideOpts); +// animating=true; +// } +// }); + } else { + navtree = $("#nav-tree"); + $(".side-nav-resizable").resizable({resize: function(e, ui) { resizeWidth(); } }); + $(sidenav).resizable({ minWidth: 0 }); + } + $(window).resize(function() { resizeHeight(treeview); }); + if (treeview) + { + const device = navigator.userAgent.toLowerCase(); + const touch_device = device.match(/(iphone|ipod|ipad|android)/); + if (touch_device) { /* wider split bar for touch only devices */ + $(sidenav).css({ paddingRight:'20px' }); + $('.ui-resizable-e').css({ width:'20px' }); + $('#nav-sync').css({ right:'34px' }); + barWidth=20; + } + const width = Cookie.readSetting(RESIZE_COOKIE_NAME,250); + if (width) { restoreWidth(width); } else { resizeWidth(); } + } + resizeHeight(treeview); + const url = location.href; + const i=url.indexOf("#"); + if (i>=0) window.location.hash=url.substr(i); + const _preventDefault = function(evt) { evt.preventDefault(); }; + if (treeview) + { + $("#splitbar").bind("dragstart", _preventDefault).bind("selectstart", _preventDefault); + $(".ui-resizable-handle").dblclick(collapseExpand); + // workaround for firefox + $("body").css({overflow: "hidden"}); + } + $(window).on('load',function() { resizeHeight(treeview); }); +} +/* @license-end */ diff --git a/screen_2color_8cpp.html b/screen_2color_8cpp.html new file mode 100644 index 000000000..bf55211d2 --- /dev/null +++ b/screen_2color_8cpp.html @@ -0,0 +1,229 @@ + + + + + + + + +FTXUI: color.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    color.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    namespace  ftxui::literals
     
    + + + + +

    +Functions

    Color operator""_rgb (unsigned long long int combined)
     Creates a color from a combined hex RGB representation, e.g. 0x808000_rgb.
     
    +
    +
    + + + + + diff --git a/screen_2color_8cpp.js b/screen_2color_8cpp.js new file mode 100644 index 000000000..11393ef5a --- /dev/null +++ b/screen_2color_8cpp.js @@ -0,0 +1,4 @@ +var screen_2color_8cpp = +[ + [ "operator\"\"_rgb", "screen_2color_8cpp.html#a66d988ecc082819b1671ee2bbadebccd", null ] +]; \ No newline at end of file diff --git a/screen_2color_8cpp_source.html b/screen_2color_8cpp_source.html new file mode 100644 index 000000000..1e3d6a3c4 --- /dev/null +++ b/screen_2color_8cpp_source.html @@ -0,0 +1,552 @@ + + + + + + + + +FTXUI: color.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    screen/color.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    + +
    5
    +
    6#include <array> // for array
    +
    7#include <cmath>
    +
    8#include <cstdint>
    +
    9#include <string>
    +
    10
    +
    11#include "ftxui/screen/color_info.hpp" // for GetColorInfo, ColorInfo
    +
    12#include "ftxui/screen/terminal.hpp" // for ColorSupport, Color, Palette256, TrueColor
    +
    13
    +
    14namespace ftxui {
    +
    15namespace {
    +
    16const std::array<const char*, 33> palette16code = {
    +
    17 "30", "40", //
    +
    18 "31", "41", //
    +
    19 "32", "42", //
    +
    20 "33", "43", //
    +
    21 "34", "44", //
    +
    22 "35", "45", //
    +
    23 "36", "46", //
    +
    24 "37", "47", //
    +
    25 "90", "100", //
    +
    26 "91", "101", //
    +
    27 "92", "102", //
    +
    28 "93", "103", //
    +
    29 "94", "104", //
    +
    30 "95", "105", //
    +
    31 "96", "106", //
    +
    32 "97", "107", //
    +
    33};
    +
    34
    +
    35} // namespace
    +
    36
    +
    +
    37bool Color::operator==(const Color& rhs) const {
    +
    38 return red_ == rhs.red_ && green_ == rhs.green_ && blue_ == rhs.blue_ &&
    +
    39 type_ == rhs.type_;
    +
    40}
    +
    +
    41
    +
    +
    42bool Color::operator!=(const Color& rhs) const {
    +
    43 return !operator==(rhs);
    +
    44}
    +
    +
    45
    +
    +
    46std::string Color::Print(bool is_background_color) const {
    +
    47 if (is_background_color) {
    +
    48 switch (type_) {
    +
    49 case ColorType::Palette1:
    +
    50 return "49";
    +
    51 case ColorType::Palette16:
    +
    52 return palette16code[2 * red_ + 1]; // NOLINT
    +
    53 case ColorType::Palette256:
    +
    54 return "48;5;" + std::to_string(red_);
    +
    55 case ColorType::TrueColor:
    +
    56 return "48;2;" + std::to_string(red_) + ";" + std::to_string(green_) +
    +
    57 ";" + std::to_string(blue_);
    +
    58 }
    +
    59 } else {
    +
    60 switch (type_) {
    +
    61 case ColorType::Palette1:
    +
    62 return "39";
    +
    63 case ColorType::Palette16:
    +
    64 return palette16code[2 * red_]; // NOLINT
    +
    65 case ColorType::Palette256:
    +
    66 return "38;5;" + std::to_string(red_);
    +
    67 case ColorType::TrueColor:
    +
    68 return "38;2;" + std::to_string(red_) + ";" + std::to_string(green_) +
    +
    69 ";" + std::to_string(blue_);
    +
    70 }
    +
    71 }
    +
    72 // NOTREACHED();
    +
    73 return "";
    +
    74}
    +
    +
    75
    +
    76/// @brief Build a transparent color.
    +
    77Color::Color() = default;
    +
    78
    +
    79/// @brief Build a transparent color.
    +
    80Color::Color(Palette1 /*value*/) : Color() {}
    +
    81
    +
    82/// @brief Build a color using the Palette16 colors.
    +
    + +
    84 : type_(ColorType::Palette16), red_(index), alpha_(255) {}
    +
    +
    85
    +
    86/// @brief Build a color using Palette256 colors.
    +
    + +
    88 : type_(ColorType::Palette256), red_(index), alpha_(255) {
    +
    89 if (Terminal::ColorSupport() >= Terminal::Color::Palette256) {
    +
    90 return;
    +
    91 }
    +
    92 type_ = ColorType::Palette16;
    + +
    94}
    +
    +
    95
    +
    96/// @brief Build a Color from its RGB representation.
    +
    97/// https://en.wikipedia.org/wiki/RGB_color_model
    +
    98///
    +
    99/// @param red The quantity of red [0,255]
    +
    100/// @param green The quantity of green [0,255]
    +
    101/// @param blue The quantity of blue [0,255]
    +
    102/// @param alpha The quantity of alpha [0,255]
    +
    +
    103Color::Color(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha)
    +
    104 : type_(ColorType::TrueColor),
    +
    105 red_(red),
    +
    106 green_(green),
    +
    107 blue_(blue),
    +
    108 alpha_(alpha) {
    +
    109 if (Terminal::ColorSupport() == Terminal::Color::TrueColor) {
    +
    110 return;
    +
    111 }
    +
    112
    +
    113 // Find the closest Color from the database:
    +
    114 const int max_distance = 256 * 256 * 3;
    +
    115 int closest = max_distance;
    +
    116 int best = 0;
    +
    117 const int database_begin = 16;
    +
    118 const int database_end = 256;
    +
    119 for (int i = database_begin; i < database_end; ++i) {
    +
    120 const ColorInfo color_info = GetColorInfo(Color::Palette256(i));
    +
    121 const int dr = color_info.red - red;
    +
    122 const int dg = color_info.green - green;
    +
    123 const int db = color_info.blue - blue;
    +
    124 const int dist = dr * dr + dg * dg + db * db;
    +
    125 if (closest > dist) {
    +
    126 closest = dist;
    +
    127 best = i;
    +
    128 }
    +
    129 }
    +
    130
    +
    131 if (Terminal::ColorSupport() == Terminal::Color::Palette256) {
    +
    132 type_ = ColorType::Palette256;
    +
    133 red_ = best;
    +
    134 } else {
    +
    135 type_ = ColorType::Palette16;
    + +
    137 }
    +
    138}
    +
    +
    139
    +
    140/// @brief Build a Color from its RGB representation.
    +
    141/// https://en.wikipedia.org/wiki/RGB_color_model
    +
    142///
    +
    143/// @param red The quantity of red [0,255]
    +
    144/// @param green The quantity of green [0,255]
    +
    145/// @param blue The quantity of blue [0,255]
    +
    146// static
    +
    +
    147Color Color::RGB(uint8_t red, uint8_t green, uint8_t blue) {
    +
    148 return RGBA(red, green, blue, 255);
    +
    149}
    +
    +
    150
    +
    151/// @brief Build a Color from its RGBA representation.
    +
    152/// https://en.wikipedia.org/wiki/RGB_color_model
    +
    153/// @param red The quantity of red [0,255]
    +
    154/// @param green The quantity of green [0,255]
    +
    155/// @param blue The quantity of blue [0,255]
    +
    156/// @param alpha The quantity of alpha [0,255]
    +
    157/// @see Color::RGB
    +
    158// static
    +
    +
    159Color Color::RGBA(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha) {
    +
    160 return {red, green, blue, alpha};
    +
    161}
    +
    +
    162
    +
    163/// @brief Build a Color from its HSV representation.
    +
    164/// https://en.wikipedia.org/wiki/HSL_and_HSV
    +
    165///
    +
    166/// @param h The hue of the color [0,255]
    +
    167/// @param s The "colorfulness" [0,255].
    +
    168/// @param v The "Lightness" [0,255]
    +
    169/// @param alpha The quantity of alpha [0,255]
    +
    170// static
    +
    +
    171Color Color::HSVA(uint8_t h, uint8_t s, uint8_t v, uint8_t alpha) {
    +
    172 uint8_t region = h / 43; // NOLINT
    +
    173 uint8_t remainder = (h - (region * 43)) * 6; // NOLINT
    +
    174 uint8_t p = (v * (255 - s)) >> 8; // NOLINT
    +
    175 uint8_t q = (v * (255 - ((s * remainder) >> 8))) >> 8; // NOLINT
    +
    176 uint8_t t = (v * (255 - ((s * (255 - remainder)) >> 8))) >> 8; // NOLINT
    +
    177
    +
    178 // clang-format off
    +
    179 switch (region) { // NOLINT
    +
    180 case 0: return Color(v,t,p, alpha); // NOLINT
    +
    181 case 1: return Color(q,v,p, alpha); // NOLINT
    +
    182 case 2: return Color(p,v,t, alpha); // NOLINT
    +
    183 case 3: return Color(p,q,v, alpha); // NOLINT
    +
    184 case 4: return Color(t,p,v, alpha); // NOLINT
    +
    185 case 5: return Color(v,p,q, alpha); // NOLINT
    +
    186 } // NOLINT
    +
    187 // clang-format on
    +
    188 return {0, 0, 0, alpha};
    +
    189}
    +
    +
    190
    +
    191/// @brief Build a Color from its HSV representation.
    +
    192/// https://en.wikipedia.org/wiki/HSL_and_HSV
    +
    193///
    +
    194/// @param h The hue of the color [0,255]
    +
    195/// @param s The "colorfulness" [0,255].
    +
    196/// @param v The "Lightness" [0,255]
    +
    197// static
    +
    +
    198Color Color::HSV(uint8_t h, uint8_t s, uint8_t v) {
    +
    199 return HSVA(h, s, v, 255);
    +
    200}
    +
    +
    201
    +
    202// static
    +
    +
    203Color Color::Interpolate(float t, const Color& a, const Color& b) {
    +
    204 if (a.type_ == ColorType::Palette1 || //
    +
    205 b.type_ == ColorType::Palette1) {
    +
    206 if (t < 0.5F) { // NOLINT
    +
    207 return a;
    +
    208 } else {
    +
    209 return b;
    +
    210 }
    +
    211 }
    +
    212
    +
    213 auto get_color = [](const Color& color, //
    +
    214 uint8_t* red, uint8_t* green, uint8_t* blue) {
    +
    215 switch (color.type_) {
    +
    216 case ColorType::Palette1: {
    +
    217 return;
    +
    218 }
    +
    219
    +
    220 case ColorType::Palette16: {
    +
    221 const ColorInfo info = GetColorInfo(Color::Palette16(color.red_));
    +
    222 *red = info.red;
    +
    223 *green = info.green;
    +
    224 *blue = info.blue;
    +
    225 return;
    +
    226 }
    +
    227
    +
    228 case ColorType::Palette256: {
    +
    229 const ColorInfo info = GetColorInfo(Color::Palette256(color.red_));
    +
    230 *red = info.red;
    +
    231 *green = info.green;
    +
    232 *blue = info.blue;
    +
    233 return;
    +
    234 }
    +
    235
    +
    236 case ColorType::TrueColor:
    +
    237 default: {
    +
    238 *red = color.red_;
    +
    239 *green = color.green_;
    +
    240 *blue = color.blue_;
    +
    241 return;
    +
    242 }
    +
    243 }
    +
    244 };
    +
    245
    +
    246 uint8_t a_r = 0;
    +
    247 uint8_t a_g = 0;
    +
    248 uint8_t a_b = 0;
    +
    249 uint8_t b_r = 0;
    +
    250 uint8_t b_g = 0;
    +
    251 uint8_t b_b = 0;
    +
    252 get_color(a, &a_r, &a_g, &a_b);
    +
    253 get_color(b, &b_r, &b_g, &b_b);
    +
    254
    +
    255 // Gamma correction:
    +
    256 // https://en.wikipedia.org/wiki/Gamma_correction
    +
    257 auto interp = [t](uint8_t a_u, uint8_t b_u) {
    +
    258 constexpr float gamma = 2.2F;
    +
    259 const float a_f = powf(a_u, gamma);
    +
    260 const float b_f = powf(b_u, gamma);
    +
    261 const float c_f = a_f * (1.0F - t) + //
    +
    262 b_f * t;
    +
    263 return static_cast<uint8_t>(powf(c_f, 1.F / gamma));
    +
    264 };
    +
    265 return Color::RGB(interp(a_r, b_r), //
    +
    266 interp(a_g, b_g), //
    +
    267 interp(a_b, b_b)); //
    +
    268}
    +
    +
    269
    +
    270/// @brief Blend two colors together using the alpha channel.
    +
    271// static
    +
    +
    272Color Color::Blend(const Color& lhs, const Color& rhs) {
    +
    273 Color out = Interpolate(float(rhs.alpha_) / 255.F, lhs, rhs);
    +
    274 out.alpha_ = lhs.alpha_ + rhs.alpha_ - lhs.alpha_ * rhs.alpha_ / 255;
    +
    275 return out;
    +
    276}
    +
    +
    277
    +
    278inline namespace literals {
    +
    279
    +
    +
    280Color operator""_rgb(unsigned long long int combined) {
    +
    281 // assert(combined <= 0xffffffU);
    +
    282 auto const red = static_cast<uint8_t>(combined >> 16U);
    +
    283 auto const green = static_cast<uint8_t>(combined >> 8U);
    +
    284 auto const blue = static_cast<uint8_t>(combined);
    +
    285 return {red, green, blue};
    +
    286}
    +
    +
    287
    +
    288} // namespace literals
    +
    289
    +
    290} // namespace ftxui
    + + +
    Decorator color(Color)
    Decorate using a foreground color.
    +
    Color()
    Build a transparent color.
    +
    static Color HSV(uint8_t hue, uint8_t saturation, uint8_t value)
    Build a Color from its HSV representation. https://en.wikipedia.org/wiki/HSL_and_HSV.
    +
    static Color RGBA(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha)
    Build a Color from its RGBA representation. https://en.wikipedia.org/wiki/RGB_color_model.
    + +
    static Color Blend(const Color &lhs, const Color &rhs)
    Blend two colors together using the alpha channel.
    +
    bool operator!=(const Color &rhs) const
    + +
    bool operator==(const Color &rhs) const
    + + +
    static Color RGB(uint8_t red, uint8_t green, uint8_t blue)
    Build a Color from its RGB representation. https://en.wikipedia.org/wiki/RGB_color_model.
    + +
    std::string Print(bool is_background_color) const
    + + +
    static Color Interpolate(float t, const Color &a, const Color &b)
    +
    static Color HSVA(uint8_t hue, uint8_t saturation, uint8_t value, uint8_t alpha)
    Build a Color from its HSV representation. https://en.wikipedia.org/wiki/HSL_and_HSV.
    +
    Color is a class that represents a color in the terminal user interface.
    Definition color.hpp:22
    + + +
    ColorInfo is a structure that contains information about the terminal color palette.
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    ColorInfo GetColorInfo(Color::Palette256 index)
    + +
    +
    + + + + + diff --git a/screen_2deprecated_8cppm.html b/screen_2deprecated_8cppm.html new file mode 100644 index 000000000..f471b2691 --- /dev/null +++ b/screen_2deprecated_8cppm.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: deprecated.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    deprecated.cppm File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    +
    +
    + + + + + diff --git a/screen_2deprecated_8cppm_source.html b/screen_2deprecated_8cppm_source.html new file mode 100644 index 000000000..fa0989bf1 --- /dev/null +++ b/screen_2deprecated_8cppm_source.html @@ -0,0 +1,229 @@ + + + + + + + + +FTXUI: deprecated.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    screen/deprecated.cppm
    +
    +
    +Go to the documentation of this file.
    1/// @module ftxui.screen.deprecated
    +
    2/// @brief Module file for the deprecated parts of the Screen module
    +
    3
    +
    4module;
    +
    5
    + +
    7
    +
    8export module ftxui.screen.deprecated;
    +
    9
    +
    10/**
    +
    11 * @namespace ftxui
    +
    12 * @brief The FTXUI ftxui:: namespace
    +
    13 */
    +
    14export namespace ftxui {
    +
    15 using ftxui::wchar_width;
    +
    16 using ftxui::wstring_width;
    +
    17}
    +
    Module file for the deprecated parts of the Screen module.
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + +
    +
    + + + + + diff --git a/screen_2deprecated_8hpp.html b/screen_2deprecated_8hpp.html new file mode 100644 index 000000000..3fa237368 --- /dev/null +++ b/screen_2deprecated_8hpp.html @@ -0,0 +1,228 @@ + + + + + + + + +FTXUI: deprecated.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    deprecated.hpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + + +

    +Functions

    int wchar_width (wchar_t)
     
    int wstring_width (const std::wstring &)
     
    +
    +
    + + + + + diff --git a/screen_2deprecated_8hpp.js b/screen_2deprecated_8hpp.js new file mode 100644 index 000000000..ce5765e44 --- /dev/null +++ b/screen_2deprecated_8hpp.js @@ -0,0 +1,5 @@ +var screen_2deprecated_8hpp = +[ + [ "wchar_width", "screen_2deprecated_8hpp.html#a1bb4947f62228380f5c415f69b34021f", null ], + [ "wstring_width", "screen_2deprecated_8hpp.html#adedb4aa528ad2aef48177dea69ca7a9d", null ] +]; \ No newline at end of file diff --git a/screen_2deprecated_8hpp_source.html b/screen_2deprecated_8hpp_source.html new file mode 100644 index 000000000..9471d2742 --- /dev/null +++ b/screen_2deprecated_8hpp_source.html @@ -0,0 +1,226 @@ + + + + + + + + +FTXUI: deprecated.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    screen/deprecated.hpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2021 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#ifndef FTXUI_SCREEN_DEPRECATED_HPP
    +
    5#define FTXUI_SCREEN_DEPRECATED_HPP
    +
    6
    +
    7#include <string>
    +
    8
    +
    9namespace ftxui {
    +
    10int wchar_width(wchar_t);
    +
    11int wstring_width(const std::wstring&);
    +
    12} // namespace ftxui
    +
    13
    +
    14#endif // FTXUI_SCREEN_DEPRECATED_HPP
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    int wchar_width(wchar_t)
    Definition string.cpp:1314
    +
    int wstring_width(const std::wstring &)
    Definition string.cpp:1318
    +
    +
    + + + + + diff --git a/screen_2screen_8cppm.html b/screen_2screen_8cppm.html new file mode 100644 index 000000000..e3d530344 --- /dev/null +++ b/screen_2screen_8cppm.html @@ -0,0 +1,223 @@ + + + + + + + + +FTXUI: screen.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    screen.cppm File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    namespace  ftxui::Dimension
     Define how the Screen's dimensions should look like.
     
    +
    +
    + + + + + diff --git a/screen_2screen_8cppm_source.html b/screen_2screen_8cppm_source.html new file mode 100644 index 000000000..97a42f8ad --- /dev/null +++ b/screen_2screen_8cppm_source.html @@ -0,0 +1,236 @@ + + + + + + + + +FTXUI: screen.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    screen/screen.cppm
    +
    +
    +Go to the documentation of this file.
    1/// @module ftxui.screen.screen
    +
    2/// @brief Module file for the Screen class of the Screen module
    +
    3
    +
    4module;
    +
    5
    + +
    7
    +
    8export module ftxui.screen.screen;
    +
    9
    +
    10/**
    +
    11 * @namespace ftxui
    +
    12 * @brief The FTXUI ftxui:: namespace
    +
    13 */
    +
    14export namespace ftxui {
    +
    15 namespace Dimension {
    +
    16 using ftxui::Dimension::Fixed;
    +
    17 using ftxui::Dimension::Full;
    +
    18 }
    +
    19
    +
    20 using ftxui::Image;
    +
    21 using ftxui::Screen;
    +
    22}
    +
    A rectangular grid of Pixel.
    Definition image.hpp:17
    +
    A rectangular grid of Pixel.
    Definition screen.hpp:26
    +
    Module file for the Screen class of the Screen module.
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + +
    +
    + + + + + diff --git a/screen_8cpp.html b/screen_8cpp.html new file mode 100644 index 000000000..f4ec42dd6 --- /dev/null +++ b/screen_8cpp.html @@ -0,0 +1,356 @@ + + + + + + + + +FTXUI: screen.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    screen.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + + +

    +Macros

    #define FTXUI_UNLIKELY(x)
     
    #define FTXUI_LIKELY(x)
     
    +

    Macro Definition Documentation

    + +

    ◆ FTXUI_UNLIKELY

    + +
    +
    + + + + + + + +
    #define FTXUI_UNLIKELY( x)
    +
    +Value:
    (x)
    +
    +

    Definition at line 31 of file screen.cpp.

    + +
    +
    + +

    ◆ FTXUI_LIKELY

    + +
    +
    + + + + + + + +
    #define FTXUI_LIKELY( x)
    +
    +Value:
    (x)
    +
    +

    Definition at line 39 of file screen.cpp.

    + +
    +
    +

    Variable Documentation

    + +

    ◆ left

    + +
    +
    + + + + +
    std::uint8_t left
    +
    +
    Examples
    examples/component/resizable_split.cpp.
    +
    + +

    Definition at line 130 of file screen.cpp.

    + +
    +
    + +

    ◆ top

    + +
    +
    + + + + +
    std::uint8_t top
    +
    +
    Examples
    examples/component/resizable_split.cpp.
    +
    + +

    Definition at line 131 of file screen.cpp.

    + +
    +
    + +

    ◆ right

    + +
    +
    + + + + +
    std::uint8_t right
    +
    +
    Examples
    examples/component/resizable_split.cpp.
    +
    + +

    Definition at line 132 of file screen.cpp.

    + +
    +
    + +

    ◆ down

    + +
    +
    + + + + +
    std::uint8_t down
    +
    + +

    Definition at line 133 of file screen.cpp.

    + +
    +
    + +

    ◆ round

    + +
    +
    + + + + +
    std::uint8_t round
    +
    + +

    Definition at line 134 of file screen.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/screen_8cpp.js b/screen_8cpp.js new file mode 100644 index 000000000..cec967ec1 --- /dev/null +++ b/screen_8cpp.js @@ -0,0 +1,10 @@ +var screen_8cpp = +[ + [ "FTXUI_UNLIKELY", "screen_8cpp.html#a6048239c71b0f0be5c9d01ba721d7dd9", null ], + [ "FTXUI_LIKELY", "screen_8cpp.html#a3350a75634f7952b2795de433b111f0e", null ], + [ "left", "screen_8cpp.html#a972107f15f3c0c099eb9fd605e7f51c6", null ], + [ "top", "screen_8cpp.html#a495e1456dc6a7df7638b2c507c756a24", null ], + [ "right", "screen_8cpp.html#aa4b74e56e675912bbc06504407fc7a46", null ], + [ "down", "screen_8cpp.html#a9cdd0454d64ec151b59fdd7d22ed505a", null ], + [ "round", "screen_8cpp.html#ad20ff2177c37ddb2e308815c71d4be81", null ] +]; \ No newline at end of file diff --git a/screen_8cpp_source.html b/screen_8cpp_source.html new file mode 100644 index 000000000..7d7543d92 --- /dev/null +++ b/screen_8cpp_source.html @@ -0,0 +1,842 @@ + + + + + + + + +FTXUI: screen.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    screen.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <cstddef> // for size_t
    +
    5#include <cstdint>
    +
    6#include <iostream> // for operator<<, stringstream, basic_ostream, flush, cout, ostream
    +
    7#include <limits>
    +
    8#include <map> // for _Rb_tree_const_iterator, map, operator!=, operator==
    +
    9#include <sstream> // IWYU pragma: keep
    +
    10#include <utility> // for pair
    +
    11
    +
    12#include "ftxui/screen/image.hpp" // for Image
    +
    13#include "ftxui/screen/pixel.hpp" // for Pixel
    + +
    15#include "ftxui/screen/string.hpp" // for string_width
    +
    16#include "ftxui/screen/terminal.hpp" // for Dimensions, Size
    +
    17
    +
    18#if defined(_WIN32)
    +
    19#define WIN32_LEAN_AND_MEAN
    +
    20#ifndef NOMINMAX
    +
    21#define NOMINMAX
    +
    22#endif
    +
    23#include <windows.h>
    +
    24#endif
    +
    25
    +
    26// Macro for hinting that an expression is likely to be false.
    +
    27#if !defined(FTXUI_UNLIKELY)
    +
    28#if defined(COMPILER_GCC) || defined(__clang__)
    +
    29#define FTXUI_UNLIKELY(x) __builtin_expect(!!(x), 0)
    +
    30#else
    +
    31#define FTXUI_UNLIKELY(x) (x)
    +
    32#endif // defined(COMPILER_GCC)
    +
    33#endif // !defined(FTXUI_UNLIKELY)
    +
    34
    +
    35#if !defined(FTXUI_LIKELY)
    +
    36#if defined(COMPILER_GCC) || defined(__clang__)
    +
    37#define FTXUI_LIKELY(x) __builtin_expect(!!(x), 1)
    +
    38#else
    +
    39#define FTXUI_LIKELY(x) (x)
    +
    40#endif // defined(COMPILER_GCC)
    +
    41#endif // !defined(FTXUI_LIKELY)
    +
    42
    +
    43namespace ftxui {
    +
    44
    +
    45namespace {
    +
    46
    +
    47#if defined(_WIN32)
    +
    48void WindowsEmulateVT100Terminal() {
    +
    49 static bool done = false;
    +
    50 if (done) {
    +
    51 return;
    +
    52 }
    +
    53 done = true;
    +
    54
    +
    55 // Enable VT processing on stdout and stdin
    +
    56 auto stdout_handle = GetStdHandle(STD_OUTPUT_HANDLE);
    +
    57
    +
    58 DWORD out_mode = 0;
    +
    59 GetConsoleMode(stdout_handle, &out_mode);
    +
    60
    +
    61 // https://docs.microsoft.com/en-us/windows/console/setconsolemode
    +
    62 const int enable_virtual_terminal_processing = 0x0004;
    +
    63 const int disable_newline_auto_return = 0x0008;
    +
    64 out_mode |= enable_virtual_terminal_processing;
    +
    65 out_mode |= disable_newline_auto_return;
    +
    66
    +
    67 SetConsoleMode(stdout_handle, out_mode);
    +
    68}
    +
    69#endif
    +
    70
    +
    71// NOLINTNEXTLINE(readability-function-cognitive-complexity)
    +
    72void UpdatePixelStyle(const Screen* screen,
    +
    73 std::stringstream& ss,
    +
    74 const Pixel& prev,
    +
    75 const Pixel& next) {
    +
    76 // See https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
    +
    77 if (FTXUI_UNLIKELY(next.hyperlink != prev.hyperlink)) {
    +
    78 ss << "\x1B]8;;" << screen->Hyperlink(next.hyperlink) << "\x1B\\";
    +
    79 }
    +
    80
    +
    81 // Bold
    +
    82 if (FTXUI_UNLIKELY((next.bold ^ prev.bold) | (next.dim ^ prev.dim))) {
    +
    83 // BOLD_AND_DIM_RESET:
    +
    84 ss << ((prev.bold && !next.bold) || (prev.dim && !next.dim) ? "\x1B[22m"
    +
    85 : "");
    +
    86 ss << (next.bold ? "\x1B[1m" : ""); // BOLD_SET
    +
    87 ss << (next.dim ? "\x1B[2m" : ""); // DIM_SET
    +
    88 }
    +
    89
    +
    90 // Underline
    +
    91 if (FTXUI_UNLIKELY(next.underlined != prev.underlined ||
    +
    92 next.underlined_double != prev.underlined_double)) {
    +
    93 ss << (next.underlined ? "\x1B[4m" // UNDERLINE
    +
    94 : next.underlined_double ? "\x1B[21m" // UNDERLINE_DOUBLE
    +
    95 : "\x1B[24m"); // UNDERLINE_RESET
    +
    96 }
    +
    97
    +
    98 // Blink
    +
    99 if (FTXUI_UNLIKELY(next.blink != prev.blink)) {
    +
    100 ss << (next.blink ? "\x1B[5m" // BLINK_SET
    +
    101 : "\x1B[25m"); // BLINK_RESET
    +
    102 }
    +
    103
    +
    104 // Inverted
    +
    105 if (FTXUI_UNLIKELY(next.inverted != prev.inverted)) {
    +
    106 ss << (next.inverted ? "\x1B[7m" // INVERTED_SET
    +
    107 : "\x1B[27m"); // INVERTED_RESET
    +
    108 }
    +
    109
    +
    110 // Italics
    +
    111 if (FTXUI_UNLIKELY(next.italic != prev.italic)) {
    +
    112 ss << (next.italic ? "\x1B[3m" // ITALIC_SET
    +
    113 : "\x1B[23m"); // ITALIC_RESET
    +
    114 }
    +
    115
    +
    116 // StrikeThrough
    +
    117 if (FTXUI_UNLIKELY(next.strikethrough != prev.strikethrough)) {
    +
    118 ss << (next.strikethrough ? "\x1B[9m" // CROSSED_OUT
    +
    119 : "\x1B[29m"); // CROSSED_OUT_RESET
    +
    120 }
    +
    121
    +
    122 if (FTXUI_UNLIKELY(next.foreground_color != prev.foreground_color ||
    +
    123 next.background_color != prev.background_color)) {
    +
    124 ss << "\x1B[" + next.foreground_color.Print(false) + "m";
    +
    125 ss << "\x1B[" + next.background_color.Print(true) + "m";
    +
    126 }
    +
    127}
    +
    128
    +
    129struct TileEncoding {
    +
    130 std::uint8_t left : 2;
    +
    131 std::uint8_t top : 2;
    +
    132 std::uint8_t right : 2;
    +
    133 std::uint8_t down : 2;
    +
    134 std::uint8_t round : 1;
    +
    135
    +
    136 // clang-format off
    +
    137 bool operator<(const TileEncoding& other) const {
    +
    138 if (left < other.left) { return true; }
    +
    139 if (left > other.left) { return false; }
    +
    140 if (top < other.top) { return true; }
    +
    141 if (top > other.top) { return false; }
    +
    142 if (right < other.right) { return true; }
    +
    143 if (right > other.right) { return false; }
    +
    144 if (down < other.down) { return true; }
    +
    145 if (down > other.down) { return false; }
    +
    146 if (round < other.round) { return true; }
    +
    147 if (round > other.round) { return false; }
    +
    148 return false;
    +
    149 }
    +
    150 // clang-format on
    +
    151};
    +
    152
    +
    153// clang-format off
    +
    154const std::map<std::string, TileEncoding> tile_encoding = { // NOLINT
    +
    155 {"─", {1, 0, 1, 0, 0}},
    +
    156 {"━", {2, 0, 2, 0, 0}},
    +
    157 {"╍", {2, 0, 2, 0, 0}},
    +
    158
    +
    159 {"│", {0, 1, 0, 1, 0}},
    +
    160 {"┃", {0, 2, 0, 2, 0}},
    +
    161 {"╏", {0, 2, 0, 2, 0}},
    +
    162
    +
    163 {"┌", {0, 0, 1, 1, 0}},
    +
    164 {"┍", {0, 0, 2, 1, 0}},
    +
    165 {"┎", {0, 0, 1, 2, 0}},
    +
    166 {"┏", {0, 0, 2, 2, 0}},
    +
    167
    +
    168 {"┐", {1, 0, 0, 1, 0}},
    +
    169 {"┑", {2, 0, 0, 1, 0}},
    +
    170 {"┒", {1, 0, 0, 2, 0}},
    +
    171 {"┓", {2, 0, 0, 2, 0}},
    +
    172
    +
    173 {"└", {0, 1, 1, 0, 0}},
    +
    174 {"┕", {0, 1, 2, 0, 0}},
    +
    175 {"┖", {0, 2, 1, 0, 0}},
    +
    176 {"┗", {0, 2, 2, 0, 0}},
    +
    177
    +
    178 {"┘", {1, 1, 0, 0, 0}},
    +
    179 {"┙", {2, 1, 0, 0, 0}},
    +
    180 {"┚", {1, 2, 0, 0, 0}},
    +
    181 {"┛", {2, 2, 0, 0, 0}},
    +
    182
    +
    183 {"├", {0, 1, 1, 1, 0}},
    +
    184 {"┝", {0, 1, 2, 1, 0}},
    +
    185 {"┞", {0, 2, 1, 1, 0}},
    +
    186 {"┟", {0, 1, 1, 2, 0}},
    +
    187 {"┠", {0, 2, 1, 2, 0}},
    +
    188 {"┡", {0, 2, 2, 1, 0}},
    +
    189 {"┢", {0, 1, 2, 2, 0}},
    +
    190 {"┣", {0, 2, 2, 2, 0}},
    +
    191
    +
    192 {"┤", {1, 1, 0, 1, 0}},
    +
    193 {"┥", {2, 1, 0, 1, 0}},
    +
    194 {"┦", {1, 2, 0, 1, 0}},
    +
    195 {"┧", {1, 1, 0, 2, 0}},
    +
    196 {"┨", {1, 2, 0, 2, 0}},
    +
    197 {"┩", {2, 2, 0, 1, 0}},
    +
    198 {"┪", {2, 1, 0, 2, 0}},
    +
    199 {"┫", {2, 2, 0, 2, 0}},
    +
    200
    +
    201 {"┬", {1, 0, 1, 1, 0}},
    +
    202 {"┭", {2, 0, 1, 1, 0}},
    +
    203 {"┮", {1, 0, 2, 1, 0}},
    +
    204 {"┯", {2, 0, 2, 1, 0}},
    +
    205 {"┰", {1, 0, 1, 2, 0}},
    +
    206 {"┱", {2, 0, 1, 2, 0}},
    +
    207 {"┲", {1, 0, 2, 2, 0}},
    +
    208 {"┳", {2, 0, 2, 2, 0}},
    +
    209
    +
    210 {"┴", {1, 1, 1, 0, 0}},
    +
    211 {"┵", {2, 1, 1, 0, 0}},
    +
    212 {"┶", {1, 1, 2, 0, 0}},
    +
    213 {"┷", {2, 1, 2, 0, 0}},
    +
    214 {"┸", {1, 2, 1, 0, 0}},
    +
    215 {"┹", {2, 2, 1, 0, 0}},
    +
    216 {"┺", {1, 2, 2, 0, 0}},
    +
    217 {"┻", {2, 2, 2, 0, 0}},
    +
    218
    +
    219 {"┼", {1, 1, 1, 1, 0}},
    +
    220 {"┽", {2, 1, 1, 1, 0}},
    +
    221 {"┾", {1, 1, 2, 1, 0}},
    +
    222 {"┿", {2, 1, 2, 1, 0}},
    +
    223 {"╀", {1, 2, 1, 1, 0}},
    +
    224 {"╁", {1, 1, 1, 2, 0}},
    +
    225 {"╂", {1, 2, 1, 2, 0}},
    +
    226 {"╃", {2, 2, 1, 1, 0}},
    +
    227 {"╄", {1, 2, 2, 1, 0}},
    +
    228 {"╅", {2, 1, 1, 2, 0}},
    +
    229 {"╆", {1, 1, 2, 2, 0}},
    +
    230 {"╇", {2, 2, 2, 1, 0}},
    +
    231 {"╈", {2, 1, 2, 2, 0}},
    +
    232 {"╉", {2, 2, 1, 2, 0}},
    +
    233 {"╊", {1, 2, 2, 2, 0}},
    +
    234 {"╋", {2, 2, 2, 2, 0}},
    +
    235
    +
    236 {"═", {3, 0, 3, 0, 0}},
    +
    237 {"║", {0, 3, 0, 3, 0}},
    +
    238
    +
    239 {"╒", {0, 0, 3, 1, 0}},
    +
    240 {"╓", {0, 0, 1, 3, 0}},
    +
    241 {"╔", {0, 0, 3, 3, 0}},
    +
    242
    +
    243 {"╕", {3, 0, 0, 1, 0}},
    +
    244 {"╖", {1, 0, 0, 3, 0}},
    +
    245 {"╗", {3, 0, 0, 3, 0}},
    +
    246
    +
    247 {"╘", {0, 1, 3, 0, 0}},
    +
    248 {"╙", {0, 3, 1, 0, 0}},
    +
    249 {"╚", {0, 3, 3, 0, 0}},
    +
    250
    +
    251 {"╛", {3, 1, 0, 0, 0}},
    +
    252 {"╜", {1, 3, 0, 0, 0}},
    +
    253 {"╝", {3, 3, 0, 0, 0}},
    +
    254
    +
    255 {"╞", {0, 1, 3, 1, 0}},
    +
    256 {"╟", {0, 3, 1, 3, 0}},
    +
    257 {"╠", {0, 3, 3, 3, 0}},
    +
    258
    +
    259 {"╡", {3, 1, 0, 1, 0}},
    +
    260 {"╢", {1, 3, 0, 3, 0}},
    +
    261 {"╣", {3, 3, 0, 3, 0}},
    +
    262
    +
    263 {"╤", {3, 0, 3, 1, 0}},
    +
    264 {"╥", {1, 0, 1, 3, 0}},
    +
    265 {"╦", {3, 0, 3, 3, 0}},
    +
    266
    +
    267 {"╧", {3, 1, 3, 0, 0}},
    +
    268 {"╨", {1, 3, 1, 0, 0}},
    +
    269 {"╩", {3, 3, 3, 0, 0}},
    +
    270
    +
    271 {"╪", {3, 1, 3, 1, 0}},
    +
    272 {"╫", {1, 3, 1, 3, 0}},
    +
    273 {"╬", {3, 3, 3, 3, 0}},
    +
    274
    +
    275 {"╭", {0, 0, 1, 1, 1}},
    +
    276 {"╮", {1, 0, 0, 1, 1}},
    +
    277 {"╯", {1, 1, 0, 0, 1}},
    +
    278 {"╰", {0, 1, 1, 0, 1}},
    +
    279
    +
    280 {"╴", {1, 0, 0, 0, 0}},
    +
    281 {"╵", {0, 1, 0, 0, 0}},
    +
    282 {"╶", {0, 0, 1, 0, 0}},
    +
    283 {"╷", {0, 0, 0, 1, 0}},
    +
    284
    +
    285 {"╸", {2, 0, 0, 0, 0}},
    +
    286 {"╹", {0, 2, 0, 0, 0}},
    +
    287 {"╺", {0, 0, 2, 0, 0}},
    +
    288 {"╻", {0, 0, 0, 2, 0}},
    +
    289
    +
    290 {"╼", {1, 0, 2, 0, 0}},
    +
    291 {"╽", {0, 1, 0, 2, 0}},
    +
    292 {"╾", {2, 0, 1, 0, 0}},
    +
    293 {"╿", {0, 2, 0, 1, 0}},
    +
    294};
    +
    295// clang-format on
    +
    296
    +
    297template <class A, class B>
    +
    298std::map<B, A> InvertMap(const std::map<A, B> input) {
    +
    299 std::map<B, A> output;
    +
    300 for (const auto& it : input) {
    +
    301 output[it.second] = it.first;
    +
    302 }
    +
    303 return output;
    +
    304}
    +
    305
    +
    306const std::map<TileEncoding, std::string> tile_encoding_inverse = // NOLINT
    +
    307 InvertMap(tile_encoding);
    +
    308
    +
    309void UpgradeLeftRight(std::string& left, std::string& right) {
    +
    310 const auto it_left = tile_encoding.find(left);
    +
    311 if (it_left == tile_encoding.end()) {
    +
    312 return;
    +
    313 }
    +
    314 const auto it_right = tile_encoding.find(right);
    +
    315 if (it_right == tile_encoding.end()) {
    +
    316 return;
    +
    317 }
    +
    318
    +
    319 if (it_left->second.right == 0 && it_right->second.left != 0) {
    +
    320 TileEncoding encoding_left = it_left->second;
    +
    321 encoding_left.right = it_right->second.left;
    +
    322 const auto it_left_upgrade = tile_encoding_inverse.find(encoding_left);
    +
    323 if (it_left_upgrade != tile_encoding_inverse.end()) {
    +
    324 left = it_left_upgrade->second;
    +
    325 }
    +
    326 }
    +
    327
    +
    328 if (it_right->second.left == 0 && it_left->second.right != 0) {
    +
    329 TileEncoding encoding_right = it_right->second;
    +
    330 encoding_right.left = it_left->second.right;
    +
    331 const auto it_right_upgrade = tile_encoding_inverse.find(encoding_right);
    +
    332 if (it_right_upgrade != tile_encoding_inverse.end()) {
    +
    333 right = it_right_upgrade->second;
    +
    334 }
    +
    335 }
    +
    336}
    +
    337
    +
    338void UpgradeTopDown(std::string& top, std::string& down) {
    +
    339 const auto it_top = tile_encoding.find(top);
    +
    340 if (it_top == tile_encoding.end()) {
    +
    341 return;
    +
    342 }
    +
    343 const auto it_down = tile_encoding.find(down);
    +
    344 if (it_down == tile_encoding.end()) {
    +
    345 return;
    +
    346 }
    +
    347
    +
    348 if (it_top->second.down == 0 && it_down->second.top != 0) {
    +
    349 TileEncoding encoding_top = it_top->second;
    +
    350 encoding_top.down = it_down->second.top;
    +
    351 const auto it_top_down = tile_encoding_inverse.find(encoding_top);
    +
    352 if (it_top_down != tile_encoding_inverse.end()) {
    +
    353 top = it_top_down->second;
    +
    354 }
    +
    355 }
    +
    356
    +
    357 if (it_down->second.top == 0 && it_top->second.down != 0) {
    +
    358 TileEncoding encoding_down = it_down->second;
    +
    359 encoding_down.top = it_top->second.down;
    +
    360 const auto it_down_top = tile_encoding_inverse.find(encoding_down);
    +
    361 if (it_down_top != tile_encoding_inverse.end()) {
    +
    362 down = it_down_top->second;
    +
    363 }
    +
    364 }
    +
    365}
    +
    366
    +
    367bool ShouldAttemptAutoMerge(Pixel& pixel) {
    +
    368 return pixel.automerge && pixel.character.size() == 3;
    +
    369}
    +
    370
    +
    371} // namespace
    +
    372
    +
    373/// A fixed dimension.
    +
    374/// @see Fit
    +
    375/// @see Full
    +
    376Dimensions Dimension::Fixed(int v) {
    +
    377 return {v, v};
    +
    378}
    +
    379
    +
    380/// Use the terminal dimensions.
    +
    381/// @see Fixed
    +
    382/// @see Fit
    +
    383Dimensions Dimension::Full() {
    +
    384 return Terminal::Size();
    +
    385}
    +
    386
    +
    387// static
    +
    388/// Create a screen with the given dimension along the x-axis and y-axis.
    +
    + +
    390 return {width.dimx, height.dimy};
    +
    391}
    +
    +
    392
    +
    393// static
    +
    394/// Create a screen with the given dimension.
    +
    + +
    396 return {dimension.dimx, dimension.dimy};
    +
    397}
    +
    +
    398
    +
    +
    399Screen::Screen(int dimx, int dimy) : Image{dimx, dimy} {
    +
    400#if defined(_WIN32)
    +
    401 // The placement of this call is a bit weird, however we can assume that
    +
    402 // anybody who instantiates a Screen object eventually wants to output
    +
    403 // something to the console. If that is not the case, use an instance of Image
    +
    404 // instead. As we require UTF8 for all input/output operations we will just
    +
    405 // switch to UTF8 encoding here
    +
    406 SetConsoleOutputCP(CP_UTF8);
    +
    407 SetConsoleCP(CP_UTF8);
    +
    408 WindowsEmulateVT100Terminal();
    +
    409#endif
    +
    410}
    +
    +
    411
    +
    412/// Produce a std::string that can be used to print the Screen on the
    +
    413/// terminal.
    +
    414/// @note Don't forget to flush stdout. Alternatively, you can use
    +
    415/// Screen::Print();
    +
    +
    416std::string Screen::ToString() const {
    +
    417 std::stringstream ss;
    +
    418
    +
    419 const Pixel default_pixel;
    +
    420 const Pixel* previous_pixel_ref = &default_pixel;
    +
    421
    +
    422 for (int y = 0; y < dimy_; ++y) {
    +
    423 // New line in between two lines.
    +
    424 if (y != 0) {
    +
    425 UpdatePixelStyle(this, ss, *previous_pixel_ref, default_pixel);
    +
    426 previous_pixel_ref = &default_pixel;
    +
    427 ss << "\r\n";
    +
    428 }
    +
    429
    +
    430 // After printing a fullwith character, we need to skip the next cell.
    +
    431 bool previous_fullwidth = false;
    +
    432 for (const auto& pixel : pixels_[y]) {
    +
    433 if (!previous_fullwidth) {
    +
    434 UpdatePixelStyle(this, ss, *previous_pixel_ref, pixel);
    +
    435 previous_pixel_ref = &pixel;
    +
    436 if (pixel.character.empty()) {
    +
    437 ss << " ";
    +
    438 } else {
    +
    439 ss << pixel.character;
    +
    440 }
    +
    441 }
    +
    442 previous_fullwidth = (string_width(pixel.character) == 2);
    +
    443 }
    +
    444 }
    +
    445
    +
    446 // Reset the style to default:
    +
    447 UpdatePixelStyle(this, ss, *previous_pixel_ref, default_pixel);
    +
    448
    +
    449 return ss.str();
    +
    450}
    +
    +
    451
    +
    452// Print the Screen to the terminal.
    +
    +
    453void Screen::Print() const {
    +
    454 std::cout << ToString() << '\0' << std::flush;
    +
    455}
    +
    +
    456
    +
    457/// @brief Return a string to be printed in order to reset the cursor position
    +
    458/// to the beginning of the screen.
    +
    459///
    +
    460/// ```cpp
    +
    461/// std::string reset_position;
    +
    462/// while(true) {
    +
    463/// auto document = render();
    +
    464/// auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    465/// Render(screen, document);
    +
    466/// std::cout << reset_position << screen.ToString() << std::flush;
    +
    467/// reset_position = screen.ResetPosition();
    +
    468///
    +
    469/// using namespace std::chrono_literals;
    +
    470/// std::this_thread::sleep_for(0.01s);
    +
    471/// }
    +
    472/// ```
    +
    473///
    +
    474/// @return The string to print in order to reset the cursor position to the
    +
    475/// beginning.
    +
    +
    476std::string Screen::ResetPosition(bool clear) const {
    +
    477 std::stringstream ss;
    +
    478 if (clear) {
    +
    479 ss << "\r"; // MOVE_LEFT;
    +
    480 ss << "\x1b[2K"; // CLEAR_SCREEN;
    +
    481 for (int y = 1; y < dimy_; ++y) {
    +
    482 ss << "\x1B[1A"; // MOVE_UP;
    +
    483 ss << "\x1B[2K"; // CLEAR_LINE;
    +
    484 }
    +
    485 } else {
    +
    486 ss << "\r"; // MOVE_LEFT;
    +
    487 for (int y = 1; y < dimy_; ++y) {
    +
    488 ss << "\x1B[1A"; // MOVE_UP;
    +
    489 }
    +
    490 }
    +
    491 return ss.str();
    +
    492}
    +
    +
    493
    +
    494/// @brief Clear all the pixel from the screen.
    +
    + +
    496 Image::Clear();
    +
    497
    +
    498 cursor_.x = dimx_ - 1;
    +
    499 cursor_.y = dimy_ - 1;
    +
    500
    +
    501 hyperlinks_ = {
    +
    502 "",
    +
    503 };
    +
    504}
    +
    +
    505
    +
    506// clang-format off
    +
    + +
    508 // Merge box characters togethers.
    +
    509 for (int y = 0; y < dimy_; ++y) {
    +
    510 for (int x = 0; x < dimx_; ++x) {
    +
    511 // Box drawing character uses exactly 3 byte.
    +
    512 Pixel& cur = pixels_[y][x];
    +
    513 if (!ShouldAttemptAutoMerge(cur)) {
    +
    514 continue;
    +
    515 }
    +
    516
    +
    517 if (x > 0) {
    +
    518 Pixel& left = pixels_[y][x-1];
    +
    519 if (ShouldAttemptAutoMerge(left)) {
    +
    520 UpgradeLeftRight(left.character, cur.character);
    +
    521 }
    +
    522 }
    +
    523 if (y > 0) {
    +
    524 Pixel& top = pixels_[y-1][x];
    +
    525 if (ShouldAttemptAutoMerge(top)) {
    +
    526 UpgradeTopDown(top.character, cur.character);
    +
    527 }
    +
    528 }
    +
    529 }
    +
    530 }
    +
    531}
    +
    +
    532// clang-format on
    +
    533
    +
    +
    534std::uint8_t Screen::RegisterHyperlink(const std::string& link) {
    +
    535 for (std::size_t i = 0; i < hyperlinks_.size(); ++i) {
    +
    536 if (hyperlinks_[i] == link) {
    +
    537 return i;
    +
    538 }
    +
    539 }
    +
    540 if (hyperlinks_.size() == std::numeric_limits<std::uint8_t>::max()) {
    +
    541 return 0;
    +
    542 }
    +
    543 hyperlinks_.push_back(link);
    +
    544 return hyperlinks_.size() - 1;
    +
    545}
    +
    +
    546
    +
    +
    547const std::string& Screen::Hyperlink(std::uint8_t id) const {
    +
    548 if (id >= hyperlinks_.size()) {
    +
    549 return hyperlinks_[0];
    +
    550 }
    +
    551 return hyperlinks_[id];
    +
    552}
    +
    +
    553
    +
    554/// @brief Return the current selection style.
    +
    555/// @see SetSelectionStyle
    + +
    559
    +
    560/// @brief Set the current selection style.
    +
    561/// @see GetSelectionStyle
    +
    + +
    563 selection_style_ = std::move(decorator);
    +
    564}
    +
    +
    565
    +
    566} // namespace ftxui
    +
    std::function< void(Pixel &)> SelectionStyle
    Definition screen.hpp:74
    +
    void ApplyShader()
    Definition screen.cpp:507
    +
    const SelectionStyle & GetSelectionStyle() const
    Return the current selection style.
    Definition screen.cpp:556
    +
    const std::string & Hyperlink(uint8_t id) const
    Definition screen.cpp:547
    +
    std::string ToString() const
    Definition screen.cpp:416
    + +
    static Screen Create(Dimensions dimension)
    Create a screen with the given dimension.
    Definition screen.cpp:395
    +
    uint8_t RegisterHyperlink(const std::string &link)
    Definition screen.cpp:534
    + +
    std::string character
    Definition pixel.hpp:45
    +
    Screen(int dimx, int dimy)
    Definition screen.cpp:399
    + +
    std::string ResetPosition(bool clear=false) const
    Return a string to be printed in order to reset the cursor position to the beginning of the screen.
    Definition screen.cpp:476
    +
    Cursor cursor_
    Definition screen.hpp:79
    + +
    void Clear()
    Clear all the pixel from the screen.
    Definition screen.cpp:495
    +
    SelectionStyle selection_style_
    Definition screen.hpp:83
    +
    void SetSelectionStyle(SelectionStyle decorator)
    Set the current selection style.
    Definition screen.cpp:562
    +
    std::vector< std::string > hyperlinks_
    Definition screen.hpp:80
    +
    void Print() const
    Definition screen.cpp:453
    +
    std::vector< std::vector< Pixel > > pixels_
    Definition image.hpp:46
    +
    A rectangular grid of Pixel.
    Definition image.hpp:17
    +
    A rectangular grid of Pixel.
    Definition screen.hpp:26
    +
    Dimensions Size()
    Get the terminal size.
    Definition terminal.cpp:94
    +
    Dimensions is a structure that represents the size of the terminal.
    Definition terminal.hpp:11
    +
    A Unicode character and its associated style.
    Definition pixel.hpp:15
    + +
    Dimensions Fixed(int)
    +
    Dimensions Full()
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    int string_width(const std::string &)
    Definition string.cpp:1331
    + +
    std::uint8_t top
    Definition screen.cpp:131
    +
    #define FTXUI_UNLIKELY(x)
    Definition screen.cpp:31
    +
    std::uint8_t left
    Definition screen.cpp:130
    +
    std::uint8_t down
    Definition screen.cpp:133
    +
    std::uint8_t right
    Definition screen.cpp:132
    +
    std::uint8_t round
    Definition screen.cpp:134
    + + + + + +
    +
    + + + + + diff --git a/screen_8cppm.html b/screen_8cppm.html new file mode 100644 index 000000000..c554a23c8 --- /dev/null +++ b/screen_8cppm.html @@ -0,0 +1,211 @@ + + + + + + + + +FTXUI: screen.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    screen.cppm File Reference
    +
    + +
    + + + + + diff --git a/screen_8cppm_source.html b/screen_8cppm_source.html new file mode 100644 index 000000000..91f2777cf --- /dev/null +++ b/screen_8cppm_source.html @@ -0,0 +1,233 @@ + + + + + + + + +FTXUI: screen.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    screen.cppm
    +
    +
    +Go to the documentation of this file.
    1/// @module ftxui.screen
    +
    2/// @brief Module file for FTXUI screen operations.
    +
    3
    +
    4export module ftxui.screen;
    +
    5
    +
    6export import ftxui.screen.box;
    +
    7export import ftxui.screen.color;
    +
    8export import ftxui.screen.color_info;
    +
    9export import ftxui.screen.deprecated;
    +
    10export import ftxui.screen.image;
    +
    11export import ftxui.screen.pixel;
    +
    12export import ftxui.screen.screen;
    +
    13export import ftxui.screen.string;
    +
    14export import ftxui.screen.terminal;
    +
    Module file for the Box struct of the Screen module.
    +
    Module file for the ColorInfo struct of the Screen module.
    +
    Module file for the Color class of the Screen module.
    +
    Module file for the deprecated parts of the Screen module.
    +
    Module file for the Image class of the Screen module.
    +
    Module file for the Pixel struct of the Screen module.
    +
    Module file for the Screen class of the Screen module.
    +
    Module file for string functions of the Screen module.
    +
    Module file for the Terminal namespace of the Screen module.
    +
    Module file for FTXUI screen operations.
    +
    +
    + + + + + diff --git a/screen_8hpp.html b/screen_8hpp.html new file mode 100644 index 000000000..1ca42f1d5 --- /dev/null +++ b/screen_8hpp.html @@ -0,0 +1,240 @@ + + + + + + + + +FTXUI: screen.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    screen.hpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + + + +

    +Classes

    class  Screen
     A rectangular grid of Pixel. More...
     
    struct  Screen::Cursor
     
    + + + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    namespace  ftxui::Dimension
     Define how the Screen's dimensions should look like.
     
    + + + + + +

    +Functions

    Dimensions Fixed (int)
     
    Dimensions Full ()
     
    +
    +
    + + + + + diff --git a/screen_8hpp.js b/screen_8hpp.js new file mode 100644 index 000000000..16cf97843 --- /dev/null +++ b/screen_8hpp.js @@ -0,0 +1,6 @@ +var screen_8hpp = +[ + [ "Cursor", "structftxui_1_1Screen_1_1Cursor.html", "structftxui_1_1Screen_1_1Cursor" ], + [ "Fixed", "screen_8hpp.html#a36e539ed36f88d7f01233974da485937", null ], + [ "Full", "screen_8hpp.html#af795790b995132f62de607ddfd07f9fa", null ] +]; \ No newline at end of file diff --git a/screen_8hpp_source.html b/screen_8hpp_source.html new file mode 100644 index 000000000..0a82be04f --- /dev/null +++ b/screen_8hpp_source.html @@ -0,0 +1,348 @@ + + + + + + + + +FTXUI: screen.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    screen.hpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#ifndef FTXUI_SCREEN_SCREEN_HPP
    +
    5#define FTXUI_SCREEN_SCREEN_HPP
    +
    6
    +
    7#include <cstdint> // for uint8_t
    +
    8#include <functional> // for function
    +
    9#include <string> // for string, basic_string, allocator
    +
    10#include <vector> // for vector
    +
    11
    +
    12#include "ftxui/screen/image.hpp" // for Pixel, Image
    +
    13#include "ftxui/screen/terminal.hpp" // for Dimensions
    +
    14
    +
    15namespace ftxui {
    +
    16
    +
    17/// @brief Define how the Screen's dimensions should look like.
    +
    18/// @ingroup screen
    +
    19namespace Dimension {
    + + +
    22} // namespace Dimension
    +
    23
    +
    24/// @brief A rectangular grid of Pixel.
    +
    25/// @ingroup screen
    +
    +
    26class Screen : public Image {
    +
    27 public:
    +
    28 // Constructors:
    +
    29 Screen(int dimx, int dimy);
    +
    30 static Screen Create(Dimensions dimension);
    +
    31 static Screen Create(Dimensions width, Dimensions height);
    +
    32
    +
    33 // Destructor:
    +
    34 ~Screen() override = default;
    +
    35
    +
    36 std::string ToString() const;
    +
    37
    +
    38 // Print the Screen on to the terminal.
    +
    39 void Print() const;
    +
    40
    +
    41 // Fill the screen with space and reset any screen state, like hyperlinks, and
    +
    42 // cursor
    +
    43 void Clear();
    +
    44
    +
    45 // Move the terminal cursor n-lines up with n = dimy().
    +
    46 std::string ResetPosition(bool clear = false) const;
    +
    47
    +
    48 void ApplyShader();
    +
    49
    +
    +
    50 struct Cursor {
    +
    51 int x = 0;
    +
    52 int y = 0;
    +
    53
    +
    +
    54 enum Shape {
    +
    55 Hidden = 0,
    + +
    57 Block = 2,
    + + + +
    61 Bar = 6,
    +
    62 };
    +
    + +
    64 };
    +
    +
    65
    +
    66 Cursor cursor() const { return cursor_; }
    + +
    68
    +
    69 // Store an hyperlink in the screen. Return the id of the hyperlink. The id is
    +
    70 // used to identify the hyperlink when the user click on it.
    +
    71 uint8_t RegisterHyperlink(const std::string& link);
    +
    72 const std::string& Hyperlink(uint8_t id) const;
    +
    73
    +
    74 using SelectionStyle = std::function<void(Pixel&)>;
    +
    75 const SelectionStyle& GetSelectionStyle() const;
    +
    76 void SetSelectionStyle(SelectionStyle decorator);
    +
    77
    +
    78 protected:
    + +
    80 std::vector<std::string> hyperlinks_ = {""};
    +
    81
    +
    82 // The current selection style. This is overridden by various dom elements.
    +
    + +
    84 pixel.inverted ^= true;
    +
    85 };
    +
    +
    86};
    +
    +
    87
    +
    88} // namespace ftxui
    +
    89
    +
    90#endif // FTXUI_SCREEN_SCREEN_HPP
    +
    std::function< void(Pixel &)> SelectionStyle
    Definition screen.hpp:74
    +
    void ApplyShader()
    Definition screen.cpp:507
    +
    const SelectionStyle & GetSelectionStyle() const
    Return the current selection style.
    Definition screen.cpp:556
    +
    const std::string & Hyperlink(uint8_t id) const
    Definition screen.cpp:547
    +
    int dimy() const
    Definition image.hpp:36
    +
    std::string ToString() const
    Definition screen.cpp:416
    +
    void SetCursor(Cursor cursor)
    Definition screen.hpp:67
    +
    ~Screen() override=default
    +
    static Screen Create(Dimensions dimension)
    Create a screen with the given dimension.
    Definition screen.cpp:395
    +
    uint8_t RegisterHyperlink(const std::string &link)
    Definition screen.cpp:534
    +
    Screen(int dimx, int dimy)
    Definition screen.cpp:399
    +
    Cursor cursor() const
    Definition screen.hpp:66
    +
    std::string ResetPosition(bool clear=false) const
    Return a string to be printed in order to reset the cursor position to the beginning of the screen.
    Definition screen.cpp:476
    +
    Cursor cursor_
    Definition screen.hpp:79
    +
    void Clear()
    Clear all the pixel from the screen.
    Definition screen.cpp:495
    +
    SelectionStyle selection_style_
    Definition screen.hpp:83
    +
    void SetSelectionStyle(SelectionStyle decorator)
    Set the current selection style.
    Definition screen.cpp:562
    +
    std::vector< std::string > hyperlinks_
    Definition screen.hpp:80
    +
    void Print() const
    Definition screen.cpp:453
    +
    int dimx() const
    Definition image.hpp:35
    +
    A rectangular grid of Pixel.
    Definition image.hpp:17
    +
    A rectangular grid of Pixel.
    Definition screen.hpp:26
    +
    Dimensions is a structure that represents the size of the terminal.
    Definition terminal.hpp:11
    +
    A Unicode character and its associated style.
    Definition pixel.hpp:15
    + +
    Dimensions Fixed(int)
    +
    Dimensions Full()
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + + + + + + + + + + + + + +
    +
    + + + + + diff --git a/screen__interactive_8cpp.html b/screen__interactive_8cpp.html new file mode 100644 index 000000000..be6f1fa9d --- /dev/null +++ b/screen__interactive_8cpp.html @@ -0,0 +1,230 @@ + + + + + + + + +FTXUI: screen_interactive.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    screen_interactive.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    namespace  ftxui::animation
     The FTXUI ftxui::animation:: namespace.
     
    + + + + +

    +Functions

    void RequestAnimationFrame ()
     RequestAnimationFrame is a function that requests a new frame to be drawn in the next animation cycle.
     
    +
    +
    + + + + + diff --git a/screen__interactive_8cpp.js b/screen__interactive_8cpp.js new file mode 100644 index 000000000..57cc9383b --- /dev/null +++ b/screen__interactive_8cpp.js @@ -0,0 +1,4 @@ +var screen__interactive_8cpp = +[ + [ "RequestAnimationFrame", "screen__interactive_8cpp.html#gad94d3d42aba3359550759aae5bcffbe9", null ] +]; \ No newline at end of file diff --git a/screen__interactive_8cpp_source.html b/screen__interactive_8cpp_source.html new file mode 100644 index 000000000..74512227d --- /dev/null +++ b/screen__interactive_8cpp_source.html @@ -0,0 +1,1476 @@ + + + + + + + + +FTXUI: screen_interactive.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    screen_interactive.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    + +
    5#include <algorithm> // for copy, max, min
    +
    6#include <array> // for array
    +
    7#include <atomic>
    +
    8#include <chrono> // for operator-, milliseconds, operator>=, duration, common_type<>::type, time_point
    +
    9#include <csignal> // for signal, SIGTSTP, SIGABRT, SIGWINCH, raise, SIGFPE, SIGILL, SIGINT, SIGSEGV, SIGTERM, __sighandler_t, size_t
    +
    10#include <cstdint>
    +
    11#include <cstdio> // for fileno, stdin
    +
    12#include <ftxui/component/task.hpp> // for Task, Closure, AnimationTask
    +
    13#include <ftxui/screen/screen.hpp> // for Pixel, Screen::Cursor, Screen, Screen::Cursor::Hidden
    +
    14#include <functional> // for function
    +
    15#include <initializer_list> // for initializer_list
    +
    16#include <iostream> // for cout, ostream, operator<<, basic_ostream, endl, flush
    +
    17#include <memory>
    +
    18#include <stack> // for stack
    +
    19#include <string>
    +
    20#include <thread> // for thread, sleep_for
    +
    21#include <tuple> // for _Swallow_assign, ignore
    +
    22#include <utility> // for move, swap
    +
    23#include <variant> // for visit, variant
    +
    24#include <vector> // for vector
    +
    25#include "ftxui/component/animation.hpp" // for TimePoint, Clock, Duration, Params, RequestAnimationFrame
    +
    26#include "ftxui/component/captured_mouse.hpp" // for CapturedMouse, CapturedMouseInterface
    +
    27#include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    28#include "ftxui/component/event.hpp" // for Event
    +
    29#include "ftxui/component/loop.hpp" // for Loop
    + +
    31#include "ftxui/component/terminal_input_parser.hpp" // for TerminalInputParser
    +
    32#include "ftxui/dom/node.hpp" // for Node, Render
    +
    33#include "ftxui/screen/terminal.hpp" // for Dimensions, Size
    +
    34#include "ftxui/screen/util.hpp" // for util::clamp
    +
    35#include "ftxui/util/autoreset.hpp" // for AutoReset
    +
    36
    +
    37#if defined(_WIN32)
    +
    38#define DEFINE_CONSOLEV2_PROPERTIES
    +
    39#define WIN32_LEAN_AND_MEAN
    +
    40#ifndef NOMINMAX
    +
    41#define NOMINMAX
    +
    42#endif
    +
    43#include <windows.h>
    +
    44#ifndef UNICODE
    +
    45#error Must be compiled in UNICODE mode
    +
    46#endif
    +
    47#else
    +
    48#include <fcntl.h>
    +
    49#include <sys/select.h> // for select, FD_ISSET, FD_SET, FD_ZERO, fd_set, timeval
    +
    50#include <termios.h> // for tcsetattr, termios, tcgetattr, TCSANOW, cc_t, ECHO, ICANON, VMIN, VTIME
    +
    51#include <unistd.h> // for STDIN_FILENO, read
    +
    52#include <cerrno>
    +
    53#endif
    +
    54
    +
    55// Quick exit is missing in standard CLang headers
    +
    56#if defined(__clang__) && defined(__APPLE__)
    +
    57#define quick_exit(a) exit(a)
    +
    58#endif
    +
    59
    +
    60namespace ftxui {
    +
    61
    +
    62struct ScreenInteractive::Internal {
    +
    63 // Convert char to Event.
    +
    64 TerminalInputParser terminal_input_parser;
    +
    65
    +
    66 task::TaskRunner task_runner;
    +
    67
    +
    68 // The last time a character was received.
    +
    69 std::chrono::time_point<std::chrono::steady_clock> last_char_time =
    +
    70 std::chrono::steady_clock::now();
    +
    71
    +
    72 explicit Internal(std::function<void(Event)> out)
    +
    73 : terminal_input_parser(std::move(out)) {}
    +
    74};
    +
    75
    +
    76namespace animation {
    +
    + +
    78 auto* screen = ScreenInteractive::Active();
    +
    79 if (screen) {
    +
    80 screen->RequestAnimationFrame();
    +
    81 }
    +
    82}
    +
    +
    83} // namespace animation
    +
    84
    +
    85namespace {
    +
    86
    +
    87ScreenInteractive* g_active_screen = nullptr; // NOLINT
    +
    88
    +
    89void Flush() {
    +
    90 // Emscripten doesn't implement flush. We interpret zero as flush.
    +
    91 std::cout << '\0' << std::flush;
    +
    92}
    +
    93
    +
    94constexpr int timeout_milliseconds = 20;
    +
    95[[maybe_unused]] constexpr int timeout_microseconds =
    +
    96 timeout_milliseconds * 1000;
    +
    97#if defined(_WIN32)
    +
    98
    +
    99#elif defined(__EMSCRIPTEN__)
    +
    100#include <emscripten.h>
    +
    101
    +
    102extern "C" {
    +
    103EMSCRIPTEN_KEEPALIVE
    +
    104void ftxui_on_resize(int columns, int rows) {
    + +
    106 columns,
    +
    107 rows,
    +
    108 });
    +
    109 std::raise(SIGWINCH);
    +
    110}
    +
    111}
    +
    112
    +
    113#else // POSIX (Linux & Mac)
    +
    114
    +
    115int CheckStdinReady() {
    +
    116 timeval tv = {0, 0}; // NOLINT
    +
    117 fd_set fds;
    +
    118 FD_ZERO(&fds); // NOLINT
    +
    119 FD_SET(STDIN_FILENO, &fds); // NOLINT
    +
    120 select(STDIN_FILENO + 1, &fds, nullptr, nullptr, &tv); // NOLINT
    +
    121 return FD_ISSET(STDIN_FILENO, &fds); // NOLINT
    +
    122}
    +
    123
    +
    124#endif
    +
    125
    +
    126std::stack<Closure> on_exit_functions; // NOLINT
    +
    127void OnExit() {
    +
    128 while (!on_exit_functions.empty()) {
    +
    129 on_exit_functions.top()();
    +
    130 on_exit_functions.pop();
    +
    131 }
    +
    132}
    +
    133
    +
    134std::atomic<int> g_signal_exit_count = 0; // NOLINT
    +
    135#if !defined(_WIN32)
    +
    136std::atomic<int> g_signal_stop_count = 0; // NOLINT
    +
    137std::atomic<int> g_signal_resize_count = 0; // NOLINT
    +
    138#endif
    +
    139
    +
    140// Async signal safe function
    +
    141void RecordSignal(int signal) {
    +
    142 switch (signal) {
    +
    143 case SIGABRT:
    +
    144 case SIGFPE:
    +
    145 case SIGILL:
    +
    146 case SIGINT:
    +
    147 case SIGSEGV:
    +
    148 case SIGTERM:
    +
    149 g_signal_exit_count++;
    +
    150 break;
    +
    151
    +
    152#if !defined(_WIN32)
    +
    153 case SIGTSTP: // NOLINT
    +
    154 g_signal_stop_count++;
    +
    155 break;
    +
    156
    +
    157 case SIGWINCH: // NOLINT
    +
    158 g_signal_resize_count++;
    +
    159 break;
    +
    160#endif
    +
    161
    +
    162 default:
    +
    163 break;
    +
    164 }
    +
    165}
    +
    166
    +
    167void ExecuteSignalHandlers() {
    +
    168 int signal_exit_count = g_signal_exit_count.exchange(0);
    +
    169 while (signal_exit_count--) {
    +
    170 ScreenInteractive::Private::Signal(*g_active_screen, SIGABRT);
    +
    171 }
    +
    172
    +
    173#if !defined(_WIN32)
    +
    174 int signal_stop_count = g_signal_stop_count.exchange(0);
    +
    175 while (signal_stop_count--) {
    +
    176 ScreenInteractive::Private::Signal(*g_active_screen, SIGTSTP);
    +
    177 }
    +
    178
    +
    179 int signal_resize_count = g_signal_resize_count.exchange(0);
    +
    180 while (signal_resize_count--) {
    +
    181 ScreenInteractive::Private::Signal(*g_active_screen, SIGWINCH);
    +
    182 }
    +
    183#endif
    +
    184}
    +
    185
    +
    186void InstallSignalHandler(int sig) {
    +
    187 auto old_signal_handler = std::signal(sig, RecordSignal);
    +
    188 on_exit_functions.emplace(
    +
    189 [=] { std::ignore = std::signal(sig, old_signal_handler); });
    +
    190}
    +
    191
    +
    192// CSI: Control Sequence Introducer
    +
    193const std::string CSI = "\x1b["; // NOLINT
    +
    194 //
    +
    195// DCS: Device Control String
    +
    196const std::string DCS = "\x1bP"; // NOLINT
    +
    197// ST: String Terminator
    +
    198const std::string ST = "\x1b\\"; // NOLINT
    +
    199
    +
    200// DECRQSS: Request Status String
    +
    201// DECSCUSR: Set Cursor Style
    +
    202const std::string DECRQSS_DECSCUSR = DCS + "$q q" + ST; // NOLINT
    +
    203
    +
    204// DEC: Digital Equipment Corporation
    +
    205enum class DECMode : std::uint16_t {
    +
    206 kLineWrap = 7,
    +
    207 kCursor = 25,
    +
    208
    +
    209 kMouseX10 = 9,
    +
    210 kMouseVt200 = 1000,
    +
    211 kMouseVt200Highlight = 1001,
    +
    212
    +
    213 kMouseBtnEventMouse = 1002,
    +
    214 kMouseAnyEvent = 1003,
    +
    215
    +
    216 kMouseUtf8 = 1005,
    +
    217 kMouseSgrExtMode = 1006,
    +
    218 kMouseUrxvtMode = 1015,
    +
    219 kMouseSgrPixelsMode = 1016,
    +
    220 kAlternateScreen = 1049,
    +
    221};
    +
    222
    +
    223// Device Status Report (DSR) {
    +
    224enum class DSRMode : std::uint8_t {
    +
    225 kCursor = 6,
    +
    226};
    +
    227
    +
    228std::string Serialize(const std::vector<DECMode>& parameters) {
    +
    229 bool first = true;
    +
    230 std::string out;
    +
    231 for (const DECMode parameter : parameters) {
    +
    232 if (!first) {
    +
    233 out += ";";
    +
    234 }
    +
    235 out += std::to_string(int(parameter));
    +
    236 first = false;
    +
    237 }
    +
    238 return out;
    +
    239}
    +
    240
    +
    241// DEC Private Mode Set (DECSET)
    +
    242std::string Set(const std::vector<DECMode>& parameters) {
    +
    243 return CSI + "?" + Serialize(parameters) + "h";
    +
    244}
    +
    245
    +
    246// DEC Private Mode Reset (DECRST)
    +
    247std::string Reset(const std::vector<DECMode>& parameters) {
    +
    248 return CSI + "?" + Serialize(parameters) + "l";
    +
    249}
    +
    250
    +
    251// Device Status Report (DSR)
    +
    252std::string DeviceStatusReport(DSRMode ps) {
    +
    253 return CSI + std::to_string(int(ps)) + "n";
    +
    254}
    +
    255
    +
    256class CapturedMouseImpl : public CapturedMouseInterface {
    +
    257 public:
    +
    258 explicit CapturedMouseImpl(std::function<void(void)> callback)
    +
    259 : callback_(std::move(callback)) {}
    +
    260 ~CapturedMouseImpl() override { callback_(); }
    +
    261 CapturedMouseImpl(const CapturedMouseImpl&) = delete;
    +
    262 CapturedMouseImpl(CapturedMouseImpl&&) = delete;
    +
    263 CapturedMouseImpl& operator=(const CapturedMouseImpl&) = delete;
    +
    264 CapturedMouseImpl& operator=(CapturedMouseImpl&&) = delete;
    +
    265
    +
    266 private:
    +
    267 std::function<void(void)> callback_;
    +
    268};
    +
    269
    +
    270} // namespace
    +
    271
    +
    272ScreenInteractive::ScreenInteractive(Dimension dimension,
    +
    273 int dimx,
    +
    274 int dimy,
    +
    275 bool use_alternative_screen)
    +
    276 : Screen(dimx, dimy),
    +
    277 dimension_(dimension),
    +
    278 use_alternative_screen_(use_alternative_screen) {
    +
    279 internal_ = std::make_unique<Internal>(
    +
    280 [&](Event event) { PostEvent(std::move(event)); });
    +
    281}
    +
    282
    +
    283// static
    +
    + +
    285 return {
    +
    286 Dimension::Fixed,
    +
    287 dimx,
    +
    288 dimy,
    +
    289 /*use_alternative_screen=*/false,
    +
    290 };
    +
    291}
    +
    +
    292
    +
    293/// Create a ScreenInteractive taking the full terminal size. This is using the
    +
    294/// alternate screen buffer to avoid messing with the terminal content.
    +
    295/// @note This is the same as `ScreenInteractive::FullscreenAlternateScreen()`
    +
    296// static
    + +
    300
    +
    301/// Create a ScreenInteractive taking the full terminal size. The primary screen
    +
    302/// buffer is being used. It means if the terminal is resized, the previous
    +
    303/// content might mess up with the terminal content.
    +
    304// static
    +
    + +
    306 auto terminal = Terminal::Size();
    +
    307 return {
    +
    308 Dimension::Fullscreen,
    +
    309 terminal.dimx,
    +
    310 terminal.dimy,
    +
    311 /*use_alternative_screen=*/false,
    +
    312 };
    +
    313}
    +
    +
    314
    +
    315/// Create a ScreenInteractive taking the full terminal size. This is using the
    +
    316/// alternate screen buffer to avoid messing with the terminal content.
    +
    317// static
    +
    + +
    319 auto terminal = Terminal::Size();
    +
    320 return {
    +
    321 Dimension::Fullscreen,
    +
    322 terminal.dimx,
    +
    323 terminal.dimy,
    +
    324 /*use_alternative_screen=*/true,
    +
    325 };
    +
    326}
    +
    +
    327
    +
    328/// Create a ScreenInteractive whose width match the terminal output width and
    +
    329/// the height matches the component being drawn.
    +
    330// static
    +
    + +
    332 auto terminal = Terminal::Size();
    +
    333 return {
    +
    334 Dimension::TerminalOutput,
    +
    335 terminal.dimx,
    +
    336 terminal.dimy, // Best guess.
    +
    337 /*use_alternative_screen=*/false,
    +
    338 };
    +
    339}
    +
    +
    340
    + +
    342
    +
    343/// Create a ScreenInteractive whose width and height match the component being
    +
    344/// drawn.
    +
    345// static
    +
    + +
    347 auto terminal = Terminal::Size();
    +
    348 return {
    +
    349 Dimension::FitComponent,
    +
    350 terminal.dimx, // Best guess.
    +
    351 terminal.dimy, // Best guess.
    +
    352 false,
    +
    353 };
    +
    354}
    +
    +
    355
    +
    356/// @brief Set whether mouse is tracked and events reported.
    +
    357/// called outside of the main loop. E.g `ScreenInteractive::Loop(...)`.
    +
    358/// @param enable Whether to enable mouse event tracking.
    +
    359/// @note This muse be called outside of the main loop. E.g. before calling
    +
    360/// `ScreenInteractive::Loop`.
    +
    361/// @note Mouse tracking is enabled by default.
    +
    362/// @note Mouse tracking is only supported on terminals that supports it.
    +
    363///
    +
    364/// ### Example
    +
    365///
    +
    366/// ```cpp
    +
    367/// auto screen = ScreenInteractive::TerminalOutput();
    +
    368/// screen.TrackMouse(false);
    +
    369/// screen.Loop(component);
    +
    370/// ```
    +
    + +
    372 track_mouse_ = enable;
    +
    373}
    +
    +
    374
    +
    375/// @brief Add a task to the main loop.
    +
    376/// It will be executed later, after every other scheduled tasks.
    +
    + +
    378 internal_->task_runner.PostTask([this, task = std::move(task)]() mutable {
    +
    379 HandleTask(component_, task);
    +
    380 });
    +
    381}
    +
    +
    382
    +
    383/// @brief Add an event to the main loop.
    +
    384/// It will be executed later, after every other scheduled events.
    +
    + +
    386 Post(event);
    +
    387}
    +
    +
    388
    +
    389/// @brief Add a task to draw the screen one more time, until all the animations
    +
    390/// are done.
    +
    + +
    392 if (animation_requested_) {
    +
    393 return;
    +
    394 }
    +
    395 animation_requested_ = true;
    +
    396 auto now = animation::Clock::now();
    +
    397 const auto time_histeresis = std::chrono::milliseconds(33);
    +
    398 if (now - previous_animation_time_ >= time_histeresis) {
    +
    399 previous_animation_time_ = now;
    +
    400 }
    +
    401}
    +
    +
    402
    +
    403/// @brief Try to get the unique lock about behing able to capture the mouse.
    +
    404/// @return A unique lock if the mouse is not already captured, otherwise a
    +
    405/// null.
    +
    + +
    407 if (mouse_captured) {
    +
    408 return nullptr;
    +
    409 }
    +
    410 mouse_captured = true;
    +
    411 return std::make_unique<CapturedMouseImpl>(
    +
    412 [this] { mouse_captured = false; });
    +
    413}
    +
    +
    414
    +
    415/// @brief Execute the main loop.
    +
    416/// @param component The component to draw.
    +
    +
    417void ScreenInteractive::Loop(Component component) { // NOLINT
    +
    418 class Loop loop(this, std::move(component));
    +
    419 loop.Run();
    +
    420}
    +
    +
    421
    +
    422/// @brief Return whether the main loop has been quit.
    +
    423bool ScreenInteractive::HasQuitted() {
    +
    424 return quit_;
    +
    425}
    +
    426
    +
    427// private
    +
    428void ScreenInteractive::PreMain() {
    +
    429 // Suspend previously active screen:
    +
    430 if (g_active_screen) {
    +
    431 std::swap(suspended_screen_, g_active_screen);
    +
    432 // Reset cursor position to the top of the screen and clear the screen.
    +
    433 suspended_screen_->ResetCursorPosition();
    +
    434 std::cout << suspended_screen_->ResetPosition(/*clear=*/true);
    +
    435 suspended_screen_->dimx_ = 0;
    +
    436 suspended_screen_->dimy_ = 0;
    +
    437
    +
    438 // Reset dimensions to force drawing the screen again next time:
    +
    439 suspended_screen_->Uninstall();
    +
    440 }
    +
    441
    +
    442 // This screen is now active:
    +
    443 g_active_screen = this;
    +
    444 g_active_screen->Install();
    +
    445
    +
    446 previous_animation_time_ = animation::Clock::now();
    +
    447}
    +
    448
    +
    449// private
    +
    450void ScreenInteractive::PostMain() {
    +
    451 // Put cursor position at the end of the drawing.
    +
    452 ResetCursorPosition();
    +
    453
    +
    454 g_active_screen = nullptr;
    +
    455
    +
    456 // Restore suspended screen.
    +
    457 if (suspended_screen_) {
    +
    458 // Clear screen, and put the cursor at the beginning of the drawing.
    +
    459 std::cout << ResetPosition(/*clear=*/true);
    +
    460 dimx_ = 0;
    +
    461 dimy_ = 0;
    +
    462 Uninstall();
    +
    463 std::swap(g_active_screen, suspended_screen_);
    +
    464 g_active_screen->Install();
    +
    465 } else {
    +
    466 Uninstall();
    +
    467
    +
    468 std::cout << '\r';
    +
    469 // On final exit, keep the current drawing and reset cursor position one
    +
    470 // line after it.
    +
    471 if (!use_alternative_screen_) {
    +
    472 std::cout << '\n';
    +
    473 std::cout << std::flush;
    +
    474 }
    +
    475 }
    +
    476}
    +
    477
    +
    478/// @brief Decorate a function. It executes the same way, but with the currently
    +
    479/// active screen terminal hooks temporarilly uninstalled during its execution.
    +
    480/// @param fn The function to decorate.
    +
    + +
    482 return [this, fn] {
    +
    483 Uninstall();
    +
    484 fn();
    +
    485 Install();
    +
    486 };
    +
    487}
    +
    +
    488
    +
    489/// @brief Force FTXUI to handle or not handle Ctrl-C, even if the component
    +
    490/// catches the Event::CtrlC.
    +
    + +
    492 force_handle_ctrl_c_ = force;
    +
    493}
    +
    +
    494
    +
    495/// @brief Force FTXUI to handle or not handle Ctrl-Z, even if the component
    +
    496/// catches the Event::CtrlZ.
    +
    + +
    498 force_handle_ctrl_z_ = force;
    +
    499}
    +
    +
    500
    +
    501/// @brief Returns the content of the current selection
    +
    + +
    503 if (!selection_) {
    +
    504 return "";
    +
    505 }
    +
    506 return selection_->GetParts();
    +
    507}
    +
    +
    508
    +
    +
    509void ScreenInteractive::SelectionChange(std::function<void()> callback) {
    +
    510 selection_on_change_ = std::move(callback);
    +
    511}
    +
    +
    512
    +
    513/// @brief Return the currently active screen, or null if none.
    +
    514// static
    +
    + +
    516 return g_active_screen;
    +
    517}
    +
    +
    518
    +
    519// private
    +
    520void ScreenInteractive::Install() {
    +
    521 frame_valid_ = false;
    +
    522
    +
    523 // Flush the buffer for stdout to ensure whatever the user has printed before
    +
    524 // is fully applied before we start modifying the terminal configuration. This
    +
    525 // is important, because we are using two different channels (stdout vs
    +
    526 // termios/WinAPI) to communicate with the terminal emulator below. See
    +
    527 // https://github.com/ArthurSonzogni/FTXUI/issues/846
    +
    528 Flush();
    +
    529
    +
    530 // After uninstalling the new configuration, flush it to the terminal to
    +
    531 // ensure it is fully applied:
    +
    532 on_exit_functions.emplace([] { Flush(); });
    +
    533
    +
    534 on_exit_functions.emplace([this] { ExitLoopClosure()(); });
    +
    535
    +
    536 // Request the terminal to report the current cursor shape. We will restore it
    +
    537 // on exit.
    +
    538 std::cout << DECRQSS_DECSCUSR;
    +
    539 on_exit_functions.emplace([this] {
    +
    540 std::cout << "\033[?25h"; // Enable cursor.
    +
    541 std::cout << "\033[" + std::to_string(cursor_reset_shape_) + " q";
    +
    542 });
    +
    543
    +
    544 // Install signal handlers to restore the terminal state on exit. The default
    +
    545 // signal handlers are restored on exit.
    +
    546 for (const int signal : {SIGTERM, SIGSEGV, SIGINT, SIGILL, SIGABRT, SIGFPE}) {
    +
    547 InstallSignalHandler(signal);
    +
    548 }
    +
    549
    +
    550// Save the old terminal configuration and restore it on exit.
    +
    551#if defined(_WIN32)
    +
    552 // Enable VT processing on stdout and stdin
    +
    553 auto stdout_handle = GetStdHandle(STD_OUTPUT_HANDLE);
    +
    554 auto stdin_handle = GetStdHandle(STD_INPUT_HANDLE);
    +
    555
    +
    556 DWORD out_mode = 0;
    +
    557 DWORD in_mode = 0;
    +
    558 GetConsoleMode(stdout_handle, &out_mode);
    +
    559 GetConsoleMode(stdin_handle, &in_mode);
    +
    560 on_exit_functions.push([=] { SetConsoleMode(stdout_handle, out_mode); });
    +
    561 on_exit_functions.push([=] { SetConsoleMode(stdin_handle, in_mode); });
    +
    562
    +
    563 // https://docs.microsoft.com/en-us/windows/console/setconsolemode
    +
    564 const int enable_virtual_terminal_processing = 0x0004;
    +
    565 const int disable_newline_auto_return = 0x0008;
    +
    566 out_mode |= enable_virtual_terminal_processing;
    +
    567 out_mode |= disable_newline_auto_return;
    +
    568
    +
    569 // https://docs.microsoft.com/en-us/windows/console/setconsolemode
    +
    570 const int enable_line_input = 0x0002;
    +
    571 const int enable_echo_input = 0x0004;
    +
    572 const int enable_virtual_terminal_input = 0x0200;
    +
    573 const int enable_window_input = 0x0008;
    +
    574 in_mode &= ~enable_echo_input;
    +
    575 in_mode &= ~enable_line_input;
    +
    576 in_mode |= enable_virtual_terminal_input;
    +
    577 in_mode |= enable_window_input;
    +
    578
    +
    579 SetConsoleMode(stdin_handle, in_mode);
    +
    580 SetConsoleMode(stdout_handle, out_mode);
    +
    581#else // POSIX (Linux & Mac)
    +
    582 // #if defined(__EMSCRIPTEN__)
    +
    583 //// Reading stdin isn't blocking.
    +
    584 // int flags = fcntl(0, F_GETFL, 0);
    +
    585 // fcntl(0, F_SETFL, flags | O_NONBLOCK);
    +
    586
    +
    587 //// Restore the terminal configuration on exit.
    +
    588 // on_exit_functions.emplace([flags] { fcntl(0, F_SETFL, flags); });
    +
    589 // #endif
    +
    590 for (const int signal : {SIGWINCH, SIGTSTP}) {
    +
    591 InstallSignalHandler(signal);
    +
    592 }
    +
    593
    +
    594 struct termios terminal; // NOLINT
    +
    595 tcgetattr(STDIN_FILENO, &terminal);
    +
    596 on_exit_functions.emplace(
    +
    597 [=] { tcsetattr(STDIN_FILENO, TCSANOW, &terminal); });
    +
    598
    +
    599 // Enabling raw terminal input mode
    +
    600 terminal.c_iflag &= ~IGNBRK; // Disable ignoring break condition
    +
    601 terminal.c_iflag &= ~BRKINT; // Disable break causing input and output to be
    +
    602 // flushed
    +
    603 terminal.c_iflag &= ~PARMRK; // Disable marking parity errors.
    +
    604 terminal.c_iflag &= ~ISTRIP; // Disable striping 8th bit off characters.
    +
    605 terminal.c_iflag &= ~INLCR; // Disable mapping NL to CR.
    +
    606 terminal.c_iflag &= ~IGNCR; // Disable ignoring CR.
    +
    607 terminal.c_iflag &= ~ICRNL; // Disable mapping CR to NL.
    +
    608 terminal.c_iflag &= ~IXON; // Disable XON/XOFF flow control on output
    +
    609
    +
    610 terminal.c_lflag &= ~ECHO; // Disable echoing input characters.
    +
    611 terminal.c_lflag &= ~ECHONL; // Disable echoing new line characters.
    +
    612 terminal.c_lflag &= ~ICANON; // Disable Canonical mode.
    +
    613 terminal.c_lflag &= ~ISIG; // Disable sending signal when hitting:
    +
    614 // - => DSUSP
    +
    615 // - C-Z => SUSP
    +
    616 // - C-C => INTR
    +
    617 // - C-d => QUIT
    +
    618 terminal.c_lflag &= ~IEXTEN; // Disable extended input processing
    +
    619 terminal.c_cflag |= CS8; // 8 bits per byte
    +
    620
    +
    621 terminal.c_cc[VMIN] = 0; // Minimum number of characters for non-canonical
    +
    622 // read.
    +
    623 terminal.c_cc[VTIME] = 0; // Timeout in deciseconds for non-canonical read.
    +
    624
    +
    625 tcsetattr(STDIN_FILENO, TCSANOW, &terminal);
    +
    626
    +
    627#endif
    +
    628
    +
    629 auto enable = [&](const std::vector<DECMode>& parameters) {
    +
    630 std::cout << Set(parameters);
    +
    631 on_exit_functions.emplace([=] { std::cout << Reset(parameters); });
    +
    632 };
    +
    633
    +
    634 auto disable = [&](const std::vector<DECMode>& parameters) {
    +
    635 std::cout << Reset(parameters);
    +
    636 on_exit_functions.emplace([=] { std::cout << Set(parameters); });
    +
    637 };
    +
    638
    +
    639 if (use_alternative_screen_) {
    +
    640 enable({
    +
    641 DECMode::kAlternateScreen,
    +
    642 });
    +
    643 }
    +
    644
    +
    645 disable({
    +
    646 // DECMode::kCursor,
    +
    647 DECMode::kLineWrap,
    +
    648 });
    +
    649
    +
    650 if (track_mouse_) {
    +
    651 enable({DECMode::kMouseVt200});
    +
    652 enable({DECMode::kMouseAnyEvent});
    +
    653 enable({DECMode::kMouseUrxvtMode});
    +
    654 enable({DECMode::kMouseSgrExtMode});
    +
    655 }
    +
    656
    +
    657 // After installing the new configuration, flush it to the terminal to
    +
    658 // ensure it is fully applied:
    +
    659 Flush();
    +
    660
    +
    661 quit_ = false;
    +
    662
    +
    663 PostAnimationTask();
    +
    664}
    +
    665
    +
    666// private
    +
    667void ScreenInteractive::Uninstall() {
    +
    668 ExitNow();
    +
    669 OnExit();
    +
    670}
    +
    671
    +
    672// private
    +
    673// NOLINTNEXTLINE
    +
    674void ScreenInteractive::RunOnceBlocking(Component component) {
    +
    675 // Set FPS to 60 at most.
    +
    676 const auto time_per_frame = std::chrono::microseconds(16666); // 1s / 60fps
    +
    677
    +
    678 auto time = std::chrono::steady_clock::now();
    +
    679 size_t executed_task = internal_->task_runner.ExecutedTasks();
    +
    680
    +
    681 // Wait for at least one task to execute.
    +
    682 while (executed_task == internal_->task_runner.ExecutedTasks() &&
    +
    683 !HasQuitted()) {
    +
    684 RunOnce(component);
    +
    685
    +
    686 const auto now = std::chrono::steady_clock::now();
    +
    687 const auto delta = now - time;
    +
    688 time = now;
    +
    689
    +
    690 if (delta < time_per_frame) {
    +
    691 const auto sleep_duration = time_per_frame - delta;
    +
    692 std::this_thread::sleep_for(sleep_duration);
    +
    693 }
    +
    694 }
    +
    695}
    +
    696
    +
    697// private
    +
    698void ScreenInteractive::RunOnce(Component component) {
    +
    699 AutoReset set_component(&component_, component);
    +
    700 ExecuteSignalHandlers();
    +
    701 FetchTerminalEvents();
    +
    702
    +
    703 // Execute the pending tasks from the queue.
    +
    704 const size_t executed_task = internal_->task_runner.ExecutedTasks();
    +
    705 internal_->task_runner.RunUntilIdle();
    +
    706 // If no executed task, we can return early without redrawing the screen.
    +
    707 if (executed_task == internal_->task_runner.ExecutedTasks()) {
    +
    708 return;
    +
    709 }
    +
    710
    +
    711 ExecuteSignalHandlers();
    +
    712 Draw(component);
    +
    713
    +
    714 if (selection_data_previous_ != selection_data_) {
    +
    715 selection_data_previous_ = selection_data_;
    +
    716 if (selection_on_change_) {
    +
    717 selection_on_change_();
    + +
    719 }
    +
    720 }
    +
    721}
    +
    722
    +
    723// private
    +
    724// NOLINTNEXTLINE
    +
    725void ScreenInteractive::HandleTask(Component component, Task& task) {
    +
    726 std::visit(
    +
    727 [&](auto&& arg) {
    +
    728 using T = std::decay_t<decltype(arg)>;
    +
    729
    +
    730 // clang-format off
    +
    731 // Handle Event.
    +
    732 if constexpr (std::is_same_v<T, Event>) {
    +
    733
    +
    734 if (arg.is_cursor_position()) {
    +
    735 cursor_x_ = arg.cursor_x();
    +
    736 cursor_y_ = arg.cursor_y();
    +
    737 return;
    +
    738 }
    +
    739
    +
    740 if (arg.is_cursor_shape()) {
    +
    741 cursor_reset_shape_= arg.cursor_shape();
    +
    742 return;
    +
    743 }
    +
    744
    +
    745 if (arg.is_mouse()) {
    +
    746 arg.mouse().x -= cursor_x_;
    +
    747 arg.mouse().y -= cursor_y_;
    +
    748 }
    +
    749
    +
    750 arg.screen_ = this;
    +
    751
    +
    752 bool handled = component->OnEvent(arg);
    +
    753
    +
    754 handled = HandleSelection(handled, arg);
    +
    755
    +
    756 if (arg == Event::CtrlC && (!handled || force_handle_ctrl_c_)) {
    +
    757 RecordSignal(SIGABRT);
    +
    758 }
    +
    759
    +
    760#if !defined(_WIN32)
    +
    761 if (arg == Event::CtrlZ && (!handled || force_handle_ctrl_z_)) {
    +
    762 RecordSignal(SIGTSTP);
    +
    763 }
    +
    764#endif
    +
    765
    +
    766 frame_valid_ = false;
    +
    767 return;
    +
    768 }
    +
    769
    +
    770 // Handle callback
    +
    771 if constexpr (std::is_same_v<T, Closure>) {
    +
    772 arg();
    +
    773 return;
    +
    774 }
    +
    775
    +
    776 // Handle Animation
    +
    777 if constexpr (std::is_same_v<T, AnimationTask>) {
    +
    778 if (!animation_requested_) {
    +
    779 return;
    +
    780 }
    +
    781
    +
    782 animation_requested_ = false;
    +
    783 const animation::TimePoint now = animation::Clock::now();
    +
    784 const animation::Duration delta = now - previous_animation_time_;
    +
    785 previous_animation_time_ = now;
    +
    786
    +
    787 animation::Params params(delta);
    +
    788 component->OnAnimation(params);
    +
    789 frame_valid_ = false;
    +
    790 return;
    +
    791 }
    +
    792 },
    +
    793 task);
    +
    794 // clang-format on
    +
    795}
    +
    796
    +
    797// private
    +
    798bool ScreenInteractive::HandleSelection(bool handled, Event event) {
    +
    799 if (handled) {
    +
    800 selection_pending_ = nullptr;
    +
    801 selection_data_.empty = true;
    +
    802 selection_ = nullptr;
    +
    803 return true;
    +
    804 }
    +
    805
    +
    806 if (!event.is_mouse()) {
    +
    807 return false;
    +
    808 }
    +
    809
    +
    810 auto& mouse = event.mouse();
    +
    811 if (mouse.button != Mouse::Left) {
    +
    812 return false;
    +
    813 }
    +
    814
    +
    815 if (mouse.motion == Mouse::Pressed) {
    +
    816 selection_pending_ = CaptureMouse();
    +
    817 selection_data_.start_x = mouse.x;
    +
    818 selection_data_.start_y = mouse.y;
    +
    819 selection_data_.end_x = mouse.x;
    +
    820 selection_data_.end_y = mouse.y;
    +
    821 return false;
    +
    822 }
    +
    823
    +
    824 if (!selection_pending_) {
    +
    825 return false;
    +
    826 }
    +
    827
    +
    828 if (mouse.motion == Mouse::Moved) {
    +
    829 if ((mouse.x != selection_data_.end_x) ||
    +
    830 (mouse.y != selection_data_.end_y)) {
    +
    831 selection_data_.end_x = mouse.x;
    +
    832 selection_data_.end_y = mouse.y;
    +
    833 selection_data_.empty = false;
    +
    834 }
    +
    835
    +
    836 return true;
    +
    837 }
    +
    838
    +
    839 if (mouse.motion == Mouse::Released) {
    +
    840 selection_pending_ = nullptr;
    +
    841 selection_data_.end_x = mouse.x;
    +
    842 selection_data_.end_y = mouse.y;
    +
    843 selection_data_.empty = false;
    +
    844 return true;
    +
    845 }
    +
    846
    +
    847 return false;
    +
    848}
    +
    849
    +
    850// private
    +
    851// NOLINTNEXTLINE
    +
    852void ScreenInteractive::Draw(Component component) {
    +
    853 if (frame_valid_) {
    +
    854 return;
    +
    855 }
    +
    856 auto document = component->Render();
    +
    857 int dimx = 0;
    +
    858 int dimy = 0;
    +
    859 auto terminal = Terminal::Size();
    +
    860 document->ComputeRequirement();
    +
    861 switch (dimension_) {
    +
    862 case Dimension::Fixed:
    +
    863 dimx = dimx_;
    +
    864 dimy = dimy_;
    +
    865 break;
    +
    866 case Dimension::TerminalOutput:
    +
    867 dimx = terminal.dimx;
    +
    868 dimy = util::clamp(document->requirement().min_y, 0, terminal.dimy);
    +
    869 break;
    +
    870 case Dimension::Fullscreen:
    +
    871 dimx = terminal.dimx;
    +
    872 dimy = terminal.dimy;
    +
    873 break;
    +
    874 case Dimension::FitComponent:
    +
    875 dimx = util::clamp(document->requirement().min_x, 0, terminal.dimx);
    +
    876 dimy = util::clamp(document->requirement().min_y, 0, terminal.dimy);
    +
    877 break;
    +
    878 }
    +
    879
    +
    880 const bool resized = frame_count_ == 0 || (dimx != dimx_) || (dimy != dimy_);
    +
    881 ResetCursorPosition();
    +
    882 std::cout << ResetPosition(/*clear=*/resized);
    +
    883
    +
    884 // If the terminal width decrease, the terminal emulator will start wrapping
    +
    885 // lines and make the display dirty. We should clear it completely.
    +
    886 if ((dimx < dimx_) && !use_alternative_screen_) {
    +
    887 std::cout << "\033[J"; // clear terminal output
    +
    888 std::cout << "\033[H"; // move cursor to home position
    +
    889 }
    +
    890
    +
    891 // Resize the screen if needed.
    +
    892 if (resized) {
    +
    893 dimx_ = dimx;
    +
    894 dimy_ = dimy;
    +
    895 pixels_ = std::vector<std::vector<Pixel>>(dimy, std::vector<Pixel>(dimx));
    +
    896 cursor_.x = dimx_ - 1;
    +
    897 cursor_.y = dimy_ - 1;
    +
    898 }
    +
    899
    +
    900 // Periodically request the terminal emulator the frame position relative to
    +
    901 // the screen. This is useful for converting mouse position reported in
    +
    902 // screen's coordinates to frame's coordinates.
    +
    903#if defined(FTXUI_MICROSOFT_TERMINAL_FALLBACK)
    +
    904 // Microsoft's terminal suffers from a [bug]. When reporting the cursor
    +
    905 // position, several output sequences are mixed together into garbage.
    +
    906 // This causes FTXUI user to see some "1;1;R" sequences into the Input
    +
    907 // component. See [issue]. Solution is to request cursor position less
    +
    908 // often. [bug]: https://github.com/microsoft/terminal/pull/7583 [issue]:
    +
    909 // https://github.com/ArthurSonzogni/FTXUI/issues/136
    +
    910 static int i = -3;
    +
    911 ++i;
    +
    912 if (!use_alternative_screen_ && (i % 150 == 0)) { // NOLINT
    +
    913 std::cout << DeviceStatusReport(DSRMode::kCursor);
    +
    914 }
    +
    915#else
    +
    916 static int i = -3;
    +
    917 ++i;
    +
    918 if (!use_alternative_screen_ &&
    +
    919 (previous_frame_resized_ || i % 40 == 0)) { // NOLINT
    +
    920 std::cout << DeviceStatusReport(DSRMode::kCursor);
    +
    921 }
    +
    922#endif
    +
    923 previous_frame_resized_ = resized;
    +
    924
    +
    925 selection_ = selection_data_.empty
    +
    926 ? std::make_unique<Selection>()
    +
    927 : std::make_unique<Selection>(
    +
    928 selection_data_.start_x, selection_data_.start_y, //
    +
    929 selection_data_.end_x, selection_data_.end_y);
    +
    930 Render(*this, document.get(), *selection_);
    +
    931
    +
    932 // Set cursor position for user using tools to insert CJK characters.
    +
    933 {
    +
    934 const int dx = dimx_ - 1 - cursor_.x + int(dimx_ != terminal.dimx);
    +
    935 const int dy = dimy_ - 1 - cursor_.y;
    +
    936
    +
    937 set_cursor_position.clear();
    +
    938 reset_cursor_position.clear();
    +
    939
    +
    940 if (dy != 0) {
    +
    941 set_cursor_position += "\x1B[" + std::to_string(dy) + "A";
    +
    942 reset_cursor_position += "\x1B[" + std::to_string(dy) + "B";
    +
    943 }
    +
    944
    +
    945 if (dx != 0) {
    +
    946 set_cursor_position += "\x1B[" + std::to_string(dx) + "D";
    +
    947 reset_cursor_position += "\x1B[" + std::to_string(dx) + "C";
    +
    948 }
    +
    949
    +
    950 if (cursor_.shape == Cursor::Hidden) {
    +
    951 set_cursor_position += "\033[?25l";
    +
    952 } else {
    +
    953 set_cursor_position += "\033[?25h";
    +
    954 set_cursor_position +=
    +
    955 "\033[" + std::to_string(int(cursor_.shape)) + " q";
    +
    956 }
    +
    957 }
    +
    958
    +
    959 std::cout << ToString() << set_cursor_position;
    +
    960 Flush();
    +
    961 Clear();
    +
    962 frame_valid_ = true;
    +
    963 frame_count_++;
    +
    964}
    +
    965
    +
    966// private
    +
    967void ScreenInteractive::ResetCursorPosition() {
    +
    968 std::cout << reset_cursor_position;
    +
    969 reset_cursor_position = "";
    +
    970}
    +
    971
    +
    972/// @brief Return a function to exit the main loop.
    +
    + +
    974 return [this] { Exit(); };
    +
    975}
    +
    +
    976
    +
    977/// @brief Exit the main loop.
    +
    + +
    979 Post([this] { ExitNow(); });
    +
    980}
    +
    +
    981
    +
    982// private:
    +
    983void ScreenInteractive::ExitNow() {
    +
    984 quit_ = true;
    +
    985}
    +
    986
    +
    987// private:
    +
    988void ScreenInteractive::Signal(int signal) {
    +
    989 if (signal == SIGABRT) {
    +
    990 Exit();
    +
    991 return;
    +
    992 }
    +
    993
    +
    994// Windows do no support SIGTSTP / SIGWINCH
    +
    995#if !defined(_WIN32)
    +
    996 if (signal == SIGTSTP) {
    +
    997 Post([&] {
    +
    998 ResetCursorPosition();
    +
    999 std::cout << ResetPosition(/*clear*/ true); // Cursor to the beginning
    +
    1000 Uninstall();
    +
    1001 dimx_ = 0;
    +
    1002 dimy_ = 0;
    +
    1003 Flush();
    +
    1004 std::ignore = std::raise(SIGTSTP);
    +
    1005 Install();
    +
    1006 });
    +
    1007 return;
    +
    1008 }
    +
    1009
    +
    1010 if (signal == SIGWINCH) {
    +
    1011 Post(Event::Special({0}));
    +
    1012 return;
    +
    1013 }
    +
    1014#endif
    +
    1015}
    +
    1016
    +
    1017void ScreenInteractive::FetchTerminalEvents() {
    +
    1018#if defined(_WIN32)
    +
    1019 auto get_input_records = [&]() -> std::vector<INPUT_RECORD> {
    +
    1020 // Check if there is input in the console.
    +
    1021 auto console = GetStdHandle(STD_INPUT_HANDLE);
    +
    1022 DWORD number_of_events = 0;
    +
    1023 if (!GetNumberOfConsoleInputEvents(console, &number_of_events)) {
    +
    1024 return std::vector<INPUT_RECORD>();
    +
    1025 }
    +
    1026 if (number_of_events <= 0) {
    +
    1027 // No input, return.
    +
    1028 return std::vector<INPUT_RECORD>();
    +
    1029 }
    +
    1030 // Read the input events.
    +
    1031 std::vector<INPUT_RECORD> records(number_of_events);
    +
    1032 DWORD number_of_events_read = 0;
    +
    1033 if (!ReadConsoleInput(console, records.data(), (DWORD)records.size(),
    +
    1034 &number_of_events_read)) {
    +
    1035 return std::vector<INPUT_RECORD>();
    +
    1036 }
    +
    1037 records.resize(number_of_events_read);
    +
    1038 return records;
    +
    1039 };
    +
    1040
    +
    1041 auto records = get_input_records();
    +
    1042 if (records.size() == 0) {
    +
    1043 const auto timeout =
    +
    1044 std::chrono::steady_clock::now() - internal_->last_char_time;
    +
    1045 const size_t timeout_microseconds =
    +
    1046 std::chrono::duration_cast<std::chrono::microseconds>(timeout).count();
    +
    1047 internal_->terminal_input_parser.Timeout(timeout_microseconds);
    +
    1048 return;
    +
    1049 }
    +
    1050 internal_->last_char_time = std::chrono::steady_clock::now();
    +
    1051
    +
    1052 // Convert the input events to FTXUI events.
    +
    1053 // For each event, we call the terminal input parser to convert it to
    +
    1054 // Event.
    +
    1055 for (const auto& r : records) {
    +
    1056 switch (r.EventType) {
    +
    1057 case KEY_EVENT: {
    +
    1058 auto key_event = r.Event.KeyEvent;
    +
    1059 // ignore UP key events
    +
    1060 if (key_event.bKeyDown == FALSE) {
    +
    1061 continue;
    +
    1062 }
    +
    1063 std::wstring wstring;
    +
    1064 wstring += key_event.uChar.UnicodeChar;
    +
    1065 for (auto it : to_string(wstring)) {
    +
    1066 internal_->terminal_input_parser.Add(it);
    +
    1067 }
    +
    1068 } break;
    +
    1069 case WINDOW_BUFFER_SIZE_EVENT:
    +
    1070 Post(Event::Special({0}));
    +
    1071 break;
    +
    1072 case MENU_EVENT:
    +
    1073 case FOCUS_EVENT:
    +
    1074 case MOUSE_EVENT:
    +
    1075 // TODO(mauve): Implement later.
    +
    1076 break;
    +
    1077 }
    +
    1078 }
    +
    1079#elif defined(__EMSCRIPTEN__)
    +
    1080 // Read chars from the terminal.
    +
    1081 // We configured it to be non blocking.
    +
    1082 std::array<char, 128> out{};
    +
    1083 size_t l = read(STDIN_FILENO, out.data(), out.size());
    +
    1084 if (l == 0) {
    +
    1085 const auto timeout =
    +
    1086 std::chrono::steady_clock::now() - internal_->last_char_time;
    +
    1087 const size_t timeout_microseconds =
    +
    1088 std::chrono::duration_cast<std::chrono::microseconds>(timeout).count();
    +
    1089 internal_->terminal_input_parser.Timeout(timeout_microseconds);
    +
    1090 return;
    +
    1091 }
    +
    1092 internal_->last_char_time = std::chrono::steady_clock::now();
    +
    1093
    +
    1094 // Convert the chars to events.
    +
    1095 for (size_t i = 0; i < l; ++i) {
    +
    1096 internal_->terminal_input_parser.Add(out[i]);
    +
    1097 }
    +
    1098#else // POSIX (Linux & Mac)
    +
    1099 if (!CheckStdinReady()) {
    +
    1100 const auto timeout =
    +
    1101 std::chrono::steady_clock::now() - internal_->last_char_time;
    +
    1102 const size_t timeout_ms =
    +
    1103 std::chrono::duration_cast<std::chrono::milliseconds>(timeout).count();
    +
    1104 internal_->terminal_input_parser.Timeout(timeout_ms);
    +
    1105 return;
    +
    1106 }
    +
    1107 internal_->last_char_time = std::chrono::steady_clock::now();
    +
    1108
    +
    1109 // Read chars from the terminal.
    +
    1110 std::array<char, 128> out{};
    +
    1111 size_t l = read(fileno(stdin), out.data(), out.size());
    +
    1112
    +
    1113 // Convert the chars to events.
    +
    1114 for (size_t i = 0; i < l; ++i) {
    +
    1115 internal_->terminal_input_parser.Add(out[i]);
    +
    1116 }
    +
    1117#endif
    +
    1118}
    +
    1119
    +
    1120void ScreenInteractive::PostAnimationTask() {
    +
    1121 Post(AnimationTask());
    +
    1122
    +
    1123 // Repeat the animation task every 15ms. This correspond to a frame rate
    +
    1124 // of around 66fps.
    +
    1125 internal_->task_runner.PostDelayedTask([this] { PostAnimationTask(); },
    +
    1126 std::chrono::milliseconds(15));
    +
    1127}
    +
    1128
    +
    1129bool ScreenInteractive::SelectionData::operator==(
    +
    1130 const ScreenInteractive::SelectionData& other) const {
    +
    1131 if (empty && other.empty) {
    +
    1132 return true;
    +
    1133 }
    +
    1134 if (empty || other.empty) {
    +
    1135 return false;
    +
    1136 }
    +
    1137 return start_x == other.start_x && start_y == other.start_y &&
    +
    1138 end_x == other.end_x && end_y == other.end_y;
    +
    1139}
    +
    1140
    +
    1141bool ScreenInteractive::SelectionData::operator!=(
    +
    1142 const ScreenInteractive::SelectionData& other) const {
    +
    1143 return !(*this == other);
    +
    1144}
    +
    1145
    +
    1146} // namespace ftxui.
    + + + +
    static void Signal(ScreenInteractive &s, int signal)
    + + +
    auto PostTask(Task task) -> void
    Schedules a task to be executed immediately.
    +
    auto RunUntilIdle() -> std::optional< std::chrono::steady_clock::duration >
    Runs the tasks in the queue.
    +
    auto PostDelayedTask(Task task, std::chrono::steady_clock::duration duration) -> void
    Schedules a task to be executed after a certain duration.
    +
    size_t ExecutedTasks() const
    + + +
    static const Event CtrlC
    Definition event.hpp:71
    + + + + +
    static ScreenInteractive TerminalOutput()
    +
    void Exit()
    Exit the main loop.
    +
    static const Event CtrlZ
    Definition event.hpp:94
    +
    static ScreenInteractive FixedSize(int dimx, int dimy)
    +
    void PostEvent(Event event)
    Add an event to the main loop. It will be executed later, after every other scheduled events.
    + +
    void Post(Task task)
    Add a task to the main loop. It will be executed later, after every other scheduled tasks.
    +
    static ScreenInteractive FitComponent()
    +
    static ScreenInteractive Fullscreen()
    +
    static const Event Custom
    Definition event.hpp:97
    +
    static ScreenInteractive FullscreenPrimaryScreen()
    + +
    static ScreenInteractive * Active()
    Return the currently active screen, or null if none.
    +
    CapturedMouse CaptureMouse()
    Try to get the unique lock about behing able to capture the mouse.
    +
    std::string GetSelection()
    Returns the content of the current selection.
    +
    static ScreenInteractive FullscreenAlternateScreen()
    +
    void TrackMouse(bool enable=true)
    Set whether mouse is tracked and events reported. called outside of the main loop....
    +
    void SelectionChange(std::function< void()> callback)
    +
    void RequestAnimationFrame()
    Add a task to draw the screen one more time, until all the animations are done.
    +
    Closure ExitLoopClosure()
    Return a function to exit the main loop.
    +
    void ForceHandleCtrlC(bool force)
    Force FTXUI to handle or not handle Ctrl-C, even if the component catches the Event::CtrlC.
    +
    void ForceHandleCtrlZ(bool force)
    Force FTXUI to handle or not handle Ctrl-Z, even if the component catches the Event::CtrlZ.
    +
    Closure WithRestoredIO(Closure)
    Decorate a function. It executes the same way, but with the currently active screen terminal hooks te...
    +
    static Event Special(std::string)
    An custom event whose meaning is defined by the user of the library.
    Definition event.cpp:74
    +
    Loop is a class that manages the event loop for a component.
    Definition loop.hpp:56
    +
    ScreenInteractive is a Screen that can handle events, run a main loop, and manage components.
    +
    void RequestAnimationFrame()
    RequestAnimationFrame is a function that requests a new frame to be drawn in the next animation cycle...
    +
    Represent an event. It can be key press event, a terminal resize, or more ...
    Definition event.hpp:29
    +
    void Render(Screen &screen, const Element &element)
    Display an element on a ftxui::Screen.
    Definition node.cpp:84
    +
    int dimy() const
    Definition image.hpp:36
    +
    std::string ToString() const
    Definition screen.cpp:416
    + +
    std::string ResetPosition(bool clear=false) const
    Return a string to be printed in order to reset the cursor position to the beginning of the screen.
    Definition screen.cpp:476
    +
    Cursor cursor_
    Definition screen.hpp:79
    + +
    void Clear()
    Clear all the pixel from the screen.
    Definition screen.cpp:495
    +
    int dimx() const
    Definition image.hpp:35
    +
    std::vector< std::vector< Pixel > > pixels_
    Definition image.hpp:46
    +
    Dimensions Size()
    Get the terminal size.
    Definition terminal.cpp:94
    + +
    void SetFallbackSize(const Dimensions &fallbackSize)
    Override terminal size in case auto-detection fails.
    Definition terminal.cpp:124
    +
    std::chrono::duration< float > Duration
    Definition animation.hpp:30
    +
    std::chrono::time_point< Clock > TimePoint
    Definition animation.hpp:29
    +
    constexpr const T & clamp(const T &v, const T &lo, const T &hi)
    Definition util.hpp:11
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::unique_ptr< CapturedMouseInterface > CapturedMouse
    +
    std::string to_string(const std::wstring &s)
    Convert a std::wstring into a UTF8 std::string.
    Definition string.cpp:1566
    +
    Element select(Element e)
    Set the child to be the one focused among its siblings.
    Definition frame.cpp:108
    +
    std::variant< Event, Closure, AnimationTask > Task
    Definition task.hpp:14
    +
    std::function< void()> Closure
    Definition task.hpp:13
    +
    std::shared_ptr< ComponentBase > Component
    + + + + + + + + + + + +
    +
    + + + + + diff --git a/screen__interactive_8cppm.html b/screen__interactive_8cppm.html new file mode 100644 index 000000000..a82ce3aa5 --- /dev/null +++ b/screen__interactive_8cppm.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: screen_interactive.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    screen_interactive.cppm File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    +
    +
    + + + + + diff --git a/screen__interactive_8cppm_source.html b/screen__interactive_8cppm_source.html new file mode 100644 index 000000000..42784753f --- /dev/null +++ b/screen__interactive_8cppm_source.html @@ -0,0 +1,241 @@ + + + + + + + + +FTXUI: screen_interactive.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    screen_interactive.cppm
    +
    +
    +Go to the documentation of this file.
    1/// @module ftxui.component.screen_interactive
    +
    2/// @brief Module file for the ScreenInteractive class of the Component module
    +
    3
    +
    4module;
    +
    5
    + +
    7
    + +
    9
    +
    10/**
    +
    11 * @namespace ftxui
    +
    12 * @brief The FTXUI ftxui:: namespace
    +
    13 */
    +
    14export namespace ftxui {
    + +
    16 using ftxui::Loop;
    +
    17 using ftxui::Event;
    +
    18 using ftxui::Component;
    +
    19
    +
    20 using ftxui::Screen;
    +
    21 using ftxui::ScreenInteractivePrivate;
    + +
    23}
    +
    It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ft...
    +
    Loop is a class that manages the event loop for a component.
    Definition loop.hpp:56
    +
    ScreenInteractive is a Screen that can handle events, run a main loop, and manage components.
    +
    Represent an event. It can be key press event, a terminal resize, or more ...
    Definition event.hpp:29
    +
    A rectangular grid of Pixel.
    Definition screen.hpp:26
    +
    Module file for the ScreenInteractive class of the Component module.
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::shared_ptr< ComponentBase > Component
    + +
    +
    + + + + + diff --git a/screen__interactive_8hpp.html b/screen__interactive_8hpp.html new file mode 100644 index 000000000..3aabecd20 --- /dev/null +++ b/screen__interactive_8hpp.html @@ -0,0 +1,231 @@ + + + + + + + + +FTXUI: screen_interactive.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    screen_interactive.hpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + + + +

    +Classes

    class  ScreenInteractive
     ScreenInteractive is a Screen that can handle events, run a main loop, and manage components. More...
     
    class  ScreenInteractive::Private
     
    + + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    namespace  ftxui::task
     
    +
    +
    + + + + + diff --git a/screen__interactive_8hpp.js b/screen__interactive_8hpp.js new file mode 100644 index 000000000..a9f06f01d --- /dev/null +++ b/screen__interactive_8hpp.js @@ -0,0 +1,4 @@ +var screen__interactive_8hpp = +[ + [ "Private", "classftxui_1_1ScreenInteractive_1_1Private.html", null ] +]; \ No newline at end of file diff --git a/screen__interactive_8hpp_source.html b/screen__interactive_8hpp_source.html new file mode 100644 index 000000000..65ca0aaf1 --- /dev/null +++ b/screen__interactive_8hpp_source.html @@ -0,0 +1,439 @@ + + + + + + + + +FTXUI: screen_interactive.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    screen_interactive.hpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#ifndef FTXUI_COMPONENT_SCREEN_INTERACTIVE_HPP
    +
    5#define FTXUI_COMPONENT_SCREEN_INTERACTIVE_HPP
    +
    6
    +
    7#include <atomic> // for atomic
    +
    8#include <functional> // for function
    +
    9#include <memory> // for shared_ptr
    +
    10#include <string> // for string
    +
    11
    +
    12#include "ftxui/component/animation.hpp" // for TimePoint
    +
    13#include "ftxui/component/captured_mouse.hpp" // for CapturedMouse
    +
    14#include "ftxui/component/event.hpp" // for Event
    +
    15#include "ftxui/component/task.hpp" // for Task, Closure
    +
    16#include "ftxui/dom/selection.hpp" // for SelectionOption
    +
    17#include "ftxui/screen/screen.hpp" // for Screen
    +
    18
    +
    19namespace ftxui {
    +
    20class ComponentBase;
    +
    21class Loop;
    +
    22struct Event;
    +
    23
    +
    24using Component = std::shared_ptr<ComponentBase>;
    +
    25class ScreenInteractivePrivate;
    +
    26
    +
    +
    27namespace task {
    +
    28class TaskRunner;
    +
    29}
    +
    +
    30
    +
    31/// @brief ScreenInteractive is a `Screen` that can handle events, run a main
    +
    32/// loop, and manage components.
    +
    33///
    +
    34/// @ingroup component
    +
    +
    35class ScreenInteractive : public Screen {
    +
    36 public:
    +
    37 // Constructors:
    +
    38 static ScreenInteractive FixedSize(int dimx, int dimy);
    + + + + + +
    44
    +
    45 // Destructor.
    + +
    47
    +
    48 // Options. Must be called before Loop().
    +
    49 void TrackMouse(bool enable = true);
    +
    50
    +
    51 // Return the currently active screen, nullptr if none.
    +
    52 static ScreenInteractive* Active();
    +
    53
    +
    54 // Start/Stop the main loop.
    +
    55 void Loop(Component);
    +
    56 void Exit();
    + +
    58
    +
    59 // Post tasks to be executed by the loop.
    +
    60 void Post(Task task);
    +
    61 void PostEvent(Event event);
    + +
    63
    + +
    65
    +
    66 // Decorate a function. The outputted one will execute similarly to the
    +
    67 // inputted one, but with the currently active screen terminal hooks
    +
    68 // temporarily uninstalled.
    + +
    70
    +
    71 // FTXUI implements handlers for Ctrl-C and Ctrl-Z. By default, these handlers
    +
    72 // are executed, even if the component catches the event. This avoid users
    +
    73 // handling every event to be trapped in the application. However, in some
    +
    74 // cases, the application may want to handle these events itself. In this
    +
    75 // case, the application can force FTXUI to not handle these events by calling
    +
    76 // the following functions with force=true.
    +
    77 void ForceHandleCtrlC(bool force);
    +
    78 void ForceHandleCtrlZ(bool force);
    +
    79
    +
    80 // Selection API.
    +
    81 std::string GetSelection();
    +
    82 void SelectionChange(std::function<void()> callback);
    +
    83
    +
    84 private:
    +
    85 void ExitNow();
    +
    86
    +
    87 void Install();
    +
    88 void Uninstall();
    +
    89
    +
    90 void PreMain();
    +
    91 void PostMain();
    +
    92
    +
    93 bool HasQuitted();
    +
    94 void RunOnce(Component component);
    +
    95 void RunOnceBlocking(Component component);
    +
    96
    +
    97 void HandleTask(Component component, Task& task);
    +
    98 bool HandleSelection(bool handled, Event event);
    +
    99 void RefreshSelection();
    +
    100 void Draw(Component component);
    +
    101 void ResetCursorPosition();
    +
    102
    +
    103 void Signal(int signal);
    +
    104
    +
    105 void FetchTerminalEvents();
    +
    106
    +
    107 void PostAnimationTask();
    +
    108
    +
    109 ScreenInteractive* suspended_screen_ = nullptr;
    +
    110 enum class Dimension {
    + +
    112 Fixed,
    + + +
    115 };
    +
    116 ScreenInteractive(Dimension dimension,
    +
    117 int dimx,
    +
    118 int dimy,
    +
    119 bool use_alternative_screen);
    +
    120 const Dimension dimension_;
    +
    121 const bool use_alternative_screen_;
    +
    122
    +
    123 bool track_mouse_ = true;
    +
    124
    +
    125 std::string set_cursor_position;
    +
    126 std::string reset_cursor_position;
    +
    127
    +
    128 std::atomic<bool> quit_{false};
    +
    129 bool animation_requested_ = false;
    +
    130 animation::TimePoint previous_animation_time_;
    +
    131
    +
    132 int cursor_x_ = 1;
    +
    133 int cursor_y_ = 1;
    +
    134
    +
    135 std::uint64_t frame_count_ = 0;
    +
    136 bool mouse_captured = false;
    +
    137 bool previous_frame_resized_ = false;
    +
    138
    +
    139 bool frame_valid_ = false;
    +
    140
    +
    141 bool force_handle_ctrl_c_ = true;
    +
    142 bool force_handle_ctrl_z_ = true;
    +
    143
    +
    144 // The style of the cursor to restore on exit.
    +
    145 int cursor_reset_shape_ = 1;
    +
    146
    +
    147 // Selection API:
    +
    148 CapturedMouse selection_pending_;
    +
    149 struct SelectionData {
    +
    150 int start_x = -1;
    +
    151 int start_y = -1;
    +
    152 int end_x = -2;
    +
    153 int end_y = -2;
    +
    154 bool empty = true;
    +
    155 bool operator==(const SelectionData& other) const;
    +
    156 bool operator!=(const SelectionData& other) const;
    +
    157 };
    +
    158 SelectionData selection_data_;
    +
    159 SelectionData selection_data_previous_;
    +
    160 std::unique_ptr<Selection> selection_;
    +
    161 std::function<void()> selection_on_change_;
    +
    162
    +
    163 // PIMPL private implementation idiom (Pimpl).
    +
    164 struct Internal;
    +
    165 std::unique_ptr<Internal> internal_;
    +
    166
    +
    167 friend class Loop;
    +
    168
    +
    169 Component component_;
    +
    170
    +
    171 public:
    +
    +
    172 class Private {
    +
    173 public:
    +
    174 static void Signal(ScreenInteractive& s, int signal) { s.Signal(signal); }
    +
    175 };
    +
    +
    176 friend Private;
    +
    177};
    +
    +
    178
    +
    179} // namespace ftxui
    +
    180
    +
    181#endif /* end of include guard: FTXUI_COMPONENT_SCREEN_INTERACTIVE_HPP */
    + + + +
    static void Signal(ScreenInteractive &s, int signal)
    + + +
    static ScreenInteractive TerminalOutput()
    +
    void Exit()
    Exit the main loop.
    +
    static ScreenInteractive FixedSize(int dimx, int dimy)
    +
    void PostEvent(Event event)
    Add an event to the main loop. It will be executed later, after every other scheduled events.
    + +
    void Post(Task task)
    Add a task to the main loop. It will be executed later, after every other scheduled tasks.
    +
    static ScreenInteractive FitComponent()
    +
    static ScreenInteractive Fullscreen()
    + +
    static ScreenInteractive FullscreenPrimaryScreen()
    + +
    static ScreenInteractive * Active()
    Return the currently active screen, or null if none.
    +
    CapturedMouse CaptureMouse()
    Try to get the unique lock about behing able to capture the mouse.
    +
    std::string GetSelection()
    Returns the content of the current selection.
    +
    static ScreenInteractive FullscreenAlternateScreen()
    +
    void TrackMouse(bool enable=true)
    Set whether mouse is tracked and events reported. called outside of the main loop....
    +
    void SelectionChange(std::function< void()> callback)
    +
    void RequestAnimationFrame()
    Add a task to draw the screen one more time, until all the animations are done.
    +
    Closure ExitLoopClosure()
    Return a function to exit the main loop.
    +
    void ForceHandleCtrlC(bool force)
    Force FTXUI to handle or not handle Ctrl-C, even if the component catches the Event::CtrlC.
    +
    void ForceHandleCtrlZ(bool force)
    Force FTXUI to handle or not handle Ctrl-Z, even if the component catches the Event::CtrlZ.
    +
    Closure WithRestoredIO(Closure)
    Decorate a function. It executes the same way, but with the currently active screen terminal hooks te...
    +
    Loop is a class that manages the event loop for a component.
    Definition loop.hpp:56
    +
    ScreenInteractive is a Screen that can handle events, run a main loop, and manage components.
    +
    Represent an event. It can be key press event, a terminal resize, or more ...
    Definition event.hpp:29
    +
    int dimy() const
    Definition image.hpp:36
    +
    int dimx() const
    Definition image.hpp:35
    +
    A rectangular grid of Pixel.
    Definition screen.hpp:26
    +
    std::chrono::time_point< Clock > TimePoint
    Definition animation.hpp:29
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::unique_ptr< CapturedMouseInterface > CapturedMouse
    +
    std::variant< Event, Closure, AnimationTask > Task
    Definition task.hpp:14
    +
    std::function< void()> Closure
    Definition task.hpp:13
    +
    std::shared_ptr< ComponentBase > Component
    + + + +
    +
    + + + + + diff --git a/scroll__indicator_8cpp.html b/scroll__indicator_8cpp.html new file mode 100644 index 000000000..59bf9020a --- /dev/null +++ b/scroll__indicator_8cpp.html @@ -0,0 +1,230 @@ + + + + + + + + +FTXUI: scroll_indicator.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    scroll_indicator.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + + + + +

    +Functions

    Element vscroll_indicator (Element child)
     Display a vertical scrollbar on the right. Colors follow the content.
     
    Element hscroll_indicator (Element child)
     Display a horizontal scrollbar at the bottom. Colors follow the content.
     
    +
    +
    + + + + + diff --git a/scroll__indicator_8cpp.js b/scroll__indicator_8cpp.js new file mode 100644 index 000000000..e1ee0d6e8 --- /dev/null +++ b/scroll__indicator_8cpp.js @@ -0,0 +1,5 @@ +var scroll__indicator_8cpp = +[ + [ "vscroll_indicator", "scroll__indicator_8cpp.html#ga1974176e676afdb96d203e8e0f579219", null ], + [ "hscroll_indicator", "scroll__indicator_8cpp.html#ga7f48136f949ccbde722dd93a6de4d0de", null ] +]; \ No newline at end of file diff --git a/scroll__indicator_8cpp_source.html b/scroll__indicator_8cpp_source.html new file mode 100644 index 000000000..15e654c83 --- /dev/null +++ b/scroll__indicator_8cpp_source.html @@ -0,0 +1,365 @@ + + + + + + + + +FTXUI: scroll_indicator.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    scroll_indicator.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2021 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <algorithm> // for max
    +
    5#include <memory> // for make_shared, __shared_ptr_access
    +
    6#include <string> // for string
    +
    7#include <utility> // for move
    +
    8
    +
    9#include "ftxui/dom/elements.hpp" // for Element, vscroll_indicator, hscroll_indicator
    +
    10#include "ftxui/dom/node.hpp" // for Node, Elements
    +
    11#include "ftxui/dom/node_decorator.hpp" // for NodeDecorator
    +
    12#include "ftxui/dom/requirement.hpp" // for Requirement
    +
    13#include "ftxui/screen/box.hpp" // for Box
    +
    14#include "ftxui/screen/screen.hpp" // for Screen, Pixel
    +
    15
    +
    16namespace ftxui {
    +
    17
    +
    18/// @brief Display a vertical scrollbar on the right.
    +
    19/// Colors follow the content.
    +
    20/// @ingroup dom
    +
    + +
    22 class Impl : public NodeDecorator {
    +
    23 using NodeDecorator::NodeDecorator;
    +
    24
    +
    25 void ComputeRequirement() override {
    +
    26 NodeDecorator::ComputeRequirement();
    +
    27 requirement_ = children_[0]->requirement();
    +
    28 requirement_.min_x++;
    +
    29 }
    +
    30
    +
    31 void SetBox(Box box) override {
    +
    32 box_ = box;
    +
    33 box.x_max--;
    +
    34 children_[0]->SetBox(box);
    +
    35 }
    +
    36
    +
    37 void Render(Screen& screen) final {
    +
    38 NodeDecorator::Render(screen);
    +
    39
    +
    40 const Box& stencil = screen.stencil;
    +
    41
    +
    42 const int size_inner = box_.y_max - box_.y_min;
    +
    43 if (size_inner <= 0) {
    +
    44 return;
    +
    45 }
    +
    46 const int size_outter = stencil.y_max - stencil.y_min + 1;
    +
    47 if (size_outter >= size_inner) {
    +
    48 return;
    +
    49 }
    +
    50
    +
    51 int size = 2 * size_outter * size_outter / size_inner;
    +
    52 size = std::max(size, 1);
    +
    53
    +
    54 const int start_y =
    +
    55 2 * stencil.y_min + //
    +
    56 2 * (stencil.y_min - box_.y_min) * size_outter / size_inner;
    +
    57
    +
    58 const int x = stencil.x_max;
    +
    59 for (int y = stencil.y_min; y <= stencil.y_max; ++y) {
    +
    60 const int y_up = 2 * y + 0;
    +
    61 const int y_down = 2 * y + 1;
    +
    62 const bool up = (start_y <= y_up) && (y_up <= start_y + size);
    +
    63 const bool down = (start_y <= y_down) && (y_down <= start_y + size);
    +
    64
    +
    65 const char* c = up ? (down ? "┃" : "╹") : (down ? "╻" : " "); // NOLINT
    +
    66 screen.PixelAt(x, y).character = c;
    +
    67 }
    +
    68 }
    +
    69 };
    +
    70 return std::make_shared<Impl>(std::move(child));
    +
    71}
    +
    +
    72
    +
    73/// @brief Display a horizontal scrollbar at the bottom.
    +
    74/// Colors follow the content.
    +
    75/// @ingroup dom
    +
    + +
    77 class Impl : public NodeDecorator {
    +
    78 using NodeDecorator::NodeDecorator;
    +
    79
    +
    80 void ComputeRequirement() override {
    +
    81 NodeDecorator::ComputeRequirement();
    +
    82 requirement_ = children_[0]->requirement();
    +
    83 requirement_.min_y++;
    +
    84 }
    +
    85
    +
    86 void SetBox(Box box) override {
    +
    87 box_ = box;
    +
    88 box.y_max--;
    +
    89 children_[0]->SetBox(box);
    +
    90 }
    +
    91
    +
    92 void Render(Screen& screen) final {
    +
    93 NodeDecorator::Render(screen);
    +
    94
    +
    95 const Box& stencil = screen.stencil;
    +
    96
    +
    97 const int size_inner = box_.x_max - box_.x_min;
    +
    98 if (size_inner <= 0) {
    +
    99 return;
    +
    100 }
    +
    101 const int size_outter = stencil.x_max - stencil.x_min + 1;
    +
    102 if (size_outter >= size_inner) {
    +
    103 return;
    +
    104 }
    +
    105
    +
    106 int size = 2 * size_outter * size_outter / size_inner;
    +
    107 size = std::max(size, 1);
    +
    108
    +
    109 const int start_x =
    +
    110 2 * stencil.x_min + //
    +
    111 2 * (stencil.x_min - box_.x_min) * size_outter / size_inner;
    +
    112
    +
    113 const int y = stencil.y_max;
    +
    114 for (int x = stencil.x_min; x <= stencil.x_max; ++x) {
    +
    115 const int x_left = 2 * x + 0;
    +
    116 const int x_right = 2 * x + 1;
    +
    117 const bool left = (start_x <= x_left) && (x_left <= start_x + size);
    +
    118 const bool right = (start_x <= x_right) && (x_right <= start_x + size);
    +
    119
    +
    120 const char* c =
    +
    121 left ? (right ? "─" : "╴") : (right ? "╶" : " "); // NOLINT
    +
    122 screen.PixelAt(x, y).character = c;
    +
    123 }
    +
    124 }
    +
    125 };
    +
    126 return std::make_shared<Impl>(std::move(child));
    +
    127}
    +
    +
    128
    +
    129} // namespace ftxui
    + + + +
    Element vscroll_indicator(Element)
    Display a vertical scrollbar on the right. Colors follow the content.
    +
    Element hscroll_indicator(Element)
    Display a horizontal scrollbar at the bottom. Colors follow the content.
    +
    std::string character
    Definition pixel.hpp:45
    +
    Pixel & PixelAt(int x, int y)
    Access a cell (Pixel) at a given position.
    Definition image.cpp:43
    +
    int x_max
    Definition box.hpp:18
    +
    int y_min
    Definition box.hpp:19
    +
    Box stencil
    Definition image.hpp:41
    +
    int y_max
    Definition box.hpp:20
    +
    int x_min
    Definition box.hpp:17
    +
    A rectangular grid of Pixel.
    Definition screen.hpp:26
    +
    Box is a structure that represents a rectangular area in a 2D space.
    Definition box.hpp:16
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    + + + +
    std::uint8_t left
    Definition screen.cpp:130
    +
    std::uint8_t down
    Definition screen.cpp:133
    +
    std::uint8_t right
    Definition screen.cpp:132
    + +
    +
    + + + + + diff --git a/scrollbar_8cpp.html b/scrollbar_8cpp.html new file mode 100644 index 000000000..2dfe1cdd8 --- /dev/null +++ b/scrollbar_8cpp.html @@ -0,0 +1,262 @@ + + + + + + + + +FTXUI: scrollbar.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    scrollbar.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + + +

    +Functions

    Component DummyWindowContent ()
     
    int main ()
     
    +

    Function Documentation

    + +

    ◆ DummyWindowContent()

    + +
    +
    + + + + + + + +
    Component DummyWindowContent ()
    +
    +
    Examples
    examples/component/scrollbar.cpp, and examples/component/window.cpp.
    +
    + +

    Definition at line 10 of file scrollbar.cpp.

    + +
    +
    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 87 of file scrollbar.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/scrollbar_8cpp.js b/scrollbar_8cpp.js new file mode 100644 index 000000000..87b3ef2a4 --- /dev/null +++ b/scrollbar_8cpp.js @@ -0,0 +1,5 @@ +var scrollbar_8cpp = +[ + [ "DummyWindowContent", "scrollbar_8cpp.html#a83db372d294b69185f7a26148935cfc3", null ], + [ "main", "scrollbar_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/scrollbar_8cpp_source.html b/scrollbar_8cpp_source.html new file mode 100644 index 000000000..97bfb0404 --- /dev/null +++ b/scrollbar_8cpp_source.html @@ -0,0 +1,359 @@ + + + + + + + + +FTXUI: scrollbar.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    scrollbar.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2023 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    + + +
    6#include <string>
    +
    7
    +
    8using namespace ftxui;
    +
    9
    +
    + +
    11 class Impl : public ComponentBase {
    +
    12 private:
    +
    13 float scroll_x = 0.1;
    +
    14 float scroll_y = 0.1;
    +
    15
    +
    16 public:
    +
    17 Impl() {
    +
    18 auto content = Renderer([=] {
    +
    19 const std::string lorem =
    +
    20 "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed "
    +
    21 "do eiusmod tempor incididunt ut labore et dolore magna "
    +
    22 "aliqua. Ut enim ad minim veniam, quis nostrud exercitation "
    +
    23 "ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis "
    +
    24 "aute irure dolor in reprehenderit in voluptate velit esse "
    +
    25 "cillum dolore eu fugiat nulla pariatur. Excepteur sint "
    +
    26 "occaecat cupidatat non proident, sunt in culpa qui officia "
    +
    27 "deserunt mollit anim id est laborum.";
    +
    28 return vbox({
    +
    29 text(lorem.substr(0, -1)), text(lorem.substr(5, -1)), text(""),
    +
    30 text(lorem.substr(10, -1)), text(lorem.substr(15, -1)), text(""),
    +
    31 text(lorem.substr(20, -1)), text(lorem.substr(25, -1)), text(""),
    +
    32 text(lorem.substr(30, -1)), text(lorem.substr(35, -1)), text(""),
    +
    33 text(lorem.substr(40, -1)), text(lorem.substr(45, -1)), text(""),
    +
    34 text(lorem.substr(50, -1)), text(lorem.substr(55, -1)), text(""),
    +
    35 text(lorem.substr(60, -1)), text(lorem.substr(65, -1)), text(""),
    +
    36 text(lorem.substr(70, -1)), text(lorem.substr(75, -1)), text(""),
    +
    37 text(lorem.substr(80, -1)), text(lorem.substr(85, -1)), text(""),
    +
    38 text(lorem.substr(90, -1)), text(lorem.substr(95, -1)), text(""),
    +
    39 text(lorem.substr(100, -1)), text(lorem.substr(105, -1)), text(""),
    +
    40 text(lorem.substr(110, -1)), text(lorem.substr(115, -1)), text(""),
    +
    41 text(lorem.substr(120, -1)), text(lorem.substr(125, -1)), text(""),
    +
    42 text(lorem.substr(130, -1)), text(lorem.substr(135, -1)), text(""),
    +
    43 text(lorem.substr(140, -1)),
    +
    44 });
    +
    45 });
    +
    46
    +
    47 auto scrollable_content = Renderer(content, [&, content] {
    +
    48 return content->Render() | focusPositionRelative(scroll_x, scroll_y) |
    +
    49 frame | flex;
    +
    50 });
    +
    51
    +
    52 SliderOption<float> option_x;
    +
    53 option_x.value = &scroll_x;
    +
    54 option_x.min = 0.f;
    +
    55 option_x.max = 1.f;
    +
    56 option_x.increment = 0.1f;
    +
    57 option_x.direction = Direction::Right;
    +
    58 option_x.color_active = Color::Blue;
    +
    59 option_x.color_inactive = Color::BlueLight;
    +
    60 auto scrollbar_x = Slider(option_x);
    +
    61
    +
    62 SliderOption<float> option_y;
    +
    63 option_y.value = &scroll_y;
    +
    64 option_y.min = 0.f;
    +
    65 option_y.max = 1.f;
    +
    66 option_y.increment = 0.1f;
    +
    67 option_y.direction = Direction::Down;
    +
    68 option_y.color_active = Color::Yellow;
    + +
    70 auto scrollbar_y = Slider(option_y);
    +
    71
    +
    72 Add(Container::Vertical({
    + +
    74 scrollable_content,
    +
    75 scrollbar_y,
    +
    76 }) | flex,
    +
    77 Container::Horizontal({
    +
    78 scrollbar_x,
    +
    79 Renderer([] { return text(L"x"); }),
    +
    80 }),
    +
    81 }));
    +
    82 }
    +
    83 };
    +
    84 return Make<Impl>();
    +
    85}
    +
    +
    86
    +
    +
    87int main() {
    +
    88 auto window_1 = Window({
    +
    89 .inner = DummyWindowContent(),
    +
    90 .title = "First window",
    +
    91 .width = 80,
    +
    92 .height = 30,
    +
    93 });
    +
    94
    +
    95 auto window_2 = Window({
    +
    96 .inner = DummyWindowContent(),
    +
    97 .title = "My window",
    +
    98 .left = 40,
    +
    99 .top = 20,
    +
    100 .width = 80,
    +
    101 .height = 30,
    +
    102 });
    +
    103
    +
    104 auto window_container = Container::Stacked({
    +
    105 window_1,
    +
    106 window_2,
    +
    107 });
    +
    108
    +
    109 auto screen = ScreenInteractive::Fullscreen();
    +
    110 screen.Loop(window_container);
    +
    111
    +
    112 return EXIT_SUCCESS;
    +
    113}
    +
    + +
    void Add(Component children)
    Add a child. @param child The child to be attached.
    Definition component.cpp:70
    +
    static ScreenInteractive Fullscreen()
    +
    It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ft...
    +
    Component Horizontal(Components children)
    A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow...
    +
    Component Renderer(Component child, std::function< Element()>)
    Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
    +
    Component Window(WindowOptions option)
    A draggeable / resizeable window. To use multiple of them, they must be stacked using Container::Stac...
    +
    Component Stacked(Components children)
    A list of components to be stacked on top of each other. Events are propagated to the first component...
    +
    Decorator focusPositionRelative(float x, float y)
    Used inside a frame, this force the view to be scrolled toward a a given position....
    +
    Element flex(Element)
    Make a child element to expand proportionally to the space left in a container.
    Definition flex.cpp:123
    +
    Element text(std::wstring text)
    Display a piece of unicode text.
    Definition text.cpp:160
    +
    Element vbox(Elements)
    A container displaying elements vertically one by one.
    Definition vbox.cpp:96
    + + + + + + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::shared_ptr< T > Make(Args &&... args)
    Definition component.hpp:27
    +
    Component Slider(SliderOption< T > options)
    A slider in any direction.
    +
    std::shared_ptr< ComponentBase > Component
    + +
    Component DummyWindowContent()
    Definition scrollbar.cpp:10
    +
    int main()
    Definition scrollbar.cpp:87
    + + + + + + + + +
    +
    + + + + + diff --git a/search/all_0.js b/search/all_0.js new file mode 100644 index 000000000..e4388f31c --- /dev/null +++ b/search/all_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['20_20modules_0',['C++20 Modules',['../cpp20-modules.html',1,'']]] +]; diff --git a/search/all_1.js b/search/all_1.js new file mode 100644 index 000000000..297594340 --- /dev/null +++ b/search/all_1.js @@ -0,0 +1,79 @@ +var searchData= +[ + ['a_0',['A',['../group__component.html#a6a0fe62e2e45aa9516d3d774dc405b0c',1,'ftxui::Event']]], + ['a_1',['a',['../group__component.html#a0dd476cbdcf3ab0b9bba76b7eb51dd18',1,'ftxui::Event']]], + ['a_20dependency_2',['Use as a Dependency',['../installation_nix.html#use-as-a-dependency',1,'']]], + ['a_20frame_20redraw_3',['Force a frame redraw.',['../module-component.html#component-force-redraw',1,'']]], + ['active_4',['Active',['../group__component.html#a52beef6d7a687d4d109e6cec1606e32e',1,'ftxui::ComponentBase::Active()'],['../group__component.html#a9dc30615370889030396a239ceee2a77',1,'ftxui::ScreenInteractive::Active()']]], + ['active_5',['active',['../structftxui_1_1EntryState.html#a03c996f9fcf0e10baeb3e700be0c409a',1,'ftxui::EntryState::active'],['../group__component.html#a5c04e41d802330270ae14a9861c1e2df',1,'ftxui::AnimatedColorOption::active'],['../group__component.html#a03c996f9fcf0e10baeb3e700be0c409a',1,'ftxui::WindowRenderState::active']]], + ['activechild_6',['ActiveChild',['../group__component.html#a5c421f00a2a7f50c542c5c286d2e696c',1,'ftxui::ComponentBase']]], + ['adapter_7',['Adapter',['../classftxui_1_1ConstStringListRef_1_1Adapter.html',1,'ConstStringListRef::Adapter'],['../classftxui_1_1ConstStringListRef_1_1Adapter.html#aeeff28a487da7a74856b51e966773246',1,'ftxui::ConstStringListRef::Adapter::Adapter()=default'],['../classftxui_1_1ConstStringListRef_1_1Adapter.html#afaf35b0fc91e998543942da0b2b9a3ee',1,'ftxui::ConstStringListRef::Adapter::Adapter(const Adapter &)=default'],['../classftxui_1_1ConstStringListRef_1_1Adapter.html#a5bcc41e3dec29c90da901ab45c95774a',1,'ftxui::ConstStringListRef::Adapter::Adapter(Adapter &&)=default']]], + ['add_8',['Add',['../group__component.html#a21f040bec9104e164bfa6c3ad45be3a1',1,'ftxui::ComponentBase::Add()'],['../classftxui_1_1TerminalInputParser.html#a4b2f1e271dd6ebbf5bad2418d960832a',1,'ftxui::TerminalInputParser::Add()']]], + ['addpart_9',['AddPart',['../group__dom.html#a9887e25feddebbf840876824cb3cbf61',1,'ftxui::Selection']]], + ['aletter_10',['ALetter',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aab1bb481a6d76de94d35e1d67cb85d966',1,'ftxui']]], + ['align_5fcontent_11',['align_content',['../group__dom.html#a103275cb09167852e469450cf8471256',1,'ftxui::FlexboxConfig']]], + ['align_5fitems_12',['align_items',['../group__dom.html#a1514fd3d64965c521555fdc2cf2002ce',1,'ftxui::FlexboxConfig']]], + ['align_5fright_13',['align_right',['../group__dom.html#ga778e52afe28f1978f1f7ef065ed92d6d',1,'ftxui']]], + ['aligncontent_14',['AlignContent',['../group__dom.html#a1f99410fd0fc632a5bc2497b6a447420',1,'ftxui::FlexboxConfig']]], + ['alignitems_15',['AlignItems',['../group__dom.html#a821af961ece5fe13540ad48b54c7a9e7',1,'ftxui::FlexboxConfig']]], + ['alta_16',['AltA',['../group__component.html#a9afff79ad622a8deab0c1106610bd635',1,'ftxui::Event']]], + ['altb_17',['AltB',['../group__component.html#ab72b86bd630ac23d469394b4f115d388',1,'ftxui::Event']]], + ['altc_18',['AltC',['../group__component.html#a527184b90a16487888d646d44e0e8a6b',1,'ftxui::Event']]], + ['altd_19',['AltD',['../group__component.html#aaeed8e5d3503dc5418978329168cc455',1,'ftxui::Event']]], + ['alte_20',['AltE',['../group__component.html#adbc22b402e7e8e7a25ea8da614e84082',1,'ftxui::Event']]], + ['altf_21',['AltF',['../group__component.html#a13f05bbf8f71e0ecd73bca163018e2b5',1,'ftxui::Event']]], + ['altg_22',['AltG',['../group__component.html#a6e26660f8ded2ee68c00bbd09247f007',1,'ftxui::Event']]], + ['alth_23',['AltH',['../group__component.html#a1365e5d1a530aca80da90dfe10b48cbc',1,'ftxui::Event']]], + ['alti_24',['AltI',['../group__component.html#ac728998d6c0e0a9b59e31987e9292c1e',1,'ftxui::Event']]], + ['altj_25',['AltJ',['../group__component.html#ab2b4e0ee4d2db65374b1111553dc96f9',1,'ftxui::Event']]], + ['altk_26',['AltK',['../group__component.html#a4d2a42120ce47e7fa7cd5237d61cf9c5',1,'ftxui::Event']]], + ['altl_27',['AltL',['../group__component.html#a2d0b55c600a1ae7c0406dfad3c31c591',1,'ftxui::Event']]], + ['altm_28',['AltM',['../group__component.html#a59dc4d656241c7f76433d0103e8e6934',1,'ftxui::Event']]], + ['altn_29',['AltN',['../group__component.html#a9a6e150b0940479d2dd24f039f91675c',1,'ftxui::Event']]], + ['alto_30',['AltO',['../group__component.html#a76c653ab37318c4bb6a2832c9cf1d612',1,'ftxui::Event']]], + ['altp_31',['AltP',['../group__component.html#acabec40a30b5854999e774d0a1f3342e',1,'ftxui::Event']]], + ['altq_32',['AltQ',['../group__component.html#a26ff1602105cf0df822f8b370be63fdd',1,'ftxui::Event']]], + ['altr_33',['AltR',['../group__component.html#a7edddb7c159929157b0bf0b0deb7e4e0',1,'ftxui::Event']]], + ['alts_34',['AltS',['../group__component.html#ad1becc889768aafe7e452bc529f3bc4c',1,'ftxui::Event']]], + ['altt_35',['AltT',['../group__component.html#a06b17875059c0e92f716c0463ca60e86',1,'ftxui::Event']]], + ['altu_36',['AltU',['../group__component.html#a95b1b6528a78575ca07954600c45f805',1,'ftxui::Event']]], + ['altv_37',['AltV',['../group__component.html#ae5063b138286493e68fa140af2c3e4e6',1,'ftxui::Event']]], + ['altw_38',['AltW',['../group__component.html#a35ad37bd8fb24e3ce38df9c3b61ef4e5',1,'ftxui::Event']]], + ['altx_39',['AltX',['../group__component.html#aec5dcc79e3d6c86ce71306a57b49b48c',1,'ftxui::Event']]], + ['alty_40',['AltY',['../group__component.html#a2a7b9d5b6dc8ce1529bd58b5f196cf91',1,'ftxui::Event']]], + ['altz_41',['AltZ',['../group__component.html#aaac4eb7051d6901cf79fa32b46bface9',1,'ftxui::Event']]], + ['and_20ubuntu_20packages_20unofficial_42',['Debian and Ubuntu Packages (Unofficial)',['../installation_debian.html#debian-and-ubuntu-packages-unofficial',1,'']]], + ['angle_43',['Angle',['../group__dom.html#a251d447c54f49914a2cbf5dc16fc8b5b',1,'ftxui::LinearGradient']]], + ['angle_44',['angle',['../group__dom.html#ab8ef1bf8a70cc07c6d55823c390a7e76',1,'ftxui::LinearGradient::angle'],['../src_2ftxui_2dom_2linear__gradient_8cpp.html#ab8ef1bf8a70cc07c6d55823c390a7e76',1,'angle: linear_gradient.cpp']]], + ['animated_45',['Animated',['../group__component.html#a008018822835ed0f3758af3c6e72837d',1,'ftxui::ButtonOption::Animated()'],['../group__component.html#a1a78fe7bb802251805a3867ba1a31e15',1,'ftxui::ButtonOption::Animated(Color color)'],['../group__component.html#a0295430ca4a317b0cbba9ee5faa4a324',1,'ftxui::ButtonOption::Animated(Color background, Color foreground)'],['../group__component.html#adf705e582d884e89211b540a97f2e090',1,'ftxui::ButtonOption::Animated(Color background, Color foreground, Color background_active, Color foreground_active)']]], + ['animated_5fcolors_46',['animated_colors',['../group__component.html#ab7131557fbe84a6b4b2f2ffcff7d44f0',1,'ftxui::MenuEntryOption::animated_colors'],['../group__component.html#ab7131557fbe84a6b4b2f2ffcff7d44f0',1,'ftxui::ButtonOption::animated_colors']]], + ['animatedcoloroption_47',['AnimatedColorOption',['../group__component.html#structftxui_1_1AnimatedColorOption',1,'ftxui']]], + ['animatedcolorsoption_48',['AnimatedColorsOption',['../structftxui_1_1AnimatedColorsOption.html',1,'ftxui']]], + ['animation_2ecpp_49',['animation.cpp',['../animation_8cpp.html',1,'']]], + ['animation_2ecppm_50',['animation.cppm',['../animation_8cppm.html',1,'']]], + ['animation_2ehpp_51',['animation.hpp',['../animation_8hpp.html',1,'']]], + ['animationtask_52',['AnimationTask',['../classftxui_1_1AnimationTask.html',1,'ftxui']]], + ['animator_53',['Animator',['../classftxui_1_1animation_1_1Animator.html',1,'Animator'],['../classftxui_1_1animation_1_1Animator.html#a03909a0243b559e18e21996ccacdc8b6',1,'ftxui::animation::Animator::Animator()']]], + ['applyshader_54',['ApplyShader',['../group__screen.html#a04d18c0cb0df3ed7a01ca5c3b8711ff7',1,'ftxui::Screen']]], + ['aquamarine1_55',['Aquamarine1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf54d1112226e67ee67339a050ae1b352',1,'ftxui::Color']]], + ['aquamarine1bis_56',['Aquamarine1Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa4db1324d99372274e2414031d1773151',1,'ftxui::Color']]], + ['aquamarine3_57',['Aquamarine3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfadc172e17e6f05d6e2b0e48c85803a85a',1,'ftxui::Color']]], + ['arch_20linux_58',['Arch Linux',['../installation_arch.html',1,'installation']]], + ['arrowdown_59',['ArrowDown',['../group__component.html#a9d2a831cf68bf2185a3c56c2e09b2f23',1,'ftxui::Event']]], + ['arrowdownctrl_60',['ArrowDownCtrl',['../group__component.html#aeb40ca3ed1e25a8a02cec6e94f20cd01',1,'ftxui::Event']]], + ['arrowleft_61',['ArrowLeft',['../group__component.html#ae1b59315a513c99ac3095bc42dff0d94',1,'ftxui::Event']]], + ['arrowleftctrl_62',['ArrowLeftCtrl',['../group__component.html#a05941a0e87f230113219319b1ce8a6b2',1,'ftxui::Event']]], + ['arrowright_63',['ArrowRight',['../group__component.html#afed9a747f55d4564e4f749bea1de4022',1,'ftxui::Event']]], + ['arrowrightctrl_64',['ArrowRightCtrl',['../group__component.html#af7861733aa43e55da68824c10e164dd1',1,'ftxui::Event']]], + ['arrowup_65',['ArrowUp',['../group__component.html#a916bd0ae3c86941b660d9a07980bb0c9',1,'ftxui::Event']]], + ['arrowupctrl_66',['ArrowUpCtrl',['../group__component.html#abcf6d1b9fe64b9a6376e1d6c486d802b',1,'ftxui::Event']]], + ['as_20a_20dependency_67',['Use as a Dependency',['../installation_nix.html#use-as-a-dependency',1,'']]], + ['ascii_68',['Ascii',['../group__component.html#a66e244b326f3cdc7b80ea836c391c34b',1,'ftxui::ButtonOption']]], + ['asked_5f_69',['asked_',['../flexbox_8cpp.html#a020ee158f0c398a7ffd442a82bb878d0',1,'flexbox.cpp']]], + ['at_70',['at',['../group__screen.html#a55b0a995463c6936efb33391f29565bc',1,'ftxui::Image::at(int x, int y)'],['../group__screen.html#a0882d58bb8ca1be9953135338456cf9e',1,'ftxui::Image::at(int x, int y) const']]], + ['automerge_71',['automerge',['../group__screen.html#ada8b6dbd466ba5b6c4b240f229bd627f',1,'ftxui::Pixel::automerge'],['../group__dom.html#gaca42bd6c44d8d366d5c1014330402086',1,'ftxui::automerge()']]], + ['automerge_2ecpp_72',['automerge.cpp',['../automerge_8cpp.html',1,'']]], + ['autoreset_73',['AutoReset',['../classftxui_1_1AutoReset.html',1,'AutoReset< T >'],['../classftxui_1_1AutoReset.html#ae393855d753027bcb3d4d1e1514e6ad4',1,'ftxui::AutoReset::AutoReset(T *variable, T new_value)'],['../classftxui_1_1AutoReset.html#a5280cdbbbecce1de0ae69bfdca10d7ed',1,'ftxui::AutoReset::AutoReset(const AutoReset &)=delete'],['../classftxui_1_1AutoReset.html#aaef5fed3c034c065dfc218244e112a4e',1,'ftxui::AutoReset::AutoReset(AutoReset &&)=delete']]], + ['autoreset_2ecppm_74',['autoreset.cppm',['../autoreset_8cppm.html',1,'']]], + ['autoreset_2ehpp_75',['autoreset.hpp',['../autoreset_8hpp.html',1,'']]] +]; diff --git a/search/all_10.js b/search/all_10.js new file mode 100644 index 000000000..2861dbed8 --- /dev/null +++ b/search/all_10.js @@ -0,0 +1,66 @@ +var searchData= +[ + ['p_0',['P',['../group__component.html#adbe5783b3283110278f68e58bb286b9f',1,'ftxui::Event']]], + ['p_1',['p',['../group__component.html#a6e9d231eb7f1a65490a68e31131c945b',1,'ftxui::Event']]], + ['package_2',['Vcpkg Package',['../installation_vcpkg.html#vcpkg-package',1,'']]], + ['package_20unofficial_3',['Package Unofficial',['../installation_opensuse.html#opensuse-package-unofficial',1,'openSUSE Package (Unofficial)'],['../installation_xmake.html#xmake-package-unofficial',1,'XMake Package (Unofficial)']]], + ['package_5fmanager_4',['package_manager',['../module-dom-examples.html#package_manager',1,'']]], + ['package_5fmanager_2ecpp_5',['package_manager.cpp',['../package__manager_8cpp.html',1,'']]], + ['packages_20unofficial_6',['Debian and Ubuntu Packages (Unofficial)',['../installation_debian.html#debian-and-ubuntu-packages-unofficial',1,'']]], + ['pagedown_7',['PageDown',['../group__component.html#acc3462fea2a9b2085734ff87dc881b4c',1,'ftxui::Event']]], + ['pageup_8',['PageUp',['../group__component.html#a21ae13b6dcbc80ed6549a5afab248477',1,'ftxui::Event']]], + ['palegreen1_9',['PaleGreen1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa37e5d9f46ab5a7952f9cdf0a3cc8925',1,'ftxui::Color']]], + ['palegreen1bis_10',['PaleGreen1Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa115628c4a676f43dc9a5791c927e7048',1,'ftxui::Color']]], + ['palegreen3_11',['PaleGreen3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa73f2e82908260a1c80e9cdffd7c80b05',1,'ftxui::Color']]], + ['palegreen3bis_12',['PaleGreen3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa05657d514246de9444d35bfd78da177d',1,'ftxui::Color']]], + ['palette1_13',['Palette1',['../group__screen.html#aa4be56f94fc180d7b070df23c235b0c7',1,'ftxui::Color::Palette1'],['../group__screen.html#ggab87bacfdad76e61b9412d7124be44c1caf8fee1420fe204b3dafbacf27a545c41',1,'ftxui::Terminal::Palette1']]], + ['palette16 _14',['Palette16 ',['../module-dom.html#dom-colors-palette-16',1,'']]], + ['palette16_15',['Palette16',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802f',1,'ftxui::Color::Palette16'],['../group__screen.html#ggab87bacfdad76e61b9412d7124be44c1cae5a76102d821ec8233fee04273c60349',1,'ftxui::Terminal::Palette16']]], + ['palette256 _16',['Palette256 ',['../module-dom.html#dom-colors-palette-256',1,'']]], + ['palette256_17',['Palette256',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcf',1,'ftxui::Color::Palette256'],['../group__screen.html#ggab87bacfdad76e61b9412d7124be44c1ca7b88ab2a5c8fe8866c96ea4acb623876',1,'ftxui::Terminal::Palette256']]], + ['palette256_18',['palette256',['../namespaceftxui.html#acc77ce2876ca75e8d5fe8925a45592d1',1,'ftxui']]], + ['paleturquoise1_19',['PaleTurquoise1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2c1b8b84117604af63923758665c0762',1,'ftxui::Color']]], + ['paleturquoise4_20',['PaleTurquoise4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfafebf48dd9c5efb72a880db1800b70cb4',1,'ftxui::Color']]], + ['palevioletred1_21',['PaleVioletRed1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7b52566a531a122cc807cd5698659f6f',1,'ftxui::Color']]], + ['paragraph _22',['paragraph ',['../module-dom.html#dom-paragraph',1,'']]], + ['paragraph_23',['paragraph',['../namespaceftxui.html#ac54cdd05db30871ce082a8fa650545da',1,'ftxui::paragraph(std::wstring text)'],['../group__dom.html#ga3f9093ae1a2790d396fc2cff9990fbbd',1,'ftxui::paragraph(const std::string &the_text)'],['../module-dom-examples.html#paragraph',1,'paragraph']]], + ['paragraphaligncenter_24',['paragraphAlignCenter',['../group__dom.html#ga6a105f6b0d07d7933379ff1ae9282fb8',1,'ftxui']]], + ['paragraphalignjustify_25',['paragraphAlignJustify',['../group__dom.html#gae4de548aa67ab77cb345e4ddec6b248b',1,'ftxui']]], + ['paragraphalignleft_26',['paragraphAlignLeft',['../group__dom.html#gaa334a836eccc573e1137a1ba29d07d8a',1,'ftxui']]], + ['paragraphalignright_27',['paragraphAlignRight',['../group__dom.html#ga28a69f06a88c89fe7a507e33ab486411',1,'ftxui']]], + ['params_28',['Params',['../classftxui_1_1animation_1_1Params.html',1,'Params'],['../classftxui_1_1animation_1_1Params.html#a27854a0925475df9b926b03808cc8d8c',1,'ftxui::animation::Params::Params()']]], + ['parent_29',['Parent',['../group__component.html#aaf284a408631f31558694973a04186c2',1,'ftxui::ComponentBase']]], + ['password_30',['password',['../group__component.html#a927bd46792ffe38c7545a764d847d066',1,'ftxui::InputOption']]], + ['pendingtask_31',['PendingTask',['../structftxui_1_1task_1_1PendingTask.html',1,'PendingTask'],['../structftxui_1_1task_1_1PendingTask.html#afc8e67df1a9259a50e7afa49765cb7c8',1,'ftxui::task::PendingTask::PendingTask(Task t)'],['../structftxui_1_1task_1_1PendingTask.html#a5e36044e86c7936eee25d0ff222b7235',1,'ftxui::task::PendingTask::PendingTask(Task t, std::chrono::steady_clock::duration duration)']]], + ['pink1_32',['Pink1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfab1b14b4665532f810353fbd89ba7bf69',1,'ftxui::Color']]], + ['pink3_33',['Pink3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa18d97cfab35116e2049378e4410b0563',1,'ftxui::Color']]], + ['pixel_34',['Pixel',['../group__screen.html#structftxui_1_1Pixel',1,'Pixel'],['../group__screen.html#a3d22dc2630f1c1c69ec973cd4648b5d5',1,'ftxui::Pixel::Pixel()']]], + ['pixel_2ecppm_35',['pixel.cppm',['../pixel_8cppm.html',1,'']]], + ['pixel_2ehpp_36',['pixel.hpp',['../pixel_8hpp.html',1,'']]], + ['pixelat_37',['PixelAt',['../group__screen.html#a483f8ee1967e200cfc9e277b3ce00174',1,'ftxui::Image::PixelAt(int x, int y)'],['../group__screen.html#a03b2b39bb8f4d72068744776093125b3',1,'ftxui::Image::PixelAt(int x, int y) const']]], + ['pixels_5f_38',['pixels_',['../group__screen.html#aeab8c1788b3f2c7403749c3be95a68ae',1,'ftxui::Image']]], + ['placeholder_39',['placeholder',['../group__component.html#aaca8e18f9fe70089d8fd4165f4b518e1',1,'ftxui::InputOption']]], + ['platforms_40',['Supported Platforms',['../index.html#supported-platforms',1,'']]], + ['plum1_41',['Plum1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa3c254e3ced4cbe2836a246270317ac1',1,'ftxui::Color']]], + ['plum2_42',['Plum2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa383cc742bb6efae64c17af4b0159f2f1',1,'ftxui::Color']]], + ['plum3_43',['Plum3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfab2b302d3a548112c82dbe295f1cace40',1,'ftxui::Color']]], + ['plum4_44',['Plum4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa69b6a24bf00f2a9278f12241e176106c',1,'ftxui::Color']]], + ['position_45',['position',['../structftxui_1_1LinearGradient_1_1Stop.html#a2f3c9e83b473a71f2882ee1ec4fb88de',1,'ftxui::LinearGradient::Stop']]], + ['positions_46',['positions',['../src_2ftxui_2dom_2linear__gradient_8cpp.html#af3fd42b7427cb742f96e7ec3244fb7cf',1,'linear_gradient.cpp']]], + ['post_47',['Post',['../group__component.html#a49209b09dcf8bc540f79e2bfd0a7ee88',1,'ftxui::ScreenInteractive']]], + ['postdelayedtask_48',['PostDelayedTask',['../classftxui_1_1task_1_1TaskRunner.html#a9ed72fa10b2d44bb1af7bd8af64dd28b',1,'ftxui::task::TaskRunner']]], + ['postevent_49',['PostEvent',['../group__component.html#a29e75bdaa1d5465518787ec014b2c3bf',1,'ftxui::ScreenInteractive']]], + ['posttask_50',['PostTask',['../structftxui_1_1task_1_1TaskQueue.html#ada41a34871c48f856bf3659e0b0c4f81',1,'ftxui::task::TaskQueue::PostTask()'],['../classftxui_1_1task_1_1TaskRunner.html#a6265a2d99ef09d491365c21a4a703c71',1,'ftxui::task::TaskRunner::PostTask()']]], + ['prefer_51',['Prefer',['../structftxui_1_1Requirement_1_1Focused.html#a8a204963959c73e971c7d030cbc34134',1,'ftxui::Requirement::Focused']]], + ['pressed_52',['Pressed',['../group__component.html#a099c889d2b948b264c7a665b66e3a9b6a05f4abb2322aa023aba9570c327aff25',1,'ftxui::Mouse']]], + ['print_53',['Print',['../group__screen.html#acfe358aa128835387b6c2b7ffe22bab5',1,'ftxui::Color::Print()'],['../group__screen.html#ad93edbe885499a712129356f1ffd506b',1,'ftxui::Screen::Print()']]], + ['print_5fkey_5fpress_54',['print_key_press',['../module-component-examples.html#print_key_press',1,'']]], + ['print_5fkey_5fpress_2ecpp_55',['print_key_press.cpp',['../print__key__press_8cpp.html',1,'']]], + ['private_56',['Private',['../classftxui_1_1ScreenInteractive_1_1Private.html',1,'ScreenInteractive::Private'],['../group__component.html#a55bfcd8369da28d548069f2761d2c39f',1,'ftxui::ScreenInteractive::Private']]], + ['project_57',['Starter Project',['../installation_bazel.html#starter-project',1,'']]], + ['purple_58',['Purple',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0102772e56e7f068bdb57bf2905f7c09',1,'ftxui::Color']]], + ['purple3_59',['Purple3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa3ba6254f6df4ad7c05ee0be4ccd4bce0',1,'ftxui::Color']]], + ['purple4_60',['Purple4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfacb508ce5a099dbfa4e04cd59530f7f0c',1,'ftxui::Color']]], + ['purple4bis_61',['Purple4Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa1dfe93e583d4f1a3538c40ce29208e64',1,'ftxui::Color']]], + ['purplebis_62',['PurpleBis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfae855e26440338753abef27e7b999ce5b',1,'ftxui::Color']]] +]; diff --git a/search/all_11.js b/search/all_11.js new file mode 100644 index 000000000..193fd5240 --- /dev/null +++ b/search/all_11.js @@ -0,0 +1,14 @@ +var searchData= +[ + ['q_0',['Q',['../group__component.html#a1ff5f6b99205a10c360cd51ec758ac5c',1,'ftxui::Event']]], + ['q_1',['q',['../group__component.html#aa636a5e07d605ae7bf53b02f8b17b4bf',1,'ftxui::Event']]], + ['quadraticin_2',['QuadraticIn',['../namespaceftxui_1_1animation_1_1easing.html#ab0b9303e7f956c36960e601f158e488f',1,'ftxui::animation::easing']]], + ['quadraticinout_3',['QuadraticInOut',['../namespaceftxui_1_1animation_1_1easing.html#a8155757f48a6e85e27da99c0a93f7e8d',1,'ftxui::animation::easing']]], + ['quadraticout_4',['QuadraticOut',['../namespaceftxui_1_1animation_1_1easing.html#aa1618a8f59ae7bae191d0ab36bf90e66',1,'ftxui::animation::easing']]], + ['quarticin_5',['QuarticIn',['../namespaceftxui_1_1animation_1_1easing.html#af60268bac4059d32b3f7680042dba350',1,'ftxui::animation::easing']]], + ['quarticinout_6',['QuarticInOut',['../namespaceftxui_1_1animation_1_1easing.html#a72dd2cb5c7ffddfe3a3d8b455f68d37e',1,'ftxui::animation::easing']]], + ['quarticout_7',['QuarticOut',['../namespaceftxui_1_1animation_1_1easing.html#a8878f359f37551ae64eb183af3ca93b8',1,'ftxui::animation::easing']]], + ['quinticin_8',['QuinticIn',['../namespaceftxui_1_1animation_1_1easing.html#ab4eae8c5808cc6ab161037659e761a50',1,'ftxui::animation::easing']]], + ['quinticinout_9',['QuinticInOut',['../namespaceftxui_1_1animation_1_1easing.html#afcbc9e6b461fe3418a59faf4a5f9284d',1,'ftxui::animation::easing']]], + ['quinticout_10',['QuinticOut',['../namespaceftxui_1_1animation_1_1easing.html#aae2598b1aa6a2fc944f52edbf0453fd5',1,'ftxui::animation::easing']]] +]; diff --git a/search/all_12.js b/search/all_12.js new file mode 100644 index 000000000..a2a88d195 --- /dev/null +++ b/search/all_12.js @@ -0,0 +1,78 @@ +var searchData= +[ + ['r_0',['R',['../group__component.html#a587f0654c3c66dc8739b421c29dbe8a7',1,'ftxui::Event']]], + ['r_1',['r',['../group__component.html#a953b41738801a5ec92b15681aed4a3a9',1,'ftxui::Event']]], + ['radiobox_2',['RadioBox',['../module-component.html#component-radiobox',1,'']]], + ['radiobox_3',['Radiobox',['../group__component.html#ga3e7a44f321fa910f07aef5879e67af95',1,'ftxui::Radiobox(RadioboxOption option)'],['../group__component.html#gac73eebf15ff6b5386b7ee6c6cb4a4890',1,'ftxui::Radiobox(ConstStringListRef entries, int *selected, RadioboxOption option)']]], + ['radiobox_4',['radiobox',['../group__component.html#a83288bb2ebb6ca0eef0651285a71291e',1,'ftxui::DropdownOption::radiobox'],['../module-component-examples.html#radiobox',1,'radiobox']]], + ['radiobox_5fin_5fframe_5',['radiobox_in_frame',['../module-component-examples.html#radiobox_in_frame',1,'']]], + ['radiobox_5fin_5fframe_2ecpp_6',['radiobox_in_frame.cpp',['../radiobox__in__frame_8cpp.html',1,'']]], + ['radioboxoption_7',['RadioboxOption',['../group__component.html#structftxui_1_1RadioboxOption',1,'ftxui']]], + ['receive_8',['Receive',['../classftxui_1_1ReceiverImpl.html#a2d2bc6945a964ecb739002cc58291bee',1,'ftxui::ReceiverImpl']]], + ['receivenonblocking_9',['ReceiveNonBlocking',['../classftxui_1_1ReceiverImpl.html#a3afe67ce4b9296787d4133866e0b2b00',1,'ftxui::ReceiverImpl']]], + ['receiver_10',['Receiver',['../namespaceftxui.html#a7abbe763f26611fbf3902861863b7659',1,'ftxui']]], + ['receiver_2ecppm_11',['receiver.cppm',['../receiver_8cppm.html',1,'']]], + ['receiver_2ehpp_12',['receiver.hpp',['../receiver_8hpp.html',1,'']]], + ['receiverimpl_13',['ReceiverImpl',['../classftxui_1_1ReceiverImpl.html',1,'ReceiverImpl< T >'],['../classftxui_1_1ReceiverImpl.html#a06cce9969ba99f4e42c24dbce9662a3a',1,'ftxui::ReceiverImpl::ReceiverImpl()']]], + ['red_14',['Red',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802fad3163c1fcda01965b692ec2c3122b743',1,'ftxui::Color']]], + ['red_15',['red',['../group__screen.html#ad47d918910aaa51c73160ac85999d09c',1,'ftxui::ColorInfo']]], + ['red1_16',['Red1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa62acd44726f02a17ba2a17c1cf253639',1,'ftxui::Color']]], + ['red3_17',['Red3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa37bd25cf1e1fe1eeb8e4840dbc863dac',1,'ftxui::Color']]], + ['red3bis_18',['Red3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2925c3081d309e0d11612a0dcd564379',1,'ftxui::Color']]], + ['redlight_19',['RedLight',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802fa0a04dda6f997cd48c0ca74203c501d27',1,'ftxui::Color']]], + ['redraw_20',['Force a frame redraw.',['../module-component.html#component-force-redraw',1,'']]], + ['ref_21',['Ref',['../classftxui_1_1Ref.html',1,'Ref< T >'],['../classftxui_1_1Ref.html#a6170df9accd9f47736e97385233017b3',1,'ftxui::Ref::Ref()=default'],['../classftxui_1_1Ref.html#ab19bb3d5a2b0867c790f00f339915c56',1,'ftxui::Ref::Ref(T t)'],['../classftxui_1_1Ref.html#ae16b183b63cb1d7ef3d11ff47c158a8b',1,'ftxui::Ref::Ref(T *t)'],['../classftxui_1_1Ref.html#aec110a549f4e384fb89896bd013cc8fe',1,'ftxui::Ref::Ref(const Ref< T > &)=default'],['../classftxui_1_1Ref.html#af37c209213693451d05f4b089402ee07',1,'ftxui::Ref::Ref(Ref< T > &&) noexcept=default']]], + ['ref_2ecppm_22',['ref.cppm',['../ref_8cppm.html',1,'']]], + ['ref_2ehpp_23',['ref.hpp',['../ref_8hpp.html',1,'']]], + ['ref_3c_20bool_20_3e_24',['Ref< bool >',['../classftxui_1_1Ref.html',1,'ftxui']]], + ['ref_3c_20direction_20_3e_25',['Ref< Direction >',['../classftxui_1_1Ref.html',1,'ftxui']]], + ['ref_3c_20int_20_3e_26',['Ref< int >',['../classftxui_1_1Ref.html',1,'ftxui']]], + ['ref_3c_20std_3a_3astring_20_3e_27',['Ref< std::string >',['../classftxui_1_1Ref.html',1,'ftxui']]], + ['reflect_28',['reflect',['../namespaceftxui.html#aaff8245861617a3d9e846e99de582a63',1,'ftxui']]], + ['reflect_2ecpp_29',['reflect.cpp',['../reflect_8cpp.html',1,'']]], + ['regional_5findicator_30',['Regional_Indicator',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aa7f219844b91c2bb3bdb5fb7ffbdfca72',1,'ftxui']]], + ['registerhyperlink_31',['RegisterHyperlink',['../group__screen.html#a38015a8bc3dda474354ec8a374a6e2de',1,'ftxui::Screen']]], + ['released_32',['Released',['../group__component.html#a099c889d2b948b264c7a665b66e3a9b6ad9417ac74f0134b9577d1d85cf422c25',1,'ftxui::Mouse']]], + ['render_33',['Render',['../group__component.html#a28d41d6113c5b29c8dd45846582b3299',1,'ftxui::ComponentBase::Render()'],['../group__dom.html#a7e286fe14880614686ceeec84a9a9702',1,'ftxui::Node::Render(Screen &screen)'],['../group__dom.html#ab35030b64136afa183d474d11bd1f6dd',1,'ftxui::Node::Render'],['../group__dom.html#a28d41d6113c5b29c8dd45846582b3299',1,'ftxui::Table::Render()'],['../group__dom.html#gad4b8aa9392f56ba41e2b421e046a7d83',1,'ftxui::Render(Screen &screen, const Element &element)'],['../group__dom.html#ga32a24db985fa1b37bf686b00f7e1b4ff',1,'ftxui::Render(Screen &screen, Node *node)'],['../namespaceftxui.html#ab35030b64136afa183d474d11bd1f6dd',1,'ftxui::Render(Screen &screen, Node *node, Selection &selection)']]], + ['render_34',['render',['../structftxui_1_1WindowOptions.html#aa3858f495756090a379c564844eaf342',1,'ftxui::WindowOptions']]], + ['renderer_35',['Renderer',['../group__component.html#ga533e883e2aeea28de2b60564fcaf0361',1,'ftxui::Renderer(Component child, std::function< Element()> render)'],['../group__component.html#gaf03d3df7243bf71bb1a73686628f7f2b',1,'ftxui::Renderer(std::function< Element()> render)'],['../group__component.html#ga099cb57274a99396ee10f38acbfe62a7',1,'ftxui::Renderer(std::function< Element(bool)> render)'],['../group__component.html#ga41d63b7af41dee1570b54915821abd30',1,'ftxui::Renderer(ElementDecorator decorator)'],['../module-component.html#component-renderer',1,'Renderer']]], + ['renderer_36',['renderer',['../module-component-examples.html#renderer',1,'']]], + ['requestanimationframe_37',['RequestAnimationFrame',['../group__component.html#ad94d3d42aba3359550759aae5bcffbe9',1,'ftxui::ScreenInteractive::RequestAnimationFrame()'],['../group__component.html#gad94d3d42aba3359550759aae5bcffbe9',1,'ftxui::animation::RequestAnimationFrame()']]], + ['requirement_38',['Requirement',['../group__dom.html#structftxui_1_1Requirement',1,'ftxui']]], + ['requirement_39',['requirement',['../group__dom.html#a39a263e8c8786dc62fcb4d734aad7fe6',1,'ftxui::Node']]], + ['requirement_2ecppm_40',['requirement.cppm',['../requirement_8cppm.html',1,'']]], + ['requirement_2ehpp_41',['requirement.hpp',['../requirement_8hpp.html',1,'']]], + ['requirement_5f_42',['requirement_',['../group__dom.html#a3530d99687053ce0d0006b9dee9a1ca7',1,'ftxui::Node']]], + ['resetposition_43',['ResetPosition',['../group__screen.html#a9677c078c4270afdb7451cdc0b0871d4',1,'ftxui::Screen']]], + ['resizable_5fsplit_44',['resizable_split',['../module-component-examples.html#resizable_split',1,'']]], + ['resizablesplit_45',['ResizableSplit',['../namespaceftxui.html#a5ce41caeafc35dedc5c7da5347386e80',1,'ftxui::ResizableSplit()'],['../module-component.html#component-resizable-split',1,'ResizableSplit']]], + ['resizablesplitbottom_46',['ResizableSplitBottom',['../group__component.html#gacb75e6e61a021829893f7b57aeb7e3a2',1,'ftxui']]], + ['resizablesplitleft_47',['ResizableSplitLeft',['../group__component.html#gae2205fc172615b43e1e3307bb614be4c',1,'ftxui']]], + ['resizablesplitoption_48',['ResizableSplitOption',['../structftxui_1_1ResizableSplitOption.html',1,'ftxui']]], + ['resizablesplitright_49',['ResizableSplitRight',['../group__component.html#ga9030d0beb64f653603cab382b02750a8',1,'ftxui']]], + ['resizablesplittop_50',['ResizableSplitTop',['../group__component.html#ga238b4b650aca14716b82b2198695e008',1,'ftxui']]], + ['resize_51',['resize',['../group__component.html#a47beb6819c84c39255cb60f5710714ce',1,'ftxui::WindowRenderState']]], + ['resize_5fdown_52',['resize_down',['../structftxui_1_1WindowOptions.html#a0e28320aa6145db8201aebb07162d461',1,'ftxui::WindowOptions']]], + ['resize_5fdown_5f_53',['resize_down_',['../src_2ftxui_2component_2window_8cpp.html#abb5820730ee5ac08f5623d866a8b6777',1,'window.cpp']]], + ['resize_5fleft_54',['resize_left',['../structftxui_1_1WindowOptions.html#a17b2004b29ac06ad2b486d923fad0dbb',1,'ftxui::WindowOptions']]], + ['resize_5fleft_5f_55',['resize_left_',['../src_2ftxui_2component_2window_8cpp.html#a11cd63ba8957337034d3351d3b416030',1,'window.cpp']]], + ['resize_5fright_56',['resize_right',['../structftxui_1_1WindowOptions.html#abaa0c8009acea8039e5b6f5bab86c4dc',1,'ftxui::WindowOptions']]], + ['resize_5fright_5f_57',['resize_right_',['../src_2ftxui_2component_2window_8cpp.html#a435bdeaeaea854a80f574fbfda91032f',1,'window.cpp']]], + ['resize_5ftop_58',['resize_top',['../structftxui_1_1WindowOptions.html#a8885b0a965d3975426bd615b2fef3542',1,'ftxui::WindowOptions']]], + ['resize_5ftop_5f_59',['resize_top_',['../src_2ftxui_2component_2window_8cpp.html#a12f0c5cd8f00f860d8fb47550f0af746',1,'window.cpp']]], + ['return_60',['Return',['../group__component.html#ad3ab0b5bcc923c4b994080d45b97e36b',1,'ftxui::Event']]], + ['rgb_61',['RGB',['../group__screen.html#aacec69e0aa1063fbec2cc305e7b076dd',1,'ftxui::Color']]], + ['rgba_62',['RGBA',['../group__screen.html#a2649c83ca263094811d2c537d44b59b4',1,'ftxui::Color']]], + ['right_63',['Right',['../group__component.html#a03bfec859eac87be20f8952c1eb89de0ad48f7af8c070184f3774c8e85854eb66',1,'ftxui::Mouse::Right'],['../group__dom.html#gga224b9163917ac32fc95a60d8c1eec3aaa92b09c7c48c520c3c55e497875da437c',1,'ftxui::Right']]], + ['right_64',['right',['../screen_8cpp.html#aa4b74e56e675912bbc06504407fc7a46',1,'screen.cpp']]], + ['rosybrown_65',['RosyBrown',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa5104c5c0a54bc5ac1dc83e20c75dbea',1,'ftxui::Color']]], + ['round_66',['round',['../screen_8cpp.html#ad20ff2177c37ddb2e308815c71d4be81',1,'screen.cpp']]], + ['rounded_67',['ROUNDED',['../group__dom.html#ggafe3103dd0b8240c5443892484ef5af9ca655074b92b285adff7d18a45748bf493',1,'ftxui']]], + ['row_68',['Row',['../group__dom.html#a224b9163917ac32fc95a60d8c1eec3aaaa70367aa7cb74e510f4f9413ccf059d3',1,'ftxui::FlexboxConfig']]], + ['rowinversed_69',['RowInversed',['../group__dom.html#a224b9163917ac32fc95a60d8c1eec3aaabba4d6f3a9cec9c96600e3e0d17b9f6a',1,'ftxui::FlexboxConfig']]], + ['royalblue1_70',['RoyalBlue1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0dbe4adc6031521d77fc91e09f8d3fbf',1,'ftxui::Color']]], + ['run_71',['Run',['../group__component.html#aa3eca255b6be227d7d901cc2a72017a5',1,'ftxui::Loop::Run()'],['../classftxui_1_1task_1_1TaskRunner.html#a58f2f0e6ed3d38c3e6a081f7c99a544f',1,'ftxui::task::TaskRunner::Run()']]], + ['runonce_72',['RunOnce',['../group__component.html#ad638ec512bc0d9876c2bf1c15913e9d3',1,'ftxui::Loop']]], + ['runonceblocking_73',['RunOnceBlocking',['../group__component.html#afe89c4e52cb64cd7271c3fa8a04e7b61',1,'ftxui::Loop']]], + ['rununtilidle_74',['RunUntilIdle',['../classftxui_1_1task_1_1TaskRunner.html#a7865ea610276e71d61633de0aab71753',1,'ftxui::task::TaskRunner']]] +]; diff --git a/search/all_13.js b/search/all_13.js new file mode 100644 index 000000000..edf5bed0c --- /dev/null +++ b/search/all_13.js @@ -0,0 +1,202 @@ +var searchData= +[ + ['s_0',['S',['../group__component.html#ad3a8ae79497cbfa7cd88230b8fef68bb',1,'ftxui::Event']]], + ['s_1',['s',['../group__component.html#ac09c6206315a7cd54fb467bc7760dfae',1,'ftxui::Event']]], + ['salmon1_2',['Salmon1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa664067df16558f65cc3d46609a03dfab',1,'ftxui::Color']]], + ['sandybrown_3',['SandyBrown',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa64269c060a2fc56cb77c12360cd3a28e',1,'ftxui::Color']]], + ['saturatehorizontal_4',['SaturateHorizontal',['../group__dom.html#af3f2674604d907fbce26d4217cfa9324',1,'ftxui::Selection']]], + ['saturatevertical_5',['SaturateVertical',['../group__dom.html#ace69e1e7c6e64b7ae0c4402e0e1e3336',1,'ftxui::Selection']]], + ['saturation_6',['saturation',['../group__screen.html#a4769b22557e2bcd3edbc69f2caaf691f',1,'ftxui::ColorInfo']]], + ['screen_7',['Screen',['../group__screen.html#classftxui_1_1Screen',1,'Screen'],['../group__screen.html#a7ecf7c5fb3d90a1620098a60cfafc215',1,'ftxui::Screen::Screen()']]], + ['screen_8',['screen',['../module-screen.html',1,'ftxui / screen'],['../group__screen.html',1,'ftxui/screen'],['../ftxui.html#ftxuiscreen',1,'ftxui/screen']]], + ['screen_2ecpp_9',['screen.cpp',['../screen_8cpp.html',1,'']]], + ['screen_2ecppm_10',['screen.cppm',['../screen_8cppm.html',1,'']]], + ['screen_2ehpp_11',['screen.hpp',['../screen_8hpp.html',1,'']]], + ['screen_2fcolor_2ecpp_12',['color.cpp',['../screen_2color_8cpp.html',1,'']]], + ['screen_2fdeprecated_2ecppm_13',['deprecated.cppm',['../screen_2deprecated_8cppm.html',1,'']]], + ['screen_2fdeprecated_2ehpp_14',['deprecated.hpp',['../screen_2deprecated_8hpp.html',1,'']]], + ['screen_2fscreen_2ecppm_15',['screen.cppm',['../screen_2screen_8cppm.html',1,'']]], + ['screen_5f_16',['screen_',['../group__component.html#a57ae65156ecf0f469cc559a49e6c4f2f',1,'ftxui::Event']]], + ['screen_5finteractive_2ecpp_17',['screen_interactive.cpp',['../screen__interactive_8cpp.html',1,'']]], + ['screen_5finteractive_2ecppm_18',['screen_interactive.cppm',['../screen__interactive_8cppm.html',1,'']]], + ['screen_5finteractive_2ehpp_19',['screen_interactive.hpp',['../screen__interactive_8hpp.html',1,'']]], + ['screeninteractive_20',['ScreenInteractive',['../group__component.html#classftxui_1_1ScreenInteractive',1,'ftxui']]], + ['scroll_5findicator_2ecpp_21',['scroll_indicator.cpp',['../scroll__indicator_8cpp.html',1,'']]], + ['scrollbar_22',['scrollbar',['../module-component-examples.html#scrollbar',1,'']]], + ['scrollbar_2ecpp_23',['scrollbar.cpp',['../scrollbar_8cpp.html',1,'']]], + ['seagreen1_24',['SeaGreen1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa8e2c9e620d6245638b27d9c1fa2d0545',1,'ftxui::Color']]], + ['seagreen1bis_25',['SeaGreen1Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7819209c8bfe13fbfcb2cde9a296f7b6',1,'ftxui::Color']]], + ['seagreen2_26',['SeaGreen2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa1b69dc4c281a32346b8d2bab20dd1aef',1,'ftxui::Color']]], + ['seagreen3_27',['SeaGreen3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa5b862c5164d4597b28fba03335a834cf',1,'ftxui::Color']]], + ['select_28',['Select',['../group__dom.html#a05352f5a353f1e86630a978060e77305',1,'ftxui::Node']]], + ['select_29',['select',['../namespaceftxui.html#a9e3e2988ed61a129d82d634ad66f7eb1',1,'ftxui']]], + ['selectall_30',['SelectAll',['../group__dom.html#ad5f50927f54334b84514bc4b11a14d71',1,'ftxui::Table']]], + ['selectcell_31',['SelectCell',['../group__dom.html#a3c2f178ef9f94da293a53b467ef8643b',1,'ftxui::Table']]], + ['selectcolumn_32',['SelectColumn',['../group__dom.html#a4ee8ddbab36f592fba81c6430d26545e',1,'ftxui::Table']]], + ['selectcolumns_33',['SelectColumns',['../group__dom.html#a79109565fe65710f725eb474778cae36',1,'ftxui::Table']]], + ['selected_34',['selected',['../group__component.html#ac42a32c3439d08be9c5626a5fbc3a0c4',1,'ftxui::MenuOption::selected'],['../group__component.html#ac42a32c3439d08be9c5626a5fbc3a0c4',1,'ftxui::RadioboxOption::selected']]], + ['selection_35',['Selection',['../group__dom.html#classftxui_1_1Selection',1,'Selection'],['../group__dom.html#ade00d4039f147221b9fd6b6b402b43b1',1,'ftxui::Selection::Selection()'],['../group__dom.html#a76eafd8bc098ec9f0405e3b1f6fb42c4',1,'ftxui::Selection::Selection(int start_x, int start_y, int end_x, int end_y)']]], + ['selection_36',['selection',['../module-component-examples.html#selection',1,'']]], + ['selection_2ecppm_37',['selection.cppm',['../selection_8cppm.html',1,'']]], + ['selection_2ehpp_38',['selection.hpp',['../selection_8hpp.html',1,'']]], + ['selection_5fstyle_2ecpp_39',['selection_style.cpp',['../selection__style_8cpp.html',1,'']]], + ['selection_5fstyle_5f_40',['selection_style_',['../group__screen.html#ab9f757d5d67255f61e27950be4131be1',1,'ftxui::Screen']]], + ['selectionbackgroundcolor_41',['selectionBackgroundColor',['../namespaceftxui.html#a6c965b8f6450a50a938120b5f6ddea96',1,'ftxui']]], + ['selectionchange_42',['SelectionChange',['../group__component.html#ad6daabb2df61b6be6f0b2a8950ac3281',1,'ftxui::ScreenInteractive']]], + ['selectioncolor_43',['selectionColor',['../namespaceftxui.html#a925a73b7f0eb4b5bc11af23f4ca18019',1,'ftxui']]], + ['selectionforegroundcolor_44',['selectionForegroundColor',['../namespaceftxui.html#a5d98498c51cfbc03f37e46d46ec8acf5',1,'ftxui']]], + ['selectionstyle_45',['SelectionStyle',['../group__screen.html#a0424ec9a980000671f12bfa39fc32273',1,'ftxui::Screen']]], + ['selectionstyle_46',['selectionStyle',['../namespaceftxui.html#a4080865d947eea48cf695531f66a5160',1,'ftxui']]], + ['selectionstylereset_47',['selectionStyleReset',['../namespaceftxui.html#aa7e1317c76cefc5018503de4f6e09ea3',1,'ftxui']]], + ['selectrectangle_48',['SelectRectangle',['../group__dom.html#af0021915d0cbda394077929601b8ab8f',1,'ftxui::Table']]], + ['selectrow_49',['SelectRow',['../group__dom.html#a64435bbfbdefd7408241c69b6b8283e7',1,'ftxui::Table']]], + ['selectrows_50',['SelectRows',['../group__dom.html#ab36d32e3675a9353ee79e84405cd7a44',1,'ftxui::Table']]], + ['send_51',['Send',['../classftxui_1_1SenderImpl.html#af3a961fb9b4025671b6122a392a5bc3f',1,'ftxui::SenderImpl']]], + ['sender_52',['Sender',['../namespaceftxui.html#a8f713c247c551bd416c4697ed9ab871c',1,'ftxui']]], + ['senderimpl_53',['SenderImpl',['../classftxui_1_1SenderImpl.html',1,'SenderImpl< T >'],['../classftxui_1_1SenderImpl.html#a7770521e8bff392402a1539bf4eb8ff4',1,'ftxui::SenderImpl::SenderImpl(const SenderImpl &)=delete'],['../classftxui_1_1SenderImpl.html#a61b3d68c26b829848661ca875b0cdb13',1,'ftxui::SenderImpl::SenderImpl(SenderImpl &&)=delete']]], + ['separator_54',['Separator',['../classftxui_1_1TableSelection.html#ab1c6e11d86131eddb095c8211b824b18',1,'ftxui::TableSelection']]], + ['separator_55',['separator',['../group__dom.html#gac1ef1cf6bf7cd0759ffa195071edb2a0',1,'ftxui::separator()'],['../group__dom.html#ga71d9a6a32f65b6d172f9696b3b9579b4',1,'ftxui::separator(Pixel pixel)'],['../module-dom.html#dom-separator',1,'separator'],['../module-dom-examples.html#separator',1,'separator']]], + ['separator_5ffunc_56',['separator_func',['../structftxui_1_1ResizableSplitOption.html#a237a29bec11c71ee14c9b36ae94a1dbf',1,'ftxui::ResizableSplitOption']]], + ['separator_5fstyle_57',['separator_style',['../module-dom-examples.html#separator_style',1,'']]], + ['separator_5fstyle_2ecpp_58',['separator_style.cpp',['../separator__style_8cpp.html',1,'']]], + ['separatorcharacter_59',['separatorCharacter',['../group__dom.html#ga97a10482d591aade2958da0f2f19b371',1,'ftxui']]], + ['separatordashed_60',['separatorDashed',['../group__dom.html#ga81f2d3256c0cfbc70f820129286f08c6',1,'ftxui']]], + ['separatordouble_61',['separatorDouble',['../group__dom.html#gadd376830fdb51b0bf52672ef17515989',1,'ftxui']]], + ['separatorempty_62',['separatorEmpty',['../group__dom.html#ga1934703e56ab66f6f259b9f8da331f1b',1,'ftxui']]], + ['separatorheavy_63',['separatorHeavy',['../group__dom.html#gaf0649e89a9960f1c2703e48c1817645b',1,'ftxui']]], + ['separatorhorizontal_64',['SeparatorHorizontal',['../classftxui_1_1TableSelection.html#affd2ab7143cb388fdedad3bd51995802',1,'ftxui::TableSelection']]], + ['separatorhselector_65',['separatorHSelector',['../namespaceftxui.html#a50413065cee4757447b35c3a500667d3',1,'ftxui']]], + ['separatorlight_66',['separatorLight',['../group__dom.html#ga37c2b93daf557f68064bc9fbf93ebde0',1,'ftxui']]], + ['separatorstyled_67',['separatorStyled',['../group__dom.html#ga13cb559cfc7e409b3f211f0bb35ea7fa',1,'ftxui']]], + ['separatorvertical_68',['SeparatorVertical',['../classftxui_1_1TableSelection.html#a2334aed76610138905c96dc298b7e9df',1,'ftxui::TableSelection']]], + ['separatorvselector_69',['separatorVSelector',['../namespaceftxui.html#a1a0211233bacd4eb4d31a8e3d58b5f48',1,'ftxui']]], + ['set_70',['Set',['../group__component.html#ad186d5a36e45174bbc7c50df85c2e91e',1,'ftxui::AnimatedColorOption::Set()'],['../group__dom.html#ae47b5b0d793d0c2312e4805a1f40012a',1,'ftxui::FlexboxConfig::Set(FlexboxConfig::Direction)'],['../group__dom.html#a5afe52066ea76ddc7948b77ac155a011',1,'ftxui::FlexboxConfig::Set(FlexboxConfig::Wrap)'],['../group__dom.html#a3de11197951ee3c9037ba7f2a2586a06',1,'ftxui::FlexboxConfig::Set(FlexboxConfig::JustifyContent)'],['../group__dom.html#a07ef12f61272636369543b34932614f3',1,'ftxui::FlexboxConfig::Set(FlexboxConfig::AlignItems)'],['../group__dom.html#a6df4ec3da7d3d2cd0b216f5d2c72cbd6',1,'ftxui::FlexboxConfig::Set(FlexboxConfig::AlignContent)']]], + ['setactivechild_71',['SetActiveChild',['../group__component.html#a8cbf27680c6154e15c8b32d6601340de',1,'ftxui::ComponentBase::SetActiveChild(ComponentBase *child)'],['../group__component.html#a50ad32ad14dd7912e681fab0ee294be2',1,'ftxui::ComponentBase::SetActiveChild(Component child)']]], + ['setanimation_72',['SetAnimation',['../group__component.html#a754d89398aac6051ced26fd452c62589',1,'ftxui::UnderlineOption']]], + ['setanimationduration_73',['SetAnimationDuration',['../group__component.html#a798360474be7511364b8171f0c62f6d5',1,'ftxui::UnderlineOption']]], + ['setanimationfunction_74',['SetAnimationFunction',['../group__component.html#a34e6222dbf10e899074054160870816c',1,'ftxui::UnderlineOption::SetAnimationFunction(animation::easing::Function f)'],['../group__component.html#a7d978b34c37e9d08c57a22477016204c',1,'ftxui::UnderlineOption::SetAnimationFunction(animation::easing::Function f_leader, animation::easing::Function f_follower)']]], + ['setbox_75',['SetBox',['../group__dom.html#a2ed318aaadb07efc50e76fce1ccf9637',1,'ftxui::Node::SetBox()'],['../classftxui_1_1NodeDecorator.html#aafcc9bd6538ccb37babf4d56c4c1c238',1,'ftxui::NodeDecorator::SetBox()']]], + ['setcolorsupport_76',['SetColorSupport',['../group__dom.html#ga65945a706131f407a47a1b9960dc1a4a',1,'ftxui::Terminal']]], + ['setcursor_77',['SetCursor',['../group__screen.html#a1aa24862a3d050b3aea2ade1300d51a7',1,'ftxui::Screen']]], + ['setfallbacksize_78',['SetFallbackSize',['../namespaceftxui_1_1Terminal.html#a765662bcabb59dc93884674ee2fcc9fc',1,'ftxui::Terminal']]], + ['setgap_79',['SetGap',['../group__dom.html#a98d9a43033c09c7f967cdec791408bad',1,'ftxui::FlexboxConfig']]], + ['setselectionstyle_80',['SetSelectionStyle',['../group__screen.html#aba0d30b90db17d6b7561f704ed63b5e6',1,'ftxui::Screen']]], + ['shape_81',['Shape',['../structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37c',1,'ftxui::Screen::Cursor']]], + ['shape_82',['shape',['../structftxui_1_1Screen_1_1Cursor.html#a8b9f7758a8bd2bef680aeecc40bcfe04',1,'ftxui::Screen::Cursor']]], + ['shift_83',['Shift',['../group__screen.html#a507dad970b4732caab79e5922bdc5fb5',1,'ftxui::Box']]], + ['shift_84',['shift',['../group__component.html#ace78b37abb3d96740735fd8eb41235e6',1,'ftxui::Mouse']]], + ['signal_85',['Signal',['../classftxui_1_1ScreenInteractive_1_1Private.html#aa831d3b9234cd15d4bcb5a42dec43943',1,'ftxui::ScreenInteractive::Private']]], + ['simple_86',['Simple',['../group__component.html#a553fe18f102e8e62aec516d4d3213eac',1,'ftxui::ButtonOption::Simple()'],['../group__component.html#a41b17a916980353033366c01b15d3cb1',1,'ftxui::CheckboxOption::Simple()'],['../group__component.html#af2b048773665961fae6c104762533908',1,'ftxui::RadioboxOption::Simple()']]], + ['sinein_87',['SineIn',['../namespaceftxui_1_1animation_1_1easing.html#af48c179e363c6656e904045b33756aeb',1,'ftxui::animation::easing']]], + ['sineinout_88',['SineInOut',['../namespaceftxui_1_1animation_1_1easing.html#a0eddac1c5f32c9f874ed1c6687a3c830',1,'ftxui::animation::easing']]], + ['sineout_89',['SineOut',['../namespaceftxui_1_1animation_1_1easing.html#a92e397623fa5a607f64ba58d5c3dc56a',1,'ftxui::animation::easing']]], + ['single_5fquote_90',['Single_Quote',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aab6f9a00a0255e4da280686c4640c7671',1,'ftxui']]], + ['size_91',['Size',['../group__screen.html#gad890c37601448c82ed0d5051c29e2f0c',1,'ftxui::Terminal']]], + ['size_92',['size',['../structftxui_1_1box__helper_1_1Element.html#a439227feff9d7f55384e8780cfc2eb82',1,'ftxui::box_helper::Element::size'],['../classftxui_1_1ConstStringListRef_1_1Adapter.html#aa983ddaeded5756189f46428be79c631',1,'ftxui::ConstStringListRef::Adapter::size()'],['../classftxui_1_1ConstStringListRef.html#a259cb5a711406a8c3e5d937eb9350cca',1,'ftxui::ConstStringListRef::size()'],['../group__dom.html#ga201220986fbdc539e42efe067985cbdb',1,'ftxui::size()'],['../module-dom-examples.html#size',1,'size']]], + ['size_5fx_93',['size_x',['../structftxui_1_1flexbox__helper_1_1Global.html#aec1dee03c858e0d3910c40c209890ab0',1,'ftxui::flexbox_helper::Global']]], + ['size_5fy_94',['size_y',['../structftxui_1_1flexbox__helper_1_1Global.html#a22aeb82e7a98517be5f90c810e423af0',1,'ftxui::flexbox_helper::Global']]], + ['skyblue1_95',['SkyBlue1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfac47bacbed84298fdf72215fe2312ce64',1,'ftxui::Color']]], + ['skyblue2_96',['SkyBlue2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa1172e54ed7e62aa4ebcea4b453f5dcc',1,'ftxui::Color']]], + ['skyblue3_97',['SkyBlue3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2dfa52861bc8b2a870e5166e969db2c7',1,'ftxui::Color']]], + ['slateblue1_98',['SlateBlue1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa97807edc577e1d5d3bc271c3a4ced7f4',1,'ftxui::Color']]], + ['slateblue3_99',['SlateBlue3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfae53ce2149f6b9e7da24472b5112f7963',1,'ftxui::Color']]], + ['slateblue3bis_100',['SlateBlue3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfad477f91096f698a2b266a1bf26cd456b',1,'ftxui::Color']]], + ['slider_101',['Slider',['../namespaceftxui.html#aa3558d992a72679e5e9c9c7b67abd727',1,'ftxui::Slider(SliderOption< T > options)'],['../group__component.html#gafdce74ff1421c2f1bda336c8dacefcbd',1,'ftxui::Slider(ConstStringRef label, Ref< int > value, ConstRef< int > min, ConstRef< int > max, ConstRef< int > increment)'],['../namespaceftxui.html#a8bfa2757905a4fb50e0ec263976d1f96',1,'ftxui::Slider(ConstStringRef label, Ref< float > value, ConstRef< float > min=0.f, ConstRef< float > max=100.f, ConstRef< float > increment=5.f)'],['../namespaceftxui.html#aba34419b025c881c07808816c81c5230',1,'ftxui::Slider(ConstStringRef label, Ref< long > value, ConstRef< long > min=0L, ConstRef< long > max=100L, ConstRef< long > increment=5L)'],['../namespaceftxui.html#a877bf1673c86ac33e24facf81068e693',1,'ftxui::Slider(SliderOption< int8_t >)'],['../namespaceftxui.html#a551dff4f473bdb27fde654341d08c618',1,'ftxui::Slider(SliderOption< int16_t >)'],['../namespaceftxui.html#a8d1ae475487cb22769f127449380925e',1,'ftxui::Slider(SliderOption< int32_t >)'],['../namespaceftxui.html#a217d120bd78c7e5fbe21c60d58f411ba',1,'ftxui::Slider(SliderOption< int64_t >)'],['../namespaceftxui.html#a83667b04778e0206c7c9f05652c9110a',1,'ftxui::Slider(SliderOption< uint8_t >)'],['../namespaceftxui.html#a41e0cb91026c84d8767958a6c3d65d88',1,'ftxui::Slider(SliderOption< uint16_t >)'],['../namespaceftxui.html#a17babf521947301435a4f7c47835032c',1,'ftxui::Slider(SliderOption< uint32_t >)'],['../namespaceftxui.html#a69e9803a9d52936adf22dabd14df4289',1,'ftxui::Slider(SliderOption< uint64_t >)'],['../namespaceftxui.html#a453d7fc2e7bd34b00775062018daf96d',1,'ftxui::Slider(SliderOption< float >)'],['../namespaceftxui.html#a9d64c6ad8cbbae0735eac76e4f4f5811',1,'ftxui::Slider(SliderOption< double >)'],['../module-component.html#component-slider',1,'Slider']]], + ['slider_102',['slider',['../module-component-examples.html#slider',1,'']]], + ['slider_5fdirection_103',['slider_direction',['../module-component-examples.html#slider_direction',1,'']]], + ['slider_5fdirection_2ecpp_104',['slider_direction.cpp',['../slider__direction_8cpp.html',1,'']]], + ['slider_5frgb_105',['slider_rgb',['../module-component-examples.html#slider_rgb',1,'']]], + ['slider_5frgb_2ecpp_106',['slider_rgb.cpp',['../slider__rgb_8cpp.html',1,'']]], + ['slideroption_107',['SliderOption',['../structftxui_1_1SliderOption.html',1,'ftxui']]], + ['source_20official_108',['Building from Source (Official)',['../installation_manual.html#building-from-source-official',1,'']]], + ['spacearound_109',['SpaceAround',['../group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2aa711fff5f720542ab104aab0805e2565',1,'ftxui::FlexboxConfig::SpaceAround'],['../group__dom.html#a1f99410fd0fc632a5bc2497b6a447420aa711fff5f720542ab104aab0805e2565',1,'ftxui::FlexboxConfig::SpaceAround']]], + ['spacebetween_110',['SpaceBetween',['../group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2afa2f3f8f296dcb6e5c287d69eae1c119',1,'ftxui::FlexboxConfig::SpaceBetween'],['../group__dom.html#a1f99410fd0fc632a5bc2497b6a447420afa2f3f8f296dcb6e5c287d69eae1c119',1,'ftxui::FlexboxConfig::SpaceBetween']]], + ['spaceevenly_111',['SpaceEvenly',['../group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2a34ad3eaf7ee60a45210ad60bd731e235',1,'ftxui::FlexboxConfig::SpaceEvenly'],['../group__dom.html#a1f99410fd0fc632a5bc2497b6a447420a34ad3eaf7ee60a45210ad60bd731e235',1,'ftxui::FlexboxConfig::SpaceEvenly']]], + ['spacious_112',['Spacious',['../group__component.html#a36c56131167eaaae707f64bbb9d07ef2',1,'ftxui::InputOption']]], + ['special_113',['Special',['../group__component.html#afe901de476c29382cc358333f10e5ee7',1,'ftxui::Event']]], + ['spinner_114',['spinner',['../group__dom.html#ga3b08e0030a0831d3ec3e2a505908273b',1,'ftxui::spinner()'],['../module-dom-examples.html#spinner',1,'spinner']]], + ['springgreen1_115',['SpringGreen1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa8e70ae2a69a90e87e679685d6461b6e8',1,'ftxui::Color']]], + ['springgreen2_116',['SpringGreen2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfac85363887f660b5879e353bac03dab49',1,'ftxui::Color']]], + ['springgreen2bis_117',['SpringGreen2Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfad038ac30c015021853f183054c51c0c5',1,'ftxui::Color']]], + ['springgreen3_118',['SpringGreen3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa5a87a3e9a8af9561a373ff63e740223e',1,'ftxui::Color']]], + ['springgreen3bis_119',['SpringGreen3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf19e26246ad6f4e4de44efb6d2b4e1c6',1,'ftxui::Color']]], + ['springgreen4_120',['SpringGreen4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf3817720cb5b18b16b8d6c520a61748e',1,'ftxui::Color']]], + ['src_2fftxui_2fcomponent_2fbutton_2ecpp_121',['button.cpp',['../src_2ftxui_2component_2button_8cpp.html',1,'']]], + ['src_2fftxui_2fcomponent_2fcheckbox_2ecpp_122',['checkbox.cpp',['../src_2ftxui_2component_2checkbox_8cpp.html',1,'']]], + ['src_2fftxui_2fcomponent_2fcollapsible_2ecpp_123',['collapsible.cpp',['../src_2ftxui_2component_2collapsible_8cpp.html',1,'']]], + ['src_2fftxui_2fcomponent_2fdropdown_2ecpp_124',['dropdown.cpp',['../src_2ftxui_2component_2dropdown_8cpp.html',1,'']]], + ['src_2fftxui_2fcomponent_2finput_2ecpp_125',['input.cpp',['../src_2ftxui_2component_2input_8cpp.html',1,'']]], + ['src_2fftxui_2fcomponent_2fmaybe_2ecpp_126',['maybe.cpp',['../src_2ftxui_2component_2maybe_8cpp.html',1,'']]], + ['src_2fftxui_2fcomponent_2fmenu_2ecpp_127',['menu.cpp',['../src_2ftxui_2component_2menu_8cpp.html',1,'']]], + ['src_2fftxui_2fcomponent_2fradiobox_2ecpp_128',['radiobox.cpp',['../src_2ftxui_2component_2radiobox_8cpp.html',1,'']]], + ['src_2fftxui_2fcomponent_2frenderer_2ecpp_129',['renderer.cpp',['../src_2ftxui_2component_2renderer_8cpp.html',1,'']]], + ['src_2fftxui_2fcomponent_2fresizable_5fsplit_2ecpp_130',['resizable_split.cpp',['../src_2ftxui_2component_2resizable__split_8cpp.html',1,'']]], + ['src_2fftxui_2fcomponent_2fslider_2ecpp_131',['slider.cpp',['../src_2ftxui_2component_2slider_8cpp.html',1,'']]], + ['src_2fftxui_2fcomponent_2fwindow_2ecpp_132',['window.cpp',['../src_2ftxui_2component_2window_8cpp.html',1,'']]], + ['src_2fftxui_2fdom_2fborder_2ecpp_133',['border.cpp',['../src_2ftxui_2dom_2border_8cpp.html',1,'']]], + ['src_2fftxui_2fdom_2fcanvas_2ecpp_134',['canvas.cpp',['../src_2ftxui_2dom_2canvas_8cpp.html',1,'']]], + ['src_2fftxui_2fdom_2fdbox_2ecpp_135',['dbox.cpp',['../src_2ftxui_2dom_2dbox_8cpp.html',1,'']]], + ['src_2fftxui_2fdom_2ffocus_2ecpp_136',['focus.cpp',['../src_2ftxui_2dom_2focus_8cpp.html',1,'']]], + ['src_2fftxui_2fdom_2fgauge_2ecpp_137',['gauge.cpp',['../src_2ftxui_2dom_2gauge_8cpp.html',1,'']]], + ['src_2fftxui_2fdom_2fgraph_2ecpp_138',['graph.cpp',['../src_2ftxui_2dom_2graph_8cpp.html',1,'']]], + ['src_2fftxui_2fdom_2fgridbox_2ecpp_139',['gridbox.cpp',['../src_2ftxui_2dom_2gridbox_8cpp.html',1,'']]], + ['src_2fftxui_2fdom_2flinear_5fgradient_2ecpp_140',['linear_gradient.cpp',['../src_2ftxui_2dom_2linear__gradient_8cpp.html',1,'']]], + ['src_2fftxui_2fdom_2fparagraph_2ecpp_141',['paragraph.cpp',['../src_2ftxui_2dom_2paragraph_8cpp.html',1,'']]], + ['src_2fftxui_2fdom_2fselection_2ecpp_142',['selection.cpp',['../src_2ftxui_2dom_2selection_8cpp.html',1,'']]], + ['src_2fftxui_2fdom_2fseparator_2ecpp_143',['separator.cpp',['../src_2ftxui_2dom_2separator_8cpp.html',1,'']]], + ['src_2fftxui_2fdom_2fsize_2ecpp_144',['size.cpp',['../src_2ftxui_2dom_2size_8cpp.html',1,'']]], + ['src_2fftxui_2fdom_2fspinner_2ecpp_145',['spinner.cpp',['../src_2ftxui_2dom_2spinner_8cpp.html',1,'']]], + ['src_2fftxui_2fdom_2ftable_2ecpp_146',['table.cpp',['../src_2ftxui_2dom_2table_8cpp.html',1,'']]], + ['stacked_147',['Stacked',['../group__component.html#gaafd394665b0c231380a143b810339d8e',1,'ftxui::Container']]], + ['started_148',['Getting Started',['../getting-started.html',1,'']]], + ['starter_20project_149',['Starter Project',['../installation_bazel.html#starter-project',1,'']]], + ['starter_20template_150',['Starter Template',['../getting-started.html#starter-template',1,'']]], + ['state_151',['state',['../structftxui_1_1EntryState.html#ab30ba07e2a0bd07a15e45a92c32db9c5',1,'ftxui::EntryState']]], + ['status_152',['Status',['../structftxui_1_1Node_1_1Status.html',1,'ftxui::Node']]], + ['steelblue_153',['SteelBlue',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9224e340e6d918555c68ac2f1dc80b04',1,'ftxui::Color']]], + ['steelblue1_154',['SteelBlue1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa050bb4a5d79a1dac6aae25ce8734c973',1,'ftxui::Color']]], + ['steelblue1bis_155',['SteelBlue1Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf400af64197a052be4d59c521104cb2a',1,'ftxui::Color']]], + ['steelblue3_156',['SteelBlue3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0a49900e5a03f7545262d90592bfba92',1,'ftxui::Color']]], + ['stencil_157',['stencil',['../group__screen.html#a92cacd07ba30909855f19edc01192ff0',1,'ftxui::Image']]], + ['steps_158',['Next Steps',['../installation.html#next-steps',1,'']]], + ['stop_159',['Stop',['../structftxui_1_1LinearGradient_1_1Stop.html',1,'LinearGradient::Stop'],['../group__dom.html#a03b10012f78e1c731616ce760d28df40',1,'ftxui::LinearGradient::Stop(Color color, float position)'],['../group__dom.html#ab85b009cd214d3bd1b3bb7f704af0da6',1,'ftxui::LinearGradient::Stop(Color color)']]], + ['stops_160',['stops',['../group__dom.html#a9c56e5fb8075d8a48b1b0c3b4ea31831',1,'ftxui::LinearGradient']]], + ['stretch_161',['Stretch',['../group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2afbb09a82eafab60150d0996e8fe46560',1,'ftxui::FlexboxConfig::Stretch'],['../group__dom.html#a821af961ece5fe13540ad48b54c7a9e7afbb09a82eafab60150d0996e8fe46560',1,'ftxui::FlexboxConfig::Stretch'],['../group__dom.html#a1f99410fd0fc632a5bc2497b6a447420afbb09a82eafab60150d0996e8fe46560',1,'ftxui::FlexboxConfig::Stretch']]], + ['strikethrough_162',['strikethrough',['../group__screen.html#a21fbeba389ccf8f76447c7a73ead8db2',1,'ftxui::Pixel::strikethrough'],['../group__dom.html#ga8594d70f0491def903370e86132fbf01',1,'ftxui::strikethrough()']]], + ['strikethrough_2ecpp_163',['strikethrough.cpp',['../strikethrough_8cpp.html',1,'']]], + ['string_2ecpp_164',['string.cpp',['../string_8cpp.html',1,'']]], + ['string_2ecppm_165',['string.cppm',['../string_8cppm.html',1,'']]], + ['string_2ehpp_166',['string.hpp',['../string_8hpp.html',1,'']]], + ['string_5finternal_2ehpp_167',['string_internal.hpp',['../string__internal_8hpp.html',1,'']]], + ['string_5fwidth_168',['string_width',['../namespaceftxui.html#a517b35c7721e632812d8b3a7697c4099',1,'ftxui']]], + ['stringref_169',['StringRef',['../classftxui_1_1StringRef.html',1,'StringRef'],['../classftxui_1_1StringRef.html#ad3cfa31525e075cbd5f50c2476e665ce',1,'ftxui::StringRef::StringRef(const wchar_t *ref)'],['../classftxui_1_1StringRef.html#a9133717e5c00b480a4a4a120ba7fb886',1,'ftxui::StringRef::StringRef(const char *ref)']]], + ['style_170',['Style',['../group__dom.html#ae9e7d3f5b753cf2650057623960d4cb4',1,'ftxui::Canvas::Style()'],['../examples_2component_2button_8cpp.html#a98e3b8d17caf902b7bf0fe47562cea08',1,'Style(): button.cpp'],['../module-dom.html#dom-style',1,'Style']]], + ['style_5f_171',['style_',['../selection__style_8cpp.html#a4e933ebfcd587caa8c7a7c518ee9e4f6',1,'style_: selection_style.cpp'],['../src_2ftxui_2dom_2separator_8cpp.html#ac30a0a0ed81dc58d609a872c58242761',1,'style_: separator.cpp']]], + ['style_5fblink_172',['style_blink',['../module-dom-examples.html#style_blink',1,'']]], + ['style_5fblink_2ecpp_173',['style_blink.cpp',['../style__blink_8cpp.html',1,'']]], + ['style_5fbold_174',['style_bold',['../module-dom-examples.html#style_bold',1,'']]], + ['style_5fbold_2ecpp_175',['style_bold.cpp',['../style__bold_8cpp.html',1,'']]], + ['style_5fcolor_176',['style_color',['../module-dom-examples.html#style_color',1,'']]], + ['style_5fcolor_2ecpp_177',['style_color.cpp',['../style__color_8cpp.html',1,'']]], + ['style_5fdim_178',['style_dim',['../module-dom-examples.html#style_dim',1,'']]], + ['style_5fdim_2ecpp_179',['style_dim.cpp',['../style__dim_8cpp.html',1,'']]], + ['style_5fgallery_180',['style_gallery',['../module-dom-examples.html#style_gallery',1,'']]], + ['style_5fgallery_2ecpp_181',['style_gallery.cpp',['../style__gallery_8cpp.html',1,'']]], + ['style_5fhyperlink_182',['style_hyperlink',['../module-dom-examples.html#style_hyperlink',1,'']]], + ['style_5fhyperlink_2ecpp_183',['style_hyperlink.cpp',['../style__hyperlink_8cpp.html',1,'']]], + ['style_5finverted_184',['style_inverted',['../module-dom-examples.html#style_inverted',1,'']]], + ['style_5finverted_2ecpp_185',['style_inverted.cpp',['../style__inverted_8cpp.html',1,'']]], + ['style_5fitalic_186',['style_italic',['../module-dom-examples.html#style_italic',1,'']]], + ['style_5fitalic_2ecpp_187',['style_italic.cpp',['../style__italic_8cpp.html',1,'']]], + ['style_5fstrikethrough_188',['style_strikethrough',['../module-dom-examples.html#style_strikethrough',1,'']]], + ['style_5fstrikethrough_2ecpp_189',['style_strikethrough.cpp',['../style__strikethrough_8cpp.html',1,'']]], + ['style_5funderlined_190',['style_underlined',['../module-dom-examples.html#style_underlined',1,'']]], + ['style_5funderlined_2ecpp_191',['style_underlined.cpp',['../style__underlined_8cpp.html',1,'']]], + ['style_5funderlined_5fdouble_192',['style_underlined_double',['../module-dom-examples.html#style_underlined_double',1,'']]], + ['style_5funderlined_5fdouble_2ecpp_193',['style_underlined_double.cpp',['../style__underlined__double_8cpp.html',1,'']]], + ['stylizer_194',['Stylizer',['../group__dom.html#a407f299e079846ce6169f2a709ad4aae',1,'ftxui::Canvas']]], + ['submodule_195',['Using git submodule',['../installation_cmake.html#using-git-submodule',1,'']]], + ['supported_20methods_196',['Supported Methods',['../installation.html#supported-methods',1,'']]], + ['supported_20platforms_197',['Supported Platforms',['../index.html#supported-platforms',1,'']]], + ['system_198',['Configure your build system.',['../installation_vcpkg.html#configure-your-build-system',1,'']]] +]; diff --git a/search/all_14.js b/search/all_14.js new file mode 100644 index 000000000..c48f0e974 --- /dev/null +++ b/search/all_14.js @@ -0,0 +1,67 @@ +var searchData= +[ + ['t_0',['T',['../group__component.html#a1b87f3fb451131290d27cff5a1bbf496',1,'ftxui::Event']]], + ['t_1',['t',['../group__component.html#ab9a908cfd0d53fbf65e22a961074b86d',1,'ftxui::Event']]], + ['tab_2',['Tab',['../group__component.html#a94bd9090f8bf9eea776c867113afb86c',1,'ftxui::Event::Tab'],['../group__component.html#gaea9fe244eeeb420276bcc5760b46953d',1,'ftxui::Container::Tab()'],['../module-component.html#component-tab',1,'Tab']]], + ['tab_5fhorizontal_3',['tab_horizontal',['../module-component-examples.html#tab_horizontal',1,'']]], + ['tab_5fhorizontal_2ecpp_4',['tab_horizontal.cpp',['../tab__horizontal_8cpp.html',1,'']]], + ['tab_5fvertical_5',['tab_vertical',['../module-component-examples.html#tab_vertical',1,'']]], + ['tab_5fvertical_2ecpp_6',['tab_vertical.cpp',['../tab__vertical_8cpp.html',1,'']]], + ['table_7',['Table',['../group__dom.html#classftxui_1_1Table',1,'Table'],['../group__dom.html#a2a7f82c625b00a53f710b2ed305248d2',1,'ftxui::Table::Table()'],['../group__dom.html#a2055337c538a82ae13d92db1838fc454',1,'ftxui::Table::Table(std::vector< std::vector< std::string > >)'],['../group__dom.html#acbd904dfec77b46b257e33f9c7d1e71d',1,'ftxui::Table::Table(std::vector< std::vector< Element > >)'],['../group__dom.html#a22a1b5a5b90feb5ebbfe20d7dec5c650',1,'ftxui::Table::Table(std::initializer_list< std::vector< std::string > > init)'],['../module-dom.html#dom-table',1,'Table']]], + ['table_8',['table',['../module-dom-examples.html#table',1,'']]], + ['table_2ecppm_9',['table.cppm',['../table_8cppm.html',1,'']]], + ['table_2ehpp_10',['table.hpp',['../table_8hpp.html',1,'']]], + ['tableselection_11',['TableSelection',['../classftxui_1_1TableSelection.html',1,'ftxui']]], + ['tabreverse_12',['TabReverse',['../group__component.html#a00f063998a734c338531f38c5e3d6428',1,'ftxui::Event']]], + ['takefocus_13',['TakeFocus',['../group__component.html#a2cf27e9d7128a6a4b3263ecd34c19105',1,'ftxui::ComponentBase']]], + ['tan_14',['Tan',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfab492a96cd2b9bb37c81b8451a42889d9',1,'ftxui::Color']]], + ['task_15',['Task',['../namespaceftxui.html#aaa92a82e968c721805c62787cd000534',1,'ftxui::Task'],['../namespaceftxui_1_1task.html#a8cb97ed7903b5e83d45d0a985e629185',1,'ftxui::task::Task']]], + ['task_16',['task',['../structftxui_1_1task_1_1PendingTask.html#a8bcc572b9d73774627be66dd46aa61a8',1,'ftxui::task::PendingTask']]], + ['task_2ecpp_17',['task.cpp',['../task_8cpp.html',1,'']]], + ['task_2ecppm_18',['task.cppm',['../task_8cppm.html',1,'']]], + ['task_2ehpp_19',['task.hpp',['../task_8hpp.html',1,'']]], + ['task_5finternal_2ehpp_20',['task_internal.hpp',['../task__internal_8hpp.html',1,'']]], + ['task_5fqueue_2ecpp_21',['task_queue.cpp',['../task__queue_8cpp.html',1,'']]], + ['task_5fqueue_2ehpp_22',['task_queue.hpp',['../task__queue_8hpp.html',1,'']]], + ['task_5frunner_2ecpp_23',['task_runner.cpp',['../task__runner_8cpp.html',1,'']]], + ['task_5frunner_2ehpp_24',['task_runner.hpp',['../task__runner_8hpp.html',1,'']]], + ['taskqueue_25',['TaskQueue',['../structftxui_1_1task_1_1TaskQueue.html',1,'ftxui::task']]], + ['taskrunner_26',['TaskRunner',['../classftxui_1_1task_1_1TaskRunner.html',1,'TaskRunner'],['../classftxui_1_1task_1_1TaskRunner.html#aa2a63894916e321a8a93add257aad2c7',1,'ftxui::task::TaskRunner::TaskRunner()']]], + ['template_27',['Starter Template',['../getting-started.html#starter-template',1,'']]], + ['terminal_2ecpp_28',['terminal.cpp',['../terminal_8cpp.html',1,'']]], + ['terminal_2ecppm_29',['terminal.cppm',['../terminal_8cppm.html',1,'']]], + ['terminal_2ehpp_30',['terminal.hpp',['../terminal_8hpp.html',1,'']]], + ['terminal_5finput_5fparser_2ecpp_31',['terminal_input_parser.cpp',['../terminal__input__parser_8cpp.html',1,'']]], + ['terminal_5finput_5fparser_2ehpp_32',['terminal_input_parser.hpp',['../terminal__input__parser_8hpp.html',1,'']]], + ['terminal_5finput_5fparser_5ftest_5ffuzzer_2ecpp_33',['terminal_input_parser_test_fuzzer.cpp',['../terminal__input__parser__test__fuzzer_8cpp.html',1,'']]], + ['terminalinputparser_34',['TerminalInputParser',['../classftxui_1_1TerminalInputParser.html',1,'TerminalInputParser'],['../classftxui_1_1TerminalInputParser.html#acbc8ed784fd28db571aece82b20c9855',1,'ftxui::TerminalInputParser::TerminalInputParser()']]], + ['terminaloutput_35',['TerminalOutput',['../group__component.html#a0b7de0467b4e57ce5f337ba8634d8d13',1,'ftxui::ScreenInteractive']]], + ['text_36',['Text',['../menu__underline__animated__gallery_8cpp.html#abd88e1b2ce2a860c64bbcd44c0e0282b',1,'menu_underline_animated_gallery.cpp']]], + ['text_37',['text',['../group__dom.html#ga75baaa2734ed76a9f478beaafa87ae57',1,'ftxui::text(std::wstring text)'],['../group__dom.html#ga366051704fd333c23460f7932598a5e3',1,'ftxui::text(std::string text)'],['../module-dom.html#dom-text',1,'text']]], + ['text_2ecpp_38',['text.cpp',['../text_8cpp.html',1,'']]], + ['textarea_39',['textarea',['../module-component-examples.html#textarea',1,'']]], + ['textarea_2ecpp_40',['textarea.cpp',['../textarea_8cpp.html',1,'']]], + ['the_20library_41',['Build the Library',['../installation_nix.html#build-the-library',1,'']]], + ['thistle1_42',['Thistle1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaaa1937f76b1f6c26f042a5cea129d661',1,'ftxui::Color']]], + ['thistle3_43',['Thistle3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7e48d71618f8e50aed23876c3103859b',1,'ftxui::Color']]], + ['time_44',['time',['../structftxui_1_1task_1_1PendingTask.html#aae372ed4494e3631e9cac889d7384795',1,'ftxui::task::PendingTask']]], + ['timeout_45',['Timeout',['../classftxui_1_1TerminalInputParser.html#a9e4aeeff8f55e0b1c7a8f9c282a77823',1,'ftxui::TerminalInputParser']]], + ['timepoint_46',['TimePoint',['../namespaceftxui_1_1animation.html#a97ee0a9619acebafade22a9b7b0de667',1,'ftxui::animation']]], + ['title_47',['title',['../group__component.html#a32309346e2ae5546e342e991d0a53b37',1,'ftxui::WindowRenderState::title'],['../structftxui_1_1WindowOptions.html#ab923eb70f0f480c7104ee696bd790a36',1,'ftxui::WindowOptions::title']]], + ['to_48',['to',['../classftxui_1_1animation_1_1Animator.html#a5d3b8db14f3f21f9169cfbebf247d854',1,'ftxui::animation::Animator']]], + ['to_5fstring_49',['to_string',['../namespaceftxui.html#a757b345f73bb6cde5165a4d7f0c0a298',1,'ftxui']]], + ['to_5fwstring_50',['to_wstring',['../namespaceftxui.html#a57429a83a46c643a81dee81e49384439',1,'ftxui::to_wstring(const std::string &s)'],['../namespaceftxui.html#a24ea52e8ef70889ef1da986837e0ff34',1,'ftxui::to_wstring(T s)']]], + ['todo_20list_51',['Todo List',['../todo.html',1,'']]], + ['toggle _52',['Toggle ',['../module-component.html#component-toggle',1,'']]], + ['toggle_53',['Toggle',['../group__component.html#a133a8caaf0246db0902f7abce37a9b6d',1,'ftxui::MenuOption::Toggle()'],['../group__component.html#ga3537fccac66b07cd792874c9a6086811',1,'ftxui::Toggle()']]], + ['toggle_54',['toggle',['../module-component-examples.html#toggle',1,'']]], + ['toggle_2ecpp_55',['toggle.cpp',['../toggle_8cpp.html',1,'']]], + ['top_56',['top',['../structftxui_1_1WindowOptions.html#ae4390982a6943bb299f8626ffea0c8e5',1,'ftxui::WindowOptions::top'],['../screen_8cpp.html#a495e1456dc6a7df7638b2c507c756a24',1,'top: screen.cpp']]], + ['tostring_57',['ToString',['../group__screen.html#a19c380b03cea21d7ac7325136a131ff0',1,'ftxui::Screen']]], + ['trackmouse_58',['TrackMouse',['../group__component.html#ad5961c1d4caf0ba9a030e5675162a164',1,'ftxui::ScreenInteractive']]], + ['transform_59',['transform',['../group__component.html#a5641c45021a8cc20bdd21498563825a0',1,'ftxui::MenuEntryOption::transform'],['../group__component.html#afe14c161494dad905597e75661c7b6a0',1,'ftxui::ButtonOption::transform'],['../group__component.html#afe14c161494dad905597e75661c7b6a0',1,'ftxui::CheckboxOption::transform'],['../group__component.html#a93721d00aaf44f42cc0399024514b628',1,'ftxui::InputOption::transform'],['../group__component.html#afe14c161494dad905597e75661c7b6a0',1,'ftxui::RadioboxOption::transform'],['../group__component.html#ae2d438a2693c6279aba8a2549a161601',1,'ftxui::DropdownOption::transform']]], + ['triangle_60',['triangle',['../examples_2dom_2graph_8cpp.html#a5ab45e2cb218468666c7dc7b2b957396',1,'graph.cpp']]], + ['truecolor_61',['TrueColor',['../group__screen.html#ggab87bacfdad76e61b9412d7124be44c1ca7afd9568e82d523c91b2bfe0cc47be29',1,'ftxui::Terminal::TrueColor'],['../module-dom.html#dom-colors-true-color',1,'TrueColor']]], + ['turquoise2_62',['Turquoise2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0514acacf99b53570d7a2ee25dde1f5a',1,'ftxui::Color']]], + ['turquoise4_63',['Turquoise4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfac0d913fe38afad9dad5a51083ebc1e86',1,'ftxui::Color']]] +]; diff --git a/search/all_15.js b/search/all_15.js new file mode 100644 index 000000000..02aa3fba7 --- /dev/null +++ b/search/all_15.js @@ -0,0 +1,28 @@ +var searchData= +[ + ['u_0',['U',['../group__component.html#ab3ddf4540df2c9979a183e3cdf86681f',1,'ftxui::Event']]], + ['u_1',['u',['../group__component.html#a20b16b312cbcd41d7adbe561b4e08759',1,'ftxui::Event']]], + ['ubuntu_2',['Debian/Ubuntu',['../installation_debian.html',1,'installation']]], + ['ubuntu_20packages_20unofficial_3',['Debian and Ubuntu Packages (Unofficial)',['../installation_debian.html#debian-and-ubuntu-packages-unofficial',1,'']]], + ['underline_4',['Underline',['../structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37caa909c5f2b588ba35fcc40b3b504ad2ed',1,'ftxui::Screen::Cursor']]], + ['underline_5',['underline',['../group__component.html#a55b558727e02acce3f5259811b2dfe5b',1,'ftxui::MenuOption']]], + ['underlineblinking_6',['UnderlineBlinking',['../structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37cad7df11ee39d53d4ee2da1b22b2238abc',1,'ftxui::Screen::Cursor']]], + ['underlined_7',['underlined',['../group__screen.html#a7c8849e8321ea248cd4991ea8ef198eb',1,'ftxui::Pixel::underlined'],['../group__dom.html#ga5ad450c97c4d084b64ffb5b5ca942664',1,'ftxui::underlined()']]], + ['underlined_2ecpp_8',['underlined.cpp',['../underlined_8cpp.html',1,'']]], + ['underlined_5fdouble_9',['underlined_double',['../group__screen.html#afe0ea73f380e746092213b879003afd6',1,'ftxui::Pixel']]], + ['underlined_5fdouble_2ecpp_10',['underlined_double.cpp',['../underlined__double_8cpp.html',1,'']]], + ['underlineddouble_11',['underlinedDouble',['../group__dom.html#ga16d1b74107610750276499ddb3dde8da',1,'ftxui']]], + ['underlineoption_12',['UnderlineOption',['../group__component.html#structftxui_1_1UnderlineOption',1,'ftxui']]], + ['union_13',['Union',['../group__screen.html#adbc0a2693f6a78124076ef53bfd4207e',1,'ftxui::Box']]], + ['unofficial_14',['Unofficial',['../installation_debian.html#debian-and-ubuntu-packages-unofficial',1,'Debian and Ubuntu Packages (Unofficial)'],['../installation_opensuse.html#opensuse-package-unofficial',1,'openSUSE Package (Unofficial)'],['../installation_xmake.html#xmake-package-unofficial',1,'XMake Package (Unofficial)']]], + ['up_15',['Up',['../group__dom.html#gga224b9163917ac32fc95a60d8c1eec3aaa258f49887ef8d14ac268c92b02503aaa',1,'ftxui']]], + ['use_20as_20a_20dependency_16',['Use as a Dependency',['../installation_nix.html#use-as-a-dependency',1,'']]], + ['using_20fetchcontent_17',['Using FetchContent',['../installation_cmake.html#using-fetchcontent',1,'']]], + ['using_20find_5fpackage_18',['Using find_package',['../installation_cmake.html#using-find_package',1,'']]], + ['using_20git_20submodule_19',['Using git submodule',['../installation_cmake.html#using-git-submodule',1,'']]], + ['using_20vcpkg_20',['Install FTXUI using Vcpkg',['../installation_vcpkg.html#install-ftxui-using-vcpkg',1,'']]], + ['utf8toglyphs_21',['Utf8ToGlyphs',['../namespaceftxui.html#a389c58d385e861cd2ef109b53fc6ef96',1,'ftxui']]], + ['utf8towordbreakproperty_22',['Utf8ToWordBreakProperty',['../namespaceftxui.html#ad15724e497f0001e146da530183ca552',1,'ftxui']]], + ['util_2ecppm_23',['util.cppm',['../util_8cppm.html',1,'']]], + ['util_2ehpp_24',['util.hpp',['../util_8hpp.html',1,'']]] +]; diff --git a/search/all_16.js b/search/all_16.js new file mode 100644 index 000000000..8fc08b8b4 --- /dev/null +++ b/search/all_16.js @@ -0,0 +1,31 @@ +var searchData= +[ + ['v_0',['V',['../group__component.html#ad5fb499039d0bcd88f478ff1dbd8a729',1,'ftxui::Event']]], + ['v_1',['v',['../group__component.html#ae520ce70c694e5be3aee7a8dffa36fa2',1,'ftxui::Event']]], + ['value_2',['value',['../structftxui_1_1SliderOption.html#ab256d6c86a100045ed2329da289dce3a',1,'ftxui::SliderOption::value'],['../group__screen.html#a638e4503e0ae6ce655b7ad2e17e8f0ad',1,'ftxui::ColorInfo::value']]], + ['value_5f_3',['value_',['../src_2ftxui_2dom_2separator_8cpp.html#ad84db3d1db4de4af9935d2d361626bdb',1,'separator.cpp']]], + ['variant_4',['Variant',['../classftxui_1_1ConstStringListRef.html#a5385a19678ef154eb13e9c8428e4d19c',1,'ftxui::ConstStringListRef']]], + ['vbox_5',['vbox',['../group__dom.html#gafd28058f0ccbbdf34691a85a7cc9b2e3',1,'ftxui']]], + ['vbox_2ecpp_6',['vbox.cpp',['../vbox_8cpp.html',1,'']]], + ['vbox_5fhbox_7',['vbox_hbox',['../module-dom-examples.html#vbox_hbox',1,'']]], + ['vbox_5fhbox_2ecpp_8',['vbox_hbox.cpp',['../vbox__hbox_8cpp.html',1,'']]], + ['vcenter_9',['vcenter',['../group__dom.html#gad907a8a48bb9f9dfdb06402e9fc12316',1,'ftxui']]], + ['vcpkg_10',['Vcpkg',['../installation_vcpkg.html#install-ftxui-using-vcpkg',1,'Install FTXUI using Vcpkg'],['../installation_vcpkg.html',1,'Vcpkg']]], + ['vcpkg_20package_11',['Vcpkg Package',['../installation_vcpkg.html#vcpkg-package',1,'']]], + ['verifying_20integration_12',['Verifying Integration',['../installation_cmake.html#verifying-integration',1,'']]], + ['vertical_13',['Vertical',['../group__component.html#a617c59fdb94db99100d0e7a569c31d75',1,'ftxui::MenuOption::Vertical()'],['../group__component.html#ga6471e39f5664d059144746c5801d37e6',1,'ftxui::Container::Vertical(Components children)'],['../group__component.html#ga25099e2d2ead8a46c8d9a899982070b7',1,'ftxui::Container::Vertical(Components children, int *selector)'],['../module-component.html#component-vertical',1,'Vertical']]], + ['verticalanimated_14',['VerticalAnimated',['../group__component.html#a6079a7637256d70b30aacb92d2034205',1,'ftxui::MenuOption']]], + ['vflow_15',['vflow',['../namespaceftxui.html#ae0da51b614e95a0687727644b5898a23',1,'ftxui::vflow()'],['../module-dom-examples.html#vflow',1,'vflow']]], + ['vflow_2ecpp_16',['vflow.cpp',['../vflow_8cpp.html',1,'']]], + ['violet_17',['Violet',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa94a3ee3884eb2af70a2d764a4f06e79d',1,'ftxui::Color']]], + ['vmenu1_18',['VMenu1',['../menu__style_8cpp.html#abc833415e917ac2a93b5a4f35df2f0fb',1,'menu_style.cpp']]], + ['vmenu2_19',['VMenu2',['../menu__style_8cpp.html#ab1c7204fedc90016a50553cdcdc9b58b',1,'menu_style.cpp']]], + ['vmenu3_20',['VMenu3',['../menu__style_8cpp.html#aec99d3a88e71643df15281e0041e44a2',1,'menu_style.cpp']]], + ['vmenu4_21',['VMenu4',['../menu__style_8cpp.html#afc540158e9fcd015af9e24d4ef072214',1,'menu_style.cpp']]], + ['vmenu5_22',['VMenu5',['../menu__style_8cpp.html#a62669e7b3cf3a388a714910a16cce19b',1,'menu_style.cpp']]], + ['vmenu6_23',['VMenu6',['../menu__style_8cpp.html#aeeb06101b3a771616149626f203be146',1,'menu_style.cpp']]], + ['vmenu7_24',['VMenu7',['../menu__style_8cpp.html#af07f6b560af2a9d723b3e53360d280b5',1,'menu_style.cpp']]], + ['vmenu8_25',['VMenu8',['../menu__style_8cpp.html#afade922e195c0cda670066485469de56',1,'menu_style.cpp']]], + ['vscroll_5findicator_26',['vscroll_indicator',['../group__dom.html#ga1974176e676afdb96d203e8e0f579219',1,'ftxui']]], + ['vtext_27',['vtext',['../group__dom.html#ga9f9f7485a45aa9d432726ca9845d1eac',1,'ftxui::vtext(std::wstring text)'],['../group__dom.html#ga64172a43b4b526afeb6313e6e1a6d5a1',1,'ftxui::vtext(std::string text)'],['../module-dom.html#dom-vtext',1,'vtext']]] +]; diff --git a/search/all_17.js b/search/all_17.js new file mode 100644 index 000000000..e28f09b1c --- /dev/null +++ b/search/all_17.js @@ -0,0 +1,30 @@ +var searchData= +[ + ['w_0',['W',['../group__component.html#af220c9f0599cf10469883c7c23cf4a8f',1,'ftxui::Event']]], + ['w_1',['w',['../group__component.html#a072a3690c998e6dbe13ca87b9174b596',1,'ftxui::Event']]], + ['warn_5fwindows_5fmacro_2ehpp_2',['warn_windows_macro.hpp',['../warn__windows__macro_8hpp.html',1,'']]], + ['wchar_5fwidth_3',['wchar_width',['../namespaceftxui.html#a1bb4947f62228380f5c415f69b34021f',1,'ftxui']]], + ['wheat1_4',['Wheat1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2919dbb2ef2f19e560ee2a4f21874373',1,'ftxui::Color']]], + ['wheat4_5',['Wheat4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa3fee165b16150ce4df5f4fcecca7407',1,'ftxui::Color']]], + ['wheeldown_6',['WheelDown',['../group__component.html#a03bfec859eac87be20f8952c1eb89de0afd8a27c9d7eac3486f6fbd2d608da0db',1,'ftxui::Mouse']]], + ['wheelleft_7',['WheelLeft',['../group__component.html#a03bfec859eac87be20f8952c1eb89de0a160e671a76bd0d1f424a8b9700275375',1,'ftxui::Mouse']]], + ['wheelright_8',['WheelRight',['../group__component.html#a03bfec859eac87be20f8952c1eb89de0ae73184b2d38af984b5cda75057471adc',1,'ftxui::Mouse']]], + ['wheelup_9',['WheelUp',['../group__component.html#a03bfec859eac87be20f8952c1eb89de0ab51f2e2fc1697565b732263f86a976d6',1,'ftxui::Mouse']]], + ['white_10',['White',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802fab548046646b36c12aa6ba841de500094',1,'ftxui::Color']]], + ['width_11',['WIDTH',['../namespaceftxui.html#a04711c04f28aabfa0e5928a35baaec53a73c0818986b7c462c2977f57afd00522',1,'ftxui']]], + ['width_12',['width',['../structftxui_1_1WindowOptions.html#a9fb534b72660dd8bb6f17ce5d090a94a',1,'ftxui::WindowOptions::width'],['../group__dom.html#ad72663daf610f2a0833a2fc3d78e4fdf',1,'ftxui::Canvas::width()']]], + ['widthorheight_13',['WidthOrHeight',['../namespaceftxui.html#a04711c04f28aabfa0e5928a35baaec53',1,'ftxui']]], + ['window_14',['Window',['../group__component.html#ga638693abef9289912f5fa39606390b20',1,'ftxui::Window()'],['../menu__multiple_8cpp.html#ac2013764d7f0c7eb57876c3755e98bb3',1,'Window(): menu_multiple.cpp']]], + ['window_15',['window',['../group__dom.html#ga03049def08fa7a5eaa4d5e897152bc1a',1,'ftxui::window()'],['../module-dom.html#dom-window',1,'window'],['../module-component-examples.html#window',1,'window']]], + ['windowoptions_16',['WindowOptions',['../structftxui_1_1WindowOptions.html',1,'ftxui']]], + ['windowrenderstate_17',['WindowRenderState',['../group__component.html#structftxui_1_1WindowRenderState',1,'ftxui']]], + ['with_5frestored_5fio_18',['with_restored_io',['../module-component-examples.html#with_restored_io',1,'']]], + ['with_5frestored_5fio_2ecpp_19',['with_restored_io.cpp',['../with__restored__io_8cpp.html',1,'']]], + ['withrestoredio_20',['WithRestoredIO',['../group__component.html#af9df2de690486078fea4a7151b83b089',1,'ftxui::ScreenInteractive']]], + ['wordbreakproperty_21',['WordBreakProperty',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968a',1,'ftxui']]], + ['wrap_22',['Wrap',['../group__dom.html#a6c844a611650cf7e956dbe269a0e72ab',1,'ftxui::FlexboxConfig::Wrap'],['../group__dom.html#a6c844a611650cf7e956dbe269a0e72abaa212b19ef5f2fb30acf92e6cbccc1f2d',1,'ftxui::FlexboxConfig::Wrap'],['../gallery_8cpp.html#a0a320000c5a485508c57030f605b800a',1,'Wrap(): gallery.cpp']]], + ['wrap_23',['wrap',['../group__dom.html#a68b5470ece4f0a492cc1d2057c9bd5e0',1,'ftxui::FlexboxConfig']]], + ['wrapinversed_24',['WrapInversed',['../group__dom.html#a6c844a611650cf7e956dbe269a0e72abad639e613e3589af04e39135707dbc642',1,'ftxui::FlexboxConfig']]], + ['wsegspace_25',['WSegSpace',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aa3ddc36a0c4e381a754fb00548d567d09',1,'ftxui']]], + ['wstring_5fwidth_26',['wstring_width',['../namespaceftxui.html#adedb4aa528ad2aef48177dea69ca7a9d',1,'ftxui']]] +]; diff --git a/search/all_18.js b/search/all_18.js new file mode 100644 index 000000000..a31ce11cc --- /dev/null +++ b/search/all_18.js @@ -0,0 +1,14 @@ +var searchData= +[ + ['x_0',['X',['../group__component.html#a1e97cb57e166a02a12536507200689cd',1,'ftxui::Event']]], + ['x_1',['x',['../group__component.html#a8ea38b427ac031b90f864b64d04fb386',1,'ftxui::Event::x'],['../group__component.html#a6150e0515f7202e2fb518f7206ed97dc',1,'ftxui::Mouse::x'],['../structftxui_1_1Screen_1_1Cursor.html#a6150e0515f7202e2fb518f7206ed97dc',1,'ftxui::Screen::Cursor::x'],['../structftxui_1_1flexbox__helper_1_1Block.html#a6150e0515f7202e2fb518f7206ed97dc',1,'ftxui::flexbox_helper::Block::x'],['../structftxui_1_1flexbox__helper_1_1Line.html#a6150e0515f7202e2fb518f7206ed97dc',1,'ftxui::flexbox_helper::Line::x']]], + ['x_5fmax_2',['x_max',['../group__screen.html#a5f0bb6d8a3e66525c3e6264cb8288e43',1,'ftxui::Box']]], + ['x_5fmin_3',['x_min',['../group__screen.html#ae0951dcafafdc96ac1d8361c672d47e2',1,'ftxui::Box']]], + ['x_5fsize_4',['x_size',['../src_2ftxui_2dom_2gridbox_8cpp.html#aa84601b56e801ce086fd86309a13e695',1,'gridbox.cpp']]], + ['xflex_5',['xflex',['../group__dom.html#ga0dbba98e14f63f1dd5163cbdc4f42da8',1,'ftxui']]], + ['xflex_5fgrow_6',['xflex_grow',['../group__dom.html#ga1618cb15307f29eb3d531e7b44c280d3',1,'ftxui']]], + ['xflex_5fshrink_7',['xflex_shrink',['../group__dom.html#ga95275a9271934cf76e970c6650cc224d',1,'ftxui']]], + ['xframe_8',['xframe',['../namespaceftxui.html#a2d0617c0912b732f059cf360ac951c49',1,'ftxui']]], + ['xmake_9',['XMake',['../installation_xmake.html',1,'installation']]], + ['xmake_20package_20unofficial_10',['XMake Package (Unofficial)',['../installation_xmake.html#xmake-package-unofficial',1,'']]] +]; diff --git a/search/all_19.js b/search/all_19.js new file mode 100644 index 000000000..c9b26fbec --- /dev/null +++ b/search/all_19.js @@ -0,0 +1,21 @@ +var searchData= +[ + ['y_0',['Y',['../group__component.html#acd3caeaaff59d57221f62ea89e279c40',1,'ftxui::Event']]], + ['y_1',['y',['../group__component.html#abcbf2b29725cb4c562ff3e460934b7e3',1,'ftxui::Event::y'],['../group__component.html#a0a2f84ed7838f07779ae24c5a9086d33',1,'ftxui::Mouse::y'],['../structftxui_1_1Screen_1_1Cursor.html#a0a2f84ed7838f07779ae24c5a9086d33',1,'ftxui::Screen::Cursor::y'],['../structftxui_1_1flexbox__helper_1_1Block.html#a0a2f84ed7838f07779ae24c5a9086d33',1,'ftxui::flexbox_helper::Block::y'],['../structftxui_1_1flexbox__helper_1_1Line.html#a0a2f84ed7838f07779ae24c5a9086d33',1,'ftxui::flexbox_helper::Line::y']]], + ['y_5fmax_2',['y_max',['../group__screen.html#ad033aea530fbbcf5bcd6cd98d882e3a5',1,'ftxui::Box']]], + ['y_5fmin_3',['y_min',['../group__screen.html#a7941ddc7e35fffb8864af1e922814401',1,'ftxui::Box']]], + ['y_5fsize_4',['y_size',['../src_2ftxui_2dom_2gridbox_8cpp.html#a99e442a053babaa64367447a56138823',1,'gridbox.cpp']]], + ['yellow_5',['Yellow',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802fabf28513245738599d13e3ce36bd16c82',1,'ftxui::Color']]], + ['yellow1_6',['Yellow1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa18f6dad40423c7708a467fb630f59048',1,'ftxui::Color']]], + ['yellow2_7',['Yellow2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfac571c9dd674c4e7301b11cee12715bdf',1,'ftxui::Color']]], + ['yellow3_8',['Yellow3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa64545058cba31bf28f7cc75072664ec2',1,'ftxui::Color']]], + ['yellow3bis_9',['Yellow3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa67ae91aade6999e17c552ebe197c3a7f',1,'ftxui::Color']]], + ['yellow4_10',['Yellow4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfab60ac0c6b49456d0de7ca3388f19862a',1,'ftxui::Color']]], + ['yellow4bis_11',['Yellow4Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaaf28e9bd6542c570b963f36620b181f7',1,'ftxui::Color']]], + ['yellowlight_12',['YellowLight',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802fa7948fe5f055329af04798409b7ac37b5',1,'ftxui::Color']]], + ['yflex_13',['yflex',['../group__dom.html#ga42c7a33df6d890de30fc1ebb2d1b3ca6',1,'ftxui']]], + ['yflex_5fgrow_14',['yflex_grow',['../group__dom.html#ga7eac3f709e905af8f583aed52093b7ce',1,'ftxui']]], + ['yflex_5fshrink_15',['yflex_shrink',['../group__dom.html#gaf7d0757f5965aa579bccc125ff909256',1,'ftxui']]], + ['yframe_16',['yframe',['../namespaceftxui.html#a7ea9d3ceb2a977955125c6e4a6072325',1,'ftxui']]], + ['your_20build_20system_17',['Configure your build system.',['../installation_vcpkg.html#configure-your-build-system',1,'']]] +]; diff --git a/search/all_1a.js b/search/all_1a.js new file mode 100644 index 000000000..9809d4463 --- /dev/null +++ b/search/all_1a.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['z_0',['Z',['../group__component.html#a7ea819ebc3e828cab8618738b13bf7e4',1,'ftxui::Event']]], + ['z_1',['z',['../group__component.html#a495d2bd0a6d4ef68721d142f78394303',1,'ftxui::Event']]], + ['zwj_2',['ZWJ',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aacb4adf7b93435bdfbae8f32d5bcda514',1,'ftxui']]] +]; diff --git a/search/all_1b.js b/search/all_1b.js new file mode 100644 index 000000000..fc9b8c4d1 --- /dev/null +++ b/search/all_1b.js @@ -0,0 +1,17 @@ +var searchData= +[ + ['_7eadapter_0',['~Adapter',['../classftxui_1_1ConstStringListRef_1_1Adapter.html#acc343e0991b39fbf9b66f2faf7cb7f11',1,'ftxui::ConstStringListRef::Adapter']]], + ['_7eautoreset_1',['~AutoReset',['../classftxui_1_1AutoReset.html#ad7e022164fb38a279cca7c6cf478f379',1,'ftxui::AutoReset']]], + ['_7ecapturedmouseinterface_2',['~CapturedMouseInterface',['../classftxui_1_1CapturedMouseInterface.html#af35148d7f798953f8d7e8c1a0e2b2ef0',1,'ftxui::CapturedMouseInterface']]], + ['_7ecomponentbase_3',['~ComponentBase',['../group__component.html#ae490d465a018a9d81bb4e30604708fba',1,'ftxui::ComponentBase']]], + ['_7econstref_4',['~ConstRef',['../classftxui_1_1ConstRef.html#a4ab7aed14f1e68d9be361d5ccfcd4e0f',1,'ftxui::ConstRef']]], + ['_7econststringlistref_5',['~ConstStringListRef',['../classftxui_1_1ConstStringListRef.html#a517a6924cc5fa2fff3e6c08bc504f0fa',1,'ftxui::ConstStringListRef']]], + ['_7eimage_6',['~Image',['../group__screen.html#af7348fef7a61244855ed83dfb1fcbfa1',1,'ftxui::Image']]], + ['_7eloop_7',['~Loop',['../group__component.html#a84c72a09400ffc01ce3257d2109453a2',1,'ftxui::Loop']]], + ['_7enode_8',['~Node',['../group__dom.html#a6fa6bf60f34f1e3efb0e59333428c9c8',1,'ftxui::Node']]], + ['_7eref_9',['~Ref',['../classftxui_1_1Ref.html#a3950a05eee649724ae206d5dd33355f5',1,'ftxui::Ref']]], + ['_7escreen_10',['~Screen',['../group__screen.html#a20d80448fe5bd4ce01dcd821d4d67a5b',1,'ftxui::Screen']]], + ['_7escreeninteractive_11',['~ScreenInteractive',['../group__component.html#a2c4f2d0819fb7afa3ce40cc0e3107053',1,'ftxui::ScreenInteractive']]], + ['_7esenderimpl_12',['~SenderImpl',['../classftxui_1_1SenderImpl.html#ac23f2c8d2bf8c021dcce059afd2c3405',1,'ftxui::SenderImpl']]], + ['_7etaskrunner_13',['~TaskRunner',['../classftxui_1_1task_1_1TaskRunner.html#afab0128a700661663463c90c9a33d71d',1,'ftxui::task::TaskRunner']]] +]; diff --git a/search/all_2.js b/search/all_2.js new file mode 100644 index 000000000..517ba1d0c --- /dev/null +++ b/search/all_2.js @@ -0,0 +1,74 @@ +var searchData= +[ + ['b_0',['B',['../group__component.html#a4dd738a967d95833e57bd94580c03d08',1,'ftxui::Event']]], + ['b_1',['b',['../group__component.html#a27d7cfd7232d069c045ca18db3523093',1,'ftxui::Event']]], + ['back_2',['back',['../structftxui_1_1ResizableSplitOption.html#a591ffd25e449a214855e0dfd78dab766',1,'ftxui::ResizableSplitOption']]], + ['background_3',['background',['../structftxui_1_1AnimatedColorsOption.html#a550692ff465684652d29385a6b24304d',1,'ftxui::AnimatedColorsOption']]], + ['background_5fcolor_4',['background_color',['../group__screen.html#a3af4612678da78558adccf47e17164bb',1,'ftxui::Pixel']]], + ['backin_5',['BackIn',['../namespaceftxui_1_1animation_1_1easing.html#ae9cca3240dd9f14a807364e322bbdf79',1,'ftxui::animation::easing']]], + ['backinout_6',['BackInOut',['../namespaceftxui_1_1animation_1_1easing.html#a4dfa1e95971ff8e4d0f7539f2e8ae577',1,'ftxui::animation::easing']]], + ['backout_7',['BackOut',['../namespaceftxui_1_1animation_1_1easing.html#a440085789f25b7f3ffa1391f09e154f3',1,'ftxui::animation::easing']]], + ['backspace_8',['Backspace',['../group__component.html#a87cb6a8c09564342227afc71c7f76c82',1,'ftxui::Event']]], + ['bar_9',['Bar',['../structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37ca6424dbda22da2f105580d1c8095600d3',1,'ftxui::Screen::Cursor']]], + ['barblinking_10',['BarBlinking',['../structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37cae7dfc08d4e90b88e0cb1cea7a54796c1',1,'ftxui::Screen::Cursor']]], + ['bazel_11',['Bazel',['../installation_bazel.html',1,'installation']]], + ['bgcolor_12',['bgcolor',['../group__dom.html#ga01d4c5aaf0447e862246849111782245',1,'ftxui::bgcolor(Color color)'],['../group__dom.html#gaee41f3eaff28a123214e81231f8f4593',1,'ftxui::bgcolor(const LinearGradient &gradient)'],['../group__dom.html#gaae86eacae0a0626b41e9964ac7f4f532',1,'ftxui::bgcolor(Color color, Element child)'],['../group__dom.html#gaaac1622d43662a6a02113d9230a4fdd4',1,'ftxui::bgcolor(const LinearGradient &gradient, Element child)']]], + ['black_13',['Black',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802fac1e9bce8242f443c54c7405223d616cd',1,'ftxui::Color']]], + ['blend_14',['Blend',['../group__screen.html#a3422660268648b5a260ac94336e7e405',1,'ftxui::Color']]], + ['blink_15',['blink',['../group__screen.html#a399ff0c757d88aeaa2439212f073f380',1,'ftxui::Pixel::blink'],['../group__dom.html#gad57613de5895e774218d91dea48d074b',1,'ftxui::blink()']]], + ['blink_2ecpp_16',['blink.cpp',['../blink_8cpp.html',1,'']]], + ['block_17',['Block',['../structftxui_1_1flexbox__helper_1_1Block.html',1,'Block'],['../structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37caa00f801460e81f86eab56d86fe627551',1,'ftxui::Screen::Cursor::Block']]], + ['blockblinking_18',['BlockBlinking',['../structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37ca2f4a0b3cacb4468d8467dc0746ea23aa',1,'ftxui::Screen::Cursor']]], + ['blocks_19',['blocks',['../structftxui_1_1flexbox__helper_1_1Line.html#acb3eeab6f2ab1007cacd9f72caf9cdb8',1,'ftxui::flexbox_helper::Line::blocks'],['../structftxui_1_1flexbox__helper_1_1Global.html#ac91f06264613997a325271ce8e35d840',1,'ftxui::flexbox_helper::Global::blocks']]], + ['blue_20',['Blue',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802faf5e09dd1da4088464f264b7a3118bff8',1,'ftxui::Color']]], + ['blue_21',['blue',['../group__screen.html#a287b397e90d7b995c81ff54e741f96b2',1,'ftxui::ColorInfo']]], + ['blue1_22',['Blue1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9eafa8db807f9452108cd02b80cd4adc',1,'ftxui::Color']]], + ['blue3_23',['Blue3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa910d98e6c6282c1c8133f53438beb7ca',1,'ftxui::Color']]], + ['blue3bis_24',['Blue3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfabb8f8ef3f352a8a9c884fadff1576b13',1,'ftxui::Color']]], + ['bluelight_25',['BlueLight',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802faf7cc79a56a740e9c59a156b0b3b93cbd',1,'ftxui::Color']]], + ['blueviolet_26',['BlueViolet',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfabcd3fa02524f2597996333516267c773',1,'ftxui::Color']]], + ['bold_27',['bold',['../group__screen.html#a7a210a24d67146bd143c013d1da0f2dd',1,'ftxui::Pixel::bold'],['../group__dom.html#ga353c769068e25303eb41fa2da565c604',1,'ftxui::bold()']]], + ['bold_2ecpp_28',['bold.cpp',['../bold_8cpp.html',1,'']]], + ['border_29',['Border',['../group__component.html#a2f8ead79a770376a36e9b9b7fa6bc966',1,'ftxui::ButtonOption::Border()'],['../classftxui_1_1TableSelection.html#af47b05e5a3f01cafc419ce94388cae51',1,'ftxui::TableSelection::Border()']]], + ['border_30',['border',['../group__dom.html#gae8537acd423d47cf07e61bd774fb1098',1,'ftxui::border()'],['../module-dom.html#dom-border',1,'border'],['../module-dom-examples.html#border',1,'border']]], + ['border_5fcolored_31',['border_colored',['../module-dom-examples.html#border_colored',1,'']]], + ['border_5fcolored_2ecpp_32',['border_colored.cpp',['../border__colored_8cpp.html',1,'']]], + ['border_5fstyle_33',['border_style',['../module-dom-examples.html#border_style',1,'']]], + ['border_5fstyle_2ecpp_34',['border_style.cpp',['../border__style_8cpp.html',1,'']]], + ['borderbottom_35',['BorderBottom',['../classftxui_1_1TableSelection.html#ab3efbe517730170703eba50cf23b150d',1,'ftxui::TableSelection']]], + ['borderdashed_36',['borderDashed',['../group__dom.html#ga181c80f8ada12d1356f6bfa0ebb7219f',1,'ftxui']]], + ['borderdouble_37',['borderDouble',['../group__dom.html#ga052b504344f3bc1ff86b3493cd934215',1,'ftxui']]], + ['borderempty_38',['borderEmpty',['../group__dom.html#gaf20f7d6fb275d109f0bdc01a2e4d3f3e',1,'ftxui']]], + ['borderheavy_39',['borderHeavy',['../group__dom.html#ga666c31419cc31cdadc9f8178ed63529e',1,'ftxui']]], + ['borderleft_40',['BorderLeft',['../classftxui_1_1TableSelection.html#a5b822ad80ff44922a9d6551743f64259',1,'ftxui::TableSelection']]], + ['borderlight_41',['borderLight',['../group__dom.html#gaa074cdab57eeb47b99f1699bcc8addd8',1,'ftxui']]], + ['borderright_42',['BorderRight',['../classftxui_1_1TableSelection.html#af36f1d9893a26293f24da431c5a344cc',1,'ftxui::TableSelection']]], + ['borderrounded_43',['borderRounded',['../group__dom.html#ga3cf2db223a5efaa370f0ca6bb405b80e',1,'ftxui']]], + ['borderstyle_44',['BorderStyle',['../group__dom.html#gafe3103dd0b8240c5443892484ef5af9c',1,'ftxui']]], + ['borderstyled_45',['borderStyled',['../group__dom.html#gabc9db79957d4dd36deb8ca79938e4c41',1,'ftxui::borderStyled(BorderStyle style)'],['../group__dom.html#ga5aab98b289d2e7b2ce8ca0eeee51ce78',1,'ftxui::borderStyled(BorderStyle style, Color foreground_color)'],['../group__dom.html#gad1dbf36194dcb77674085df9e11c1e22',1,'ftxui::borderStyled(Color foreground_color)']]], + ['bordertop_46',['BorderTop',['../classftxui_1_1TableSelection.html#aa9002be87d1fc0c5c6416b8006a902e4',1,'ftxui::TableSelection']]], + ['borderwith_47',['borderWith',['../group__dom.html#gaa97cfcfbe6df92dac085454395ec7b2f',1,'ftxui']]], + ['bouncein_48',['BounceIn',['../namespaceftxui_1_1animation_1_1easing.html#a3a136fc5aedb4e99e08e5bea138463cb',1,'ftxui::animation::easing']]], + ['bounceinout_49',['BounceInOut',['../namespaceftxui_1_1animation_1_1easing.html#a1a048fdae839f9493331cf1745767519',1,'ftxui::animation::easing']]], + ['bounceout_50',['BounceOut',['../namespaceftxui_1_1animation_1_1easing.html#aba7f60496f13f39385d9a47349e97c09',1,'ftxui::animation::easing']]], + ['box_51',['Box',['../group__screen.html#structftxui_1_1Box',1,'ftxui']]], + ['box_52',['box',['../structftxui_1_1Requirement_1_1Focused.html#ab19e728e80bc2fc43d8e82c3602f8333',1,'ftxui::Requirement::Focused']]], + ['box_2ecpp_53',['box.cpp',['../box_8cpp.html',1,'']]], + ['box_2ecppm_54',['box.cppm',['../box_8cppm.html',1,'']]], + ['box_2ehpp_55',['box.hpp',['../box_8hpp.html',1,'']]], + ['box_5f_56',['box_',['../group__dom.html#aa7e7d30102945911407723a5cbcdfabc',1,'ftxui::Node']]], + ['box_5fhelper_2ecpp_57',['box_helper.cpp',['../box__helper_8cpp.html',1,'']]], + ['box_5fhelper_2ehpp_58',['box_helper.hpp',['../box__helper_8hpp.html',1,'']]], + ['build_20system_59',['Configure your build system.',['../installation_vcpkg.html#configure-your-build-system',1,'']]], + ['build_20the_20library_60',['Build the Library',['../installation_nix.html#build-the-library',1,'']]], + ['building_20from_20source_20official_61',['Building from Source (Official)',['../installation_manual.html#building-from-source-official',1,'']]], + ['button_62',['Button',['../group__component.html#a03bfec859eac87be20f8952c1eb89de0',1,'ftxui::Mouse::Button'],['../group__component.html#ga4e8295ec77dd31b0acc5063b134473e7',1,'ftxui::Button(ButtonOption option)'],['../group__component.html#ga0488e28ee9388e0ddca26f1d03d827d1',1,'ftxui::Button(ConstStringRef label, std::function< void()> on_click, ButtonOption option)']]], + ['button_63',['button',['../group__component.html#aa56e877ca6a7524cf1e891c7435c3ace',1,'ftxui::Mouse::button'],['../module-component-examples.html#button',1,'button']]], + ['button_5fanimated_64',['button_animated',['../module-component-examples.html#button_animated',1,'']]], + ['button_5fanimated_2ecpp_65',['button_animated.cpp',['../button__animated_8cpp.html',1,'']]], + ['button_5fin_5fframe_66',['button_in_frame',['../module-component-examples.html#button_in_frame',1,'']]], + ['button_5fin_5fframe_2ecpp_67',['button_in_frame.cpp',['../button__in__frame_8cpp.html',1,'']]], + ['button_5fstyle_68',['button_style',['../modal__dialog_8cpp.html#a1a0df261e66f85913256ea3d321b3e87',1,'button_style: modal_dialog.cpp'],['../module-component-examples.html#button_style',1,'button_style']]], + ['button_5fstyle_2ecpp_69',['button_style.cpp',['../button__style_8cpp.html',1,'']]], + ['buttonoption_70',['ButtonOption',['../group__component.html#structftxui_1_1ButtonOption',1,'ftxui']]] +]; diff --git a/search/all_3.js b/search/all_3.js new file mode 100644 index 000000000..7b4b70109 --- /dev/null +++ b/search/all_3.js @@ -0,0 +1,206 @@ +var searchData= +[ + ['c_0',['C',['../group__component.html#aad99c99d06c8b90edc409743b4c23efb',1,'ftxui::Event']]], + ['c_1',['c',['../group__component.html#af8a909c0d59f212fdf1e79af33888d53',1,'ftxui::Event']]], + ['c_2020_20modules_2',['C++20 Modules',['../cpp20-modules.html',1,'']]], + ['cadetblue_3',['CadetBlue',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa76906c6e4ac2ee22b81bda5a59e335f1',1,'ftxui::Color']]], + ['cadetbluebis_4',['CadetBlueBis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfacb5d4e2aebcd3abba4c91d055f07513b',1,'ftxui::Color']]], + ['canvas_5',['Canvas',['../group__dom.html#structftxui_1_1Canvas',1,'Canvas'],['../group__dom.html#a3cbcd839ac8597df2e0f351850ec4735',1,'ftxui::Canvas::Canvas()=default'],['../group__dom.html#a6a78dda2095054ffa03f215f0153bdbb',1,'ftxui::Canvas::Canvas(int width, int height)'],['../module-dom.html#dom-canvas',1,'Canvas']]], + ['canvas_6',['canvas',['../namespaceftxui.html#a57d7bdf155e190de514a689abb4e9a35',1,'ftxui::canvas(ConstRef< Canvas > canvas)'],['../namespaceftxui.html#ac781c6530fb74b861af7d52c03ffb2b9',1,'ftxui::canvas(int width, int height, std::function< void(Canvas &)> fn)'],['../namespaceftxui.html#a8bef154e558868d259c52380e1e5ead9',1,'ftxui::canvas(std::function< void(Canvas &)> fn)'],['../module-dom-examples.html#canvas',1,'canvas']]], + ['canvas_2ecppm_7',['canvas.cppm',['../canvas_8cppm.html',1,'']]], + ['canvas_2ehpp_8',['canvas.hpp',['../canvas_8hpp.html',1,'']]], + ['canvas_5fanimated_9',['canvas_animated',['../module-component-examples.html#canvas_animated',1,'']]], + ['canvas_5fanimated_2ecpp_10',['canvas_animated.cpp',['../canvas__animated_8cpp.html',1,'']]], + ['captured_5fmouse_2ecppm_11',['captured_mouse.cppm',['../captured__mouse_8cppm.html',1,'']]], + ['captured_5fmouse_2ehpp_12',['captured_mouse.hpp',['../captured__mouse_8hpp.html',1,'']]], + ['capturedmouse_13',['CapturedMouse',['../namespaceftxui.html#a24b663cb6b0b262055c94d3a03bdd274',1,'ftxui']]], + ['capturedmouseinterface_14',['CapturedMouseInterface',['../classftxui_1_1CapturedMouseInterface.html',1,'CapturedMouseInterface'],['../classftxui_1_1CapturedMouseInterface.html#abc72c038150d1866199c28dffe7ace7b',1,'ftxui::CapturedMouseInterface::CapturedMouseInterface()=default'],['../classftxui_1_1CapturedMouseInterface.html#abb21b580f6362d9f5f4d25c6b8ca54cb',1,'ftxui::CapturedMouseInterface::CapturedMouseInterface(const CapturedMouseInterface &)=default'],['../classftxui_1_1CapturedMouseInterface.html#a2f92bdd8e2c098ade383916b8e47b7e0',1,'ftxui::CapturedMouseInterface::CapturedMouseInterface(CapturedMouseInterface &&)=delete']]], + ['capturemouse_15',['CaptureMouse',['../group__component.html#a164d10a2cf367bdd4ae14318a6c7d769',1,'ftxui::ComponentBase::CaptureMouse()'],['../group__component.html#aad61519d291dcc216d2ac618618a45a2',1,'ftxui::ScreenInteractive::CaptureMouse()']]], + ['catch_5fevent_2ecpp_16',['catch_event.cpp',['../catch__event_8cpp.html',1,'']]], + ['catchevent_17',['CatchEvent',['../namespaceftxui.html#afa5872ba3f9889c7487e57e745e56857',1,'ftxui::CatchEvent(Component child, std::function< bool(Event)>)'],['../group__component.html#gad2948235799c010c76c6de861c050c59',1,'ftxui::CatchEvent(std::function< bool(Event)> on_event)'],['../group__component.html#ga0bfd67a2815807dc6fc9bc0f79bce29e',1,'ftxui::CatchEvent(Component child, std::function< bool(Event event)> on_event)'],['../module-component.html#component-catchevent',1,'CatchEvent']]], + ['celltoglyphindex_18',['CellToGlyphIndex',['../namespaceftxui.html#a9769a28baa6a84d5de6a8bd624a29294',1,'ftxui']]], + ['center_19',['Center',['../group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2a4f1f6016fc9f3f2353c0cc7c67b292bd',1,'ftxui::FlexboxConfig::Center'],['../group__dom.html#a821af961ece5fe13540ad48b54c7a9e7a4f1f6016fc9f3f2353c0cc7c67b292bd',1,'ftxui::FlexboxConfig::Center'],['../group__dom.html#a1f99410fd0fc632a5bc2497b6a447420a4f1f6016fc9f3f2353c0cc7c67b292bd',1,'ftxui::FlexboxConfig::Center']]], + ['center_20',['center',['../group__dom.html#ga5b11656305fce8427b81daf1c35883f1',1,'ftxui']]], + ['character_21',['Character',['../group__component.html#a769519ed730b72a53a2e770d6ee44365',1,'ftxui::Event::Character(std::string)'],['../group__component.html#a9970fcb99b3c5ed50753111edf1d2cae',1,'ftxui::Event::Character(char)'],['../group__component.html#a2f33d5ea7fca5423861773f891f5ba07',1,'ftxui::Event::Character(wchar_t)']]], + ['character_22',['character',['../group__screen.html#a3bbcd6a381555ea201dbe4251a9aafb3',1,'ftxui::Pixel::character'],['../group__component.html#a07022c6e92b9144a0e5b337b562f9892',1,'ftxui::Event::character()']]], + ['charset_5f_23',['charset_',['../src_2ftxui_2dom_2border_8cpp.html#a108d200440dbd1759a7b025709c2d321',1,'border.cpp']]], + ['chartreuse1_24',['Chartreuse1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7d2d4cc3af6756a4eac7d12fbe4775d4',1,'ftxui::Color']]], + ['chartreuse2_25',['Chartreuse2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa353575e36d1260652eb3d18e73f04cfe',1,'ftxui::Color']]], + ['chartreuse2bis_26',['Chartreuse2Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6338086ae05e58041188d89165d87c1a',1,'ftxui::Color']]], + ['chartreuse3_27',['Chartreuse3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2f3df27b5ed05a3e040deec31c684003',1,'ftxui::Color']]], + ['chartreuse3bis_28',['Chartreuse3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2087d90de0840d3f15fad878ba4b4fc4',1,'ftxui::Color']]], + ['chartreuse4_29',['Chartreuse4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa734cd2fab3e94385552fc745665bcc98',1,'ftxui::Color']]], + ['check_30',['Check',['../group__dom.html#a5b71d891a102197f2856f53702425581',1,'ftxui::Node']]], + ['checkbox_31',['CheckBox',['../module-component.html#component-checkbox',1,'']]], + ['checkbox_32',['Checkbox',['../group__component.html#gae0d441d2c83740f187f62db566bbefcd',1,'ftxui::Checkbox(CheckboxOption option)'],['../group__component.html#ga5e9dbb03c44d549f10c96f134269366f',1,'ftxui::Checkbox(ConstStringRef label, bool *checked, CheckboxOption option)']]], + ['checkbox_33',['checkbox',['../group__component.html#a0797deb307cd89059137a4ca6075fcbf',1,'ftxui::DropdownOption::checkbox'],['../module-component-examples.html#checkbox',1,'checkbox']]], + ['checkbox_5fin_5fframe_34',['checkbox_in_frame',['../module-component-examples.html#checkbox_in_frame',1,'']]], + ['checkbox_5fin_5fframe_2ecpp_35',['checkbox_in_frame.cpp',['../checkbox__in__frame_8cpp.html',1,'']]], + ['checkboxoption_36',['CheckboxOption',['../group__component.html#structftxui_1_1CheckboxOption',1,'ftxui']]], + ['checked_37',['checked',['../group__component.html#ab7741e52624c0d7906159d77edffe27e',1,'ftxui::CheckboxOption']]], + ['childat_38',['ChildAt',['../group__component.html#aceb41a98abe10fb0b521ff8b65529b7f',1,'ftxui::ComponentBase']]], + ['childcount_39',['ChildCount',['../group__component.html#a9ae5f77e923e2f0f8b0e26dcd4affb5b',1,'ftxui::ComponentBase']]], + ['children_5f_40',['children_',['../group__component.html#a22b4fa4d6aa4c9c2eef275cd25aa8ab9',1,'ftxui::ComponentBase::children_'],['../group__dom.html#a2aeb117dade3254694355ab90e9fc566',1,'ftxui::Node::children_']]], + ['circularin_41',['CircularIn',['../namespaceftxui_1_1animation_1_1easing.html#a9af9e9dc6ba657b5ab681eb8be39ddb5',1,'ftxui::animation::easing']]], + ['circularinout_42',['CircularInOut',['../namespaceftxui_1_1animation_1_1easing.html#a0d1df50c1810db4a8b16416b62ac7db0',1,'ftxui::animation::easing']]], + ['circularout_43',['CircularOut',['../namespaceftxui_1_1animation_1_1easing.html#a4188d3f98b876d0e0f181f9fd707f476',1,'ftxui::animation::easing']]], + ['clamp_44',['clamp',['../namespaceftxui_1_1util.html#aab9f0232e41c960b4a09629eac33aef3',1,'ftxui::util']]], + ['clear_45',['Clear',['../group__screen.html#aa71d36872f416feaa853788a7a7a7ef8',1,'ftxui::Image::Clear()'],['../group__screen.html#aa71d36872f416feaa853788a7a7a7ef8',1,'ftxui::Screen::Clear()']]], + ['clear_5funder_46',['clear_under',['../group__dom.html#ga17a89519e6b87e12b1e5811a702f7847',1,'ftxui']]], + ['clear_5funder_2ecpp_47',['clear_under.cpp',['../clear__under_8cpp.html',1,'']]], + ['clock_48',['Clock',['../namespaceftxui_1_1animation.html#a19bfb27380067c74ae297dd7dad5fb37',1,'ftxui::animation']]], + ['clone_49',['Clone',['../classftxui_1_1SenderImpl.html#a575817a7bf1afd8bc9af4973e4f38481',1,'ftxui::SenderImpl']]], + ['closure_50',['Closure',['../namespaceftxui.html#adc2f3bfa69ce99c596a1ff1b69b04d33',1,'ftxui']]], + ['cmake_51',['CMake',['../installation_cmake.html',1,'installation']]], + ['cmake_20flags_52',['Optional CMake Flags',['../installation_cmake.html#optional-cmake-flags',1,'']]], + ['code_53',['Code',['../print__key__press_8cpp.html#a1bbdd0071095abee0e28134bd4ad9213',1,'print_key_press.cpp']]], + ['codepointtowordbreakproperty_54',['CodepointToWordBreakProperty',['../namespaceftxui.html#a191b3278846ceb6ac35d2e4eb26db759',1,'ftxui']]], + ['collapsible_55',['Collapsible',['../namespaceftxui.html#a760cd5eb9a72c008ca18f1e6b366c796',1,'ftxui::Collapsible()'],['../module-component.html#component-collapsible',1,'Collapsible']]], + ['collapsible_56',['collapsible',['../module-component-examples.html#collapsible',1,'']]], + ['color_57',['Color',['../group__screen.html#classftxui_1_1Color',1,'Color'],['../group__screen.html#a1589b83974b42a2f3315624f14c3c92c',1,'ftxui::Color::Color()'],['../group__screen.html#a3c93cb793b88256235f17235c9359b35',1,'ftxui::Color::Color(Palette1 index)'],['../group__screen.html#a55decaa0b2ab846729582f5f7b6acb49',1,'ftxui::Color::Color(Palette16 index)'],['../group__screen.html#a4f2602aacaf27a6482580fea0f7de0d2',1,'ftxui::Color::Color(Palette256 index)'],['../group__screen.html#a92d70d7572b7a07d2af4ff650e272e08',1,'ftxui::Color::Color(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha=255)'],['../group__screen.html#gab87bacfdad76e61b9412d7124be44c1c',1,'ftxui::Terminal::Color']]], + ['color_58',['color',['../structftxui_1_1LinearGradient_1_1Stop.html#aa5f4d1eda21c196bd8401ff73f105073',1,'ftxui::LinearGradient::Stop::color'],['../group__dom.html#gaf61b489da39ca5e24b68e6e1a2b09c0d',1,'ftxui::color(Color c)'],['../group__dom.html#ga8af6b5a06b03fd53bf30a6b050b96968',1,'ftxui::color(const LinearGradient &gradient)'],['../group__dom.html#gadef6e6e66199153de6d3b21b14dcf868',1,'ftxui::color(Color color, Element child)'],['../group__dom.html#ga050df9c8ed04eec13309d6c0542c636d',1,'ftxui::color(const LinearGradient &gradient, Element child)']]], + ['color_2ecppm_59',['color.cppm',['../color_8cppm.html',1,'']]], + ['color_2ehpp_60',['color.hpp',['../color_8hpp.html',1,'']]], + ['color_5f_61',['color_',['../src_2ftxui_2component_2window_8cpp.html#af75802a6553b2b23639f23d3c4b94217',1,'color_: window.cpp'],['../dom_2color_8cpp.html#af75802a6553b2b23639f23d3c4b94217',1,'color_: color.cpp']]], + ['color_5factive_62',['color_active',['../group__component.html#a593f1ba15add21d1972c01372db369df',1,'ftxui::UnderlineOption::color_active'],['../structftxui_1_1SliderOption.html#a593f1ba15add21d1972c01372db369df',1,'ftxui::SliderOption::color_active']]], + ['color_5fgallery_63',['color_gallery',['../module-dom-examples.html#color_gallery',1,'']]], + ['color_5fgallery_2ecpp_64',['color_gallery.cpp',['../color__gallery_8cpp.html',1,'']]], + ['color_5finactive_65',['color_inactive',['../group__component.html#ad5a77e0bc0ce649271a13949a7a0a635',1,'ftxui::UnderlineOption::color_inactive'],['../structftxui_1_1SliderOption.html#ad5a77e0bc0ce649271a13949a7a0a635',1,'ftxui::SliderOption::color_inactive']]], + ['color_5finfo_2ecpp_66',['color_info.cpp',['../color__info_8cpp.html',1,'']]], + ['color_5finfo_2ecppm_67',['color_info.cppm',['../color__info_8cppm.html',1,'']]], + ['color_5finfo_2ehpp_68',['color_info.hpp',['../color__info_8hpp.html',1,'']]], + ['color_5finfo_5fpalette256_69',['color_info_palette256',['../module-dom-examples.html#color_info_palette256',1,'']]], + ['color_5finfo_5fpalette256_2ecpp_70',['color_info_palette256.cpp',['../color__info__palette256_8cpp.html',1,'']]], + ['color_5finfo_5fsorted_5f2d_2eipp_71',['color_info_sorted_2d.ipp',['../color__info__sorted__2d_8ipp.html',1,'']]], + ['color_5ftruecolor_5fhsv_72',['color_truecolor_HSV',['../module-dom-examples.html#color_truecolor_hsv',1,'']]], + ['color_5ftruecolor_5fhsv_2ecpp_73',['color_truecolor_HSV.cpp',['../color__truecolor__HSV_8cpp.html',1,'']]], + ['color_5ftruecolor_5frgb_74',['color_truecolor_RGB',['../module-dom-examples.html#color_truecolor_rgb',1,'']]], + ['color_5ftruecolor_5frgb_2ecpp_75',['color_truecolor_RGB.cpp',['../color__truecolor__RGB_8cpp.html',1,'']]], + ['colored_76',['Colored',['../menu__entries_8cpp.html#a12f3ca405f8238e1d03dff81d4cf6997',1,'Colored(ftxui::Color c): menu_entries.cpp'],['../menu__entries__animated_8cpp.html#a12f3ca405f8238e1d03dff81d4cf6997',1,'Colored(ftxui::Color c): menu_entries_animated.cpp']]], + ['colorinfo_77',['ColorInfo',['../group__screen.html#structftxui_1_1ColorInfo',1,'ftxui']]], + ['colorinfosorted2d_78',['ColorInfoSorted2D',['../color__info__sorted__2d_8ipp.html#a0f08918d6064cd2a0e56cb9ec74033ca',1,'color_info_sorted_2d.ipp']]], + ['colors_79',['Colors',['../module-dom.html#dom-colors',1,'']]], + ['colors_80',['colors',['../src_2ftxui_2dom_2linear__gradient_8cpp.html#ac3290ba0758760ac0d6df01f7707dd94',1,'linear_gradient.cpp']]], + ['colorstring_81',['ColorString',['../slider__rgb_8cpp.html#acfbf512737b012658b0c3b6997da144e',1,'slider_rgb.cpp']]], + ['colorsupport_82',['ColorSupport',['../group__screen.html#gae6e034f37aa66cfe4458a8cb6e8fc526',1,'ftxui::Terminal']]], + ['colortile_83',['ColorTile',['../slider__rgb_8cpp.html#ac5038fb3740e7d9137dfb4969a9a8035',1,'slider_rgb.cpp']]], + ['column_84',['Column',['../group__dom.html#a224b9163917ac32fc95a60d8c1eec3aaa1976d7f704de389d9fe064e08ea35b2d',1,'ftxui::FlexboxConfig']]], + ['columninversed_85',['ColumnInversed',['../group__dom.html#a224b9163917ac32fc95a60d8c1eec3aaa338df815740895b690c7b07716acda20',1,'ftxui::FlexboxConfig']]], + ['component_86',['Component',['../namespaceftxui.html#af1479ede01dbf087342534ab4ada11d3',1,'ftxui']]], + ['component_87',['component',['../module-component.html',1,'ftxui / component'],['../group__component.html',1,'ftxui/component'],['../ftxui.html#ftxuicomponent',1,'ftxui/component']]], + ['component_2ecpp_88',['component.cpp',['../component_8cpp.html',1,'']]], + ['component_2ecppm_89',['component.cppm',['../component_8cppm.html',1,'']]], + ['component_2ehpp_90',['component.hpp',['../component_8hpp.html',1,'']]], + ['component_2fcomponent_2ecppm_91',['component.cppm',['../component_2component_8cppm.html',1,'']]], + ['component_2futil_2ecpp_92',['util.cpp',['../component_2util_8cpp.html',1,'']]], + ['component_5factive_93',['component_active',['../structftxui_1_1Requirement_1_1Focused.html#ac3226c18ed017dd81566f593d1257ce1',1,'ftxui::Requirement::Focused']]], + ['component_5fbase_2ecppm_94',['component_base.cppm',['../component__base_8cppm.html',1,'']]], + ['component_5fbase_2ehpp_95',['component_base.hpp',['../component__base_8hpp.html',1,'']]], + ['component_5fexamples_2emd_96',['component_examples.md',['../component__examples_8md.html',1,'']]], + ['component_5ffuzzer_2ecpp_97',['component_fuzzer.cpp',['../component__fuzzer_8cpp.html',1,'']]], + ['component_5foptions_2ecpp_98',['component_options.cpp',['../component__options_8cpp.html',1,'']]], + ['component_5foptions_2ecppm_99',['component_options.cppm',['../component__options_8cppm.html',1,'']]], + ['component_5foptions_2ehpp_100',['component_options.hpp',['../component__options_8hpp.html',1,'']]], + ['componentbase_101',['ComponentBase',['../group__component.html#classftxui_1_1ComponentBase',1,'ComponentBase'],['../group__component.html#ad2a5b6ce11bc7a8ce1150cf0ba9144c0',1,'ftxui::ComponentBase::ComponentBase(Components children)'],['../group__component.html#acda4c8b63ffbc2e9e2e28f056edbf01c',1,'ftxui::ComponentBase::ComponentBase()=default'],['../group__component.html#abd8cf6a9df5eb4678fb9925b686c7aea',1,'ftxui::ComponentBase::ComponentBase(const ComponentBase &)=delete'],['../group__component.html#a9b3cf357cf150023641969d5fcb7d08f',1,'ftxui::ComponentBase::ComponentBase(ComponentBase &&)=delete']]], + ['componentdecorator_102',['ComponentDecorator',['../namespaceftxui.html#af07b496fe512e3a4863ee546f19e9a6c',1,'ftxui']]], + ['components_103',['Components',['../namespaceftxui.html#a3d4ccad0c8a07d5b0cb4b2e690ffc90c',1,'ftxui']]], + ['composite_5fdecorator_2ecpp_104',['composite_decorator.cpp',['../composite__decorator_8cpp.html',1,'']]], + ['composition_105',['composition',['../module-component-examples.html#composition',1,'']]], + ['composition_2ecpp_106',['composition.cpp',['../composition_8cpp.html',1,'']]], + ['compute_107',['Compute',['../namespaceftxui_1_1box__helper.html#aede4ed6e71fbe0689a500ff8db06f3a3',1,'ftxui::box_helper::Compute()'],['../namespaceftxui_1_1flexbox__helper.html#aaf9df834cf83e439dd0e74cb1999c83d',1,'ftxui::flexbox_helper::Compute()']]], + ['computerequirement_108',['ComputeRequirement',['../group__dom.html#a40bd818c5de23bb2d208360d275ae59d',1,'ftxui::Node::ComputeRequirement()'],['../classftxui_1_1NodeDecorator.html#ac68a91492bfe8a6dd7ea2b3f7f295720',1,'ftxui::NodeDecorator::ComputeRequirement()']]], + ['conan_109',['Conan',['../installation_conan.html',1,'installation']]], + ['config_110',['config',['../structftxui_1_1flexbox__helper_1_1Global.html#ae1dac1dbfb99211895f88d2c4b609849',1,'ftxui::flexbox_helper::Global']]], + ['config_5f_111',['config_',['../flexbox_8cpp.html#a85d583fe20f57cb4f383cba6eae3d073',1,'flexbox.cpp']]], + ['config_5fnormalized_5f_112',['config_normalized_',['../flexbox_8cpp.html#a8a92e22645479418ed4d290ebf4b51c3',1,'flexbox.cpp']]], + ['configure_20your_20build_20system_113',['Configure your build system.',['../installation_vcpkg.html#configure-your-build-system',1,'']]], + ['constraint_114',['Constraint',['../namespaceftxui.html#ae09f44b989d381a387329fd0a0935926',1,'ftxui']]], + ['constref_115',['ConstRef',['../classftxui_1_1ConstRef.html',1,'ConstRef< T >'],['../classftxui_1_1ConstRef.html#a2949426897a0bd427771597c7cc34f08',1,'ftxui::ConstRef::ConstRef()=default'],['../classftxui_1_1ConstRef.html#aa33f2e3c9020518540c2850c7ad2669f',1,'ftxui::ConstRef::ConstRef(T t)'],['../classftxui_1_1ConstRef.html#a7dde5cd8bdbcd4c83a7b3bbddfc31bd9',1,'ftxui::ConstRef::ConstRef(const T *t)'],['../classftxui_1_1ConstRef.html#a184e14dab2e9bca47f7d172ca7126c60',1,'ftxui::ConstRef::ConstRef(const ConstRef< T > &)=default'],['../classftxui_1_1ConstRef.html#aa89dd79143a428e57480cda1cc7b675e',1,'ftxui::ConstRef::ConstRef(ConstRef< T > &&) noexcept=default']]], + ['constref_3c_20std_3a_3astring_20_3e_116',['ConstRef< std::string >',['../classftxui_1_1ConstRef.html',1,'ftxui']]], + ['conststringlistref_117',['ConstStringListRef',['../classftxui_1_1ConstStringListRef.html',1,'ConstStringListRef'],['../classftxui_1_1ConstStringListRef.html#a425bc6a013bf3a539794b7a874fc722f',1,'ftxui::ConstStringListRef::ConstStringListRef()=default'],['../classftxui_1_1ConstStringListRef.html#a4d5f9a6302f997c4ef51b36370b84042',1,'ftxui::ConstStringListRef::ConstStringListRef(ConstStringListRef &&)=default'],['../classftxui_1_1ConstStringListRef.html#abfb65b9a4a2648e7b9f110cecefa57a4',1,'ftxui::ConstStringListRef::ConstStringListRef(const ConstStringListRef &)=default'],['../classftxui_1_1ConstStringListRef.html#a143d850d76c8d8f8b4f8750c94ce1a52',1,'ftxui::ConstStringListRef::ConstStringListRef(std::vector< std::string > value)'],['../classftxui_1_1ConstStringListRef.html#a1dea39816b5515bb126f980ed0839d63',1,'ftxui::ConstStringListRef::ConstStringListRef(const std::vector< std::string > *value)'],['../classftxui_1_1ConstStringListRef.html#a8f2ca283f552f4cdd835401e3b177b4a',1,'ftxui::ConstStringListRef::ConstStringListRef(const std::vector< std::wstring > *value)'],['../classftxui_1_1ConstStringListRef.html#ae1af1937e833f81fe7013261ec0ee1ef',1,'ftxui::ConstStringListRef::ConstStringListRef(Adapter *adapter)'],['../classftxui_1_1ConstStringListRef.html#a79bb658d6bae69e91da078978d5ded33',1,'ftxui::ConstStringListRef::ConstStringListRef(std::unique_ptr< AdapterType > adapter)']]], + ['conststringref_118',['ConstStringRef',['../classftxui_1_1ConstStringRef.html',1,'ConstStringRef'],['../classftxui_1_1ConstStringRef.html#a9a4560dc18026ec3753e87d569fa5103',1,'ftxui::ConstStringRef::ConstStringRef(const std::wstring *ref)'],['../classftxui_1_1ConstStringRef.html#a1e8c54776eada9969ebbadb21d8e689a',1,'ftxui::ConstStringRef::ConstStringRef(const std::wstring ref)'],['../classftxui_1_1ConstStringRef.html#ad8b24bac5669d8787ac2109068094938',1,'ftxui::ConstStringRef::ConstStringRef(const wchar_t *ref)'],['../classftxui_1_1ConstStringRef.html#a013cd384d028ab8f67fa4cf8e9c521cd',1,'ftxui::ConstStringRef::ConstStringRef(const char *ref)']]], + ['contain_119',['Contain',['../group__screen.html#a2f31c89738607b84e65992a7005d35a9',1,'ftxui::Box']]], + ['container_120',['Container',['../module-component.html#component-container',1,'']]], + ['container_2ecpp_121',['container.cpp',['../container_8cpp.html',1,'']]], + ['content_122',['content',['../group__component.html#ac9f6c2acd72d74eeb3a18baf32b02932',1,'ftxui::InputOption']]], + ['contributions_123',['Contributions',['../installation.html#contributions',1,'']]], + ['control_124',['control',['../group__component.html#ad155fe5a68eb888a7e0eb897a3dfc015',1,'ftxui::Mouse']]], + ['cornflowerblue_125',['CornflowerBlue',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfab4dcc712554f602559b3f9b7662ea4dd',1,'ftxui::Color']]], + ['cornsilk1_126',['Cornsilk1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9d7dd269922a0e2fac6366c623ed3d45',1,'ftxui::Color']]], + ['cpp20_2dmodules_2emd_127',['cpp20-modules.md',['../cpp20-modules_8md.html',1,'']]], + ['cr_128',['CR',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aa1d7b33fc26ca22c2011aaa97fecc43d8',1,'ftxui']]], + ['create_129',['Create',['../group__screen.html#a32b98be0603ace46d6dc9d05b330a9fd',1,'ftxui::Screen::Create(Dimensions dimension)'],['../group__screen.html#a29a8d230cd1913d26626158fc4fc0a0c',1,'ftxui::Screen::Create(Dimensions width, Dimensions height)']]], + ['ctrla_130',['CtrlA',['../group__component.html#acf7817ed11559c82a26322521f390d6e',1,'ftxui::Event']]], + ['ctrlalta_131',['CtrlAltA',['../group__component.html#adb198f3baf944a55bcfa46107615d359',1,'ftxui::Event']]], + ['ctrlaltb_132',['CtrlAltB',['../group__component.html#ae44c243b858cb3400fdbfa0175c489e4',1,'ftxui::Event']]], + ['ctrlaltc_133',['CtrlAltC',['../group__component.html#a1cd1b6ca37581db00ee5ad5d44e94e3f',1,'ftxui::Event']]], + ['ctrlaltd_134',['CtrlAltD',['../group__component.html#aec5fdc15c18b77c8ca74d1f077754916',1,'ftxui::Event']]], + ['ctrlalte_135',['CtrlAltE',['../group__component.html#a459c4f925ed72d9ebdd5caa74be905f8',1,'ftxui::Event']]], + ['ctrlaltf_136',['CtrlAltF',['../group__component.html#a22ee0cd5fb9dbb1ff5fe2b249d9de1fc',1,'ftxui::Event']]], + ['ctrlaltg_137',['CtrlAltG',['../group__component.html#acf6ba80979dddb644d8a06ddc8b32a43',1,'ftxui::Event']]], + ['ctrlalth_138',['CtrlAltH',['../group__component.html#a54b56653957ef7a339f0659e6c4f826f',1,'ftxui::Event']]], + ['ctrlalti_139',['CtrlAltI',['../group__component.html#a2bf197114604fe111bd01a5ad64b0576',1,'ftxui::Event']]], + ['ctrlaltj_140',['CtrlAltJ',['../group__component.html#a48019246646c62005152941069919bf2',1,'ftxui::Event']]], + ['ctrlaltk_141',['CtrlAltK',['../group__component.html#ace12bff4272d8e0c85db12524e42f7b0',1,'ftxui::Event']]], + ['ctrlaltl_142',['CtrlAltL',['../group__component.html#ab37accf33aab3cd7187bb7f589bc3c5b',1,'ftxui::Event']]], + ['ctrlaltm_143',['CtrlAltM',['../group__component.html#a7866574be02fec611b5aca5d333ccccf',1,'ftxui::Event']]], + ['ctrlaltn_144',['CtrlAltN',['../group__component.html#a0bcae083304c682e85f1e18be85dc141',1,'ftxui::Event']]], + ['ctrlalto_145',['CtrlAltO',['../group__component.html#a62641366fdaffa002aca0087af45297a',1,'ftxui::Event']]], + ['ctrlaltp_146',['CtrlAltP',['../group__component.html#a44bc2e6312cd6e9eda4d4778e88052f0',1,'ftxui::Event']]], + ['ctrlaltq_147',['CtrlAltQ',['../group__component.html#af8bec3764c43c08d08c0bffdcf9b4255',1,'ftxui::Event']]], + ['ctrlaltr_148',['CtrlAltR',['../group__component.html#a8aecef2c60fd63f3cbc7c16b7b5d804b',1,'ftxui::Event']]], + ['ctrlalts_149',['CtrlAltS',['../group__component.html#abf589677d9c6463e97519567c3d1b021',1,'ftxui::Event']]], + ['ctrlaltt_150',['CtrlAltT',['../group__component.html#adad452726bfb3d523b19299bf8017a41',1,'ftxui::Event']]], + ['ctrlaltu_151',['CtrlAltU',['../group__component.html#ad4e4ff7f9a534882d7e5adc29235d761',1,'ftxui::Event']]], + ['ctrlaltv_152',['CtrlAltV',['../group__component.html#ae7afc70b1bc9d4e5c046bcbaf7767c19',1,'ftxui::Event']]], + ['ctrlaltw_153',['CtrlAltW',['../group__component.html#a5d6ebbe9bdb0b7fe28104a58602bcc37',1,'ftxui::Event']]], + ['ctrlaltx_154',['CtrlAltX',['../group__component.html#a07a380297456b42f4929d47ece5517a0',1,'ftxui::Event']]], + ['ctrlalty_155',['CtrlAltY',['../group__component.html#ab001073b99625145403adbbd3a3e21e8',1,'ftxui::Event']]], + ['ctrlaltz_156',['CtrlAltZ',['../group__component.html#a98f8350cb5499a5432506ac732d495ec',1,'ftxui::Event']]], + ['ctrlb_157',['CtrlB',['../group__component.html#a52c5a6db246fce616cf8d6408af8e3a3',1,'ftxui::Event']]], + ['ctrlc_158',['CtrlC',['../group__component.html#a038a33c469a2e4474d08d637e37f660d',1,'ftxui::Event']]], + ['ctrld_159',['CtrlD',['../group__component.html#ae0d493f520768be24d4e9508eb3f263d',1,'ftxui::Event']]], + ['ctrle_160',['CtrlE',['../group__component.html#a1fbae80d9ab6f7c72f07f1a84da7de64',1,'ftxui::Event']]], + ['ctrlf_161',['CtrlF',['../group__component.html#a46651cd420861328dff49c5651ac853c',1,'ftxui::Event']]], + ['ctrlg_162',['CtrlG',['../group__component.html#aa221be42071500650486cc199f26b072',1,'ftxui::Event']]], + ['ctrlh_163',['CtrlH',['../group__component.html#a72c30a2cd1d2309f4e81aad7163e24ca',1,'ftxui::Event']]], + ['ctrli_164',['CtrlI',['../group__component.html#af5df3d152c8ea5303cc2d5c9bb8c5747',1,'ftxui::Event']]], + ['ctrlj_165',['CtrlJ',['../group__component.html#a76d3ea748f24c9c8d55a8f563616de3f',1,'ftxui::Event']]], + ['ctrlk_166',['CtrlK',['../group__component.html#a8deeb92abd293c7a0750b6891cc217bd',1,'ftxui::Event']]], + ['ctrll_167',['CtrlL',['../group__component.html#a0608ea347cb61c04bf7f1e89d215d1c3',1,'ftxui::Event']]], + ['ctrlm_168',['CtrlM',['../group__component.html#a86af858198ebfedc83ada8f775a1b4bc',1,'ftxui::Event']]], + ['ctrln_169',['CtrlN',['../group__component.html#a85966b9d428df487e2b896596e90f4ed',1,'ftxui::Event']]], + ['ctrlo_170',['CtrlO',['../group__component.html#ae7915261b9c6d8e844933bd1f68ed120',1,'ftxui::Event']]], + ['ctrlp_171',['CtrlP',['../group__component.html#a043bd0f01364983076c98ebf2fd6f503',1,'ftxui::Event']]], + ['ctrlq_172',['CtrlQ',['../group__component.html#a97bdebeccfd100f5e8f5df3b4e04b62e',1,'ftxui::Event']]], + ['ctrlr_173',['CtrlR',['../group__component.html#a5cca4aa809fa07d3ea1992ebef011a19',1,'ftxui::Event']]], + ['ctrls_174',['CtrlS',['../group__component.html#a7c7ffc28a2d2d1eb67444edb7a44e575',1,'ftxui::Event']]], + ['ctrlt_175',['CtrlT',['../group__component.html#ac1e7d6a13cfa09a29e2c735e01463598',1,'ftxui::Event']]], + ['ctrlu_176',['CtrlU',['../group__component.html#a26730fa452c79611f5aa6ca0e157e217',1,'ftxui::Event']]], + ['ctrlv_177',['CtrlV',['../group__component.html#a053eca96c74722632b0a1e53f3af2978',1,'ftxui::Event']]], + ['ctrlw_178',['CtrlW',['../group__component.html#a8520a7531235eb2ff76f2de1704e7e1c',1,'ftxui::Event']]], + ['ctrlx_179',['CtrlX',['../group__component.html#a50ef26ee285d63d0a805f59eed52239f',1,'ftxui::Event']]], + ['ctrly_180',['CtrlY',['../group__component.html#a697c813972ac5d83b75f65e81acd5cff',1,'ftxui::Event']]], + ['ctrlz_181',['CtrlZ',['../group__component.html#a22ef83103e0443ba82acc19f24f729bc',1,'ftxui::Event']]], + ['cubicin_182',['CubicIn',['../namespaceftxui_1_1animation_1_1easing.html#a2288ba740a847ea0e565017cb16c24f2',1,'ftxui::animation::easing']]], + ['cubicinout_183',['CubicInOut',['../namespaceftxui_1_1animation_1_1easing.html#a2aa1d45766fe10c3b16b7dd4f65db859',1,'ftxui::animation::easing']]], + ['cubicout_184',['CubicOut',['../namespaceftxui_1_1animation_1_1easing.html#acd3c619812de25f3613b36735a5cdc91',1,'ftxui::animation::easing']]], + ['current_185',['Current',['../classftxui_1_1task_1_1TaskRunner.html#a4e90ab04a37a29bb0e3432d1290a4565',1,'ftxui::task::TaskRunner']]], + ['cursor_186',['Cursor',['../structftxui_1_1Screen_1_1Cursor.html',1,'ftxui::Screen']]], + ['cursor_187',['cursor',['../group__component.html#a9d8d873964fd143f113fce55e15c37fb',1,'ftxui::Event::cursor'],['../group__screen.html#a94febaac347b83267ff6a10b7837d612',1,'ftxui::Screen::cursor() const']]], + ['cursor_5f_188',['cursor_',['../group__screen.html#a9df9d1ae7ed66857ca987963b2365904',1,'ftxui::Screen']]], + ['cursor_5fposition_189',['cursor_position',['../group__component.html#a699547942204afa70864e0e6df94c96c',1,'ftxui::InputOption']]], + ['cursor_5fshape_190',['cursor_shape',['../group__component.html#a25a0efbff7ae0393c695f6d720cb5542',1,'ftxui::Event::cursor_shape'],['../structftxui_1_1Requirement_1_1Focused.html#a21f4c5c8f6862a204f795d4f0cb6d479',1,'ftxui::Requirement::Focused::cursor_shape'],['../group__component.html#a022c841864c305d5e3ef69f6957dc367',1,'ftxui::Event::cursor_shape() const']]], + ['cursor_5fx_191',['cursor_x',['../group__component.html#a1ef75084a5f2a9d26df8cafcf048526e',1,'ftxui::Event']]], + ['cursor_5fy_192',['cursor_y',['../group__component.html#a1a24372c00e6485f2648350df4301ae3',1,'ftxui::Event']]], + ['cursorposition_193',['CursorPosition',['../group__component.html#acef096fb0273c844877408912445988c',1,'ftxui::Event']]], + ['cursorshape_194',['CursorShape',['../group__component.html#a0e2ede93a1146707a4f5e540056e13bc',1,'ftxui::Event']]], + ['custom_195',['Custom',['../group__component.html#a699872f2a6d8607d714be174e9435290',1,'ftxui::Event']]], + ['custom_5floop_196',['custom_loop',['../module-component-examples.html#custom_loop',1,'']]], + ['custom_5floop_2ecpp_197',['custom_loop.cpp',['../custom__loop_8cpp.html',1,'']]], + ['cyan_198',['Cyan',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802fab0d4738f9c7f12049e52aa4e868bdc8b',1,'ftxui::Color']]], + ['cyan1_199',['Cyan1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa35e9559f51c82a7adda45276bbedb0f4',1,'ftxui::Color']]], + ['cyan2_200',['Cyan2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfacc49853d1836ecf3b66c4b8c568aba3f',1,'ftxui::Color']]], + ['cyan3_201',['Cyan3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7a36fc7d64942362d706fad5544517d1',1,'ftxui::Color']]], + ['cyanlight_202',['CyanLight',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802fa61bd7f1290cc0a24e565539a61ba5839',1,'ftxui::Color']]] +]; diff --git a/search/all_4.js b/search/all_4.js new file mode 100644 index 000000000..ebcbde2b9 --- /dev/null +++ b/search/all_4.js @@ -0,0 +1,128 @@ +var searchData= +[ + ['d_0',['D',['../group__component.html#a0885c6b998110e03e7e24799d6845fe0',1,'ftxui::Event']]], + ['d_1',['d',['../group__component.html#a880f64e789647bba6c1e0140fb306c8c',1,'ftxui::Event']]], + ['darkblue_2',['DarkBlue',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa4d5c4dd6c3cf0fe617dec801025bd76',1,'ftxui::Color']]], + ['darkcyan_3',['DarkCyan',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa180097c82c1863b9c2f94b41d341c529',1,'ftxui::Color']]], + ['darkgoldenrod_4',['DarkGoldenrod',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfab5d8a9760923e3357c167fc19de8a914',1,'ftxui::Color']]], + ['darkgreen_5',['DarkGreen',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6c1a381d726d9c383c05b9ca12682e4f',1,'ftxui::Color']]], + ['darkkhaki_6',['DarkKhaki',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa480194578592f6fc90b8b6a1a1f66e8b',1,'ftxui::Color']]], + ['darkmagenta_7',['DarkMagenta',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2ba5febce0999080bcfe1ef92192fe12',1,'ftxui::Color']]], + ['darkmagentabis_8',['DarkMagentaBis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0e32b2f735ea792ab1d5253d3e631241',1,'ftxui::Color']]], + ['darkolivegreen1_9',['DarkOliveGreen1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa4a1641f09fbb37751ade39859adbcfaa',1,'ftxui::Color']]], + ['darkolivegreen1bis_10',['DarkOliveGreen1Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa4e0500dd80f0e6f0a2a1a93de953cf86',1,'ftxui::Color']]], + ['darkolivegreen2_11',['DarkOliveGreen2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaad55a68e83744f717a7f83f7a8fd265f',1,'ftxui::Color']]], + ['darkolivegreen3_12',['DarkOliveGreen3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaeca91c2f996796b37a2123515356ded3',1,'ftxui::Color']]], + ['darkolivegreen3bis_13',['DarkOliveGreen3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfad6dc23b32b2396e59cfc48238fd05bd8',1,'ftxui::Color']]], + ['darkolivegreen3ter_14',['DarkOliveGreen3Ter',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7a607c03adbcbd4b210fc095272a76a0',1,'ftxui::Color']]], + ['darkorange_15',['DarkOrange',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2458c6f4cddf4f28bf1285975975b987',1,'ftxui::Color']]], + ['darkorange3_16',['DarkOrange3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa08efc0d59d20277a3c2f01473250108c',1,'ftxui::Color']]], + ['darkorange3bis_17',['DarkOrange3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa3def467cbbb99502637734c3bd2ce456',1,'ftxui::Color']]], + ['darkred_18',['DarkRed',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa556650aa9f007ea0239e66d3ddf26759',1,'ftxui::Color']]], + ['darkredbis_19',['DarkRedBis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa3bcdc58abc2165b0032a207e9d6883d',1,'ftxui::Color']]], + ['darkseagreen_20',['DarkSeaGreen',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa380e1f43f086bd475d720c459fcff2a8',1,'ftxui::Color']]], + ['darkseagreen1_21',['DarkSeaGreen1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaded95d3c0d616d9658b034e9ae705bf5',1,'ftxui::Color']]], + ['darkseagreen1bis_22',['DarkSeaGreen1Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa691f28c053f9d2a12db86b8aa396374b',1,'ftxui::Color']]], + ['darkseagreen2_23',['DarkSeaGreen2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfad5089e0939bbe16ed485053e771e8a68',1,'ftxui::Color']]], + ['darkseagreen2bis_24',['DarkSeaGreen2Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfac388011f4493d875983a3c7264e7ded5',1,'ftxui::Color']]], + ['darkseagreen3_25',['DarkSeaGreen3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa02af538b8573bc9c037822273620864f',1,'ftxui::Color']]], + ['darkseagreen3bis_26',['DarkSeaGreen3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7b2765271febec45b933598f18a7ca98',1,'ftxui::Color']]], + ['darkseagreen4_27',['DarkSeaGreen4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfabda195126fea1b4f0aa6d25513820ca0',1,'ftxui::Color']]], + ['darkseagreen4bis_28',['DarkSeaGreen4Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa393410b62bd90565aa0c25e61c92d999',1,'ftxui::Color']]], + ['darkslategray1_29',['DarkSlateGray1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfafb40765294d1d25a5ec1ec17d3ee4ae8',1,'ftxui::Color']]], + ['darkslategray2_30',['DarkSlateGray2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa29221856aecf72cfe57d5ca2e6d41b42',1,'ftxui::Color']]], + ['darkslategray3_31',['DarkSlateGray3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0621f3f774389bc57973bbed3c78b9f7',1,'ftxui::Color']]], + ['darkturquoise_32',['DarkTurquoise',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6a5df4f33663381387285b54ee22ab78',1,'ftxui::Color']]], + ['darkviolet_33',['DarkViolet',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0c92c7e17edeca09b7c63c8a783a562f',1,'ftxui::Color']]], + ['darkvioletbis_34',['DarkVioletBis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9870a3dcf46498ca4a10be946521097d',1,'ftxui::Color']]], + ['dashed_35',['DASHED',['../group__dom.html#ggafe3103dd0b8240c5443892484ef5af9ca830310bdfd296d7cd00c59773579b892',1,'ftxui']]], + ['dbox_36',['dbox',['../group__dom.html#ga901ab1b6b2e0e8c295552168ab206441',1,'ftxui::dbox()'],['../module-dom-examples.html#dbox',1,'dbox']]], + ['debian_20and_20ubuntu_20packages_20unofficial_37',['Debian and Ubuntu Packages (Unofficial)',['../installation_debian.html#debian-and-ubuntu-packages-unofficial',1,'']]], + ['debian_20ubuntu_38',['Debian/Ubuntu',['../installation_debian.html',1,'installation']]], + ['debugstring_39',['DebugString',['../group__component.html#a764be64f3029f8b8e23511061d8de355',1,'ftxui::Event']]], + ['decorate_40',['Decorate',['../classftxui_1_1TableSelection.html#a8e7e9329ee7f557eef6d037fef8003e0',1,'ftxui::TableSelection']]], + ['decoratealternatecolumn_41',['DecorateAlternateColumn',['../classftxui_1_1TableSelection.html#a00b7d84571ed47043e55cd879ed851a3',1,'ftxui::TableSelection']]], + ['decoratealternaterow_42',['DecorateAlternateRow',['../classftxui_1_1TableSelection.html#a9cadee0ff95e66e2ca90e15648ad592d',1,'ftxui::TableSelection']]], + ['decoratecells_43',['DecorateCells',['../classftxui_1_1TableSelection.html#a335808a6c8beb4744bfe91b359ebf0bb',1,'ftxui::TableSelection']]], + ['decoratecellsalternatecolumn_44',['DecorateCellsAlternateColumn',['../classftxui_1_1TableSelection.html#a751593eb3bc2e704eb6667ed518f614e',1,'ftxui::TableSelection']]], + ['decoratecellsalternaterow_45',['DecorateCellsAlternateRow',['../classftxui_1_1TableSelection.html#ac2810f38a5f722916f364f354c204cb7',1,'ftxui::TableSelection']]], + ['decorator_46',['Decorator',['../namespaceftxui.html#a164021903e9ac6f1357e4186582891e3',1,'ftxui']]], + ['deeppink1_47',['DeepPink1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfad05d6a1937a822876238056c449d358a',1,'ftxui::Color']]], + ['deeppink1bis_48',['DeepPink1Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa65e73df447238ae75a0d07efb65dbe9e',1,'ftxui::Color']]], + ['deeppink2_49',['DeepPink2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaeef51aafc2cd821d225e0da0c53f8e20',1,'ftxui::Color']]], + ['deeppink3_50',['DeepPink3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfafe2c78801538b191a773d879ce8ef205',1,'ftxui::Color']]], + ['deeppink3bis_51',['DeepPink3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfabff5bbcace3282974cfa06467832cb79',1,'ftxui::Color']]], + ['deeppink4_52',['DeepPink4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf13fb129c07396292da1f7530914f07d',1,'ftxui::Color']]], + ['deeppink4bis_53',['DeepPink4Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa26e5234f400791a8e9e7850ba7cf6df8',1,'ftxui::Color']]], + ['deeppink4ter_54',['DeepPink4Ter',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfac8deabe72bda5e1baf1db1ffc1edf966',1,'ftxui::Color']]], + ['deepskyblue1_55',['DeepSkyBlue1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa601eba969cf1007265ed79e626d49be7',1,'ftxui::Color']]], + ['deepskyblue2_56',['DeepSkyBlue2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa932fa24051e9217b181a71e7491bb214',1,'ftxui::Color']]], + ['deepskyblue3_57',['DeepSkyBlue3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa99066355a2c8a3d09741cc7318a41dbc',1,'ftxui::Color']]], + ['deepskyblue3bis_58',['DeepSkyBlue3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa8986a4db4b9a9e78822a35345484d23a',1,'ftxui::Color']]], + ['deepskyblue4_59',['DeepSkyBlue4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0bedec2878fd084bb46dcd7f7dd3b9aa',1,'ftxui::Color']]], + ['deepskyblue4bis_60',['DeepSkyBlue4Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfad0cc3282e3ba7e9d833052832a54fdc3',1,'ftxui::Color']]], + ['deepskyblue4ter_61',['DeepSkyBlue4Ter',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa98b88c697db6fc8899bee87fa24e86dd',1,'ftxui::Color']]], + ['default_62',['Default',['../group__screen.html#aa4be56f94fc180d7b070df23c235b0c7a79935518a3889663d8688b6b01fff051',1,'ftxui::Color::Default'],['../group__component.html#a2108670f055ede2fdc4993f6ffc8ff07',1,'ftxui::InputOption::Default()']]], + ['delete_63',['Delete',['../group__component.html#ae7a3abf1b7aa72c31f924c2a337805af',1,'ftxui::Event']]], + ['dependency_64',['Use as a Dependency',['../installation_nix.html#use-as-a-dependency',1,'']]], + ['detach_65',['Detach',['../group__component.html#abb7a2b60240651d16e17d02eb6f636cf',1,'ftxui::ComponentBase']]], + ['detachallchildren_66',['DetachAllChildren',['../group__component.html#a84bd6480cf5e8f51cf5965f81b1f2460',1,'ftxui::ComponentBase']]], + ['dim_67',['dim',['../group__screen.html#a3cecb006e0ca185024cd89f9ea2ea69a',1,'ftxui::Pixel::dim'],['../group__dom.html#gac6a3b77604739516e809369810896646',1,'ftxui::dim()']]], + ['dim_2ecpp_68',['dim.cpp',['../dim_8cpp.html',1,'']]], + ['dim_5fx_69',['dim_x',['../structftxui_1_1flexbox__helper_1_1Block.html#a78e7e791466dc8e951311de2a1709955',1,'ftxui::flexbox_helper::Block::dim_x'],['../structftxui_1_1flexbox__helper_1_1Line.html#a78e7e791466dc8e951311de2a1709955',1,'ftxui::flexbox_helper::Line::dim_x']]], + ['dim_5fy_70',['dim_y',['../structftxui_1_1flexbox__helper_1_1Block.html#ad26cec1d8cdf8ba04707fd4cf822065a',1,'ftxui::flexbox_helper::Block::dim_y'],['../structftxui_1_1flexbox__helper_1_1Line.html#ad26cec1d8cdf8ba04707fd4cf822065a',1,'ftxui::flexbox_helper::Line::dim_y']]], + ['dimensions_71',['Dimensions',['../group__screen.html#structftxui_1_1Dimensions',1,'ftxui']]], + ['dimx_72',['dimx',['../group__screen.html#a8b0f6ae031a507c3ffb7bf0eec290d46',1,'ftxui::Dimensions::dimx'],['../group__screen.html#ae7a460c9dacd70ed81b1adfea46b492e',1,'ftxui::Image::dimx() const']]], + ['dimx_5f_73',['dimx_',['../group__screen.html#a1b254c3faacd432c325efff4268ca683',1,'ftxui::Image']]], + ['dimy_74',['dimy',['../group__screen.html#a3a072d6ef9c51d085b44eac70f2edff6',1,'ftxui::Dimensions::dimy'],['../group__screen.html#a0d283cfb1ec16b3fc13d344ebfea93d4',1,'ftxui::Image::dimy() const']]], + ['dimy_5f_75',['dimy_',['../group__screen.html#a9e9d5df4b41aaa5eca27cdcaca6d4574',1,'ftxui::Image']]], + ['direction_76',['Direction',['../group__dom.html#a224b9163917ac32fc95a60d8c1eec3aa',1,'ftxui::FlexboxConfig::Direction'],['../group__dom.html#ga224b9163917ac32fc95a60d8c1eec3aa',1,'ftxui::Direction']]], + ['direction_77',['direction',['../group__component.html#a53421c695d00016ab925777d423b4eb6',1,'ftxui::MenuOption::direction'],['../structftxui_1_1ResizableSplitOption.html#ade634553502b9c3f7d21cd3f088b362e',1,'ftxui::ResizableSplitOption::direction'],['../structftxui_1_1SliderOption.html#a53421c695d00016ab925777d423b4eb6',1,'ftxui::SliderOption::direction'],['../group__dom.html#a53421c695d00016ab925777d423b4eb6',1,'ftxui::FlexboxConfig::direction']]], + ['direction_2ecppm_78',['direction.cppm',['../direction_8cppm.html',1,'']]], + ['direction_2ehpp_79',['direction.hpp',['../direction_8hpp.html',1,'']]], + ['dodgerblue1_80',['DodgerBlue1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6902167c73e03c1214dae9265c9a9523',1,'ftxui::Color']]], + ['dodgerblue2_81',['DodgerBlue2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa4bfe8de454eabc37639b32813912000e',1,'ftxui::Color']]], + ['dodgerblue3_82',['DodgerBlue3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf82b272abcc583f2c0ac11d6b22c45ca',1,'ftxui::Color']]], + ['dom_83',['dom',['../module-dom.html',1,'ftxui / dom'],['../group__dom.html',1,'ftxui/dom'],['../ftxui.html#ftxuidom',1,'ftxui/dom']]], + ['dom_2ecppm_84',['dom.cppm',['../dom_8cppm.html',1,'']]], + ['dom_2fcolor_2ecpp_85',['color.cpp',['../dom_2color_8cpp.html',1,'']]], + ['dom_2fdeprecated_2ecppm_86',['deprecated.cppm',['../dom_2deprecated_8cppm.html',1,'']]], + ['dom_2fdeprecated_2ehpp_87',['deprecated.hpp',['../dom_2deprecated_8hpp.html',1,'']]], + ['dom_2futil_2ecpp_88',['util.cpp',['../dom_2util_8cpp.html',1,'']]], + ['dom_5fexamples_2emd_89',['dom_examples.md',['../dom__examples_8md.html',1,'']]], + ['double_90',['DOUBLE',['../group__dom.html#ggafe3103dd0b8240c5443892484ef5af9ca33465d1d419b1074fb259ef444609e92',1,'ftxui']]], + ['double_5fquote_91',['Double_Quote',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aa3a1f5142815614aa554e376af7047de3',1,'ftxui']]], + ['down_92',['Down',['../group__dom.html#gga224b9163917ac32fc95a60d8c1eec3aaa08a38277b0309070706f6652eeae9a53',1,'ftxui']]], + ['down_93',['down',['../screen_8cpp.html#a9cdd0454d64ec151b59fdd7d22ed505a',1,'screen.cpp']]], + ['drag_94',['drag',['../group__component.html#a2104e875bdb7c78a8bf7dfd3728459c5',1,'ftxui::WindowRenderState']]], + ['drawblock_95',['DrawBlock',['../group__dom.html#ae38b2e4f5bcda94c060bb77779d1e339',1,'ftxui::Canvas::DrawBlock(int x, int y, bool value)'],['../group__dom.html#a0a51b12eb4089c9a3afb8d3052599b98',1,'ftxui::Canvas::DrawBlock(int x, int y, bool value, const Stylizer &s)'],['../group__dom.html#ab5717755b773771ef642e9e774dbb1a0',1,'ftxui::Canvas::DrawBlock(int x, int y, bool value, const Color &color)']]], + ['drawblockcircle_96',['DrawBlockCircle',['../group__dom.html#ac3977d4b06ca96ff799a3b72437c8a0b',1,'ftxui::Canvas::DrawBlockCircle(int x1, int y1, int radius)'],['../group__dom.html#a685bec108334c6a43ceb5ca8a0666cd7',1,'ftxui::Canvas::DrawBlockCircle(int x1, int y1, int radius, const Stylizer &s)'],['../group__dom.html#ab2bf509dc9519bd9f76a7721b5b152bf',1,'ftxui::Canvas::DrawBlockCircle(int x1, int y1, int radius, const Color &color)']]], + ['drawblockcirclefilled_97',['DrawBlockCircleFilled',['../group__dom.html#acffdcd5bae224992e155facb0baf4119',1,'ftxui::Canvas::DrawBlockCircleFilled(int x1, int y1, int radius)'],['../group__dom.html#a60a31c3685d296333e594feb8ec04c48',1,'ftxui::Canvas::DrawBlockCircleFilled(int x1, int y1, int radius, const Stylizer &s)'],['../group__dom.html#a70cd877698afe354ca070c6b93ef3847',1,'ftxui::Canvas::DrawBlockCircleFilled(int x1, int y1, int radius, const Color &color)']]], + ['drawblockellipse_98',['DrawBlockEllipse',['../group__dom.html#a8dd75f2dfc5bef37aa2c8bc8cfaf0579',1,'ftxui::Canvas::DrawBlockEllipse(int x1, int y1, int r1, int r2)'],['../group__dom.html#ac53509c067c979cc6ec766b4db8e6e2c',1,'ftxui::Canvas::DrawBlockEllipse(int x1, int y1, int r1, int r2, const Stylizer &s)'],['../group__dom.html#a0916ab1d55ac16c158571d135893e88a',1,'ftxui::Canvas::DrawBlockEllipse(int x1, int y1, int r1, int r2, const Color &color)']]], + ['drawblockellipsefilled_99',['DrawBlockEllipseFilled',['../group__dom.html#a78dc3c908f7ce1c30837bd3043f19526',1,'ftxui::Canvas::DrawBlockEllipseFilled(int x1, int y1, int r1, int r2)'],['../group__dom.html#aa3f717282aab0cee9835503ef1eb6f1b',1,'ftxui::Canvas::DrawBlockEllipseFilled(int x1, int y1, int r1, int r2, const Stylizer &s)'],['../group__dom.html#a616781dd82158e306ebf71d87283e6f8',1,'ftxui::Canvas::DrawBlockEllipseFilled(int x1, int y1, int r1, int r2, const Color &color)']]], + ['drawblockline_100',['DrawBlockLine',['../group__dom.html#a182a915a7e3fc863f5c222253de01ff1',1,'ftxui::Canvas::DrawBlockLine(int x1, int y1, int x2, int y2)'],['../group__dom.html#a2911f015b5085dd2f74a4f88910eabe3',1,'ftxui::Canvas::DrawBlockLine(int x1, int y1, int x2, int y2, const Stylizer &s)'],['../group__dom.html#a8543417c0289090a5eefb2d6fcd521fc',1,'ftxui::Canvas::DrawBlockLine(int x1, int y1, int x2, int y2, const Color &color)']]], + ['drawblockoff_101',['DrawBlockOff',['../group__dom.html#ad626747e5e54412d0376ba870565dce6',1,'ftxui::Canvas']]], + ['drawblockon_102',['DrawBlockOn',['../group__dom.html#a43cd60e79e418d3173e757a1809fde09',1,'ftxui::Canvas']]], + ['drawblocktoggle_103',['DrawBlockToggle',['../group__dom.html#ab4154641384d18497de60c2626b71a94',1,'ftxui::Canvas']]], + ['drawimage_104',['DrawImage',['../group__dom.html#a02b6e8bab532a2c43d3102674e1e1647',1,'ftxui::Canvas']]], + ['drawpixel_105',['DrawPixel',['../group__dom.html#afde1b1962124ef417569bef59c6dcdcc',1,'ftxui::Canvas']]], + ['drawpoint_106',['DrawPoint',['../group__dom.html#a8707f2585ed8b787b6b14032a5c761a1',1,'ftxui::Canvas::DrawPoint(int x, int y, bool value)'],['../group__dom.html#a356677acf431f88673b59526f290eb0c',1,'ftxui::Canvas::DrawPoint(int x, int y, bool value, const Stylizer &s)'],['../group__dom.html#ab89d4e0bd8bf78ba40dde08cd5779fa7',1,'ftxui::Canvas::DrawPoint(int x, int y, bool value, const Color &color)']]], + ['drawpointcircle_107',['DrawPointCircle',['../group__dom.html#ad21641f8f1fd60aa5f1d149379eba3eb',1,'ftxui::Canvas::DrawPointCircle(int x, int y, int radius)'],['../group__dom.html#a644133eccde18caeaf06e5b7fdb5ef51',1,'ftxui::Canvas::DrawPointCircle(int x, int y, int radius, const Stylizer &s)'],['../group__dom.html#adcc98793cdb931c3438b5ec35ed7a0dd',1,'ftxui::Canvas::DrawPointCircle(int x, int y, int radius, const Color &color)']]], + ['drawpointcirclefilled_108',['DrawPointCircleFilled',['../group__dom.html#a5b6388d2515edcfb6c88a39ea56805b2',1,'ftxui::Canvas::DrawPointCircleFilled(int x, int y, int radius)'],['../group__dom.html#af7a213e8dbed8debae0155f1b707fd74',1,'ftxui::Canvas::DrawPointCircleFilled(int x, int y, int radius, const Stylizer &s)'],['../group__dom.html#adace7c348090660c1a6a5fffce18b7d2',1,'ftxui::Canvas::DrawPointCircleFilled(int x, int y, int radius, const Color &color)']]], + ['drawpointellipse_109',['DrawPointEllipse',['../group__dom.html#a79ee88b3cfe258309041469f707dcf68',1,'ftxui::Canvas::DrawPointEllipse(int x, int y, int r1, int r2)'],['../group__dom.html#a6926683a29ff97d77e40ae533bb51eed',1,'ftxui::Canvas::DrawPointEllipse(int x, int y, int r1, int r2, const Color &color)'],['../group__dom.html#acdafc386934cf7e11b529c0c38b788a3',1,'ftxui::Canvas::DrawPointEllipse(int x, int y, int r1, int r2, const Stylizer &s)']]], + ['drawpointellipsefilled_110',['DrawPointEllipseFilled',['../group__dom.html#a2633b8a556a82c74438fe41b253b39ee',1,'ftxui::Canvas::DrawPointEllipseFilled(int x, int y, int r1, int r2)'],['../group__dom.html#a395ec10a91d15be650afddcb85757945',1,'ftxui::Canvas::DrawPointEllipseFilled(int x, int y, int r1, int r2, const Color &color)'],['../group__dom.html#a22ec58bdf5a3578ce68c52ace9324fb6',1,'ftxui::Canvas::DrawPointEllipseFilled(int x, int y, int r1, int r2, const Stylizer &s)']]], + ['drawpointline_111',['DrawPointLine',['../group__dom.html#a2b6800c9a6a93457a921d9b570fb2f30',1,'ftxui::Canvas::DrawPointLine(int x1, int y1, int x2, int y2)'],['../group__dom.html#a4eb34a7688220b3b8ad274ff9d0f3649',1,'ftxui::Canvas::DrawPointLine(int x1, int y1, int x2, int y2, const Stylizer &s)'],['../group__dom.html#a6a3d2396239afce89f1cda3c69665095',1,'ftxui::Canvas::DrawPointLine(int x1, int y1, int x2, int y2, const Color &color)']]], + ['drawpointoff_112',['DrawPointOff',['../group__dom.html#a64ad8a12830a3341d4a5afb380913474',1,'ftxui::Canvas']]], + ['drawpointon_113',['DrawPointOn',['../group__dom.html#a5f488ea43e72f25cc25d055bf18dac5b',1,'ftxui::Canvas']]], + ['drawpointtoggle_114',['DrawPointToggle',['../group__dom.html#afd64176f05f91df2d96e8f3bb0631c51',1,'ftxui::Canvas']]], + ['drawtext_115',['DrawText',['../group__dom.html#a3791777bd6d3c6f8ff6281efd19a5161',1,'ftxui::Canvas::DrawText(int x, int y, const std::string &value)'],['../group__dom.html#a389991302f9a1d5554eff24b48d6b6ec',1,'ftxui::Canvas::DrawText(int x, int y, const std::string &value, const Color &color)'],['../group__dom.html#a648ed3b48973ac1dc58ca22d54ecf6af',1,'ftxui::Canvas::DrawText(int x, int y, const std::string &value, const Stylizer &style)']]], + ['dropdown_116',['Dropdown',['../group__component.html#gaa22bddff4aeed66e20f30d0715596999',1,'ftxui::Dropdown(ConstStringListRef entries, int *selected)'],['../group__component.html#gaa4b353566017558bac648ee1409930de',1,'ftxui::Dropdown(DropdownOption option)'],['../module-component.html#component-dropdown',1,'Dropdown']]], + ['dropdown_117',['dropdown',['../module-component-examples.html#dropdown',1,'']]], + ['dropdown_5fcustom_118',['dropdown_custom',['../module-component-examples.html#dropdown_custom',1,'']]], + ['dropdown_5fcustom_2ecpp_119',['dropdown_custom.cpp',['../dropdown__custom_8cpp.html',1,'']]], + ['dropdownoption_120',['DropdownOption',['../group__component.html#structftxui_1_1DropdownOption',1,'ftxui']]], + ['dummycomponent_121',['DummyComponent',['../menu__underline__animated__gallery_8cpp.html#a488a81f58d76f17bf95ef222f68e0dfe',1,'menu_underline_animated_gallery.cpp']]], + ['dummywindowcontent_122',['DummyWindowContent',['../scrollbar_8cpp.html#a83db372d294b69185f7a26148935cfc3',1,'DummyWindowContent(): scrollbar.cpp'],['../examples_2component_2window_8cpp.html#a83db372d294b69185f7a26148935cfc3',1,'DummyWindowContent(): window.cpp']]], + ['duration_123',['Duration',['../namespaceftxui_1_1animation.html#a3c06579c86b609bce4a9a097b23cd739',1,'ftxui::animation']]], + ['duration_124',['duration',['../group__component.html#a7449575119a6168a323351fb04a7eb64',1,'ftxui::AnimatedColorOption::duration'],['../classftxui_1_1animation_1_1Params.html#a2cf2e0a4288915aee8f100d2f0ee3e50',1,'ftxui::animation::Params::duration()']]] +]; diff --git a/search/all_5.js b/search/all_5.js new file mode 100644 index 000000000..d3b276a63 --- /dev/null +++ b/search/all_5.js @@ -0,0 +1,69 @@ +var searchData= +[ + ['e_0',['E',['../group__component.html#a3a61ae4f8c53a7bb7f9281805b4fca1e',1,'ftxui::Event']]], + ['e_1',['e',['../group__component.html#ae58ffaf7d28f83b470d73530bce0bee1',1,'ftxui::Event']]], + ['easing_2',['easing',['../namespaceeasing.html',1,'']]], + ['eatcodepoint_3',['EatCodePoint',['../namespaceftxui.html#a903cd2e24b3b7cf8d7d4daa680e0a8d5',1,'ftxui::EatCodePoint(const std::string &input, size_t start, size_t *end, uint32_t *ucs)'],['../namespaceftxui.html#a88b8b2f726acaf2aca140a403989d8d0',1,'ftxui::EatCodePoint(const std::wstring &input, size_t start, size_t *end, uint32_t *ucs)']]], + ['elasticin_4',['ElasticIn',['../namespaceftxui_1_1animation_1_1easing.html#a0cc4cc8d40617d7b21dea78f71917bbc',1,'ftxui::animation::easing']]], + ['elasticinout_5',['ElasticInOut',['../namespaceftxui_1_1animation_1_1easing.html#a537ce88e07af5658175f95eb70369fb9',1,'ftxui::animation::easing']]], + ['elasticout_6',['ElasticOut',['../namespaceftxui_1_1animation_1_1easing.html#ad771aec6f0170cb9039446699d1d2295',1,'ftxui::animation::easing']]], + ['element_7',['Element',['../structftxui_1_1box__helper_1_1Element.html',1,'Element'],['../namespaceftxui.html#a2bc31f2d685189e5c61d2293a1f51b4f',1,'ftxui::Element']]], + ['element_8',['element',['../structftxui_1_1InputState.html#ae6bcc69b531dedf3a1d9142f46bcbb77',1,'ftxui::InputState']]], + ['elementdecorator_9',['ElementDecorator',['../namespaceftxui.html#a2d5012891073dbf196bfada5f702f382',1,'ftxui']]], + ['elements_10',['Elements',['../namespaceftxui.html#a5d4aa06ca6cc6a72e981bd5386f93f0a',1,'ftxui']]], + ['elements_2ecppm_11',['elements.cppm',['../elements_8cppm.html',1,'']]], + ['elements_2ehpp_12',['elements.hpp',['../elements_8hpp.html',1,'']]], + ['elements_5finfix_13',['elements_infix',['../group__component.html#a9504d8d3bfa1daaab000e5455536b20d',1,'ftxui::MenuOption']]], + ['elements_5fpostfix_14',['elements_postfix',['../group__component.html#ab08362a5698543aec0fbb37f99777119',1,'ftxui::MenuOption']]], + ['elements_5fprefix_15',['elements_prefix',['../group__component.html#a11476ea3dc58bf17777879693fb2985a',1,'ftxui::MenuOption']]], + ['empty_16',['EMPTY',['../group__dom.html#ggafe3103dd0b8240c5443892484ef5af9ca2f0d18fc0d0fa4a6cd92dc328501874d',1,'ftxui']]], + ['empty_17',['Empty',['../examples_2component_2collapsible_8cpp.html#aacbbfcb3c5bc93d26a5c681172e27eae',1,'collapsible.cpp']]], + ['emptyelement_18',['emptyElement',['../group__dom.html#ga40451515a5b3049e7a1276cad8b9356c',1,'ftxui']]], + ['enabled_19',['enabled',['../group__component.html#a8740ba80e30dd75e71d09fa1dcf04f3d',1,'ftxui::UnderlineOption::enabled'],['../group__component.html#a8740ba80e30dd75e71d09fa1dcf04f3d',1,'ftxui::AnimatedColorOption::enabled'],['../structftxui_1_1Requirement_1_1Focused.html#a8740ba80e30dd75e71d09fa1dcf04f3d',1,'ftxui::Requirement::Focused::enabled']]], + ['end_20',['End',['../group__component.html#a9e841cb4b2ac7a46cfd26806a40fe3b5',1,'ftxui::Event']]], + ['entries_21',['entries',['../group__component.html#a7b534b117dbbe826d34ba17af85f1e93',1,'ftxui::MenuOption::entries'],['../group__component.html#a7b534b117dbbe826d34ba17af85f1e93',1,'ftxui::RadioboxOption::entries']]], + ['entries_5foption_22',['entries_option',['../group__component.html#a2076e7253c5acce2321c067e9b7a1823',1,'ftxui::MenuOption']]], + ['entrystate_23',['EntryState',['../structftxui_1_1EntryState.html',1,'ftxui']]], + ['equal_24',['EQUAL',['../namespaceftxui.html#ae09f44b989d381a387329fd0a0935926a59a84258a4cb9025b567ee5139455029',1,'ftxui']]], + ['escape_25',['Escape',['../group__component.html#a27e4fc900f184c4d743c34913e180065',1,'ftxui::Event']]], + ['event_26',['Event',['../group__component.html#structftxui_1_1Event',1,'ftxui']]], + ['event_2ecpp_27',['event.cpp',['../event_8cpp.html',1,'']]], + ['event_2ecppm_28',['event.cppm',['../event_8cppm.html',1,'']]], + ['event_2ehpp_29',['event.hpp',['../event_8hpp.html',1,'']]], + ['example_30',['Example',['../module-component-examples.html',1,'Example'],['../module-dom-examples.html',1,'Example'],['../index.html#example',1,'Example'],['../group__component.html#example-1',1,'Example'],['../group__component.html#example-2',1,'Example'],['../group__component.html#example-3',1,'Example'],['../namespaceftxui.html#example-4',1,'Example'],['../group__component.html#example-5',1,'Example'],['../group__component.html#example-6',1,'Example'],['../group__component.html#example-7',1,'Example'],['../group__component.html#example-8',1,'Example'],['../group__component.html#example-9',1,'Example'],['../group__component.html#example-10',1,'Example'],['../group__component.html#example-11',1,'Example'],['../group__component.html#example-12',1,'Example'],['../group__component.html#example-13',1,'Example'],['../group__component.html#example-14',1,'Example'],['../group__component.html#example-15',1,'Example'],['../group__component.html#example-16',1,'Example'],['../group__component.html#example-17',1,'Example'],['../group__component.html#example-18',1,'Example'],['../group__component.html#example-19',1,'Example'],['../group__component.html#example-20',1,'Example'],['../group__component.html#example-21',1,'Example'],['../group__component.html#example-22',1,'Example'],['../group__component.html#example-24',1,'Example'],['../group__component.html#example-23',1,'Example'],['../group__component.html#example-25',1,'Example'],['../group__component.html#example-26',1,'Example'],['../group__component.html#example-27',1,'Example'],['../group__component.html#example-28',1,'Example'],['../group__component.html#example-29',1,'Example'],['../group__component.html#example-30',1,'Example'],['../group__component.html#example-31',1,'Example'],['../group__component.html#example-32',1,'Example'],['../group__component.html#example-33',1,'Example'],['../group__component.html#example-34',1,'Example'],['../group__component.html#example-35',1,'Example'],['../namespaceftxui.html#example-36',1,'Example'],['../group__component.html#example-37',1,'Example'],['../group__component.html#example-38',1,'Example'],['../group__component.html#example-39',1,'Example'],['../group__component.html#example-40',1,'Example'],['../group__component.html#example-41',1,'Example'],['../namespaceftxui.html#example-42',1,'Example'],['../group__component.html#example-43',1,'Example'],['../group__component.html#example-44',1,'Example'],['../group__dom.html#example-45',1,'Example'],['../group__dom.html#example-46',1,'Example'],['../group__dom.html#example-47',1,'Example'],['../group__dom.html#example-48',1,'Example'],['../namespaceftxui.html#example-49',1,'Example'],['../group__dom.html#example-50',1,'Example'],['../namespaceftxui.html#example-51',1,'Example'],['../namespaceftxui.html#example-52',1,'Example'],['../group__dom.html#example-53',1,'Example'],['../group__dom.html#example-54',1,'Example'],['../group__dom.html#example-55',1,'Example'],['../group__dom.html#example-56',1,'Example'],['../group__dom.html#example-57',1,'Example'],['../group__dom.html#example-58',1,'Example'],['../group__dom.html#example-59',1,'Example'],['../group__dom.html#example-60',1,'Example'],['../group__dom.html#example-61',1,'Example'],['../group__dom.html#example-62',1,'Example'],['../group__dom.html#example-63',1,'Example'],['../group__dom.html#example-64',1,'Example'],['../group__dom.html#example-65',1,'Example'],['../group__dom.html#example-66',1,'Example'],['../namespaceftxui.html#example-67',1,'Example'],['../group__dom.html#example-68',1,'Example'],['../group__dom.html#example-69',1,'Example'],['../group__dom.html#example-70',1,'Example'],['../group__dom.html#example-71',1,'Example'],['../group__dom.html#example-72',1,'Example'],['../namespaceftxui.html#example-73',1,'Example'],['../group__dom.html#example-74',1,'Example'],['../group__dom.html#example-75',1,'Example'],['../group__dom.html#example-76',1,'Example'],['../group__dom.html#example-77',1,'Example'],['../group__dom.html#example-78',1,'Example'],['../group__dom.html#example-79',1,'Example'],['../group__dom.html#example-80',1,'Example'],['../group__dom.html#example-81',1,'Example'],['../group__dom.html#example-82',1,'Example'],['../group__dom.html#example-83',1,'Example'],['../namespaceftxui.html#example-84',1,'Example'],['../namespaceftxui.html#example-85',1,'Example'],['../group__dom.html#example-86',1,'Example'],['../group__dom.html#example-87',1,'Example'],['../group__dom.html#example-88',1,'Example'],['../group__dom.html#example-89',1,'Example'],['../group__dom.html#example-90',1,'Example'],['../group__dom.html#example-91',1,'Example'],['../group__dom.html#example-92',1,'Example'],['../group__dom.html#example-93',1,'Example'],['../getting-started.html#minimal-example',1,'Minimal Example']]], + ['examples_2fcomponent_2fbutton_2ecpp_31',['button.cpp',['../examples_2component_2button_8cpp.html',1,'']]], + ['examples_2fcomponent_2fcheckbox_2ecpp_32',['checkbox.cpp',['../examples_2component_2checkbox_8cpp.html',1,'']]], + ['examples_2fcomponent_2fcollapsible_2ecpp_33',['collapsible.cpp',['../examples_2component_2collapsible_8cpp.html',1,'']]], + ['examples_2fcomponent_2fdropdown_2ecpp_34',['dropdown.cpp',['../examples_2component_2dropdown_8cpp.html',1,'']]], + ['examples_2fcomponent_2ffocus_2ecpp_35',['focus.cpp',['../examples_2component_2focus_8cpp.html',1,'']]], + ['examples_2fcomponent_2finput_2ecpp_36',['input.cpp',['../examples_2component_2input_8cpp.html',1,'']]], + ['examples_2fcomponent_2fmaybe_2ecpp_37',['maybe.cpp',['../examples_2component_2maybe_8cpp.html',1,'']]], + ['examples_2fcomponent_2fmenu_2ecpp_38',['menu.cpp',['../examples_2component_2menu_8cpp.html',1,'']]], + ['examples_2fcomponent_2fradiobox_2ecpp_39',['radiobox.cpp',['../examples_2component_2radiobox_8cpp.html',1,'']]], + ['examples_2fcomponent_2frenderer_2ecpp_40',['renderer.cpp',['../examples_2component_2renderer_8cpp.html',1,'']]], + ['examples_2fcomponent_2fresizable_5fsplit_2ecpp_41',['resizable_split.cpp',['../examples_2component_2resizable__split_8cpp.html',1,'']]], + ['examples_2fcomponent_2fselection_2ecpp_42',['selection.cpp',['../examples_2component_2selection_8cpp.html',1,'']]], + ['examples_2fcomponent_2fslider_2ecpp_43',['slider.cpp',['../examples_2component_2slider_8cpp.html',1,'']]], + ['examples_2fcomponent_2fwindow_2ecpp_44',['window.cpp',['../examples_2component_2window_8cpp.html',1,'']]], + ['examples_2fdom_2fborder_2ecpp_45',['border.cpp',['../examples_2dom_2border_8cpp.html',1,'']]], + ['examples_2fdom_2fcanvas_2ecpp_46',['canvas.cpp',['../examples_2dom_2canvas_8cpp.html',1,'']]], + ['examples_2fdom_2fdbox_2ecpp_47',['dbox.cpp',['../examples_2dom_2dbox_8cpp.html',1,'']]], + ['examples_2fdom_2fgauge_2ecpp_48',['gauge.cpp',['../examples_2dom_2gauge_8cpp.html',1,'']]], + ['examples_2fdom_2fgraph_2ecpp_49',['graph.cpp',['../examples_2dom_2graph_8cpp.html',1,'']]], + ['examples_2fdom_2fgridbox_2ecpp_50',['gridbox.cpp',['../examples_2dom_2gridbox_8cpp.html',1,'']]], + ['examples_2fdom_2flinear_5fgradient_2ecpp_51',['linear_gradient.cpp',['../examples_2dom_2linear__gradient_8cpp.html',1,'']]], + ['examples_2fdom_2fparagraph_2ecpp_52',['paragraph.cpp',['../examples_2dom_2paragraph_8cpp.html',1,'']]], + ['examples_2fdom_2fseparator_2ecpp_53',['separator.cpp',['../examples_2dom_2separator_8cpp.html',1,'']]], + ['examples_2fdom_2fsize_2ecpp_54',['size.cpp',['../examples_2dom_2size_8cpp.html',1,'']]], + ['examples_2fdom_2fspinner_2ecpp_55',['spinner.cpp',['../examples_2dom_2spinner_8cpp.html',1,'']]], + ['examples_2fdom_2ftable_2ecpp_56',['table.cpp',['../examples_2dom_2table_8cpp.html',1,'']]], + ['examples_3a_57',['Examples:',['../group__dom.html#examples',1,'']]], + ['executedtasks_58',['ExecutedTasks',['../classftxui_1_1task_1_1TaskRunner.html#aab6716a5f504f5985e73fb6d2b0dd677',1,'ftxui::task::TaskRunner']]], + ['exit_59',['Exit',['../group__component.html#a1a6a7739e9cc01ba888b57d1f9457f4c',1,'ftxui::ScreenInteractive']]], + ['exitloopclosure_60',['ExitLoopClosure',['../group__component.html#ae295157a88e6300609df83769ed885f2',1,'ftxui::ScreenInteractive']]], + ['exponentialin_61',['ExponentialIn',['../namespaceftxui_1_1animation_1_1easing.html#ab0ca381749febbe74887c9fff0522434',1,'ftxui::animation::easing']]], + ['exponentialinout_62',['ExponentialInOut',['../namespaceftxui_1_1animation_1_1easing.html#a502f9e65e97d295f46c6a6435a84464d',1,'ftxui::animation::easing']]], + ['exponentialout_63',['ExponentialOut',['../namespaceftxui_1_1animation_1_1easing.html#a9de59af8a36489121dace3f2a996f029',1,'ftxui::animation::easing']]], + ['extend_64',['Extend',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aa3bc026b815790a05493fa56fc4b8d8bd',1,'ftxui']]], + ['extendnumlet_65',['ExtendNumLet',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aadcba983044c9eb2afae2e2eaef5fe818',1,'ftxui']]] +]; diff --git a/search/all_6.js b/search/all_6.js new file mode 100644 index 000000000..cccfa5c12 --- /dev/null +++ b/search/all_6.js @@ -0,0 +1,142 @@ +var searchData= +[ + ['f_0',['F',['../group__component.html#ac4c32dbf039cdf80aa202c9aea54dd1f',1,'ftxui::Event']]], + ['f_1',['f',['../group__component.html#af2fc4cb7175b815a2e69616b5493e0ad',1,'ftxui::Event']]], + ['f1_2',['F1',['../group__component.html#ad3289a38381b0a9d07e2182a2c9ba9ee',1,'ftxui::Event']]], + ['f10_3',['F10',['../group__component.html#ac7e786e3b193c72a26179fce9d149848',1,'ftxui::Event']]], + ['f11_4',['F11',['../group__component.html#a9e95c75a3d332a2e2a3adfc77a7b321c',1,'ftxui::Event']]], + ['f12_5',['F12',['../group__component.html#a373d3f5b50454169a6ea41ba60d0d018',1,'ftxui::Event']]], + ['f2_6',['F2',['../group__component.html#a859749d723c3651fd301b862040a03db',1,'ftxui::Event']]], + ['f3_7',['F3',['../group__component.html#a47c2b379f2f5ac29ba6a2c414b4d2f36',1,'ftxui::Event']]], + ['f4_8',['F4',['../group__component.html#ab9a6f5b09c04d483b9fd734ee14b2e7b',1,'ftxui::Event']]], + ['f5_9',['F5',['../group__component.html#a4603a22dded4b2d2dc68054d2b87d4c5',1,'ftxui::Event']]], + ['f6_10',['F6',['../group__component.html#acf0b0d8ddfeaec98bb4779f4d7524b38',1,'ftxui::Event']]], + ['f7_11',['F7',['../group__component.html#a90c46deb63fd81bd86a4b942a1244ccc',1,'ftxui::Event']]], + ['f8_12',['F8',['../group__component.html#ab32c1934bd8f2de0d68ff0b5161fe0b2',1,'ftxui::Event']]], + ['f9_13',['F9',['../group__component.html#a520b29840c549f62b9474f5494036bc7',1,'ftxui::Event']]], + ['f_5f_14',['f_',['../flex_8cpp.html#a51920d6139d68e1a860381e730c217c3',1,'flex.cpp']]], + ['feature_15',['Feature',['../index.html#feature',1,'']]], + ['fetchcontent_16',['Using FetchContent',['../installation_cmake.html#using-fetchcontent',1,'']]], + ['filler_17',['filler',['../group__dom.html#gac2a9ed2d22ec3c8811b61f4a901ed367',1,'ftxui']]], + ['filtered_20input_18',['Filtered input',['../module-component.html#filtered-input',1,'']]], + ['find_5fpackage_19',['Using find_package',['../installation_cmake.html#using-find_package',1,'']]], + ['fit_20',['Fit',['../namespaceftxui_1_1Dimension.html#aee138f0b60ddc07682a785f55eb5fda6',1,'ftxui::Dimension']]], + ['fitcomponent_21',['FitComponent',['../group__component.html#a4f458e443ed672c2aea9fdd96531a621',1,'ftxui::ScreenInteractive']]], + ['fixed_22',['Fixed',['../namespaceftxui_1_1Dimension.html#a36e539ed36f88d7f01233974da485937',1,'ftxui::Dimension']]], + ['fixedsize_23',['FixedSize',['../group__component.html#a267cfc2d693fa96a82ae74029214d02e',1,'ftxui::ScreenInteractive']]], + ['flags_24',['Optional CMake Flags',['../installation_cmake.html#optional-cmake-flags',1,'']]], + ['flake_25',['Nix Flake',['../installation_nix.html#nix-flake',1,'']]], + ['flex_26',['flex',['../group__dom.html#ga257acd2bd47bab7db879cca2c0e67e23',1,'ftxui']]], + ['flex_2ecpp_27',['flex.cpp',['../flex_8cpp.html',1,'']]], + ['flex_5fgrow_28',['flex_grow',['../structftxui_1_1box__helper_1_1Element.html#a2fb16db68c0bf00d3bf872bc18675116',1,'ftxui::box_helper::Element::flex_grow'],['../group__dom.html#ga81ed6b31f512e849247f13d249f6f20e',1,'ftxui::flex_grow()']]], + ['flex_5fgrow_5fx_29',['flex_grow_x',['../group__dom.html#a874ced28be7064feaaf97c70c2097bd6',1,'ftxui::Requirement::flex_grow_x'],['../structftxui_1_1flexbox__helper_1_1Block.html#a874ced28be7064feaaf97c70c2097bd6',1,'ftxui::flexbox_helper::Block::flex_grow_x']]], + ['flex_5fgrow_5fy_30',['flex_grow_y',['../group__dom.html#a13f6aa7165c63a4494fc2f1ed4428880',1,'ftxui::Requirement::flex_grow_y'],['../structftxui_1_1flexbox__helper_1_1Block.html#a13f6aa7165c63a4494fc2f1ed4428880',1,'ftxui::flexbox_helper::Block::flex_grow_y']]], + ['flex_5fshrink_31',['flex_shrink',['../structftxui_1_1box__helper_1_1Element.html#a94a9a7333988edf4249f38c1b1491cf4',1,'ftxui::box_helper::Element::flex_shrink'],['../group__dom.html#ga4629196b5ffc280054d35f2a9977e829',1,'ftxui::flex_shrink()']]], + ['flex_5fshrink_5fx_32',['flex_shrink_x',['../group__dom.html#ad293f2488e260e36e72fd3da9c16df9a',1,'ftxui::Requirement::flex_shrink_x'],['../structftxui_1_1flexbox__helper_1_1Block.html#ad293f2488e260e36e72fd3da9c16df9a',1,'ftxui::flexbox_helper::Block::flex_shrink_x']]], + ['flex_5fshrink_5fy_33',['flex_shrink_y',['../group__dom.html#ab4e07297a2a55de7158ef0115b6b46a9',1,'ftxui::Requirement::flex_shrink_y'],['../structftxui_1_1flexbox__helper_1_1Block.html#ab4e07297a2a55de7158ef0115b6b46a9',1,'ftxui::flexbox_helper::Block::flex_shrink_y']]], + ['flexbox_34',['flexbox',['../namespaceftxui.html#a168a235aa438b6c72df5861322154be3',1,'ftxui']]], + ['flexbox_2ecpp_35',['flexbox.cpp',['../flexbox_8cpp.html',1,'']]], + ['flexbox_5fconfig_2ecpp_36',['flexbox_config.cpp',['../flexbox__config_8cpp.html',1,'']]], + ['flexbox_5fconfig_2ecppm_37',['flexbox_config.cppm',['../flexbox__config_8cppm.html',1,'']]], + ['flexbox_5fconfig_2ehpp_38',['flexbox_config.hpp',['../flexbox__config_8hpp.html',1,'']]], + ['flexbox_5fgallery_39',['flexbox_gallery',['../module-component-examples.html#flexbox_gallery',1,'']]], + ['flexbox_5fgallery_2ecpp_40',['flexbox_gallery.cpp',['../flexbox__gallery_8cpp.html',1,'']]], + ['flexbox_5fhelper_2ecpp_41',['flexbox_helper.cpp',['../flexbox__helper_8cpp.html',1,'']]], + ['flexbox_5fhelper_2ehpp_42',['flexbox_helper.hpp',['../flexbox__helper_8hpp.html',1,'']]], + ['flexboxconfig_43',['FlexboxConfig',['../group__dom.html#structftxui_1_1FlexboxConfig',1,'ftxui']]], + ['flexend_44',['FlexEnd',['../group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2a923a60a08f41dc3052190403fc2a6b25',1,'ftxui::FlexboxConfig::FlexEnd'],['../group__dom.html#a821af961ece5fe13540ad48b54c7a9e7a923a60a08f41dc3052190403fc2a6b25',1,'ftxui::FlexboxConfig::FlexEnd'],['../group__dom.html#a1f99410fd0fc632a5bc2497b6a447420a923a60a08f41dc3052190403fc2a6b25',1,'ftxui::FlexboxConfig::FlexEnd']]], + ['flexstart_45',['FlexStart',['../group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2a8d5898e4f1bd5527306b1f62fa4fd952',1,'ftxui::FlexboxConfig::FlexStart'],['../group__dom.html#a821af961ece5fe13540ad48b54c7a9e7a8d5898e4f1bd5527306b1f62fa4fd952',1,'ftxui::FlexboxConfig::FlexStart'],['../group__dom.html#a1f99410fd0fc632a5bc2497b6a447420a8d5898e4f1bd5527306b1f62fa4fd952',1,'ftxui::FlexboxConfig::FlexStart']]], + ['focus_46',['focus',['../group__dom.html#gaa2d7d671f184f85e0f396f2610fa6c2e',1,'ftxui::focus()'],['../module-component-examples.html#focus',1,'focus']]], + ['focus_5fcursor_47',['focus_cursor',['../module-component-examples.html#focus_cursor',1,'']]], + ['focus_5fcursor_2ecpp_48',['focus_cursor.cpp',['../focus__cursor_8cpp.html',1,'']]], + ['focusable_49',['Focusable',['../group__component.html#a02ccd3db74312f1c66aa8e7931489318',1,'ftxui::ComponentBase']]], + ['focuscursorbar_50',['focusCursorBar',['../group__dom.html#ga4f89e72e7001064e3eb8189c8317e95b',1,'ftxui']]], + ['focuscursorbarblinking_51',['focusCursorBarBlinking',['../group__dom.html#ga085a7c997e7364c5a54e73c7b84145db',1,'ftxui']]], + ['focuscursorblock_52',['focusCursorBlock',['../group__dom.html#ga509ef7e7f8913ea3de7efd45e3301ea1',1,'ftxui']]], + ['focuscursorblockblinking_53',['focusCursorBlockBlinking',['../group__dom.html#gadda589914ba8fe863c905b6566557768',1,'ftxui']]], + ['focuscursorunderline_54',['focusCursorUnderline',['../group__dom.html#ga61e1fe02a18c2b18e31ccc9cd3943823',1,'ftxui']]], + ['focuscursorunderlineblinking_55',['focusCursorUnderlineBlinking',['../group__dom.html#ga33637d59d1e52aa06dd2a94162adbfe9',1,'ftxui']]], + ['focused_56',['Focused',['../structftxui_1_1Requirement_1_1Focused.html',1,'Requirement::Focused'],['../group__component.html#a0cc612fa3d753b456e0f480f44654a9f',1,'ftxui::ComponentBase::Focused()']]], + ['focused_57',['focused',['../structftxui_1_1EntryState.html#a2a19dbfcd2235def5967609ab0c7901a',1,'ftxui::EntryState::focused'],['../structftxui_1_1InputState.html#a2a19dbfcd2235def5967609ab0c7901a',1,'ftxui::InputState::focused'],['../group__dom.html#aa4da656616dd87d4e82a4ee718db6b3c',1,'ftxui::Requirement::focused']]], + ['focused_5fentry_58',['focused_entry',['../group__component.html#a93d5d37708b77971a666b73486017835',1,'ftxui::MenuOption::focused_entry'],['../group__component.html#a93d5d37708b77971a666b73486017835',1,'ftxui::RadioboxOption::focused_entry']]], + ['focusposition_59',['focusPosition',['../group__dom.html#ga78447ba1ccb792963ad6d306f4ed1256',1,'ftxui']]], + ['focuspositionrelative_60',['focusPositionRelative',['../group__dom.html#ga13befad33cb4125e2143f2af3eddcc71',1,'ftxui']]], + ['follower_5fdelay_61',['follower_delay',['../group__component.html#a2b5d480250b61cd7e62e7c6567345e38',1,'ftxui::UnderlineOption']]], + ['follower_5fduration_62',['follower_duration',['../group__component.html#a13a6488c25b667256590c85aacb1f518',1,'ftxui::UnderlineOption']]], + ['follower_5ffunction_63',['follower_function',['../group__component.html#a7dca406bc24422caeb8f39705334dbd1',1,'ftxui::UnderlineOption']]], + ['force_20a_20frame_20redraw_64',['Force a frame redraw.',['../module-component.html#component-force-redraw',1,'']]], + ['forcehandlectrlc_65',['ForceHandleCtrlC',['../group__component.html#ae48c11a6c9160dc14cd5504ebe69304b',1,'ftxui::ScreenInteractive']]], + ['forcehandlectrlz_66',['ForceHandleCtrlZ',['../group__component.html#af1c772ab581e587daad086227435f2ec',1,'ftxui::ScreenInteractive']]], + ['foreground_67',['foreground',['../structftxui_1_1AnimatedColorsOption.html#a1acdd8b06eb18ae37ffb815462c4374a',1,'ftxui::AnimatedColorsOption']]], + ['foreground_5fcolor_68',['foreground_color',['../group__screen.html#a2ce82adc1d02baf22df658b903dcb351',1,'ftxui::Pixel']]], + ['foreground_5fcolor_5f_69',['foreground_color_',['../src_2ftxui_2dom_2border_8cpp.html#ab929ed9438df4a818e56490a23d8324e',1,'border.cpp']]], + ['format_70',['Format',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aa520d0db389f362bf79ef56ca0af3dcab',1,'ftxui']]], + ['frame_71',['frame',['../namespaceftxui.html#ad0d6a96f6e1fb6d67d9fa6323062a737',1,'ftxui']]], + ['frame_20redraw_72',['Force a frame redraw.',['../module-component.html#component-force-redraw',1,'']]], + ['frame_2ecpp_73',['frame.cpp',['../frame_8cpp.html',1,'']]], + ['from_20source_20official_74',['Building from Source (Official)',['../installation_manual.html#building-from-source-official',1,'']]], + ['ftxui_75',['Install FTXUI',['../getting-started.html#install-ftxui',1,'']]], + ['ftxui_76',['ftxui',['../namespaceftxui.html',1,'ftxui'],['../module__ftxui.html',1,'ftxui module'],['../ftxui.html',1,'ftxui']]], + ['ftxui_20component_77',['ftxui component',['../module-component.html',1,'ftxui / component'],['../group__component.html',1,'ftxui/component'],['../ftxui.html#ftxuicomponent',1,'ftxui/component']]], + ['ftxui_20dom_78',['ftxui dom',['../module-dom.html',1,'ftxui / dom'],['../group__dom.html',1,'ftxui/dom'],['../ftxui.html#ftxuidom',1,'ftxui/dom']]], + ['ftxui_20screen_79',['ftxui screen',['../module-screen.html',1,'ftxui / screen'],['../group__screen.html',1,'ftxui/screen'],['../ftxui.html#ftxuiscreen',1,'ftxui/screen']]], + ['ftxui_20using_20vcpkg_80',['Install FTXUI using Vcpkg',['../installation_vcpkg.html#install-ftxui-using-vcpkg',1,'']]], + ['ftxui_2ecomponent_81',['ftxui.component',['../module__ftxui_8component.html',1,'']]], + ['ftxui_2ecomponent_2eanimation_82',['ftxui.component.animation',['../module__ftxui_8component_8animation.html',1,'']]], + ['ftxui_2ecomponent_2ecaptured_5fmouse_83',['ftxui.component.captured_mouse',['../module__ftxui_8component_8captured__mouse.html',1,'']]], + ['ftxui_2ecomponent_2ecomponent_84',['ftxui.component.component',['../module__ftxui_8component_8component.html',1,'']]], + ['ftxui_2ecomponent_2ecomponent_5fbase_85',['ftxui.component.component_base',['../module__ftxui_8component_8component__base.html',1,'']]], + ['ftxui_2ecomponent_2ecomponent_5foptions_86',['ftxui.component.component_options',['../module__ftxui_8component_8component__options.html',1,'']]], + ['ftxui_2ecomponent_2eevent_87',['ftxui.component.event',['../module__ftxui_8component_8event.html',1,'']]], + ['ftxui_2ecomponent_2eloop_88',['ftxui.component.loop',['../module__ftxui_8component_8loop.html',1,'']]], + ['ftxui_2ecomponent_2emouse_89',['ftxui.component.mouse',['../module__ftxui_8component_8mouse.html',1,'']]], + ['ftxui_2ecomponent_2ereceiver_90',['ftxui.component.receiver',['../module__ftxui_8component_8receiver.html',1,'']]], + ['ftxui_2ecomponent_2escreen_5finteractive_91',['ftxui.component.screen_interactive',['../module__ftxui_8component_8screen__interactive.html',1,'']]], + ['ftxui_2ecomponent_2etask_92',['ftxui.component.task',['../module__ftxui_8component_8task.html',1,'']]], + ['ftxui_2ecppm_93',['ftxui.cppm',['../ftxui_8cppm.html',1,'']]], + ['ftxui_2edom_94',['ftxui.dom',['../module__ftxui_8dom.html',1,'']]], + ['ftxui_2edom_2ecanvas_95',['ftxui.dom.canvas',['../module__ftxui_8dom_8canvas.html',1,'']]], + ['ftxui_2edom_2edeprecated_96',['ftxui.dom.deprecated',['../module__ftxui_8dom_8deprecated.html',1,'']]], + ['ftxui_2edom_2edirection_97',['ftxui.dom.direction',['../module__ftxui_8dom_8direction.html',1,'']]], + ['ftxui_2edom_2eelements_98',['ftxui.dom.elements',['../module__ftxui_8dom_8elements.html',1,'']]], + ['ftxui_2edom_2eflexbox_5fconfig_99',['ftxui.dom.flexbox_config',['../module__ftxui_8dom_8flexbox__config.html',1,'']]], + ['ftxui_2edom_2elinear_5fgradient_100',['ftxui.dom.linear_gradient',['../module__ftxui_8dom_8linear__gradient.html',1,'']]], + ['ftxui_2edom_2enode_101',['ftxui.dom.node',['../module__ftxui_8dom_8node.html',1,'']]], + ['ftxui_2edom_2erequirement_102',['ftxui.dom.requirement',['../module__ftxui_8dom_8requirement.html',1,'']]], + ['ftxui_2edom_2eselection_103',['ftxui.dom.selection',['../module__ftxui_8dom_8selection.html',1,'']]], + ['ftxui_2edom_2etable_104',['ftxui.dom.table',['../module__ftxui_8dom_8table.html',1,'']]], + ['ftxui_2escreen_105',['ftxui.screen',['../module__ftxui_8screen.html',1,'']]], + ['ftxui_2escreen_2ebox_106',['ftxui.screen.box',['../module__ftxui_8screen_8box.html',1,'']]], + ['ftxui_2escreen_2ecolor_107',['ftxui.screen.color',['../module__ftxui_8screen_8color.html',1,'']]], + ['ftxui_2escreen_2ecolor_5finfo_108',['ftxui.screen.color_info',['../module__ftxui_8screen_8color__info.html',1,'']]], + ['ftxui_2escreen_2edeprecated_109',['ftxui.screen.deprecated',['../module__ftxui_8screen_8deprecated.html',1,'']]], + ['ftxui_2escreen_2eimage_110',['ftxui.screen.image',['../module__ftxui_8screen_8image.html',1,'']]], + ['ftxui_2escreen_2epixel_111',['ftxui.screen.pixel',['../module__ftxui_8screen_8pixel.html',1,'']]], + ['ftxui_2escreen_2escreen_112',['ftxui.screen.screen',['../module__ftxui_8screen_8screen.html',1,'']]], + ['ftxui_2escreen_2estring_113',['ftxui.screen.string',['../module__ftxui_8screen_8string.html',1,'']]], + ['ftxui_2escreen_2eterminal_114',['ftxui.screen.terminal',['../module__ftxui_8screen_8terminal.html',1,'']]], + ['ftxui_2eutil_115',['ftxui.util',['../module__ftxui_8util.html',1,'']]], + ['ftxui_2eutil_2eautoreset_116',['ftxui.util.autoreset',['../module__ftxui_8util_8autoreset.html',1,'']]], + ['ftxui_2eutil_2eref_117',['ftxui.util.ref',['../module__ftxui_8util_8ref.html',1,'']]], + ['ftxui_3a_3aanimation_118',['animation',['../namespaceftxui_1_1animation.html',1,'ftxui']]], + ['ftxui_3a_3aanimation_3a_3aeasing_119',['easing',['../namespaceftxui_1_1animation_1_1easing.html',1,'ftxui::animation']]], + ['ftxui_3a_3abox_5fhelper_120',['box_helper',['../namespaceftxui_1_1box__helper.html',1,'ftxui']]], + ['ftxui_3a_3acolor_121',['ftxui::Color',['../module-screen.html#ftxuicolor',1,'']]], + ['ftxui_3a_3acontainer_122',['Container',['../namespaceftxui_1_1Container.html',1,'ftxui']]], + ['ftxui_3a_3adimension_123',['ftxui::Dimension',['../namespaceftxui_1_1Dimension.html',1,'ftxui::Dimension'],['../module-screen.html#ftxuidimension',1,'ftxui::Dimension']]], + ['ftxui_3a_3aflexbox_5fhelper_124',['flexbox_helper',['../namespaceftxui_1_1flexbox__helper.html',1,'ftxui']]], + ['ftxui_3a_3aliterals_125',['literals',['../namespaceftxui_1_1literals.html',1,'ftxui']]], + ['ftxui_3a_3apixel_126',['ftxui::Pixel',['../module-screen.html#ftxuipixel',1,'']]], + ['ftxui_3a_3ascreen_127',['ftxui::Screen',['../module-screen.html#ftxuiscreen-1',1,'']]], + ['ftxui_3a_3atask_128',['task',['../namespaceftxui_1_1task.html',1,'ftxui']]], + ['ftxui_3a_3aterminal_129',['Terminal',['../namespaceftxui_1_1Terminal.html',1,'ftxui']]], + ['ftxui_3a_3autil_130',['util',['../namespaceftxui_1_1util.html',1,'ftxui']]], + ['ftxui_5flikely_131',['FTXUI_LIKELY',['../screen_8cpp.html#a3350a75634f7952b2795de433b111f0e',1,'screen.cpp']]], + ['ftxui_5funlikely_132',['FTXUI_UNLIKELY',['../screen_8cpp.html#a6048239c71b0f0be5c9d01ba721d7dd9',1,'screen.cpp']]], + ['full_133',['Full',['../namespaceftxui_1_1Dimension.html#af795790b995132f62de607ddfd07f9fa',1,'ftxui::Dimension']]], + ['fullscreen_134',['Fullscreen',['../group__component.html#a53dc5c3030151713857cf1a898d0f897',1,'ftxui::ScreenInteractive']]], + ['fullscreenalternatescreen_135',['FullscreenAlternateScreen',['../group__component.html#acad4646ece7569fd39a3a5c847ebb4a8',1,'ftxui::ScreenInteractive']]], + ['fullscreenprimaryscreen_136',['FullscreenPrimaryScreen',['../group__component.html#a6be13532d5bef8f566c12090db2dffba',1,'ftxui::ScreenInteractive']]], + ['function_137',['Function',['../namespaceftxui_1_1animation_1_1easing.html#ad820848234fca6290b7399cc5e07af3a',1,'ftxui::animation::easing']]], + ['function_138',['function',['../group__component.html#a23a21de13ab9c6644225966245df3fe3',1,'ftxui::AnimatedColorOption']]] +]; diff --git a/search/all_7.js b/search/all_7.js new file mode 100644 index 000000000..30d708149 --- /dev/null +++ b/search/all_7.js @@ -0,0 +1,84 @@ +var searchData= +[ + ['g_0',['G',['../group__component.html#a8764eeec7ae7c19ecb8de927e56fff3a',1,'ftxui::Event']]], + ['g_1',['g',['../group__component.html#ad26557cb38d17d7058ec29da8504890f',1,'ftxui::Event']]], + ['g_5funiformize_2',['g_uniformize',['../namespaceftxui.html#a81094ad1eae10308826bbd3be2723b18',1,'ftxui']]], + ['gallery_3',['gallery',['../module-component-examples.html#gallery',1,'']]], + ['gallery_2ecpp_4',['gallery.cpp',['../gallery_8cpp.html',1,'']]], + ['gap_5fx_5',['gap_x',['../group__dom.html#a109ea05d5d6e08d052672465ff8dac61',1,'ftxui::FlexboxConfig']]], + ['gap_5fy_6',['gap_y',['../group__dom.html#ab01b75a8a9419ec5c47650772f342ba3',1,'ftxui::FlexboxConfig']]], + ['gauge_7',['gauge',['../group__dom.html#gae0b8041a60629fd790716038738c93ce',1,'ftxui::gauge()'],['../module-dom.html#dom-gauge',1,'gauge'],['../module-dom-examples.html#gauge',1,'gauge']]], + ['gauge_5fdirection_8',['gauge_direction',['../module-dom-examples.html#gauge_direction',1,'']]], + ['gauge_5fdirection_2ecpp_9',['gauge_direction.cpp',['../gauge__direction_8cpp.html',1,'']]], + ['gaugedirection_10',['gaugeDirection',['../group__dom.html#ga1265cc8a52448e1b98d7abe84a04681e',1,'ftxui']]], + ['gaugedown_11',['gaugeDown',['../group__dom.html#gafe537f915cac5613261580bae3a8fe33',1,'ftxui']]], + ['gaugeleft_12',['gaugeLeft',['../group__dom.html#ga97898b9f77b3edd330eaef22fce7cf2b',1,'ftxui']]], + ['gaugeright_13',['gaugeRight',['../group__dom.html#ga333d781a44885ed4b5ea8444015b86f7',1,'ftxui']]], + ['gaugeup_14',['gaugeUp',['../group__dom.html#ga6e9a97b66c14404a2b3f95f4dae414c2',1,'ftxui']]], + ['get_15',['Get',['../structftxui_1_1task_1_1TaskQueue.html#aa79dc0bf12b85e6ac05adf59818e3939',1,'ftxui::task::TaskQueue']]], + ['getbox_16',['GetBox',['../group__dom.html#a03f5cc5dcad10fecb7a0b8203c86a13e',1,'ftxui::Selection']]], + ['getcolorinfo_17',['GetColorInfo',['../namespaceftxui.html#a883a81f30fb771a82f6c87b77ac3658e',1,'ftxui::GetColorInfo(Color::Palette256 index)'],['../namespaceftxui.html#ad5dd7fa2651003bf7c9f8b58de9b0a93',1,'ftxui::GetColorInfo(Color::Palette16 index)']]], + ['getnodeselectedcontent_18',['GetNodeSelectedContent',['../namespaceftxui.html#a1a3d5804148186b3d4bcc07391ba5f30',1,'ftxui']]], + ['getparts_19',['GetParts',['../group__dom.html#a4d4387d24d418b865c77ed592602d08d',1,'ftxui::Selection']]], + ['getpixel_20',['GetPixel',['../group__dom.html#a656c4e679bf9254e4688f2049989a9bd',1,'ftxui::Canvas']]], + ['getselectedcontent_21',['GetSelectedContent',['../group__dom.html#a2c5cebe05557529299e649867b499680',1,'ftxui::Node']]], + ['getselection_22',['GetSelection',['../group__component.html#ac25769e248caa01d336f5eaa79cd6160',1,'ftxui::ScreenInteractive']]], + ['getselectionstyle_23',['GetSelectionStyle',['../group__screen.html#a056c2ad43affdac744b6907e9ea81463',1,'ftxui::Screen']]], + ['getting_20started_24',['Getting Started',['../getting-started.html',1,'']]], + ['getting_2dstarted_2emd_25',['getting-started.md',['../getting-started_8md.html',1,'']]], + ['git_20submodule_26',['Using git submodule',['../installation_cmake.html#using-git-submodule',1,'']]], + ['global_27',['Global',['../structftxui_1_1flexbox__helper_1_1Global.html',1,'ftxui::flexbox_helper']]], + ['global_5f_28',['global_',['../flexbox_8cpp.html#ac8e8d5f863ecfaf27c5cf94ab6c9c9ca',1,'flexbox.cpp']]], + ['glyphcount_29',['GlyphCount',['../namespaceftxui.html#a9b4f3faecfbeb6b2c0fdf9c30e3f1553',1,'ftxui']]], + ['glyphiterate_30',['GlyphIterate',['../namespaceftxui.html#ad74a7d623ff7a09787469021d30c9461',1,'ftxui']]], + ['glyphnext_31',['GlyphNext',['../namespaceftxui.html#a02453c4504a5cfbc83b38abd4ec6d8ba',1,'ftxui']]], + ['glyphprevious_32',['GlyphPrevious',['../namespaceftxui.html#ae2ef74edc55750554e97ea71c5887650',1,'ftxui']]], + ['gold1_33',['Gold1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf02f1d575ceca96dc56df1295a73c007',1,'ftxui::Color']]], + ['gold3_34',['Gold3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa96bebc8d90d9444dd8fe563037cc2be2',1,'ftxui::Color']]], + ['gold3bis_35',['Gold3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa7e5b2921c53d39581597da20ce2f338',1,'ftxui::Color']]], + ['graph_36',['graph',['../namespaceftxui.html#ae78c2b2b147e65701493465f8e3f4d89',1,'ftxui::graph()'],['../module-dom.html#dom-graph',1,'graph'],['../module-dom-examples.html#graph',1,'graph']]], + ['graphfunction_37',['GraphFunction',['../namespaceftxui.html#ab07cb9a766f38fc867f8fe736ce2e6e3',1,'ftxui']]], + ['graydark_38',['GrayDark',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802fade3b52f7f38e412815092547cd6e8be7',1,'ftxui::Color']]], + ['graylight_39',['GrayLight',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802fadebf1805c024a5504872f795f83a6835',1,'ftxui::Color']]], + ['greater_5fthan_40',['GREATER_THAN',['../namespaceftxui.html#ae09f44b989d381a387329fd0a0935926a5fae95457121bd697edd588d1b64cc7c',1,'ftxui']]], + ['green_41',['Green',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802fad0784a3f969fe736e8b271a5a161d106',1,'ftxui::Color']]], + ['green_42',['green',['../group__screen.html#a90d21fa503b626c00cdc8d94863d5877',1,'ftxui::ColorInfo']]], + ['green1_43',['Green1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa8db72e307df54b6fd021fd0eff7d5a5f',1,'ftxui::Color']]], + ['green3_44',['Green3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa061b2388532ed2cf150f5ef83646ae2',1,'ftxui::Color']]], + ['green3bis_45',['Green3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9b41b1aeadc19f83c8292978c1e40af1',1,'ftxui::Color']]], + ['green4_46',['Green4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa36b7f9cbbb6e3d6d5e9df9abcbf348c3',1,'ftxui::Color']]], + ['greenlight_47',['GreenLight',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802fa9827485e548095e18c65045bc8058ce7',1,'ftxui::Color']]], + ['greenyellow_48',['GreenYellow',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfacd28fdc2094a8c7b0d90e51b38b85533',1,'ftxui::Color']]], + ['grey0_49',['Grey0',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2c49667d6b3e650b346c88d7e3fd5590',1,'ftxui::Color']]], + ['grey100_50',['Grey100',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa6cbc92ab0733f3e33cf31563dc865c4',1,'ftxui::Color']]], + ['grey11_51',['Grey11',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfac449ae3543129be859f6e1f2ea29c8be',1,'ftxui::Color']]], + ['grey15_52',['Grey15',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa461a25896feac74f19be7117ae19fefe',1,'ftxui::Color']]], + ['grey19_53',['Grey19',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0250546ff32c86258542b95876090e28',1,'ftxui::Color']]], + ['grey23_54',['Grey23',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfad715d2046e5e2d3b6bb6e2127834c485',1,'ftxui::Color']]], + ['grey27_55',['Grey27',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9306e0c6a01240c9fdfab25f3eaa0634',1,'ftxui::Color']]], + ['grey3_56',['Grey3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa81c7178d2e73d4fd43861817b9b32c9d',1,'ftxui::Color']]], + ['grey30_57',['Grey30',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa2991b68c782e1ce0b7e701e2a8a8298',1,'ftxui::Color']]], + ['grey35_58',['Grey35',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa94bb0f2f713f3ab31a7bfd224fe33e7',1,'ftxui::Color']]], + ['grey37_59',['Grey37',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa67645d98e45108256aac9234935510e3',1,'ftxui::Color']]], + ['grey39_60',['Grey39',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfae50ed802592da7fedcbd76ca96341d89',1,'ftxui::Color']]], + ['grey42_61',['Grey42',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa1cb673228bc4530517e8813bec443e7d',1,'ftxui::Color']]], + ['grey46_62',['Grey46',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7310f159106d0f63cca0ddf0c1962ff7',1,'ftxui::Color']]], + ['grey50_63',['Grey50',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa1228fc714bdb452c1efc4b9754751de7',1,'ftxui::Color']]], + ['grey53_64',['Grey53',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7a56c10be7ecd80795860dcdc6eff354',1,'ftxui::Color']]], + ['grey54_65',['Grey54',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa660a7e64726c75510f4e1cd1f63ccb09',1,'ftxui::Color']]], + ['grey58_66',['Grey58',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa3aaa86564267b4c90a2d6bb966c35f90',1,'ftxui::Color']]], + ['grey62_67',['Grey62',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa64ccec5866654552e080a406314c2b0c',1,'ftxui::Color']]], + ['grey63_68',['Grey63',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa084969e9df558ecd204bcec54bc9b03',1,'ftxui::Color']]], + ['grey66_69',['Grey66',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa1cccb7d918d79a0240c135479d58b2ec',1,'ftxui::Color']]], + ['grey69_70',['Grey69',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2ddd20c7af3e7519c138e5dfd06f188c',1,'ftxui::Color']]], + ['grey7_71',['Grey7',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9918508956b5ace54699264567757916',1,'ftxui::Color']]], + ['grey70_72',['Grey70',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfae828b663bd8be2f7efd8b2f343a06444',1,'ftxui::Color']]], + ['grey74_73',['Grey74',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7a54ca8cbf5ee4d7af93f4d08d12c9e3',1,'ftxui::Color']]], + ['grey78_74',['Grey78',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa310ea068000acabef43ec4a4b65c3121',1,'ftxui::Color']]], + ['grey82_75',['Grey82',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfab890ade13f8f5bff23c313dd9035f7f6',1,'ftxui::Color']]], + ['grey84_76',['Grey84',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6539b5d08bbd9bd011bd67aea17cd04f',1,'ftxui::Color']]], + ['grey85_77',['Grey85',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa812849e32b590f8a114804f6b8dde0e8',1,'ftxui::Color']]], + ['grey89_78',['Grey89',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa3b4692eb62f7c5065c28134769615e0',1,'ftxui::Color']]], + ['grey93_79',['Grey93',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa14181b363496871a7c2f91555a6d8a68',1,'ftxui::Color']]], + ['gridbox_80',['gridbox',['../namespaceftxui.html#abcdf409d605edafd3191cd7ba47bcbd1',1,'ftxui::gridbox()'],['../module-dom-examples.html#gridbox',1,'gridbox']]] +]; diff --git a/search/all_8.js b/search/all_8.js new file mode 100644 index 000000000..5a418b3d6 --- /dev/null +++ b/search/all_8.js @@ -0,0 +1,51 @@ +var searchData= +[ + ['h_0',['H',['../group__component.html#a4f2d69d0f85ae76a015b0fd34ccb9bbc',1,'ftxui::Event']]], + ['h_1',['h',['../group__component.html#a226af846ad5e1dd35e84212a145dfb72',1,'ftxui::Event']]], + ['hasimmediatetasks_2',['HasImmediateTasks',['../structftxui_1_1task_1_1TaskQueue.html#a257afcb3d4b649b1a39a697cea2843ce',1,'ftxui::task::TaskQueue::HasImmediateTasks()'],['../classftxui_1_1task_1_1TaskRunner.html#a257afcb3d4b649b1a39a697cea2843ce',1,'ftxui::task::TaskRunner::HasImmediateTasks()']]], + ['haspending_3',['HasPending',['../classftxui_1_1ReceiverImpl.html#a49f2a9285b485f25694f48732b0c2554',1,'ftxui::ReceiverImpl']]], + ['hasquitted_4',['HasQuitted',['../group__component.html#a0f10869cb1cad212e8885deac6960a41',1,'ftxui::Loop::HasQuitted()'],['../classftxui_1_1ReceiverImpl.html#a0f10869cb1cad212e8885deac6960a41',1,'ftxui::ReceiverImpl::HasQuitted()']]], + ['hbox_5',['hbox',['../namespaceftxui.html#a552ba6d33b3c9bec586b99fba4c243ac',1,'ftxui']]], + ['hbox_2ecpp_6',['hbox.cpp',['../hbox_8cpp.html',1,'']]], + ['hcenter_7',['hcenter',['../group__dom.html#gaf7d0d1e44c1a5424e42a5cddceacf7f7',1,'ftxui']]], + ['heavy_8',['HEAVY',['../group__dom.html#ggafe3103dd0b8240c5443892484ef5af9ca34cd68a92c52759ed9b545969a11c2da',1,'ftxui']]], + ['hebrew_5fletter_9',['Hebrew_Letter',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aa3b076a28de949c89c8443aa0cd42ef17',1,'ftxui']]], + ['height_10',['HEIGHT',['../namespaceftxui.html#a04711c04f28aabfa0e5928a35baaec53a38b9241136017b93ea2755a49cf0a000',1,'ftxui']]], + ['height_11',['height',['../structftxui_1_1WindowOptions.html#a3f551d52ec458be9ffbcd38c715f9e19',1,'ftxui::WindowOptions::height'],['../group__dom.html#ad3774f6419003470f54fd495124ef51f',1,'ftxui::Canvas::height()']]], + ['hflow_12',['hflow',['../namespaceftxui.html#a345b31919048562675615d5af78e6322',1,'ftxui::hflow()'],['../module-dom-examples.html#hflow',1,'hflow']]], + ['hflow_2ecpp_13',['hflow.cpp',['../hflow_8cpp.html',1,'']]], + ['hidden_14',['Hidden',['../structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37cacf46e529658ebc6532c204f3246929f4',1,'ftxui::Screen::Cursor']]], + ['hmenu1_15',['HMenu1',['../menu__style_8cpp.html#a909976f4b60ea372663d733e16011767',1,'menu_style.cpp']]], + ['hmenu2_16',['HMenu2',['../menu__style_8cpp.html#a9ec2a6df3ad7dd845b4d4ab507d9d5fe',1,'menu_style.cpp']]], + ['hmenu3_17',['HMenu3',['../menu__style_8cpp.html#ab5a58c425dbca17b57cfcbf4b8c98e2e',1,'menu_style.cpp']]], + ['hmenu4_18',['HMenu4',['../menu__style_8cpp.html#a1aead66022c928952b560ebab9913346',1,'menu_style.cpp']]], + ['hmenu5_19',['HMenu5',['../menu__style_8cpp.html#a16cc679d7e91d82d484eff7e443539cb',1,'menu_style.cpp']]], + ['home_20',['Home',['../group__component.html#aad7d2ec712d40ad87d330e5e4399fdbc',1,'ftxui::Event']]], + ['homescreen_21',['homescreen',['../module-component-examples.html#homescreen',1,'']]], + ['homescreen_2ecpp_22',['homescreen.cpp',['../homescreen_8cpp.html',1,'']]], + ['honeydew2_23',['Honeydew2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfacfd861941ef13f197407b7d02deaf617',1,'ftxui::Color']]], + ['horizontal_24',['Horizontal',['../group__component.html#a5ee36f528383cc1db765fa2140797837',1,'ftxui::MenuOption::Horizontal()'],['../group__component.html#ga01563bae9454fe64c0b29b0eb3755e68',1,'ftxui::Container::Horizontal(Components children)'],['../group__component.html#ga337564f8a13c98222025d8fe7e47df4c',1,'ftxui::Container::Horizontal(Components children, int *selector)'],['../module-component.html#component-horizontal',1,'Horizontal']]], + ['horizontalanimated_25',['HorizontalAnimated',['../group__component.html#aedc93fba91339d9713812821cb140c50',1,'ftxui::MenuOption']]], + ['hotpink_26',['HotPink',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfad886c67902578a7336b821b1cb279c4e',1,'ftxui::Color']]], + ['hotpink2_27',['HotPink2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa1b701a7828d1930b59b76d091913e7d1',1,'ftxui::Color']]], + ['hotpink3_28',['HotPink3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa5b9fcd5ea12531a4fb1273743063f49f',1,'ftxui::Color']]], + ['hotpink3bis_29',['HotPink3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa073af5071fd22b51b77f43766b86d6a5',1,'ftxui::Color']]], + ['hotpinkbis_30',['HotPinkBis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfac178a78c367fd250556adaa1b9ad4730',1,'ftxui::Color']]], + ['hover_5fdown_31',['hover_down',['../group__component.html#a2fbfe3e43b596c8a47c5548b38e4d721',1,'ftxui::WindowRenderState']]], + ['hover_5fleft_32',['hover_left',['../group__component.html#abca2d427dd57d2b5eecb6685ed68e857',1,'ftxui::WindowRenderState']]], + ['hover_5fright_33',['hover_right',['../group__component.html#a8e6af441e03d44f593bcb0d17ee809b1',1,'ftxui::WindowRenderState']]], + ['hover_5ftop_34',['hover_top',['../group__component.html#acb4dc002e621733f1e6c232f369af8ca',1,'ftxui::WindowRenderState']]], + ['hoverable_35',['Hoverable',['../group__component.html#ga562d984d3830d63285643565cd55d16f',1,'ftxui::Hoverable(Component component, bool *hover)'],['../group__component.html#ga92ec2f5ccb509da2e2c24ae6a1f6b12b',1,'ftxui::Hoverable(Component component, std::function< void()> on_enter, std::function< void()> on_leave)'],['../group__component.html#ga91cac81077c483efdb952268aee9a523',1,'ftxui::Hoverable(Component component, std::function< void(bool)> on_change)'],['../group__component.html#ga9d94b37352be13d3551a9d5785f75439',1,'ftxui::Hoverable(bool *hover)'],['../group__component.html#ga34adfc9c76cf3603156cba32ad5d7142',1,'ftxui::Hoverable(std::function< void()> on_enter, std::function< void()> on_leave)'],['../group__component.html#gafd7cbaef5378a907111a64ee69aed56a',1,'ftxui::Hoverable(std::function< void(bool)> on_change)']]], + ['hoverable_2ecpp_36',['hoverable.cpp',['../hoverable_8cpp.html',1,'']]], + ['hovered_37',['hovered',['../structftxui_1_1InputState.html#a9a61bb2fb8c309b32c457adb0392ec31',1,'ftxui::InputState']]], + ['hscroll_5findicator_38',['hscroll_indicator',['../group__dom.html#ga7f48136f949ccbde722dd93a6de4d0de',1,'ftxui']]], + ['hsv_39',['HSV',['../group__screen.html#a1a119fd00beafc7d2aa5f94518e38fc5',1,'ftxui::Color']]], + ['hsva_40',['HSVA',['../group__screen.html#af067d3410c55684d727aeb29bc8d2af2',1,'ftxui::Color']]], + ['html_5flike_41',['html_like',['../module-dom-examples.html#html_like',1,'']]], + ['html_5flike_2ecpp_42',['html_like.cpp',['../html__like_8cpp.html',1,'']]], + ['hue_43',['hue',['../group__screen.html#ad7b7eb0b3e04af91bdd64715226c3c68',1,'ftxui::ColorInfo']]], + ['hyperlink_44',['Hyperlink',['../group__screen.html#a0b55b16969dfccc79195fe61c5ba6d1a',1,'ftxui::Screen']]], + ['hyperlink_45',['hyperlink',['../group__screen.html#a071ab11cf7706c7800281716177c88e3',1,'ftxui::Pixel::hyperlink'],['../group__dom.html#gad0eac58eac9e6cd9a04879b20f8e123b',1,'ftxui::hyperlink(std::string link)'],['../group__dom.html#ga8bacc04e0cbde663ccc4a4891e8b50d5',1,'ftxui::hyperlink(std::string link, Element child)']]], + ['hyperlink_2ecpp_46',['hyperlink.cpp',['../hyperlink_8cpp.html',1,'']]], + ['hyperlinks_5f_47',['hyperlinks_',['../group__screen.html#acff83d382ef60ad2a0fca3ba68e9397f',1,'ftxui::Screen']]] +]; diff --git a/search/all_9.js b/search/all_9.js new file mode 100644 index 000000000..d2a6e056a --- /dev/null +++ b/search/all_9.js @@ -0,0 +1,67 @@ +var searchData= +[ + ['i_0',['I',['../group__component.html#ac1c2d328a1c8c9fde6141e8ea793a6c6',1,'ftxui::Event']]], + ['i_1',['i',['../group__component.html#ad093ba93f720c5787e0448823f72db6c',1,'ftxui::Event']]], + ['image_2',['Image',['../group__screen.html#classftxui_1_1Image',1,'Image'],['../group__screen.html#a7c483c751b9c859ef08cecb32f1d1994',1,'ftxui::Image::Image()=delete'],['../group__screen.html#aecbd97261c37fa89ea6df7ccaba216c3',1,'ftxui::Image::Image(int dimx, int dimy)']]], + ['image_2ecpp_3',['image.cpp',['../image_8cpp.html',1,'']]], + ['image_2ecppm_4',['image.cppm',['../image_8cppm.html',1,'']]], + ['image_2ehpp_5',['image.hpp',['../image_8hpp.html',1,'']]], + ['inactive_6',['inactive',['../group__component.html#a898e4eb6c2a93ea3b71fc373f39854eb',1,'ftxui::AnimatedColorOption']]], + ['increment_7',['increment',['../structftxui_1_1SliderOption.html#a752366b00bdf7bba57a18e239e86e2e1',1,'ftxui::SliderOption']]], + ['index_8',['Index',['../group__component.html#a8ef12397d1682615bc3108c397734179',1,'ftxui::ComponentBase']]], + ['index_9',['index',['../structftxui_1_1EntryState.html#a750b5d744c39a06bfb13e6eb010e35d0',1,'ftxui::EntryState']]], + ['index_5f16_10',['index_16',['../group__screen.html#a6259df4cdd9a7cae286f46a471e9afa5',1,'ftxui::ColorInfo']]], + ['index_5f256_11',['index_256',['../group__screen.html#aacf9c9496e5d01c2fe30337791f33840',1,'ftxui::ColorInfo']]], + ['indianred_12',['IndianRed',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaddee00c86a353e58b10fb84a0b52481c',1,'ftxui::Color']]], + ['indianred1_13',['IndianRed1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa46aed3d2538a5e3a7d6ae0f6b116a61a',1,'ftxui::Color']]], + ['indianred1bis_14',['IndianRed1Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa4a04ff1096e80fe3d85a78e2ab155873',1,'ftxui::Color']]], + ['indianredbis_15',['IndianRedBis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa8bc829f77e4ff418dcf2efa85a87e329',1,'ftxui::Color']]], + ['inner_16',['Inner',['../examples_2component_2collapsible_8cpp.html#a74bf63b8448df7b03bd98ae6de127c0a',1,'collapsible.cpp']]], + ['inner_17',['inner',['../group__component.html#a5486612c1fe0c8651fbb399ac512fccf',1,'ftxui::WindowRenderState::inner'],['../structftxui_1_1WindowOptions.html#a105501b401a2286451c7992a6d54dcc0',1,'ftxui::WindowOptions::inner']]], + ['input_18',['Input',['../group__component.html#ga7f285fcbc4dd0a0767b89a255fd062dc',1,'ftxui::Input(InputOption option)'],['../group__component.html#ga9d118d596e33bf5bee9d5eccb6265d15',1,'ftxui::Input(StringRef content, InputOption option)'],['../group__component.html#ga82ba18065d2c29514f034c7278dead74',1,'ftxui::Input(StringRef content, StringRef placeholder, InputOption option)'],['../module-component.html#component-input',1,'Input']]], + ['input_19',['input',['../module-component.html#filtered-input',1,'Filtered input'],['../group__component.html#a947e2de698c4bef07c78674218330677',1,'ftxui::Event::input()'],['../module-component-examples.html#input',1,'input']]], + ['input_5fin_5fframe_20',['input_in_frame',['../module-component-examples.html#input_in_frame',1,'']]], + ['input_5fin_5fframe_2ecpp_21',['input_in_frame.cpp',['../input__in__frame_8cpp.html',1,'']]], + ['input_5fstyle_22',['input_style',['../module-component-examples.html#input_style',1,'']]], + ['input_5fstyle_2ecpp_23',['input_style.cpp',['../input__style_8cpp.html',1,'']]], + ['inputoption_24',['InputOption',['../group__component.html#structftxui_1_1InputOption',1,'ftxui']]], + ['inputstate_25',['InputState',['../structftxui_1_1InputState.html',1,'ftxui']]], + ['insert_26',['Insert',['../group__component.html#af368fcc9fa5d2f609288e920ef115c51',1,'ftxui::Event']]], + ['insert_27',['insert',['../group__component.html#a3ae35fa7cff9f950b9c66536523c69c1',1,'ftxui::InputOption']]], + ['install_20ftxui_28',['Install FTXUI',['../getting-started.html#install-ftxui',1,'']]], + ['install_20ftxui_20using_20vcpkg_29',['Install FTXUI using Vcpkg',['../installation_vcpkg.html#install-ftxui-using-vcpkg',1,'']]], + ['installation_30',['Installation',['../installation.html',1,'']]], + ['installation_2emd_31',['installation.md',['../installation_8md.html',1,'']]], + ['installation_5farch_2emd_32',['installation_arch.md',['../installation__arch_8md.html',1,'']]], + ['installation_5fbazel_2emd_33',['installation_bazel.md',['../installation__bazel_8md.html',1,'']]], + ['installation_5fcmake_2emd_34',['installation_cmake.md',['../installation__cmake_8md.html',1,'']]], + ['installation_5fconan_2emd_35',['installation_conan.md',['../installation__conan_8md.html',1,'']]], + ['installation_5fdebian_2emd_36',['installation_debian.md',['../installation__debian_8md.html',1,'']]], + ['installation_5fmanual_2emd_37',['installation_manual.md',['../installation__manual_8md.html',1,'']]], + ['installation_5fnix_2emd_38',['installation_nix.md',['../installation__nix_8md.html',1,'']]], + ['installation_5fopensuse_2emd_39',['installation_opensuse.md',['../installation__opensuse_8md.html',1,'']]], + ['installation_5fvcpkg_2emd_40',['installation_vcpkg.md',['../installation__vcpkg_8md.html',1,'']]], + ['installation_5fxmake_2emd_41',['installation_xmake.md',['../installation__xmake_8md.html',1,'']]], + ['instance_42',['Instance',['../focus__cursor_8cpp.html#a96da73e7fb75cca8a91e59559ce1dba2',1,'focus_cursor.cpp']]], + ['integration_43',['Integration',['../installation_cmake.html#methods-of-integration',1,'Methods of Integration'],['../installation_cmake.html#verifying-integration',1,'Verifying Integration']]], + ['interpolate_44',['Interpolate',['../group__screen.html#ae5d82c5fbae4f6561c9471c11c0a461b',1,'ftxui::Color']]], + ['intersection_45',['Intersection',['../group__screen.html#a83d40499d9e8740c35dc2352c2ac84a8',1,'ftxui::Box']]], + ['introduction_46',['Introduction',['../index.html',1,'']]], + ['introduction_2emd_47',['introduction.md',['../introduction_8md.html',1,'']]], + ['inverted_48',['inverted',['../group__screen.html#a19bbb3c355941d56eccf70be7f7ed9e1',1,'ftxui::Pixel::inverted'],['../group__dom.html#ga672456b8f2091b615a30ff755418b37b',1,'ftxui::inverted()']]], + ['inverted_2ecpp_49',['inverted.cpp',['../inverted_8cpp.html',1,'']]], + ['is_5fcharacter_50',['is_character',['../group__component.html#ae75703788c6f68b39fc51f8db3ba156d',1,'ftxui::Event']]], + ['is_5fcursor_5fposition_51',['is_cursor_position',['../group__component.html#a4464a1cace713dc3544922cc6d5acdc1',1,'ftxui::Event']]], + ['is_5fcursor_5fshape_52',['is_cursor_shape',['../group__component.html#af795895177b7686bf63ab113e70159c8',1,'ftxui::Event']]], + ['is_5fmouse_53',['is_mouse',['../group__component.html#a2c835925299d56941ffd2e2421f0fd13',1,'ftxui::Event']]], + ['is_5fplaceholder_54',['is_placeholder',['../structftxui_1_1InputState.html#aa39d5717e975c9a321417690c76519a1',1,'ftxui::InputState']]], + ['iscombining_55',['IsCombining',['../namespaceftxui.html#a506e6b467ddd8d11646942fd101d8e9e',1,'ftxui']]], + ['iscontrol_56',['IsControl',['../namespaceftxui.html#a037df033cc26c960faa54b52bdbea900',1,'ftxui']]], + ['isempty_57',['IsEmpty',['../group__dom.html#a8e12342fc420701fbffd97025421575a',1,'ftxui::Selection::IsEmpty()'],['../group__screen.html#a8e12342fc420701fbffd97025421575a',1,'ftxui::Box::IsEmpty()']]], + ['isfullwidth_58',['IsFullWidth',['../namespaceftxui.html#abd13f584efddd3a7e5749c9c5e841a11',1,'ftxui']]], + ['isopaque_59',['IsOpaque',['../group__screen.html#a74deffc6b6c7e07b3ec67766ff35abba',1,'ftxui::Color']]], + ['iswordbreakingcharacter_60',['IsWordBreakingCharacter',['../namespaceftxui.html#a64a9bd1df7ca3ffb1622507d01cd0b13',1,'ftxui']]], + ['italic_61',['italic',['../group__screen.html#ad3c22ba2f55e1f2b3087e9ad2d1ea36e',1,'ftxui::Pixel::italic'],['../group__dom.html#ga8a8d190765de7bbd9e78f9e639c2a96d',1,'ftxui::italic()']]], + ['italic_2ecpp_62',['italic.cpp',['../italic_8cpp.html',1,'']]], + ['iteration_63',['iteration',['../structftxui_1_1Node_1_1Status.html#aa6371382c6b4224e577e14ea610ab9a9',1,'ftxui::Node::Status']]] +]; diff --git a/search/all_a.js b/search/all_a.js new file mode 100644 index 000000000..17c0ce736 --- /dev/null +++ b/search/all_a.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['j_0',['J',['../group__component.html#a231fc78914951e94f654a11d8bac7da9',1,'ftxui::Event']]], + ['j_1',['j',['../group__component.html#a02b6c10bc53abd70237fbdfa68d0f349',1,'ftxui::Event']]], + ['justify_5fcontent_2',['justify_content',['../group__dom.html#ab3173252829e796ee1c100b447243748',1,'ftxui::FlexboxConfig']]], + ['justifycontent_3',['JustifyContent',['../group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2',1,'ftxui::FlexboxConfig']]] +]; diff --git a/search/all_b.js b/search/all_b.js new file mode 100644 index 000000000..4a9f23d47 --- /dev/null +++ b/search/all_b.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['k_0',['K',['../group__component.html#a197751bfb6afd548d65867f6350a7a93',1,'ftxui::Event']]], + ['k_1',['k',['../group__component.html#abe5e126f94be451d3a7e0d311e6ca4e0',1,'ftxui::Event']]], + ['katakana_2',['Katakana',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aaedb097c9a1cb7aed483367f825211f75',1,'ftxui']]], + ['khaki1_3',['Khaki1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa1ee17e1e2f41c0175bd6202e1c345a82',1,'ftxui::Color']]], + ['khaki3_4',['Khaki3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa3d0d766baf12a67f81a152cabf151f6a',1,'ftxui::Color']]] +]; diff --git a/search/all_c.js b/search/all_c.js new file mode 100644 index 000000000..621265a72 --- /dev/null +++ b/search/all_c.js @@ -0,0 +1,64 @@ +var searchData= +[ + ['l_0',['L',['../group__component.html#aee5dd820d1fb31a71fc05a29c8901367',1,'ftxui::Event']]], + ['l_1',['l',['../group__component.html#a71d15b274ccd740b8a51704c62104230',1,'ftxui::Event']]], + ['label_2',['label',['../structftxui_1_1EntryState.html#a1dd28f5ea7b5b0780013e960944ddaa0',1,'ftxui::EntryState::label'],['../group__component.html#a336758144ce2b1095f2a0ef062551f5b',1,'ftxui::MenuEntryOption::label'],['../group__component.html#a336758144ce2b1095f2a0ef062551f5b',1,'ftxui::ButtonOption::label'],['../group__component.html#a336758144ce2b1095f2a0ef062551f5b',1,'ftxui::CheckboxOption::label']]], + ['layout_3',['Layout',['../module-dom.html#dom-layout',1,'']]], + ['leader_5fdelay_4',['leader_delay',['../group__component.html#ae29bb2e2c1e7f6eca70781e6fcd63a64',1,'ftxui::UnderlineOption']]], + ['leader_5fduration_5',['leader_duration',['../group__component.html#a6112ea2b5db5a4c50fe7d5ae70dfd016',1,'ftxui::UnderlineOption']]], + ['leader_5ffunction_6',['leader_function',['../group__component.html#a1886d86b757123859c89f3336631b1f8',1,'ftxui::UnderlineOption']]], + ['left_7',['Left',['../group__component.html#a03bfec859eac87be20f8952c1eb89de0a9d4d8b0b72fc2659da772d761a3c5ecb',1,'ftxui::Mouse::Left'],['../group__dom.html#gga224b9163917ac32fc95a60d8c1eec3aaa945d5e233cf7d6240f6b783b36a374ff',1,'ftxui::Left']]], + ['left_8',['left',['../structftxui_1_1WindowOptions.html#ad5c9f9e9f1a5086dcc7a11431d37c1f4',1,'ftxui::WindowOptions::left'],['../screen_8cpp.html#a972107f15f3c0c099eb9fd605e7f51c6',1,'left: screen.cpp']]], + ['less_5fthan_9',['LESS_THAN',['../namespaceftxui.html#ae09f44b989d381a387329fd0a0935926a41b05932cd237b2b133fff1ade85bed5',1,'ftxui']]], + ['lf_10',['LF',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aa618441d41cce47dbcfd9bed6e5ff64e6',1,'ftxui']]], + ['library_11',['Build the Library',['../installation_nix.html#build-the-library',1,'']]], + ['light_12',['LIGHT',['../group__dom.html#ggafe3103dd0b8240c5443892484ef5af9caf917d6c11c85b4ac32e30d1cc9da25eb',1,'ftxui']]], + ['lightcoral_13',['LightCoral',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa1b3ec93b81f5cfafd6fd2328904ced8',1,'ftxui::Color']]], + ['lightcyan1bis_14',['LightCyan1Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfac98b5a34ad5c17b3544e5c29521adb6a',1,'ftxui::Color']]], + ['lightcyan3_15',['LightCyan3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6d6da936c52e5dadcd790ecb07dcbb1a',1,'ftxui::Color']]], + ['lightgoldenrod1_16',['LightGoldenrod1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa25d536c972c837da1a4698982d12df00',1,'ftxui::Color']]], + ['lightgoldenrod2_17',['LightGoldenrod2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa03fd8d3402a3b6314c737b8d00f65f4b',1,'ftxui::Color']]], + ['lightgoldenrod2bis_18',['LightGoldenrod2Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfabcd883ae7f03e4115b274fba499ce91a',1,'ftxui::Color']]], + ['lightgoldenrod2ter_19',['LightGoldenrod2Ter',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa96e9b3fdf30a2f143cb4bfd844742d71',1,'ftxui::Color']]], + ['lightgoldenrod3_20',['LightGoldenrod3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa32e50d1fe92fabe310b25b9400c25cd7',1,'ftxui::Color']]], + ['lightgreen_21',['LightGreen',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6f3bae902f4a1a3b69152ad13382ab18',1,'ftxui::Color']]], + ['lightgreenbis_22',['LightGreenBis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa33510b83ef8df69f709f38f77e375193',1,'ftxui::Color']]], + ['lightpink1_23',['LightPink1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa07f3153f6b04f8aeb0925d789d79660c',1,'ftxui::Color']]], + ['lightpink3_24',['LightPink3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa253e182f6f26ad7cfae773feb6493c57',1,'ftxui::Color']]], + ['lightpink4_25',['LightPink4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0956f6a62142bbfdf7915d1d9abacb81',1,'ftxui::Color']]], + ['lightsalmon1_26',['LightSalmon1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa523f5d7969774dd37e38382a9d05e3a4',1,'ftxui::Color']]], + ['lightsalmon3_27',['LightSalmon3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9b742f7ba68078b409a6fc2bf76de5c4',1,'ftxui::Color']]], + ['lightsalmon3bis_28',['LightSalmon3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfacb0ea3d16e515f91b1071099413a36c7',1,'ftxui::Color']]], + ['lightseagreen_29',['LightSeaGreen',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6ff417c700a8e53aeb7fe424e89a1cbd',1,'ftxui::Color']]], + ['lightskyblue1_30',['LightSkyBlue1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa2290ccd3da3d1ea3e508923148ae824',1,'ftxui::Color']]], + ['lightskyblue3_31',['LightSkyBlue3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa267e864d226cfe79c1a1d3e78fdd7eb5',1,'ftxui::Color']]], + ['lightskyblue3bis_32',['LightSkyBlue3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa3a8990dd2aee1e219cc7222528ee8e0c',1,'ftxui::Color']]], + ['lightslateblue_33',['LightSlateBlue',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfab7c34cf2bc4382faf2477db06ce68875',1,'ftxui::Color']]], + ['lightslategrey_34',['LightSlateGrey',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0789c7e5fa07674a45db810280aac1bb',1,'ftxui::Color']]], + ['lightsteelblue_35',['LightSteelBlue',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfadf56a107dda30539c38643b744c312bb',1,'ftxui::Color']]], + ['lightsteelblue1_36',['LightSteelBlue1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7daff90c932ad36e146923fced98cb4d',1,'ftxui::Color']]], + ['lightsteelblue3_37',['LightSteelBlue3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf66424457d48a1e9f30467a6b4d9f735',1,'ftxui::Color']]], + ['lightyellow3_38',['LightYellow3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa602cbd76a18ddce2b63afa9dcbba0f8e',1,'ftxui::Color']]], + ['line_39',['Line',['../structftxui_1_1flexbox__helper_1_1Line.html',1,'ftxui::flexbox_helper']]], + ['line_40',['line',['../structftxui_1_1flexbox__helper_1_1Block.html#a41ebd28ef1d7c6ade45642cb6acc1039',1,'ftxui::flexbox_helper::Block']]], + ['line_5fposition_41',['line_position',['../structftxui_1_1flexbox__helper_1_1Block.html#a989ca01c829a3fc1e21bdbd0b9c811ed',1,'ftxui::flexbox_helper::Block']]], + ['linear_42',['Linear',['../namespaceftxui_1_1animation_1_1easing.html#a39923c8d62cdaacdc179c2ece3ee16b4',1,'ftxui::animation::easing']]], + ['linear_5fgradient_43',['linear_gradient',['../module-dom-examples.html#linear_gradient',1,'']]], + ['linear_5fgradient_2ecppm_44',['linear_gradient.cppm',['../linear__gradient_8cppm.html',1,'']]], + ['linear_5fgradient_2ehpp_45',['linear_gradient.hpp',['../linear__gradient_8hpp.html',1,'']]], + ['linear_5fgradient_5fgallery_46',['linear_gradient_gallery',['../module-component-examples.html#linear_gradient_gallery',1,'']]], + ['linear_5fgradient_5fgallery_2ecpp_47',['linear_gradient_gallery.cpp',['../linear__gradient__gallery_8cpp.html',1,'']]], + ['lineargradient_48',['LinearGradient',['../group__dom.html#structftxui_1_1LinearGradient',1,'LinearGradient'],['../group__dom.html#a5e989e4841fbba91e1714f977c5c58b9',1,'ftxui::LinearGradient::LinearGradient()'],['../group__dom.html#ac57e39e64c79b5389f234eeaebfbb2fd',1,'ftxui::LinearGradient::LinearGradient(Color begin, Color end)'],['../group__dom.html#adbf0567cfc8e05051a4236d6541f63b8',1,'ftxui::LinearGradient::LinearGradient(float angle, Color begin, Color end)'],['../module-dom.html#dom-linear-gradient',1,'LinearGradient']]], + ['lines_49',['lines',['../structftxui_1_1flexbox__helper_1_1Global.html#a441e790889c9bcd6e2deba604663d2ad',1,'ftxui::flexbox_helper::Global']]], + ['lines_5f_50',['lines_',['../src_2ftxui_2dom_2gridbox_8cpp.html#a14d0ca68485bdef40e820b3bd755deb7',1,'gridbox.cpp']]], + ['link_5f_51',['link_',['../hyperlink_8cpp.html#a42544edd174cb953c823c19cdec44b86',1,'hyperlink.cpp']]], + ['linux_52',['Arch Linux',['../installation_arch.html',1,'installation']]], + ['list_53',['Todo List',['../todo.html',1,'']]], + ['list_54',['Module list',['../cpp20-modules.html#module-list',1,'']]], + ['llvmfuzzertestoneinput_55',['LLVMFuzzerTestOneInput',['../component__fuzzer_8cpp.html#af5589fffd86439465eeb19c9774d1982',1,'LLVMFuzzerTestOneInput(const char *data, size_t size): component_fuzzer.cpp'],['../terminal__input__parser__test__fuzzer_8cpp.html#af5589fffd86439465eeb19c9774d1982',1,'LLVMFuzzerTestOneInput(const char *data, size_t size): terminal_input_parser_test_fuzzer.cpp']]], + ['loop_56',['Loop',['../group__component.html#classftxui_1_1Loop',1,'Loop'],['../group__component.html#aacbc899babaac445c3b9b831322e8c70',1,'ftxui::Loop::Loop(ScreenInteractive *screen, Component component)'],['../group__component.html#ad72ac0aa7a08850990b76f15e13dbe79',1,'ftxui::Loop::Loop(const Loop &)=default'],['../group__component.html#adfc045f0113bbf7f6dc5895ff7ce3ac5',1,'ftxui::Loop::Loop(Loop &&)=delete'],['../group__component.html#a734882bfa3e357e4bb57581494e8699b',1,'ftxui::Loop::Loop(const ScreenInteractive &)=delete'],['../group__component.html#a9bd3dbd471fce0038700caaa47dddc1a',1,'ftxui::ScreenInteractive::Loop()']]], + ['loop_2ecpp_57',['loop.cpp',['../loop_8cpp.html',1,'']]], + ['loop_2ecppm_58',['loop.cppm',['../loop_8cppm.html',1,'']]], + ['loop_2ehpp_59',['loop.hpp',['../loop_8hpp.html',1,'']]], + ['loremipsum_60',['LoremIpsum',['../examples_2component_2selection_8cpp.html#a693bf20426978b4a6d5114374d8c521d',1,'selection.cpp']]] +]; diff --git a/search/all_d.js b/search/all_d.js new file mode 100644 index 000000000..2439e5c35 --- /dev/null +++ b/search/all_d.js @@ -0,0 +1,98 @@ +var searchData= +[ + ['m_0',['M',['../group__component.html#afd7f21bf1b977cbc56c5594209966482',1,'ftxui::Event']]], + ['m_1',['m',['../group__component.html#a3d0e1e0e45941dbd760b8bba60bbbb2b',1,'ftxui::Event']]], + ['magenta_2',['Magenta',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802fab5059a620e2c7dc57556b1e275c2f9bc',1,'ftxui::Color']]], + ['magenta1_3',['Magenta1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa314daa7c2027494055655d34677458b1',1,'ftxui::Color']]], + ['magenta2_4',['Magenta2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa0270d909214e1a221e1937b3cf406ba',1,'ftxui::Color']]], + ['magenta2bis_5',['Magenta2Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfabe530bee1037e2b3a133e8dbc5ffa585',1,'ftxui::Color']]], + ['magenta3_6',['Magenta3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfad8a4fa649974fb5c836a14496827fdd5',1,'ftxui::Color']]], + ['magenta3bis_7',['Magenta3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaef7480a93b72c17e8023e9f7c7944b38',1,'ftxui::Color']]], + ['magenta3ter_8',['Magenta3Ter',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfac6ab7a76048a843b6eb86c062c216cab',1,'ftxui::Color']]], + ['magentalight_9',['MagentaLight',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802fa9663f993a3affdf3526fa032cfe5b9f4',1,'ftxui::Color']]], + ['main_10',['main',['../structftxui_1_1ResizableSplitOption.html#af8a61f36bf328de8218ae03ac01294dc',1,'ftxui::ResizableSplitOption::main'],['../examples_2component_2button_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): button.cpp'],['../button__animated_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): button_animated.cpp'],['../button__in__frame_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): button_in_frame.cpp'],['../button__style_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): button_style.cpp'],['../canvas__animated_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): canvas_animated.cpp'],['../examples_2component_2checkbox_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): checkbox.cpp'],['../checkbox__in__frame_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): checkbox_in_frame.cpp'],['../examples_2component_2collapsible_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): collapsible.cpp'],['../composition_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): composition.cpp'],['../custom__loop_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): custom_loop.cpp'],['../examples_2component_2dropdown_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): dropdown.cpp'],['../dropdown__custom_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): dropdown_custom.cpp'],['../flexbox__gallery_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): flexbox_gallery.cpp'],['../examples_2component_2focus_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): focus.cpp'],['../focus__cursor_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): focus_cursor.cpp'],['../gallery_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): gallery.cpp'],['../homescreen_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): homescreen.cpp'],['../examples_2component_2input_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): input.cpp'],['../input__in__frame_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): input_in_frame.cpp'],['../input__style_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): input_style.cpp'],['../linear__gradient__gallery_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): linear_gradient_gallery.cpp'],['../examples_2component_2maybe_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): maybe.cpp'],['../examples_2component_2menu_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): menu.cpp'],['../menu2_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): menu2.cpp'],['../menu__entries_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): menu_entries.cpp'],['../menu__entries__animated_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): menu_entries_animated.cpp'],['../menu__in__frame_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): menu_in_frame.cpp'],['../menu__in__frame__horizontal_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): menu_in_frame_horizontal.cpp'],['../menu__multiple_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): menu_multiple.cpp'],['../menu__style_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): menu_style.cpp'],['../menu__underline__animated__gallery_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): menu_underline_animated_gallery.cpp'],['../modal__dialog_8cpp.html#ac0f2228420376f4db7e1274f2b41667c',1,'main(int argc, const char *argv[]): modal_dialog.cpp'],['../modal__dialog__custom_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): modal_dialog_custom.cpp'],['../nested__screen_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): nested_screen.cpp'],['../print__key__press_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): print_key_press.cpp'],['../examples_2component_2radiobox_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): radiobox.cpp'],['../radiobox__in__frame_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): radiobox_in_frame.cpp'],['../examples_2component_2renderer_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): renderer.cpp'],['../examples_2component_2resizable__split_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): resizable_split.cpp'],['../scrollbar_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): scrollbar.cpp'],['../examples_2component_2selection_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): selection.cpp'],['../examples_2component_2slider_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): slider.cpp'],['../slider__direction_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): slider_direction.cpp'],['../slider__rgb_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): slider_rgb.cpp'],['../tab__horizontal_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): tab_horizontal.cpp'],['../tab__vertical_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): tab_vertical.cpp'],['../textarea_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): textarea.cpp'],['../toggle_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): toggle.cpp'],['../examples_2component_2window_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): window.cpp'],['../with__restored__io_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): with_restored_io.cpp'],['../examples_2dom_2border_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): border.cpp'],['../border__colored_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): border_colored.cpp'],['../border__style_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): border_style.cpp'],['../examples_2dom_2canvas_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): canvas.cpp'],['../color__gallery_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): color_gallery.cpp'],['../color__info__palette256_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): color_info_palette256.cpp'],['../color__truecolor__HSV_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): color_truecolor_HSV.cpp'],['../color__truecolor__RGB_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): color_truecolor_RGB.cpp'],['../examples_2dom_2dbox_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): dbox.cpp'],['../examples_2dom_2gauge_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): gauge.cpp'],['../gauge__direction_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): gauge_direction.cpp'],['../examples_2dom_2graph_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): graph.cpp'],['../examples_2dom_2gridbox_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): gridbox.cpp'],['../hflow_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): hflow.cpp'],['../html__like_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): html_like.cpp'],['../examples_2dom_2linear__gradient_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): linear_gradient.cpp'],['../package__manager_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): package_manager.cpp'],['../examples_2dom_2paragraph_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): paragraph.cpp'],['../examples_2dom_2separator_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): separator.cpp'],['../separator__style_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): separator_style.cpp'],['../examples_2dom_2size_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): size.cpp'],['../examples_2dom_2spinner_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): spinner.cpp'],['../style__blink_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): style_blink.cpp'],['../style__bold_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): style_bold.cpp'],['../style__color_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): style_color.cpp'],['../style__dim_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): style_dim.cpp'],['../style__gallery_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): style_gallery.cpp'],['../style__hyperlink_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): style_hyperlink.cpp'],['../style__inverted_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): style_inverted.cpp'],['../style__italic_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): style_italic.cpp'],['../style__strikethrough_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): style_strikethrough.cpp'],['../style__underlined_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): style_underlined.cpp'],['../style__underlined__double_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): style_underlined_double.cpp'],['../examples_2dom_2table_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): table.cpp'],['../vbox__hbox_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): vbox_hbox.cpp'],['../vflow_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): vflow.cpp']]], + ['main_5fsize_11',['main_size',['../structftxui_1_1ResizableSplitOption.html#a3b9f6b5826bf54bda63dcdf0321535ff',1,'ftxui::ResizableSplitOption']]], + ['maincomponent_12',['MainComponent',['../modal__dialog_8cpp.html#aa61b015248766b6067b6d3c99f04c389',1,'modal_dialog.cpp']]], + ['make_13',['Make',['../namespaceftxui.html#a2b8973dc71334f1d98e2e6f55de8b5ae',1,'ftxui']]], + ['make_5fbox_14',['make_box',['../examples_2component_2focus_8cpp.html#a9ffb8a33ec5d0133f63f791d526df1c7',1,'focus.cpp']]], + ['make_5fgrid_15',['make_grid',['../examples_2component_2focus_8cpp.html#a9543e1b98f00db8484ee0c856a1d4cca',1,'focus.cpp']]], + ['makereceiver_16',['MakeReceiver',['../namespaceftxui.html#a57abe3e11733b1d3ebacc56692d3537c',1,'ftxui']]], + ['makesender_17',['MakeSender',['../classftxui_1_1ReceiverImpl.html#aee8560dccb6ab3df27f0a0fc6a1f8442',1,'ftxui::ReceiverImpl']]], + ['manual_18',['Manual',['../installation_manual.html',1,'installation']]], + ['max_19',['max',['../structftxui_1_1SliderOption.html#abd146f0de5789f02aee07c54e819099b',1,'ftxui::SliderOption']]], + ['maybe_20',['Maybe',['../group__component.html#ga20b66a70c1cd4ff3f0ff571a4507d2b4',1,'ftxui::Maybe(Component child, const bool *show)'],['../group__component.html#ga70afe9695167fb736631173201969730',1,'ftxui::Maybe(Component child, std::function< bool()> show)'],['../group__component.html#ga83b6fd5e1524023722a7450f987f15d0',1,'ftxui::Maybe(const bool *show)'],['../group__component.html#gae39ad8b223e6bb7704c77a3708571a7d',1,'ftxui::Maybe(std::function< bool()> show)'],['../module-component.html#component-maybe',1,'Maybe']]], + ['maybe_21',['maybe',['../module-component-examples.html#maybe',1,'']]], + ['maybetask_22',['MaybeTask',['../structftxui_1_1task_1_1TaskQueue.html#aaebfee5f2f839afb18fd9c1a68483188',1,'ftxui::task::TaskQueue']]], + ['mediumorchid_23',['MediumOrchid',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9c685ae3aad1eaad70ff070436be85b3',1,'ftxui::Color']]], + ['mediumorchid1_24',['MediumOrchid1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa13a18f95c27e724ea9a1e7286f42c473',1,'ftxui::Color']]], + ['mediumorchid1bis_25',['MediumOrchid1Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa049a7bc19d9cacd4e00232d01f9680e6',1,'ftxui::Color']]], + ['mediumorchid3_26',['MediumOrchid3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa5d8f598938ed69b4f04b843abfadc88b',1,'ftxui::Color']]], + ['mediumpurple_27',['MediumPurple',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa99b482dd24e473ef7ddcbddece67e041',1,'ftxui::Color']]], + ['mediumpurple1_28',['MediumPurple1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf5552cc28a449506e131c050fef88e89',1,'ftxui::Color']]], + ['mediumpurple2_29',['MediumPurple2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfac3210de935f096669b79a8575e9c4578',1,'ftxui::Color']]], + ['mediumpurple2bis_30',['MediumPurple2Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa50222fd671c2f6a5f81108f8e4b05aa9',1,'ftxui::Color']]], + ['mediumpurple3_31',['MediumPurple3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6d22ae8ac2c4e98b291f40225a8874e8',1,'ftxui::Color']]], + ['mediumpurple3bis_32',['MediumPurple3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2d0fa96a55bf3d9763b465ecbd72566d',1,'ftxui::Color']]], + ['mediumpurple4_33',['MediumPurple4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfae90010fe78fb7605fc25e5e08f07e596',1,'ftxui::Color']]], + ['mediumspringgreen_34',['MediumSpringGreen',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfae4e73e4c0464a9ded093be857551d290',1,'ftxui::Color']]], + ['mediumturquoise_35',['MediumTurquoise',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7875d2ea24878490b89176952e9db784',1,'ftxui::Color']]], + ['mediumvioletred_36',['MediumVioletRed',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa8ca5789305e4c75d51a3acc1f1b8c0a9',1,'ftxui::Color']]], + ['menu_37',['Menu',['../group__component.html#ga27828fc39da10a18478ba84b1b162039',1,'ftxui::Menu(MenuOption option)'],['../group__component.html#gad793a3a507766ffa711c4332a3815e24',1,'ftxui::Menu(ConstStringListRef entries, int *selected, MenuOption option)'],['../module-component.html#component-menu',1,'Menu']]], + ['menu_38',['menu',['../module-component-examples.html#menu',1,'']]], + ['menu2_39',['menu2',['../module-component-examples.html#menu2',1,'']]], + ['menu2_2ecpp_40',['menu2.cpp',['../menu2_8cpp.html',1,'']]], + ['menu_5fentries_41',['menu_entries',['../module-component-examples.html#menu_entries',1,'']]], + ['menu_5fentries_2ecpp_42',['menu_entries.cpp',['../menu__entries_8cpp.html',1,'']]], + ['menu_5fentries_5fanimated_43',['menu_entries_animated',['../module-component-examples.html#menu_entries_animated',1,'']]], + ['menu_5fentries_5fanimated_2ecpp_44',['menu_entries_animated.cpp',['../menu__entries__animated_8cpp.html',1,'']]], + ['menu_5fin_5fframe_45',['menu_in_frame',['../module-component-examples.html#menu_in_frame',1,'']]], + ['menu_5fin_5fframe_2ecpp_46',['menu_in_frame.cpp',['../menu__in__frame_8cpp.html',1,'']]], + ['menu_5fin_5fframe_5fhorizontal_47',['menu_in_frame_horizontal',['../module-component-examples.html#menu_in_frame_horizontal',1,'']]], + ['menu_5fin_5fframe_5fhorizontal_2ecpp_48',['menu_in_frame_horizontal.cpp',['../menu__in__frame__horizontal_8cpp.html',1,'']]], + ['menu_5fmultiple_49',['menu_multiple',['../module-component-examples.html#menu_multiple',1,'']]], + ['menu_5fmultiple_2ecpp_50',['menu_multiple.cpp',['../menu__multiple_8cpp.html',1,'']]], + ['menu_5fstyle_51',['menu_style',['../module-component-examples.html#menu_style',1,'']]], + ['menu_5fstyle_2ecpp_52',['menu_style.cpp',['../menu__style_8cpp.html',1,'']]], + ['menu_5funderline_5fanimated_5fgallery_53',['menu_underline_animated_gallery',['../module-component-examples.html#menu_underline_animated_gallery',1,'']]], + ['menu_5funderline_5fanimated_5fgallery_2ecpp_54',['menu_underline_animated_gallery.cpp',['../menu__underline__animated__gallery_8cpp.html',1,'']]], + ['menuentry_55',['MenuEntry',['../group__component.html#ga2c0a27959e6a5d90109f6d4506e00f69',1,'ftxui::MenuEntry(MenuEntryOption option)'],['../group__component.html#gafca94c5cdae5fbf3c6aa81fc1cd7b1c0',1,'ftxui::MenuEntry(ConstStringRef label, MenuEntryOption option)']]], + ['menuentryoption_56',['MenuEntryOption',['../group__component.html#structftxui_1_1MenuEntryOption',1,'ftxui']]], + ['menuoption_57',['MenuOption',['../group__component.html#structftxui_1_1MenuOption',1,'ftxui']]], + ['meta_58',['meta',['../group__component.html#a46e545ef1aafd5ca9f1d6055fcebeeca',1,'ftxui::Mouse']]], + ['methods_59',['Supported Methods',['../installation.html#supported-methods',1,'']]], + ['methods_20of_20integration_60',['Methods of Integration',['../installation_cmake.html#methods-of-integration',1,'']]], + ['middle_61',['Middle',['../group__component.html#a03bfec859eac87be20f8952c1eb89de0a673e6efef9aafe98078c5552e99c923c',1,'ftxui::Mouse']]], + ['midletter_62',['MidLetter',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aab681d24011467edf425478fed96fbcde',1,'ftxui']]], + ['midnum_63',['MidNum',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aa876e36e8a85514e9c141b2aa3a7bfb5c',1,'ftxui']]], + ['midnumlet_64',['MidNumLet',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aa4d4a2ec3c1ff2c647ff25b61136aabff',1,'ftxui']]], + ['min_65',['min',['../structftxui_1_1SliderOption.html#a337a8e502154b70ef2a1d4bb3cb47ea9',1,'ftxui::SliderOption']]], + ['min_5fsize_66',['min_size',['../structftxui_1_1box__helper_1_1Element.html#ac3f0cc8c8c9e0fb97f20cf7777773197',1,'ftxui::box_helper::Element']]], + ['min_5fsize_5fx_67',['min_size_x',['../structftxui_1_1flexbox__helper_1_1Block.html#ab7c34cdb13953ba4b496c2dba7aa1a92',1,'ftxui::flexbox_helper::Block']]], + ['min_5fsize_5fy_68',['min_size_y',['../structftxui_1_1flexbox__helper_1_1Block.html#a3f7935f028cb7bfadb118396547e27fa',1,'ftxui::flexbox_helper::Block']]], + ['min_5fx_69',['min_x',['../group__dom.html#a9c8ab844b7e5b610b7a4ac433ea148a1',1,'ftxui::Requirement']]], + ['min_5fy_70',['min_y',['../group__dom.html#a5fb18fec2bc2c10f230d683506bb5a8f',1,'ftxui::Requirement']]], + ['minimal_20example_71',['Minimal Example',['../getting-started.html#minimal-example',1,'']]], + ['mistyrose1_72',['MistyRose1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa11d00787c0df60110d76fc3d098b2c1b',1,'ftxui::Color']]], + ['mistyrose3_73',['MistyRose3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfab7afa85f412a5bcede9674099b956a78',1,'ftxui::Color']]], + ['modal_74',['Modal',['../group__component.html#ga5185342fbba215496cb8a6805f36089c',1,'ftxui::Modal(Component main, Component modal, const bool *show_modal)'],['../group__component.html#ga5babae0bb25f8cada57784cc5d27fb74',1,'ftxui::Modal(Component modal, const bool *show_modal)']]], + ['modal_2ecpp_75',['modal.cpp',['../modal_8cpp.html',1,'']]], + ['modal_5fdialog_76',['modal_dialog',['../module-component-examples.html#modal_dialog',1,'']]], + ['modal_5fdialog_2ecpp_77',['modal_dialog.cpp',['../modal__dialog_8cpp.html',1,'']]], + ['modal_5fdialog_5fcustom_78',['modal_dialog_custom',['../module-component-examples.html#modal_dialog_custom',1,'']]], + ['modal_5fdialog_5fcustom_2ecpp_79',['modal_dialog_custom.cpp',['../modal__dialog__custom_8cpp.html',1,'']]], + ['modalcomponent_80',['ModalComponent',['../modal__dialog_8cpp.html#a3b73476f6f304dce17f808a7c3789f5c',1,'modal_dialog.cpp']]], + ['module_20list_81',['Module list',['../cpp20-modules.html#module-list',1,'']]], + ['module_2dcomponent_2emd_82',['module-component.md',['../module-component_8md.html',1,'']]], + ['module_2ddom_2emd_83',['module-dom.md',['../module-dom_8md.html',1,'']]], + ['module_2dscreen_2emd_84',['module-screen.md',['../module-screen_8md.html',1,'']]], + ['module_2emd_85',['module.md',['../module_8md.html',1,'']]], + ['modules_86',['C++20 Modules',['../cpp20-modules.html',1,'']]], + ['motion_87',['Motion',['../group__component.html#a099c889d2b948b264c7a665b66e3a9b6',1,'ftxui::Mouse']]], + ['motion_88',['motion',['../group__component.html#af8ec4d0833a67c0bcd400f9e30bd07c7',1,'ftxui::Mouse']]], + ['mouse_89',['Mouse',['../group__component.html#structftxui_1_1Mouse',1,'Mouse'],['../group__component.html#a382859ca10d98eb9c03713de4a95d3f9',1,'ftxui::Event::Mouse(std::string, Mouse mouse)']]], + ['mouse_90',['mouse',['../group__component.html#a761c3b7a78d8408dfbe76131209532d7',1,'ftxui::Event::mouse'],['../group__component.html#a37daf59df57eb6415eb34c8df11a4892',1,'ftxui::Event::mouse()']]], + ['mouse_2ecppm_91',['mouse.cppm',['../mouse_8cppm.html',1,'']]], + ['mouse_2ehpp_92',['mouse.hpp',['../mouse_8hpp.html',1,'']]], + ['moved_93',['Moved',['../group__component.html#a099c889d2b948b264c7a665b66e3a9b6a9bf35ab1cecfbb50d8f1d708a4921fc6',1,'ftxui::Mouse']]], + ['multiline_94',['multiline',['../group__component.html#af18b2db29029e23c13a8bfc233c62878',1,'ftxui::InputOption']]] +]; diff --git a/search/all_e.js b/search/all_e.js new file mode 100644 index 000000000..083345324 --- /dev/null +++ b/search/all_e.js @@ -0,0 +1,32 @@ +var searchData= +[ + ['n_0',['N',['../group__component.html#a4275c544cdd2b965a680fa035f71d09c',1,'ftxui::Event']]], + ['n_1',['n',['../group__component.html#aa62d71fd64f64e2496ffc6f1518f899e',1,'ftxui::Event']]], + ['name_2',['name',['../group__screen.html#a8f8f80d37794cde9472343e4487ba3eb',1,'ftxui::ColorInfo']]], + ['navajowhite1_3',['NavajoWhite1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa78e7bd911b2b1619237ec497cd3727a7',1,'ftxui::Color']]], + ['navajowhite3_4',['NavajoWhite3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa345621aa87c50e806627e1f4a1e50a2',1,'ftxui::Color']]], + ['navyblue_5',['NavyBlue',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0358bb70d298b289263c397f49820844',1,'ftxui::Color']]], + ['need_5fiteration_6',['need_iteration',['../structftxui_1_1Node_1_1Status.html#a0fffbfa5479a3b6d3ddf5ff13504a51c',1,'ftxui::Node::Status']]], + ['need_5fiteration_5f_7',['need_iteration_',['../flexbox_8cpp.html#a82e273363997977449a51ea1b7dce6f0',1,'flexbox.cpp']]], + ['nested_8',['Nested',['../nested__screen_8cpp.html#a77fdac0113a8c43983469efa26ce7276',1,'nested_screen.cpp']]], + ['nested_5fscreen_9',['nested_screen',['../module-component-examples.html#nested_screen',1,'']]], + ['nested_5fscreen_2ecpp_10',['nested_screen.cpp',['../nested__screen_8cpp.html',1,'']]], + ['newline_11',['Newline',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aa755fee300780823fcf4df98383331745',1,'ftxui']]], + ['next_20steps_12',['Next Steps',['../installation.html#next-steps',1,'']]], + ['nix_13',['Nix',['../installation_nix.html',1,'installation']]], + ['nix_20flake_14',['Nix Flake',['../installation_nix.html#nix-flake',1,'']]], + ['node_15',['Node',['../group__dom.html#classftxui_1_1Node',1,'Node'],['../group__dom.html#a0d313fac56abd7ebe58a17f1530b879e',1,'ftxui::Node::Node()'],['../group__dom.html#a19fa1eae4c02e514c62a95e395b383a1',1,'ftxui::Node::Node(Elements children)'],['../group__dom.html#a7eb6a9efa23e5f6f7fc53b5aa3759dff',1,'ftxui::Node::Node(const Node &)=delete'],['../group__dom.html#ac6365e35a2029b3e58eca97905f8124d',1,'ftxui::Node::Node(const Node &&)=delete']]], + ['node_16',['node',['../structftxui_1_1Requirement_1_1Focused.html#ab88cd70dad2e152cea983610f2a16e68',1,'ftxui::Requirement::Focused']]], + ['node_2ecpp_17',['node.cpp',['../node_8cpp.html',1,'']]], + ['node_2ecppm_18',['node.cppm',['../node_8cppm.html',1,'']]], + ['node_2ehpp_19',['node.hpp',['../node_8hpp.html',1,'']]], + ['node_5fdecorator_2ecpp_20',['node_decorator.cpp',['../node__decorator_8cpp.html',1,'']]], + ['node_5fdecorator_2ehpp_21',['node_decorator.hpp',['../node__decorator_8hpp.html',1,'']]], + ['nodedecorator_22',['NodeDecorator',['../classftxui_1_1NodeDecorator.html',1,'NodeDecorator'],['../classftxui_1_1NodeDecorator.html#a7e9d74ba5d480d87e8bfcaf2df66fbbe',1,'ftxui::NodeDecorator::NodeDecorator()']]], + ['nominmax_23',['NOMINMAX',['../src_2ftxui_2component_2window_8cpp.html#a9f918755b601cf4bffca775992e6fb90',1,'window.cpp']]], + ['none_24',['None',['../group__component.html#a03bfec859eac87be20f8952c1eb89de0ac9d3e887722f2bc482bcca9d41c512af',1,'ftxui::Mouse']]], + ['notflex_25',['notflex',['../group__dom.html#ga845b0ea50d51024aa4e050447b46e1dd',1,'ftxui']]], + ['nothing_26',['nothing',['../group__dom.html#ga1bfd3885ac8b40dc82a1103725003c07',1,'ftxui']]], + ['nowrap_27',['NoWrap',['../group__dom.html#a6c844a611650cf7e956dbe269a0e72aba93ac740a98eb4cc45b853c780ed16c44',1,'ftxui::FlexboxConfig']]], + ['numeric_28',['Numeric',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aa87322391cc6e8948ce9fd5d6cb84fced',1,'ftxui']]] +]; diff --git a/search/all_f.js b/search/all_f.js new file mode 100644 index 000000000..4e14404b3 --- /dev/null +++ b/search/all_f.js @@ -0,0 +1,40 @@ +var searchData= +[ + ['o_0',['O',['../group__component.html#a5691ff2135fa78f8daf8529850b35947',1,'ftxui::Event']]], + ['o_1',['o',['../group__component.html#ab5b66b7ce5e99da604cf984ed486b53e',1,'ftxui::Event']]], + ['of_20integration_2',['Methods of Integration',['../installation_cmake.html#methods-of-integration',1,'']]], + ['official_3',['Building from Source (Official)',['../installation_manual.html#building-from-source-official',1,'']]], + ['on_5fchange_4',['on_change',['../group__component.html#abdfe3c83deeec2323ff90248815b8f0a',1,'ftxui::MenuOption::on_change'],['../group__component.html#abdfe3c83deeec2323ff90248815b8f0a',1,'ftxui::CheckboxOption::on_change'],['../group__component.html#abdfe3c83deeec2323ff90248815b8f0a',1,'ftxui::InputOption::on_change'],['../group__component.html#abdfe3c83deeec2323ff90248815b8f0a',1,'ftxui::RadioboxOption::on_change'],['../structftxui_1_1SliderOption.html#abdfe3c83deeec2323ff90248815b8f0a',1,'ftxui::SliderOption::on_change']]], + ['on_5fclick_5',['on_click',['../group__component.html#a0ae001950b0ed23752b298963cecf3d1',1,'ftxui::ButtonOption']]], + ['on_5fenter_6',['on_enter',['../group__component.html#a4ba9530701be07334a17c0184747c535',1,'ftxui::MenuOption::on_enter'],['../group__component.html#a4ba9530701be07334a17c0184747c535',1,'ftxui::InputOption::on_enter']]], + ['onanimation_7',['OnAnimation',['../classftxui_1_1animation_1_1Animator.html#ac956aa7c105ad418392f69219711117d',1,'ftxui::animation::Animator::OnAnimation()'],['../group__component.html#aebad858485d02f035a8ea34af66a7fa7',1,'ftxui::ComponentBase::OnAnimation(animation::Params &params)']]], + ['onevent_8',['OnEvent',['../group__component.html#ab84629a8fecad2e1cdd426b7ddc72277',1,'ftxui::ComponentBase']]], + ['onrender_9',['OnRender',['../group__component.html#ab79303652dad19eac0540848487cf8c5',1,'ftxui::ComponentBase']]], + ['open_10',['open',['../group__component.html#aa9ee4f52203c5dec717cf45077b82776',1,'ftxui::DropdownOption']]], + ['opensuse_11',['openSUSE',['../installation_opensuse.html',1,'installation']]], + ['opensuse_20package_20unofficial_12',['openSUSE Package (Unofficial)',['../installation_opensuse.html#opensuse-package-unofficial',1,'']]], + ['operator_21_3d_13',['operator!=',['../group__component.html#ae4581774f4417f68d335de865fd2e6d3',1,'ftxui::Event::operator!=()'],['../group__screen.html#a1ff481fa3b55fcc402c98c7564990c17',1,'ftxui::Box::operator!=()'],['../group__screen.html#a5db052159bd2c738ea453d9b9600513a',1,'ftxui::Color::operator!=()']]], + ['operator_22_22_5frgb_14',['operator""_rgb',['../namespaceftxui_1_1literals.html#a66d988ecc082819b1671ee2bbadebccd',1,'ftxui::operator""_rgb()'],['../namespaceftxui_1_1literals.html#a66d988ecc082819b1671ee2bbadebccd',1,'ftxui::literals::operator""_rgb()']]], + ['operator_28_29_15',['operator()',['../classftxui_1_1ConstRef.html#afdc36f6a5716b29a5d81a2dd93376d82',1,'ftxui::ConstRef::operator()()'],['../classftxui_1_1Ref.html#a625855a4f62948f4f1ad06354be9ca09',1,'ftxui::Ref::operator()()'],['../classftxui_1_1Ref.html#afdc36f6a5716b29a5d81a2dd93376d82',1,'ftxui::Ref::operator()() const']]], + ['operator_2a_16',['operator*',['../classftxui_1_1ConstRef.html#a241c04e3ce86e1fd5a946eb2aa8b1f22',1,'ftxui::ConstRef::operator*()'],['../classftxui_1_1Ref.html#a3f534efce0b043d603eb8f5653268e7d',1,'ftxui::Ref::operator*()'],['../classftxui_1_1Ref.html#a241c04e3ce86e1fd5a946eb2aa8b1f22',1,'ftxui::Ref::operator*() const']]], + ['operator_2d_3e_17',['operator->',['../classftxui_1_1ConstRef.html#abaade5c780b539b94de660e314cb0c90',1,'ftxui::ConstRef::operator->()'],['../classftxui_1_1Ref.html#a4442b1b9eab40e7939e1e01cdedcb7ae',1,'ftxui::Ref::operator->()'],['../classftxui_1_1Ref.html#abaade5c780b539b94de660e314cb0c90',1,'ftxui::Ref::operator->() const']]], + ['operator_3c_18',['operator<',['../group__component.html#a7590045e19360277dfc54320b627002c',1,'ftxui::Event::operator<()'],['../structftxui_1_1task_1_1PendingTask.html#abca1f607e0e907841b7a6d88190995db',1,'ftxui::task::PendingTask::operator<()']]], + ['operator_3d_19',['operator=',['../classftxui_1_1CapturedMouseInterface.html#adfa362c249253f9570e5c1cf42fc16c3',1,'ftxui::CapturedMouseInterface::operator=(const CapturedMouseInterface &)=default'],['../classftxui_1_1CapturedMouseInterface.html#ac349c4e493dbe8aa7c47052d91e0f411',1,'ftxui::CapturedMouseInterface::operator=(CapturedMouseInterface &&)=delete'],['../group__component.html#ac444ac233dcbd4b2ad7972d2086ecc73',1,'ftxui::ComponentBase::operator=(const ComponentBase &)=delete'],['../group__component.html#a9e3b99c8fc32f2ce151e2ba737c0d546',1,'ftxui::ComponentBase::operator=(ComponentBase &&)=delete'],['../group__component.html#add07fd33947183c42a79cb4759129ff8',1,'ftxui::Loop::operator=(Loop &&)=delete'],['../group__component.html#ab35ce310313b96f28233ebc9279b5dd3',1,'ftxui::Loop::operator=(const Loop &)=delete'],['../classftxui_1_1SenderImpl.html#a571b0715efdefbfbc80bebc4ba3f16c3',1,'ftxui::SenderImpl::operator=(const SenderImpl &)=delete'],['../classftxui_1_1SenderImpl.html#aec884eaa70eed221721d0ae963974927',1,'ftxui::SenderImpl::operator=(SenderImpl &&)=delete'],['../group__dom.html#a7e12a390c13d283fc06cafbbfef7eba7',1,'ftxui::Node::operator=(const Node &)=delete'],['../group__dom.html#abe938f0d7bfdca112e345590d4887de6',1,'ftxui::Node::operator=(const Node &&)=delete'],['../classftxui_1_1AutoReset.html#a72b3c7613f9ecfb66005b1c30a5189d4',1,'ftxui::AutoReset::operator=(const AutoReset &)=delete'],['../classftxui_1_1AutoReset.html#a63fb3bea42919c7f183d4fb315451f6a',1,'ftxui::AutoReset::operator=(AutoReset &&)=delete'],['../classftxui_1_1ConstRef.html#ad144149e6f6f0d59610da4b28e22aef1',1,'ftxui::ConstRef::operator=(ConstRef &&) noexcept=default'],['../classftxui_1_1ConstRef.html#a834cee3b2f409135c37c188c583bce91',1,'ftxui::ConstRef::operator=(const ConstRef< T > &)=default'],['../classftxui_1_1Ref.html#abd99a8175d3ef482e70c239aef26322a',1,'ftxui::Ref::operator=(Ref &&) noexcept=default'],['../classftxui_1_1Ref.html#a2219840465715bbca4b1467132c686a5',1,'ftxui::Ref::operator=(const Ref< T > &)=default'],['../classftxui_1_1ConstStringListRef_1_1Adapter.html#a99e89ddbd26ca55a6696a12a819c8dac',1,'ftxui::ConstStringListRef::Adapter::operator=(const Adapter &)=default'],['../classftxui_1_1ConstStringListRef_1_1Adapter.html#a159afff9273b4ba2315d0fe5c0dc3629',1,'ftxui::ConstStringListRef::Adapter::operator=(Adapter &&)=default'],['../classftxui_1_1ConstStringListRef.html#a616528ee5b9a372e16ae2125e8dee3b7',1,'ftxui::ConstStringListRef::operator=(const ConstStringListRef &)=default'],['../classftxui_1_1ConstStringListRef.html#a51744ac3bfa14639955248e51313ba1f',1,'ftxui::ConstStringListRef::operator=(ConstStringListRef &&)=default']]], + ['operator_3d_3d_20',['operator==',['../group__component.html#ad5b326fac977a9c1c832ddb508f713da',1,'ftxui::Event::operator==()'],['../group__screen.html#ad75c695cfa18e51d88a0984af5df2f69',1,'ftxui::Box::operator==()'],['../group__screen.html#a66275ebe4681464e082660fa6be9ba28',1,'ftxui::Color::operator==()']]], + ['operator_5b_5d_21',['operator[]',['../classftxui_1_1ConstStringListRef_1_1Adapter.html#aaec2cde2cf71a044ba3305632c7a867c',1,'ftxui::ConstStringListRef::Adapter::operator[]()'],['../classftxui_1_1ConstStringListRef.html#afa13214cc014e69f7dc95b1df7c90d4e',1,'ftxui::ConstStringListRef::operator[]()']]], + ['operator_7c_22',['operator|',['../namespaceftxui.html#a65a2e15f64ae3bc205c485abc3a5aeb9',1,'ftxui::operator|(Component component, ComponentDecorator decorator)'],['../namespaceftxui.html#a9c4cf8bcb7012f740b146bfe89cbd3eb',1,'ftxui::operator|(Component component, ElementDecorator decorator)'],['../group__dom.html#ga7e9a69f0592b4013bd725d662f4a76e7',1,'ftxui::operator|(Element element, Decorator decorator)'],['../group__dom.html#ga6cbc84eb24a655ae084b3c7d26f9abfc',1,'ftxui::operator|(Elements elements, Decorator decorator)'],['../group__dom.html#ga027fbc9cf6fef9e86ae6a2a79e8bf23a',1,'ftxui::operator|(Decorator a, Decorator b)']]], + ['operator_7c_3d_23',['operator|=',['../namespaceftxui.html#ade35e69d695327db85be01c9787c39f8',1,'ftxui::operator|=(Component &component, ComponentDecorator decorator)'],['../namespaceftxui.html#aa480c58bcaeae204fbe68b192c5ede92',1,'ftxui::operator|=(Component &component, ElementDecorator decorator)'],['../group__dom.html#ga0be26ac5dcbe6c707857c791d8eec720',1,'ftxui::operator|=(Element &e, Decorator d)']]], + ['optional_20cmake_20flags_24',['Optional CMake Flags',['../installation_cmake.html#optional-cmake-flags',1,'']]], + ['orange1_25',['Orange1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa204b0d328d6009cf3947fee021fd8f9e',1,'ftxui::Color']]], + ['orange3_26',['Orange3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa00cd573911b5b30d18a11a33c6fc522b',1,'ftxui::Color']]], + ['orange4_27',['Orange4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa89cffa8b9f4fee6609397ae4070f9d6d',1,'ftxui::Color']]], + ['orange4bis_28',['Orange4Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfad2e88ff3a0d3feeec0b894602de2bdf8',1,'ftxui::Color']]], + ['orangered1_29',['OrangeRed1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa38540818f938e6576a3444b70118dbae',1,'ftxui::Color']]], + ['orchid_30',['Orchid',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2a4b392d52ff5f8074a7ddded3984e75',1,'ftxui::Color']]], + ['orchid1_31',['Orchid1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa8c9438fb930107e9c02fc9418fe1d24a',1,'ftxui::Color']]], + ['orchid2_32',['Orchid2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfadbf13507a7e98310795b8c59c3ec2f92',1,'ftxui::Color']]], + ['output_33',['Output',['../group__component.html#output',1,'Output'],['../namespaceftxui.html#output-1',1,'Output'],['../group__component.html#output-2',1,'Output'],['../group__component.html#output-3',1,'Output'],['../group__component.html#output-4',1,'Output'],['../group__component.html#output-5',1,'Output'],['../group__component.html#output-6',1,'Output'],['../group__component.html#output-7',1,'Output'],['../group__component.html#output-8',1,'Output'],['../group__component.html#output-9',1,'Output'],['../group__component.html#output-10',1,'Output'],['../group__component.html#output-11',1,'Output'],['../group__component.html#output-12',1,'Output'],['../group__component.html#output-13',1,'Output'],['../namespaceftxui.html#output-14',1,'Output'],['../group__component.html#output-15',1,'Output'],['../group__component.html#output-16',1,'Output'],['../group__component.html#output-17',1,'Output'],['../group__component.html#output-18',1,'Output'],['../group__component.html#output-19',1,'Output'],['../group__dom.html#output-22',1,'Output'],['../group__dom.html#output-23',1,'Output'],['../group__dom.html#output-24',1,'Output'],['../group__dom.html#output-25',1,'Output'],['../group__dom.html#output-26',1,'Output'],['../group__dom.html#output-21',1,'Output'],['../group__dom.html#output-27',1,'Output'],['../group__dom.html#output-28',1,'Output'],['../group__dom.html#output-29',1,'Output'],['../group__dom.html#output-30',1,'Output'],['../group__dom.html#output-31',1,'Output'],['../group__dom.html#output-32',1,'Output'],['../group__dom.html#output-33',1,'Output'],['../group__dom.html#output-34',1,'Output'],['../group__dom.html#output-35',1,'Output'],['../group__dom.html#output-36',1,'Output'],['../group__dom.html#output-37',1,'Output'],['../group__dom.html#output-38',1,'Output'],['../group__dom.html#output-39',1,'Output'],['../group__dom.html#output-40',1,'Output'],['../group__dom.html#output-41',1,'Output'],['../group__dom.html#output-42',1,'Output'],['../group__dom.html#output-43',1,'Output'],['../group__dom.html#output-44',1,'Output'],['../group__dom.html#output-45',1,'Output'],['../group__dom.html#output-46',1,'Output']]], + ['output_3a_34',['Output:',['../group__dom.html#output-20',1,'']]], + ['overflow_35',['overflow',['../structftxui_1_1flexbox__helper_1_1Block.html#a49aa97067a36875627e1380c3fb3833d',1,'ftxui::flexbox_helper::Block']]], + ['overview_36',['Overview',['../installation.html#overview',1,'']]] +]; diff --git a/search/classes_0.js b/search/classes_0.js new file mode 100644 index 000000000..abbe712d1 --- /dev/null +++ b/search/classes_0.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['adapter_0',['Adapter',['../classftxui_1_1ConstStringListRef_1_1Adapter.html',1,'ftxui::ConstStringListRef']]], + ['animatedcoloroption_1',['AnimatedColorOption',['../group__component.html#structftxui_1_1AnimatedColorOption',1,'ftxui']]], + ['animatedcolorsoption_2',['AnimatedColorsOption',['../structftxui_1_1AnimatedColorsOption.html',1,'ftxui']]], + ['animationtask_3',['AnimationTask',['../classftxui_1_1AnimationTask.html',1,'ftxui']]], + ['animator_4',['Animator',['../classftxui_1_1animation_1_1Animator.html',1,'ftxui::animation']]], + ['autoreset_5',['AutoReset',['../classftxui_1_1AutoReset.html',1,'ftxui']]] +]; diff --git a/search/classes_1.js b/search/classes_1.js new file mode 100644 index 000000000..b873bcedd --- /dev/null +++ b/search/classes_1.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['block_0',['Block',['../structftxui_1_1flexbox__helper_1_1Block.html',1,'ftxui::flexbox_helper']]], + ['box_1',['Box',['../group__screen.html#structftxui_1_1Box',1,'ftxui']]], + ['buttonoption_2',['ButtonOption',['../group__component.html#structftxui_1_1ButtonOption',1,'ftxui']]] +]; diff --git a/search/classes_10.js b/search/classes_10.js new file mode 100644 index 000000000..4356fa775 --- /dev/null +++ b/search/classes_10.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['windowoptions_0',['WindowOptions',['../structftxui_1_1WindowOptions.html',1,'ftxui']]], + ['windowrenderstate_1',['WindowRenderState',['../group__component.html#structftxui_1_1WindowRenderState',1,'ftxui']]] +]; diff --git a/search/classes_2.js b/search/classes_2.js new file mode 100644 index 000000000..92ffba9ca --- /dev/null +++ b/search/classes_2.js @@ -0,0 +1,14 @@ +var searchData= +[ + ['canvas_0',['Canvas',['../group__dom.html#structftxui_1_1Canvas',1,'ftxui']]], + ['capturedmouseinterface_1',['CapturedMouseInterface',['../classftxui_1_1CapturedMouseInterface.html',1,'ftxui']]], + ['checkboxoption_2',['CheckboxOption',['../group__component.html#structftxui_1_1CheckboxOption',1,'ftxui']]], + ['color_3',['Color',['../group__screen.html#classftxui_1_1Color',1,'ftxui']]], + ['colorinfo_4',['ColorInfo',['../group__screen.html#structftxui_1_1ColorInfo',1,'ftxui']]], + ['componentbase_5',['ComponentBase',['../group__component.html#classftxui_1_1ComponentBase',1,'ftxui']]], + ['constref_6',['ConstRef',['../classftxui_1_1ConstRef.html',1,'ftxui']]], + ['constref_3c_20std_3a_3astring_20_3e_7',['ConstRef< std::string >',['../classftxui_1_1ConstRef.html',1,'ftxui']]], + ['conststringlistref_8',['ConstStringListRef',['../classftxui_1_1ConstStringListRef.html',1,'ftxui']]], + ['conststringref_9',['ConstStringRef',['../classftxui_1_1ConstStringRef.html',1,'ftxui']]], + ['cursor_10',['Cursor',['../structftxui_1_1Screen_1_1Cursor.html',1,'ftxui::Screen']]] +]; diff --git a/search/classes_3.js b/search/classes_3.js new file mode 100644 index 000000000..6819644c4 --- /dev/null +++ b/search/classes_3.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['dimensions_0',['Dimensions',['../group__screen.html#structftxui_1_1Dimensions',1,'ftxui']]], + ['dropdownoption_1',['DropdownOption',['../group__component.html#structftxui_1_1DropdownOption',1,'ftxui']]] +]; diff --git a/search/classes_4.js b/search/classes_4.js new file mode 100644 index 000000000..e6146747f --- /dev/null +++ b/search/classes_4.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['element_0',['Element',['../structftxui_1_1box__helper_1_1Element.html',1,'ftxui::box_helper']]], + ['entrystate_1',['EntryState',['../structftxui_1_1EntryState.html',1,'ftxui']]], + ['event_2',['Event',['../group__component.html#structftxui_1_1Event',1,'ftxui']]] +]; diff --git a/search/classes_5.js b/search/classes_5.js new file mode 100644 index 000000000..b9880f2b0 --- /dev/null +++ b/search/classes_5.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['flexboxconfig_0',['FlexboxConfig',['../group__dom.html#structftxui_1_1FlexboxConfig',1,'ftxui']]], + ['focused_1',['Focused',['../structftxui_1_1Requirement_1_1Focused.html',1,'ftxui::Requirement']]] +]; diff --git a/search/classes_6.js b/search/classes_6.js new file mode 100644 index 000000000..d41c17ea3 --- /dev/null +++ b/search/classes_6.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['global_0',['Global',['../structftxui_1_1flexbox__helper_1_1Global.html',1,'ftxui::flexbox_helper']]] +]; diff --git a/search/classes_7.js b/search/classes_7.js new file mode 100644 index 000000000..02c77b733 --- /dev/null +++ b/search/classes_7.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['image_0',['Image',['../group__screen.html#classftxui_1_1Image',1,'ftxui']]], + ['inputoption_1',['InputOption',['../group__component.html#structftxui_1_1InputOption',1,'ftxui']]], + ['inputstate_2',['InputState',['../structftxui_1_1InputState.html',1,'ftxui']]] +]; diff --git a/search/classes_8.js b/search/classes_8.js new file mode 100644 index 000000000..0798ae1a4 --- /dev/null +++ b/search/classes_8.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['line_0',['Line',['../structftxui_1_1flexbox__helper_1_1Line.html',1,'ftxui::flexbox_helper']]], + ['lineargradient_1',['LinearGradient',['../group__dom.html#structftxui_1_1LinearGradient',1,'ftxui']]], + ['loop_2',['Loop',['../group__component.html#classftxui_1_1Loop',1,'ftxui']]] +]; diff --git a/search/classes_9.js b/search/classes_9.js new file mode 100644 index 000000000..ed16e670c --- /dev/null +++ b/search/classes_9.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['menuentryoption_0',['MenuEntryOption',['../group__component.html#structftxui_1_1MenuEntryOption',1,'ftxui']]], + ['menuoption_1',['MenuOption',['../group__component.html#structftxui_1_1MenuOption',1,'ftxui']]], + ['mouse_2',['Mouse',['../group__component.html#structftxui_1_1Mouse',1,'ftxui']]] +]; diff --git a/search/classes_a.js b/search/classes_a.js new file mode 100644 index 000000000..c7f5fe667 --- /dev/null +++ b/search/classes_a.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['node_0',['Node',['../group__dom.html#classftxui_1_1Node',1,'ftxui']]], + ['nodedecorator_1',['NodeDecorator',['../classftxui_1_1NodeDecorator.html',1,'ftxui']]] +]; diff --git a/search/classes_b.js b/search/classes_b.js new file mode 100644 index 000000000..bfd026401 --- /dev/null +++ b/search/classes_b.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['params_0',['Params',['../classftxui_1_1animation_1_1Params.html',1,'ftxui::animation']]], + ['pendingtask_1',['PendingTask',['../structftxui_1_1task_1_1PendingTask.html',1,'ftxui::task']]], + ['pixel_2',['Pixel',['../group__screen.html#structftxui_1_1Pixel',1,'ftxui']]], + ['private_3',['Private',['../classftxui_1_1ScreenInteractive_1_1Private.html',1,'ftxui::ScreenInteractive']]] +]; diff --git a/search/classes_c.js b/search/classes_c.js new file mode 100644 index 000000000..15db85a10 --- /dev/null +++ b/search/classes_c.js @@ -0,0 +1,12 @@ +var searchData= +[ + ['radioboxoption_0',['RadioboxOption',['../group__component.html#structftxui_1_1RadioboxOption',1,'ftxui']]], + ['receiverimpl_1',['ReceiverImpl',['../classftxui_1_1ReceiverImpl.html',1,'ftxui']]], + ['ref_2',['Ref',['../classftxui_1_1Ref.html',1,'ftxui']]], + ['ref_3c_20bool_20_3e_3',['Ref< bool >',['../classftxui_1_1Ref.html',1,'ftxui']]], + ['ref_3c_20direction_20_3e_4',['Ref< Direction >',['../classftxui_1_1Ref.html',1,'ftxui']]], + ['ref_3c_20int_20_3e_5',['Ref< int >',['../classftxui_1_1Ref.html',1,'ftxui']]], + ['ref_3c_20std_3a_3astring_20_3e_6',['Ref< std::string >',['../classftxui_1_1Ref.html',1,'ftxui']]], + ['requirement_7',['Requirement',['../group__dom.html#structftxui_1_1Requirement',1,'ftxui']]], + ['resizablesplitoption_8',['ResizableSplitOption',['../structftxui_1_1ResizableSplitOption.html',1,'ftxui']]] +]; diff --git a/search/classes_d.js b/search/classes_d.js new file mode 100644 index 000000000..e3e6f1ba1 --- /dev/null +++ b/search/classes_d.js @@ -0,0 +1,11 @@ +var searchData= +[ + ['screen_0',['Screen',['../group__screen.html#classftxui_1_1Screen',1,'ftxui']]], + ['screeninteractive_1',['ScreenInteractive',['../group__component.html#classftxui_1_1ScreenInteractive',1,'ftxui']]], + ['selection_2',['Selection',['../group__dom.html#classftxui_1_1Selection',1,'ftxui']]], + ['senderimpl_3',['SenderImpl',['../classftxui_1_1SenderImpl.html',1,'ftxui']]], + ['slideroption_4',['SliderOption',['../structftxui_1_1SliderOption.html',1,'ftxui']]], + ['status_5',['Status',['../structftxui_1_1Node_1_1Status.html',1,'ftxui::Node']]], + ['stop_6',['Stop',['../structftxui_1_1LinearGradient_1_1Stop.html',1,'ftxui::LinearGradient']]], + ['stringref_7',['StringRef',['../classftxui_1_1StringRef.html',1,'ftxui']]] +]; diff --git a/search/classes_e.js b/search/classes_e.js new file mode 100644 index 000000000..2a04d23ad --- /dev/null +++ b/search/classes_e.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['table_0',['Table',['../group__dom.html#classftxui_1_1Table',1,'ftxui']]], + ['tableselection_1',['TableSelection',['../classftxui_1_1TableSelection.html',1,'ftxui']]], + ['taskqueue_2',['TaskQueue',['../structftxui_1_1task_1_1TaskQueue.html',1,'ftxui::task']]], + ['taskrunner_3',['TaskRunner',['../classftxui_1_1task_1_1TaskRunner.html',1,'ftxui::task']]], + ['terminalinputparser_4',['TerminalInputParser',['../classftxui_1_1TerminalInputParser.html',1,'ftxui']]] +]; diff --git a/search/classes_f.js b/search/classes_f.js new file mode 100644 index 000000000..8adb365c3 --- /dev/null +++ b/search/classes_f.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['underlineoption_0',['UnderlineOption',['../group__component.html#structftxui_1_1UnderlineOption',1,'ftxui']]] +]; diff --git a/search/close.svg b/search/close.svg new file mode 100644 index 000000000..337d6cc13 --- /dev/null +++ b/search/close.svg @@ -0,0 +1,18 @@ + + + + + + diff --git a/search/defines_0.js b/search/defines_0.js new file mode 100644 index 000000000..678941944 --- /dev/null +++ b/search/defines_0.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['ftxui_5flikely_0',['FTXUI_LIKELY',['../screen_8cpp.html#a3350a75634f7952b2795de433b111f0e',1,'screen.cpp']]], + ['ftxui_5funlikely_1',['FTXUI_UNLIKELY',['../screen_8cpp.html#a6048239c71b0f0be5c9d01ba721d7dd9',1,'screen.cpp']]] +]; diff --git a/search/defines_1.js b/search/defines_1.js new file mode 100644 index 000000000..23a2be1c8 --- /dev/null +++ b/search/defines_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['nominmax_0',['NOMINMAX',['../src_2ftxui_2component_2window_8cpp.html#a9f918755b601cf4bffca775992e6fb90',1,'window.cpp']]] +]; diff --git a/search/enums_0.js b/search/enums_0.js new file mode 100644 index 000000000..85166dde5 --- /dev/null +++ b/search/enums_0.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['aligncontent_0',['AlignContent',['../group__dom.html#a1f99410fd0fc632a5bc2497b6a447420',1,'ftxui::FlexboxConfig']]], + ['alignitems_1',['AlignItems',['../group__dom.html#a821af961ece5fe13540ad48b54c7a9e7',1,'ftxui::FlexboxConfig']]] +]; diff --git a/search/enums_1.js b/search/enums_1.js new file mode 100644 index 000000000..d16492942 --- /dev/null +++ b/search/enums_1.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['borderstyle_0',['BorderStyle',['../group__dom.html#gafe3103dd0b8240c5443892484ef5af9c',1,'ftxui']]], + ['button_1',['Button',['../group__component.html#a03bfec859eac87be20f8952c1eb89de0',1,'ftxui::Mouse']]] +]; diff --git a/search/enums_2.js b/search/enums_2.js new file mode 100644 index 000000000..635b26d91 --- /dev/null +++ b/search/enums_2.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['color_0',['Color',['../group__screen.html#gab87bacfdad76e61b9412d7124be44c1c',1,'ftxui::Terminal']]], + ['constraint_1',['Constraint',['../namespaceftxui.html#ae09f44b989d381a387329fd0a0935926',1,'ftxui']]] +]; diff --git a/search/enums_3.js b/search/enums_3.js new file mode 100644 index 000000000..a061a8bd2 --- /dev/null +++ b/search/enums_3.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['direction_0',['Direction',['../group__dom.html#a224b9163917ac32fc95a60d8c1eec3aa',1,'ftxui::FlexboxConfig::Direction'],['../group__dom.html#ga224b9163917ac32fc95a60d8c1eec3aa',1,'ftxui::Direction']]] +]; diff --git a/search/enums_4.js b/search/enums_4.js new file mode 100644 index 000000000..6e1936b95 --- /dev/null +++ b/search/enums_4.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['justifycontent_0',['JustifyContent',['../group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2',1,'ftxui::FlexboxConfig']]] +]; diff --git a/search/enums_5.js b/search/enums_5.js new file mode 100644 index 000000000..e7b7b3ead --- /dev/null +++ b/search/enums_5.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['motion_0',['Motion',['../group__component.html#a099c889d2b948b264c7a665b66e3a9b6',1,'ftxui::Mouse']]] +]; diff --git a/search/enums_6.js b/search/enums_6.js new file mode 100644 index 000000000..877407931 --- /dev/null +++ b/search/enums_6.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['palette1_0',['Palette1',['../group__screen.html#aa4be56f94fc180d7b070df23c235b0c7',1,'ftxui::Color']]], + ['palette16_1',['Palette16',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802f',1,'ftxui::Color']]], + ['palette256_2',['Palette256',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcf',1,'ftxui::Color']]] +]; diff --git a/search/enums_7.js b/search/enums_7.js new file mode 100644 index 000000000..4b65433d9 --- /dev/null +++ b/search/enums_7.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['shape_0',['Shape',['../structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37c',1,'ftxui::Screen::Cursor']]] +]; diff --git a/search/enums_8.js b/search/enums_8.js new file mode 100644 index 000000000..23d9971af --- /dev/null +++ b/search/enums_8.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['widthorheight_0',['WidthOrHeight',['../namespaceftxui.html#a04711c04f28aabfa0e5928a35baaec53',1,'ftxui']]], + ['wordbreakproperty_1',['WordBreakProperty',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968a',1,'ftxui']]], + ['wrap_2',['Wrap',['../group__dom.html#a6c844a611650cf7e956dbe269a0e72ab',1,'ftxui::FlexboxConfig']]] +]; diff --git a/search/enumvalues_0.js b/search/enumvalues_0.js new file mode 100644 index 000000000..8f44667f4 --- /dev/null +++ b/search/enumvalues_0.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['aletter_0',['ALetter',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aab1bb481a6d76de94d35e1d67cb85d966',1,'ftxui']]], + ['aquamarine1_1',['Aquamarine1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf54d1112226e67ee67339a050ae1b352',1,'ftxui::Color']]], + ['aquamarine1bis_2',['Aquamarine1Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa4db1324d99372274e2414031d1773151',1,'ftxui::Color']]], + ['aquamarine3_3',['Aquamarine3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfadc172e17e6f05d6e2b0e48c85803a85a',1,'ftxui::Color']]] +]; diff --git a/search/enumvalues_1.js b/search/enumvalues_1.js new file mode 100644 index 000000000..8d3c18ee9 --- /dev/null +++ b/search/enumvalues_1.js @@ -0,0 +1,14 @@ +var searchData= +[ + ['bar_0',['Bar',['../structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37ca6424dbda22da2f105580d1c8095600d3',1,'ftxui::Screen::Cursor']]], + ['barblinking_1',['BarBlinking',['../structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37cae7dfc08d4e90b88e0cb1cea7a54796c1',1,'ftxui::Screen::Cursor']]], + ['black_2',['Black',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802fac1e9bce8242f443c54c7405223d616cd',1,'ftxui::Color']]], + ['block_3',['Block',['../structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37caa00f801460e81f86eab56d86fe627551',1,'ftxui::Screen::Cursor']]], + ['blockblinking_4',['BlockBlinking',['../structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37ca2f4a0b3cacb4468d8467dc0746ea23aa',1,'ftxui::Screen::Cursor']]], + ['blue_5',['Blue',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802faf5e09dd1da4088464f264b7a3118bff8',1,'ftxui::Color']]], + ['blue1_6',['Blue1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9eafa8db807f9452108cd02b80cd4adc',1,'ftxui::Color']]], + ['blue3_7',['Blue3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa910d98e6c6282c1c8133f53438beb7ca',1,'ftxui::Color']]], + ['blue3bis_8',['Blue3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfabb8f8ef3f352a8a9c884fadff1576b13',1,'ftxui::Color']]], + ['bluelight_9',['BlueLight',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802faf7cc79a56a740e9c59a156b0b3b93cbd',1,'ftxui::Color']]], + ['blueviolet_10',['BlueViolet',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfabcd3fa02524f2597996333516267c773',1,'ftxui::Color']]] +]; diff --git a/search/enumvalues_10.js b/search/enumvalues_10.js new file mode 100644 index 000000000..a7e9ffeec --- /dev/null +++ b/search/enumvalues_10.js @@ -0,0 +1,30 @@ +var searchData= +[ + ['salmon1_0',['Salmon1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa664067df16558f65cc3d46609a03dfab',1,'ftxui::Color']]], + ['sandybrown_1',['SandyBrown',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa64269c060a2fc56cb77c12360cd3a28e',1,'ftxui::Color']]], + ['seagreen1_2',['SeaGreen1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa8e2c9e620d6245638b27d9c1fa2d0545',1,'ftxui::Color']]], + ['seagreen1bis_3',['SeaGreen1Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7819209c8bfe13fbfcb2cde9a296f7b6',1,'ftxui::Color']]], + ['seagreen2_4',['SeaGreen2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa1b69dc4c281a32346b8d2bab20dd1aef',1,'ftxui::Color']]], + ['seagreen3_5',['SeaGreen3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa5b862c5164d4597b28fba03335a834cf',1,'ftxui::Color']]], + ['single_5fquote_6',['Single_Quote',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aab6f9a00a0255e4da280686c4640c7671',1,'ftxui']]], + ['skyblue1_7',['SkyBlue1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfac47bacbed84298fdf72215fe2312ce64',1,'ftxui::Color']]], + ['skyblue2_8',['SkyBlue2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa1172e54ed7e62aa4ebcea4b453f5dcc',1,'ftxui::Color']]], + ['skyblue3_9',['SkyBlue3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2dfa52861bc8b2a870e5166e969db2c7',1,'ftxui::Color']]], + ['slateblue1_10',['SlateBlue1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa97807edc577e1d5d3bc271c3a4ced7f4',1,'ftxui::Color']]], + ['slateblue3_11',['SlateBlue3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfae53ce2149f6b9e7da24472b5112f7963',1,'ftxui::Color']]], + ['slateblue3bis_12',['SlateBlue3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfad477f91096f698a2b266a1bf26cd456b',1,'ftxui::Color']]], + ['spacearound_13',['SpaceAround',['../group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2aa711fff5f720542ab104aab0805e2565',1,'ftxui::FlexboxConfig::SpaceAround'],['../group__dom.html#a1f99410fd0fc632a5bc2497b6a447420aa711fff5f720542ab104aab0805e2565',1,'ftxui::FlexboxConfig::SpaceAround']]], + ['spacebetween_14',['SpaceBetween',['../group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2afa2f3f8f296dcb6e5c287d69eae1c119',1,'ftxui::FlexboxConfig::SpaceBetween'],['../group__dom.html#a1f99410fd0fc632a5bc2497b6a447420afa2f3f8f296dcb6e5c287d69eae1c119',1,'ftxui::FlexboxConfig::SpaceBetween']]], + ['spaceevenly_15',['SpaceEvenly',['../group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2a34ad3eaf7ee60a45210ad60bd731e235',1,'ftxui::FlexboxConfig::SpaceEvenly'],['../group__dom.html#a1f99410fd0fc632a5bc2497b6a447420a34ad3eaf7ee60a45210ad60bd731e235',1,'ftxui::FlexboxConfig::SpaceEvenly']]], + ['springgreen1_16',['SpringGreen1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa8e70ae2a69a90e87e679685d6461b6e8',1,'ftxui::Color']]], + ['springgreen2_17',['SpringGreen2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfac85363887f660b5879e353bac03dab49',1,'ftxui::Color']]], + ['springgreen2bis_18',['SpringGreen2Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfad038ac30c015021853f183054c51c0c5',1,'ftxui::Color']]], + ['springgreen3_19',['SpringGreen3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa5a87a3e9a8af9561a373ff63e740223e',1,'ftxui::Color']]], + ['springgreen3bis_20',['SpringGreen3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf19e26246ad6f4e4de44efb6d2b4e1c6',1,'ftxui::Color']]], + ['springgreen4_21',['SpringGreen4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf3817720cb5b18b16b8d6c520a61748e',1,'ftxui::Color']]], + ['steelblue_22',['SteelBlue',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9224e340e6d918555c68ac2f1dc80b04',1,'ftxui::Color']]], + ['steelblue1_23',['SteelBlue1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa050bb4a5d79a1dac6aae25ce8734c973',1,'ftxui::Color']]], + ['steelblue1bis_24',['SteelBlue1Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf400af64197a052be4d59c521104cb2a',1,'ftxui::Color']]], + ['steelblue3_25',['SteelBlue3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0a49900e5a03f7545262d90592bfba92',1,'ftxui::Color']]], + ['stretch_26',['Stretch',['../group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2afbb09a82eafab60150d0996e8fe46560',1,'ftxui::FlexboxConfig::Stretch'],['../group__dom.html#a821af961ece5fe13540ad48b54c7a9e7afbb09a82eafab60150d0996e8fe46560',1,'ftxui::FlexboxConfig::Stretch'],['../group__dom.html#a1f99410fd0fc632a5bc2497b6a447420afbb09a82eafab60150d0996e8fe46560',1,'ftxui::FlexboxConfig::Stretch']]] +]; diff --git a/search/enumvalues_11.js b/search/enumvalues_11.js new file mode 100644 index 000000000..bdfd4e5f7 --- /dev/null +++ b/search/enumvalues_11.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['tan_0',['Tan',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfab492a96cd2b9bb37c81b8451a42889d9',1,'ftxui::Color']]], + ['thistle1_1',['Thistle1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaaa1937f76b1f6c26f042a5cea129d661',1,'ftxui::Color']]], + ['thistle3_2',['Thistle3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7e48d71618f8e50aed23876c3103859b',1,'ftxui::Color']]], + ['truecolor_3',['TrueColor',['../group__screen.html#ggab87bacfdad76e61b9412d7124be44c1ca7afd9568e82d523c91b2bfe0cc47be29',1,'ftxui::Terminal']]], + ['turquoise2_4',['Turquoise2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0514acacf99b53570d7a2ee25dde1f5a',1,'ftxui::Color']]], + ['turquoise4_5',['Turquoise4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfac0d913fe38afad9dad5a51083ebc1e86',1,'ftxui::Color']]] +]; diff --git a/search/enumvalues_12.js b/search/enumvalues_12.js new file mode 100644 index 000000000..396c325dc --- /dev/null +++ b/search/enumvalues_12.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['underline_0',['Underline',['../structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37caa909c5f2b588ba35fcc40b3b504ad2ed',1,'ftxui::Screen::Cursor']]], + ['underlineblinking_1',['UnderlineBlinking',['../structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37cad7df11ee39d53d4ee2da1b22b2238abc',1,'ftxui::Screen::Cursor']]], + ['up_2',['Up',['../group__dom.html#gga224b9163917ac32fc95a60d8c1eec3aaa258f49887ef8d14ac268c92b02503aaa',1,'ftxui']]] +]; diff --git a/search/enumvalues_13.js b/search/enumvalues_13.js new file mode 100644 index 000000000..2522b1d96 --- /dev/null +++ b/search/enumvalues_13.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['violet_0',['Violet',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa94a3ee3884eb2af70a2d764a4f06e79d',1,'ftxui::Color']]] +]; diff --git a/search/enumvalues_14.js b/search/enumvalues_14.js new file mode 100644 index 000000000..80d767fa0 --- /dev/null +++ b/search/enumvalues_14.js @@ -0,0 +1,14 @@ +var searchData= +[ + ['wheat1_0',['Wheat1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2919dbb2ef2f19e560ee2a4f21874373',1,'ftxui::Color']]], + ['wheat4_1',['Wheat4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa3fee165b16150ce4df5f4fcecca7407',1,'ftxui::Color']]], + ['wheeldown_2',['WheelDown',['../group__component.html#a03bfec859eac87be20f8952c1eb89de0afd8a27c9d7eac3486f6fbd2d608da0db',1,'ftxui::Mouse']]], + ['wheelleft_3',['WheelLeft',['../group__component.html#a03bfec859eac87be20f8952c1eb89de0a160e671a76bd0d1f424a8b9700275375',1,'ftxui::Mouse']]], + ['wheelright_4',['WheelRight',['../group__component.html#a03bfec859eac87be20f8952c1eb89de0ae73184b2d38af984b5cda75057471adc',1,'ftxui::Mouse']]], + ['wheelup_5',['WheelUp',['../group__component.html#a03bfec859eac87be20f8952c1eb89de0ab51f2e2fc1697565b732263f86a976d6',1,'ftxui::Mouse']]], + ['white_6',['White',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802fab548046646b36c12aa6ba841de500094',1,'ftxui::Color']]], + ['width_7',['WIDTH',['../namespaceftxui.html#a04711c04f28aabfa0e5928a35baaec53a73c0818986b7c462c2977f57afd00522',1,'ftxui']]], + ['wrap_8',['Wrap',['../group__dom.html#a6c844a611650cf7e956dbe269a0e72abaa212b19ef5f2fb30acf92e6cbccc1f2d',1,'ftxui::FlexboxConfig']]], + ['wrapinversed_9',['WrapInversed',['../group__dom.html#a6c844a611650cf7e956dbe269a0e72abad639e613e3589af04e39135707dbc642',1,'ftxui::FlexboxConfig']]], + ['wsegspace_10',['WSegSpace',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aa3ddc36a0c4e381a754fb00548d567d09',1,'ftxui']]] +]; diff --git a/search/enumvalues_15.js b/search/enumvalues_15.js new file mode 100644 index 000000000..694722b8f --- /dev/null +++ b/search/enumvalues_15.js @@ -0,0 +1,11 @@ +var searchData= +[ + ['yellow_0',['Yellow',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802fabf28513245738599d13e3ce36bd16c82',1,'ftxui::Color']]], + ['yellow1_1',['Yellow1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa18f6dad40423c7708a467fb630f59048',1,'ftxui::Color']]], + ['yellow2_2',['Yellow2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfac571c9dd674c4e7301b11cee12715bdf',1,'ftxui::Color']]], + ['yellow3_3',['Yellow3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa64545058cba31bf28f7cc75072664ec2',1,'ftxui::Color']]], + ['yellow3bis_4',['Yellow3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa67ae91aade6999e17c552ebe197c3a7f',1,'ftxui::Color']]], + ['yellow4_5',['Yellow4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfab60ac0c6b49456d0de7ca3388f19862a',1,'ftxui::Color']]], + ['yellow4bis_6',['Yellow4Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaaf28e9bd6542c570b963f36620b181f7',1,'ftxui::Color']]], + ['yellowlight_7',['YellowLight',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802fa7948fe5f055329af04798409b7ac37b5',1,'ftxui::Color']]] +]; diff --git a/search/enumvalues_16.js b/search/enumvalues_16.js new file mode 100644 index 000000000..e862442b6 --- /dev/null +++ b/search/enumvalues_16.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['zwj_0',['ZWJ',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aacb4adf7b93435bdfbae8f32d5bcda514',1,'ftxui']]] +]; diff --git a/search/enumvalues_2.js b/search/enumvalues_2.js new file mode 100644 index 000000000..bebb2ca8f --- /dev/null +++ b/search/enumvalues_2.js @@ -0,0 +1,22 @@ +var searchData= +[ + ['cadetblue_0',['CadetBlue',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa76906c6e4ac2ee22b81bda5a59e335f1',1,'ftxui::Color']]], + ['cadetbluebis_1',['CadetBlueBis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfacb5d4e2aebcd3abba4c91d055f07513b',1,'ftxui::Color']]], + ['center_2',['Center',['../group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2a4f1f6016fc9f3f2353c0cc7c67b292bd',1,'ftxui::FlexboxConfig::Center'],['../group__dom.html#a821af961ece5fe13540ad48b54c7a9e7a4f1f6016fc9f3f2353c0cc7c67b292bd',1,'ftxui::FlexboxConfig::Center'],['../group__dom.html#a1f99410fd0fc632a5bc2497b6a447420a4f1f6016fc9f3f2353c0cc7c67b292bd',1,'ftxui::FlexboxConfig::Center']]], + ['chartreuse1_3',['Chartreuse1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7d2d4cc3af6756a4eac7d12fbe4775d4',1,'ftxui::Color']]], + ['chartreuse2_4',['Chartreuse2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa353575e36d1260652eb3d18e73f04cfe',1,'ftxui::Color']]], + ['chartreuse2bis_5',['Chartreuse2Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6338086ae05e58041188d89165d87c1a',1,'ftxui::Color']]], + ['chartreuse3_6',['Chartreuse3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2f3df27b5ed05a3e040deec31c684003',1,'ftxui::Color']]], + ['chartreuse3bis_7',['Chartreuse3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2087d90de0840d3f15fad878ba4b4fc4',1,'ftxui::Color']]], + ['chartreuse4_8',['Chartreuse4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa734cd2fab3e94385552fc745665bcc98',1,'ftxui::Color']]], + ['column_9',['Column',['../group__dom.html#a224b9163917ac32fc95a60d8c1eec3aaa1976d7f704de389d9fe064e08ea35b2d',1,'ftxui::FlexboxConfig']]], + ['columninversed_10',['ColumnInversed',['../group__dom.html#a224b9163917ac32fc95a60d8c1eec3aaa338df815740895b690c7b07716acda20',1,'ftxui::FlexboxConfig']]], + ['cornflowerblue_11',['CornflowerBlue',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfab4dcc712554f602559b3f9b7662ea4dd',1,'ftxui::Color']]], + ['cornsilk1_12',['Cornsilk1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9d7dd269922a0e2fac6366c623ed3d45',1,'ftxui::Color']]], + ['cr_13',['CR',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aa1d7b33fc26ca22c2011aaa97fecc43d8',1,'ftxui']]], + ['cyan_14',['Cyan',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802fab0d4738f9c7f12049e52aa4e868bdc8b',1,'ftxui::Color']]], + ['cyan1_15',['Cyan1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa35e9559f51c82a7adda45276bbedb0f4',1,'ftxui::Color']]], + ['cyan2_16',['Cyan2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfacc49853d1836ecf3b66c4b8c568aba3f',1,'ftxui::Color']]], + ['cyan3_17',['Cyan3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7a36fc7d64942362d706fad5544517d1',1,'ftxui::Color']]], + ['cyanlight_18',['CyanLight',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802fa61bd7f1290cc0a24e565539a61ba5839',1,'ftxui::Color']]] +]; diff --git a/search/enumvalues_3.js b/search/enumvalues_3.js new file mode 100644 index 000000000..ecd28cbae --- /dev/null +++ b/search/enumvalues_3.js @@ -0,0 +1,59 @@ +var searchData= +[ + ['darkblue_0',['DarkBlue',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa4d5c4dd6c3cf0fe617dec801025bd76',1,'ftxui::Color']]], + ['darkcyan_1',['DarkCyan',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa180097c82c1863b9c2f94b41d341c529',1,'ftxui::Color']]], + ['darkgoldenrod_2',['DarkGoldenrod',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfab5d8a9760923e3357c167fc19de8a914',1,'ftxui::Color']]], + ['darkgreen_3',['DarkGreen',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6c1a381d726d9c383c05b9ca12682e4f',1,'ftxui::Color']]], + ['darkkhaki_4',['DarkKhaki',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa480194578592f6fc90b8b6a1a1f66e8b',1,'ftxui::Color']]], + ['darkmagenta_5',['DarkMagenta',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2ba5febce0999080bcfe1ef92192fe12',1,'ftxui::Color']]], + ['darkmagentabis_6',['DarkMagentaBis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0e32b2f735ea792ab1d5253d3e631241',1,'ftxui::Color']]], + ['darkolivegreen1_7',['DarkOliveGreen1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa4a1641f09fbb37751ade39859adbcfaa',1,'ftxui::Color']]], + ['darkolivegreen1bis_8',['DarkOliveGreen1Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa4e0500dd80f0e6f0a2a1a93de953cf86',1,'ftxui::Color']]], + ['darkolivegreen2_9',['DarkOliveGreen2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaad55a68e83744f717a7f83f7a8fd265f',1,'ftxui::Color']]], + ['darkolivegreen3_10',['DarkOliveGreen3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaeca91c2f996796b37a2123515356ded3',1,'ftxui::Color']]], + ['darkolivegreen3bis_11',['DarkOliveGreen3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfad6dc23b32b2396e59cfc48238fd05bd8',1,'ftxui::Color']]], + ['darkolivegreen3ter_12',['DarkOliveGreen3Ter',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7a607c03adbcbd4b210fc095272a76a0',1,'ftxui::Color']]], + ['darkorange_13',['DarkOrange',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2458c6f4cddf4f28bf1285975975b987',1,'ftxui::Color']]], + ['darkorange3_14',['DarkOrange3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa08efc0d59d20277a3c2f01473250108c',1,'ftxui::Color']]], + ['darkorange3bis_15',['DarkOrange3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa3def467cbbb99502637734c3bd2ce456',1,'ftxui::Color']]], + ['darkred_16',['DarkRed',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa556650aa9f007ea0239e66d3ddf26759',1,'ftxui::Color']]], + ['darkredbis_17',['DarkRedBis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa3bcdc58abc2165b0032a207e9d6883d',1,'ftxui::Color']]], + ['darkseagreen_18',['DarkSeaGreen',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa380e1f43f086bd475d720c459fcff2a8',1,'ftxui::Color']]], + ['darkseagreen1_19',['DarkSeaGreen1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaded95d3c0d616d9658b034e9ae705bf5',1,'ftxui::Color']]], + ['darkseagreen1bis_20',['DarkSeaGreen1Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa691f28c053f9d2a12db86b8aa396374b',1,'ftxui::Color']]], + ['darkseagreen2_21',['DarkSeaGreen2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfad5089e0939bbe16ed485053e771e8a68',1,'ftxui::Color']]], + ['darkseagreen2bis_22',['DarkSeaGreen2Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfac388011f4493d875983a3c7264e7ded5',1,'ftxui::Color']]], + ['darkseagreen3_23',['DarkSeaGreen3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa02af538b8573bc9c037822273620864f',1,'ftxui::Color']]], + ['darkseagreen3bis_24',['DarkSeaGreen3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7b2765271febec45b933598f18a7ca98',1,'ftxui::Color']]], + ['darkseagreen4_25',['DarkSeaGreen4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfabda195126fea1b4f0aa6d25513820ca0',1,'ftxui::Color']]], + ['darkseagreen4bis_26',['DarkSeaGreen4Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa393410b62bd90565aa0c25e61c92d999',1,'ftxui::Color']]], + ['darkslategray1_27',['DarkSlateGray1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfafb40765294d1d25a5ec1ec17d3ee4ae8',1,'ftxui::Color']]], + ['darkslategray2_28',['DarkSlateGray2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa29221856aecf72cfe57d5ca2e6d41b42',1,'ftxui::Color']]], + ['darkslategray3_29',['DarkSlateGray3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0621f3f774389bc57973bbed3c78b9f7',1,'ftxui::Color']]], + ['darkturquoise_30',['DarkTurquoise',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6a5df4f33663381387285b54ee22ab78',1,'ftxui::Color']]], + ['darkviolet_31',['DarkViolet',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0c92c7e17edeca09b7c63c8a783a562f',1,'ftxui::Color']]], + ['darkvioletbis_32',['DarkVioletBis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9870a3dcf46498ca4a10be946521097d',1,'ftxui::Color']]], + ['dashed_33',['DASHED',['../group__dom.html#ggafe3103dd0b8240c5443892484ef5af9ca830310bdfd296d7cd00c59773579b892',1,'ftxui']]], + ['deeppink1_34',['DeepPink1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfad05d6a1937a822876238056c449d358a',1,'ftxui::Color']]], + ['deeppink1bis_35',['DeepPink1Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa65e73df447238ae75a0d07efb65dbe9e',1,'ftxui::Color']]], + ['deeppink2_36',['DeepPink2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaeef51aafc2cd821d225e0da0c53f8e20',1,'ftxui::Color']]], + ['deeppink3_37',['DeepPink3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfafe2c78801538b191a773d879ce8ef205',1,'ftxui::Color']]], + ['deeppink3bis_38',['DeepPink3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfabff5bbcace3282974cfa06467832cb79',1,'ftxui::Color']]], + ['deeppink4_39',['DeepPink4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf13fb129c07396292da1f7530914f07d',1,'ftxui::Color']]], + ['deeppink4bis_40',['DeepPink4Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa26e5234f400791a8e9e7850ba7cf6df8',1,'ftxui::Color']]], + ['deeppink4ter_41',['DeepPink4Ter',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfac8deabe72bda5e1baf1db1ffc1edf966',1,'ftxui::Color']]], + ['deepskyblue1_42',['DeepSkyBlue1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa601eba969cf1007265ed79e626d49be7',1,'ftxui::Color']]], + ['deepskyblue2_43',['DeepSkyBlue2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa932fa24051e9217b181a71e7491bb214',1,'ftxui::Color']]], + ['deepskyblue3_44',['DeepSkyBlue3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa99066355a2c8a3d09741cc7318a41dbc',1,'ftxui::Color']]], + ['deepskyblue3bis_45',['DeepSkyBlue3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa8986a4db4b9a9e78822a35345484d23a',1,'ftxui::Color']]], + ['deepskyblue4_46',['DeepSkyBlue4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0bedec2878fd084bb46dcd7f7dd3b9aa',1,'ftxui::Color']]], + ['deepskyblue4bis_47',['DeepSkyBlue4Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfad0cc3282e3ba7e9d833052832a54fdc3',1,'ftxui::Color']]], + ['deepskyblue4ter_48',['DeepSkyBlue4Ter',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa98b88c697db6fc8899bee87fa24e86dd',1,'ftxui::Color']]], + ['default_49',['Default',['../group__screen.html#aa4be56f94fc180d7b070df23c235b0c7a79935518a3889663d8688b6b01fff051',1,'ftxui::Color']]], + ['dodgerblue1_50',['DodgerBlue1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6902167c73e03c1214dae9265c9a9523',1,'ftxui::Color']]], + ['dodgerblue2_51',['DodgerBlue2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa4bfe8de454eabc37639b32813912000e',1,'ftxui::Color']]], + ['dodgerblue3_52',['DodgerBlue3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf82b272abcc583f2c0ac11d6b22c45ca',1,'ftxui::Color']]], + ['double_53',['DOUBLE',['../group__dom.html#ggafe3103dd0b8240c5443892484ef5af9ca33465d1d419b1074fb259ef444609e92',1,'ftxui']]], + ['double_5fquote_54',['Double_Quote',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aa3a1f5142815614aa554e376af7047de3',1,'ftxui']]], + ['down_55',['Down',['../group__dom.html#gga224b9163917ac32fc95a60d8c1eec3aaa08a38277b0309070706f6652eeae9a53',1,'ftxui']]] +]; diff --git a/search/enumvalues_4.js b/search/enumvalues_4.js new file mode 100644 index 000000000..f5770a2c9 --- /dev/null +++ b/search/enumvalues_4.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['empty_0',['EMPTY',['../group__dom.html#ggafe3103dd0b8240c5443892484ef5af9ca2f0d18fc0d0fa4a6cd92dc328501874d',1,'ftxui']]], + ['equal_1',['EQUAL',['../namespaceftxui.html#ae09f44b989d381a387329fd0a0935926a59a84258a4cb9025b567ee5139455029',1,'ftxui']]], + ['extend_2',['Extend',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aa3bc026b815790a05493fa56fc4b8d8bd',1,'ftxui']]], + ['extendnumlet_3',['ExtendNumLet',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aadcba983044c9eb2afae2e2eaef5fe818',1,'ftxui']]] +]; diff --git a/search/enumvalues_5.js b/search/enumvalues_5.js new file mode 100644 index 000000000..59c252cd7 --- /dev/null +++ b/search/enumvalues_5.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['flexend_0',['FlexEnd',['../group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2a923a60a08f41dc3052190403fc2a6b25',1,'ftxui::FlexboxConfig::FlexEnd'],['../group__dom.html#a821af961ece5fe13540ad48b54c7a9e7a923a60a08f41dc3052190403fc2a6b25',1,'ftxui::FlexboxConfig::FlexEnd'],['../group__dom.html#a1f99410fd0fc632a5bc2497b6a447420a923a60a08f41dc3052190403fc2a6b25',1,'ftxui::FlexboxConfig::FlexEnd']]], + ['flexstart_1',['FlexStart',['../group__dom.html#ac6e5ab18dcac465ee2ac9a0d8b4a82d2a8d5898e4f1bd5527306b1f62fa4fd952',1,'ftxui::FlexboxConfig::FlexStart'],['../group__dom.html#a821af961ece5fe13540ad48b54c7a9e7a8d5898e4f1bd5527306b1f62fa4fd952',1,'ftxui::FlexboxConfig::FlexStart'],['../group__dom.html#a1f99410fd0fc632a5bc2497b6a447420a8d5898e4f1bd5527306b1f62fa4fd952',1,'ftxui::FlexboxConfig::FlexStart']]], + ['format_2',['Format',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aa520d0db389f362bf79ef56ca0af3dcab',1,'ftxui']]] +]; diff --git a/search/enumvalues_6.js b/search/enumvalues_6.js new file mode 100644 index 000000000..5e3b9afb7 --- /dev/null +++ b/search/enumvalues_6.js @@ -0,0 +1,47 @@ +var searchData= +[ + ['gold1_0',['Gold1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf02f1d575ceca96dc56df1295a73c007',1,'ftxui::Color']]], + ['gold3_1',['Gold3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa96bebc8d90d9444dd8fe563037cc2be2',1,'ftxui::Color']]], + ['gold3bis_2',['Gold3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa7e5b2921c53d39581597da20ce2f338',1,'ftxui::Color']]], + ['graydark_3',['GrayDark',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802fade3b52f7f38e412815092547cd6e8be7',1,'ftxui::Color']]], + ['graylight_4',['GrayLight',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802fadebf1805c024a5504872f795f83a6835',1,'ftxui::Color']]], + ['greater_5fthan_5',['GREATER_THAN',['../namespaceftxui.html#ae09f44b989d381a387329fd0a0935926a5fae95457121bd697edd588d1b64cc7c',1,'ftxui']]], + ['green_6',['Green',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802fad0784a3f969fe736e8b271a5a161d106',1,'ftxui::Color']]], + ['green1_7',['Green1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa8db72e307df54b6fd021fd0eff7d5a5f',1,'ftxui::Color']]], + ['green3_8',['Green3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa061b2388532ed2cf150f5ef83646ae2',1,'ftxui::Color']]], + ['green3bis_9',['Green3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9b41b1aeadc19f83c8292978c1e40af1',1,'ftxui::Color']]], + ['green4_10',['Green4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa36b7f9cbbb6e3d6d5e9df9abcbf348c3',1,'ftxui::Color']]], + ['greenlight_11',['GreenLight',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802fa9827485e548095e18c65045bc8058ce7',1,'ftxui::Color']]], + ['greenyellow_12',['GreenYellow',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfacd28fdc2094a8c7b0d90e51b38b85533',1,'ftxui::Color']]], + ['grey0_13',['Grey0',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2c49667d6b3e650b346c88d7e3fd5590',1,'ftxui::Color']]], + ['grey100_14',['Grey100',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa6cbc92ab0733f3e33cf31563dc865c4',1,'ftxui::Color']]], + ['grey11_15',['Grey11',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfac449ae3543129be859f6e1f2ea29c8be',1,'ftxui::Color']]], + ['grey15_16',['Grey15',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa461a25896feac74f19be7117ae19fefe',1,'ftxui::Color']]], + ['grey19_17',['Grey19',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0250546ff32c86258542b95876090e28',1,'ftxui::Color']]], + ['grey23_18',['Grey23',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfad715d2046e5e2d3b6bb6e2127834c485',1,'ftxui::Color']]], + ['grey27_19',['Grey27',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9306e0c6a01240c9fdfab25f3eaa0634',1,'ftxui::Color']]], + ['grey3_20',['Grey3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa81c7178d2e73d4fd43861817b9b32c9d',1,'ftxui::Color']]], + ['grey30_21',['Grey30',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa2991b68c782e1ce0b7e701e2a8a8298',1,'ftxui::Color']]], + ['grey35_22',['Grey35',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa94bb0f2f713f3ab31a7bfd224fe33e7',1,'ftxui::Color']]], + ['grey37_23',['Grey37',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa67645d98e45108256aac9234935510e3',1,'ftxui::Color']]], + ['grey39_24',['Grey39',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfae50ed802592da7fedcbd76ca96341d89',1,'ftxui::Color']]], + ['grey42_25',['Grey42',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa1cb673228bc4530517e8813bec443e7d',1,'ftxui::Color']]], + ['grey46_26',['Grey46',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7310f159106d0f63cca0ddf0c1962ff7',1,'ftxui::Color']]], + ['grey50_27',['Grey50',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa1228fc714bdb452c1efc4b9754751de7',1,'ftxui::Color']]], + ['grey53_28',['Grey53',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7a56c10be7ecd80795860dcdc6eff354',1,'ftxui::Color']]], + ['grey54_29',['Grey54',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa660a7e64726c75510f4e1cd1f63ccb09',1,'ftxui::Color']]], + ['grey58_30',['Grey58',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa3aaa86564267b4c90a2d6bb966c35f90',1,'ftxui::Color']]], + ['grey62_31',['Grey62',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa64ccec5866654552e080a406314c2b0c',1,'ftxui::Color']]], + ['grey63_32',['Grey63',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa084969e9df558ecd204bcec54bc9b03',1,'ftxui::Color']]], + ['grey66_33',['Grey66',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa1cccb7d918d79a0240c135479d58b2ec',1,'ftxui::Color']]], + ['grey69_34',['Grey69',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2ddd20c7af3e7519c138e5dfd06f188c',1,'ftxui::Color']]], + ['grey7_35',['Grey7',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9918508956b5ace54699264567757916',1,'ftxui::Color']]], + ['grey70_36',['Grey70',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfae828b663bd8be2f7efd8b2f343a06444',1,'ftxui::Color']]], + ['grey74_37',['Grey74',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7a54ca8cbf5ee4d7af93f4d08d12c9e3',1,'ftxui::Color']]], + ['grey78_38',['Grey78',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa310ea068000acabef43ec4a4b65c3121',1,'ftxui::Color']]], + ['grey82_39',['Grey82',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfab890ade13f8f5bff23c313dd9035f7f6',1,'ftxui::Color']]], + ['grey84_40',['Grey84',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6539b5d08bbd9bd011bd67aea17cd04f',1,'ftxui::Color']]], + ['grey85_41',['Grey85',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa812849e32b590f8a114804f6b8dde0e8',1,'ftxui::Color']]], + ['grey89_42',['Grey89',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa3b4692eb62f7c5065c28134769615e0',1,'ftxui::Color']]], + ['grey93_43',['Grey93',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa14181b363496871a7c2f91555a6d8a68',1,'ftxui::Color']]] +]; diff --git a/search/enumvalues_7.js b/search/enumvalues_7.js new file mode 100644 index 000000000..ed733653a --- /dev/null +++ b/search/enumvalues_7.js @@ -0,0 +1,13 @@ +var searchData= +[ + ['heavy_0',['HEAVY',['../group__dom.html#ggafe3103dd0b8240c5443892484ef5af9ca34cd68a92c52759ed9b545969a11c2da',1,'ftxui']]], + ['hebrew_5fletter_1',['Hebrew_Letter',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aa3b076a28de949c89c8443aa0cd42ef17',1,'ftxui']]], + ['height_2',['HEIGHT',['../namespaceftxui.html#a04711c04f28aabfa0e5928a35baaec53a38b9241136017b93ea2755a49cf0a000',1,'ftxui']]], + ['hidden_3',['Hidden',['../structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37cacf46e529658ebc6532c204f3246929f4',1,'ftxui::Screen::Cursor']]], + ['honeydew2_4',['Honeydew2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfacfd861941ef13f197407b7d02deaf617',1,'ftxui::Color']]], + ['hotpink_5',['HotPink',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfad886c67902578a7336b821b1cb279c4e',1,'ftxui::Color']]], + ['hotpink2_6',['HotPink2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa1b701a7828d1930b59b76d091913e7d1',1,'ftxui::Color']]], + ['hotpink3_7',['HotPink3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa5b9fcd5ea12531a4fb1273743063f49f',1,'ftxui::Color']]], + ['hotpink3bis_8',['HotPink3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa073af5071fd22b51b77f43766b86d6a5',1,'ftxui::Color']]], + ['hotpinkbis_9',['HotPinkBis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfac178a78c367fd250556adaa1b9ad4730',1,'ftxui::Color']]] +]; diff --git a/search/enumvalues_8.js b/search/enumvalues_8.js new file mode 100644 index 000000000..edbbc9993 --- /dev/null +++ b/search/enumvalues_8.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['indianred_0',['IndianRed',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaddee00c86a353e58b10fb84a0b52481c',1,'ftxui::Color']]], + ['indianred1_1',['IndianRed1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa46aed3d2538a5e3a7d6ae0f6b116a61a',1,'ftxui::Color']]], + ['indianred1bis_2',['IndianRed1Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa4a04ff1096e80fe3d85a78e2ab155873',1,'ftxui::Color']]], + ['indianredbis_3',['IndianRedBis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa8bc829f77e4ff418dcf2efa85a87e329',1,'ftxui::Color']]] +]; diff --git a/search/enumvalues_9.js b/search/enumvalues_9.js new file mode 100644 index 000000000..4e25be21b --- /dev/null +++ b/search/enumvalues_9.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['katakana_0',['Katakana',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aaedb097c9a1cb7aed483367f825211f75',1,'ftxui']]], + ['khaki1_1',['Khaki1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa1ee17e1e2f41c0175bd6202e1c345a82',1,'ftxui::Color']]], + ['khaki3_2',['Khaki3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa3d0d766baf12a67f81a152cabf151f6a',1,'ftxui::Color']]] +]; diff --git a/search/enumvalues_a.js b/search/enumvalues_a.js new file mode 100644 index 000000000..5a068a412 --- /dev/null +++ b/search/enumvalues_a.js @@ -0,0 +1,33 @@ +var searchData= +[ + ['left_0',['Left',['../group__component.html#a03bfec859eac87be20f8952c1eb89de0a9d4d8b0b72fc2659da772d761a3c5ecb',1,'ftxui::Mouse::Left'],['../group__dom.html#gga224b9163917ac32fc95a60d8c1eec3aaa945d5e233cf7d6240f6b783b36a374ff',1,'ftxui::Left']]], + ['less_5fthan_1',['LESS_THAN',['../namespaceftxui.html#ae09f44b989d381a387329fd0a0935926a41b05932cd237b2b133fff1ade85bed5',1,'ftxui']]], + ['lf_2',['LF',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aa618441d41cce47dbcfd9bed6e5ff64e6',1,'ftxui']]], + ['light_3',['LIGHT',['../group__dom.html#ggafe3103dd0b8240c5443892484ef5af9caf917d6c11c85b4ac32e30d1cc9da25eb',1,'ftxui']]], + ['lightcoral_4',['LightCoral',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa1b3ec93b81f5cfafd6fd2328904ced8',1,'ftxui::Color']]], + ['lightcyan1bis_5',['LightCyan1Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfac98b5a34ad5c17b3544e5c29521adb6a',1,'ftxui::Color']]], + ['lightcyan3_6',['LightCyan3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6d6da936c52e5dadcd790ecb07dcbb1a',1,'ftxui::Color']]], + ['lightgoldenrod1_7',['LightGoldenrod1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa25d536c972c837da1a4698982d12df00',1,'ftxui::Color']]], + ['lightgoldenrod2_8',['LightGoldenrod2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa03fd8d3402a3b6314c737b8d00f65f4b',1,'ftxui::Color']]], + ['lightgoldenrod2bis_9',['LightGoldenrod2Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfabcd883ae7f03e4115b274fba499ce91a',1,'ftxui::Color']]], + ['lightgoldenrod2ter_10',['LightGoldenrod2Ter',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa96e9b3fdf30a2f143cb4bfd844742d71',1,'ftxui::Color']]], + ['lightgoldenrod3_11',['LightGoldenrod3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa32e50d1fe92fabe310b25b9400c25cd7',1,'ftxui::Color']]], + ['lightgreen_12',['LightGreen',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6f3bae902f4a1a3b69152ad13382ab18',1,'ftxui::Color']]], + ['lightgreenbis_13',['LightGreenBis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa33510b83ef8df69f709f38f77e375193',1,'ftxui::Color']]], + ['lightpink1_14',['LightPink1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa07f3153f6b04f8aeb0925d789d79660c',1,'ftxui::Color']]], + ['lightpink3_15',['LightPink3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa253e182f6f26ad7cfae773feb6493c57',1,'ftxui::Color']]], + ['lightpink4_16',['LightPink4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0956f6a62142bbfdf7915d1d9abacb81',1,'ftxui::Color']]], + ['lightsalmon1_17',['LightSalmon1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa523f5d7969774dd37e38382a9d05e3a4',1,'ftxui::Color']]], + ['lightsalmon3_18',['LightSalmon3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9b742f7ba68078b409a6fc2bf76de5c4',1,'ftxui::Color']]], + ['lightsalmon3bis_19',['LightSalmon3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfacb0ea3d16e515f91b1071099413a36c7',1,'ftxui::Color']]], + ['lightseagreen_20',['LightSeaGreen',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6ff417c700a8e53aeb7fe424e89a1cbd',1,'ftxui::Color']]], + ['lightskyblue1_21',['LightSkyBlue1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa2290ccd3da3d1ea3e508923148ae824',1,'ftxui::Color']]], + ['lightskyblue3_22',['LightSkyBlue3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa267e864d226cfe79c1a1d3e78fdd7eb5',1,'ftxui::Color']]], + ['lightskyblue3bis_23',['LightSkyBlue3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa3a8990dd2aee1e219cc7222528ee8e0c',1,'ftxui::Color']]], + ['lightslateblue_24',['LightSlateBlue',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfab7c34cf2bc4382faf2477db06ce68875',1,'ftxui::Color']]], + ['lightslategrey_25',['LightSlateGrey',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0789c7e5fa07674a45db810280aac1bb',1,'ftxui::Color']]], + ['lightsteelblue_26',['LightSteelBlue',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfadf56a107dda30539c38643b744c312bb',1,'ftxui::Color']]], + ['lightsteelblue1_27',['LightSteelBlue1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7daff90c932ad36e146923fced98cb4d',1,'ftxui::Color']]], + ['lightsteelblue3_28',['LightSteelBlue3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf66424457d48a1e9f30467a6b4d9f735',1,'ftxui::Color']]], + ['lightyellow3_29',['LightYellow3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa602cbd76a18ddce2b63afa9dcbba0f8e',1,'ftxui::Color']]] +]; diff --git a/search/enumvalues_b.js b/search/enumvalues_b.js new file mode 100644 index 000000000..d5911821a --- /dev/null +++ b/search/enumvalues_b.js @@ -0,0 +1,32 @@ +var searchData= +[ + ['magenta_0',['Magenta',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802fab5059a620e2c7dc57556b1e275c2f9bc',1,'ftxui::Color']]], + ['magenta1_1',['Magenta1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa314daa7c2027494055655d34677458b1',1,'ftxui::Color']]], + ['magenta2_2',['Magenta2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa0270d909214e1a221e1937b3cf406ba',1,'ftxui::Color']]], + ['magenta2bis_3',['Magenta2Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfabe530bee1037e2b3a133e8dbc5ffa585',1,'ftxui::Color']]], + ['magenta3_4',['Magenta3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfad8a4fa649974fb5c836a14496827fdd5',1,'ftxui::Color']]], + ['magenta3bis_5',['Magenta3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaef7480a93b72c17e8023e9f7c7944b38',1,'ftxui::Color']]], + ['magenta3ter_6',['Magenta3Ter',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfac6ab7a76048a843b6eb86c062c216cab',1,'ftxui::Color']]], + ['magentalight_7',['MagentaLight',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802fa9663f993a3affdf3526fa032cfe5b9f4',1,'ftxui::Color']]], + ['mediumorchid_8',['MediumOrchid',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa9c685ae3aad1eaad70ff070436be85b3',1,'ftxui::Color']]], + ['mediumorchid1_9',['MediumOrchid1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa13a18f95c27e724ea9a1e7286f42c473',1,'ftxui::Color']]], + ['mediumorchid1bis_10',['MediumOrchid1Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa049a7bc19d9cacd4e00232d01f9680e6',1,'ftxui::Color']]], + ['mediumorchid3_11',['MediumOrchid3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa5d8f598938ed69b4f04b843abfadc88b',1,'ftxui::Color']]], + ['mediumpurple_12',['MediumPurple',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa99b482dd24e473ef7ddcbddece67e041',1,'ftxui::Color']]], + ['mediumpurple1_13',['MediumPurple1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaf5552cc28a449506e131c050fef88e89',1,'ftxui::Color']]], + ['mediumpurple2_14',['MediumPurple2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfac3210de935f096669b79a8575e9c4578',1,'ftxui::Color']]], + ['mediumpurple2bis_15',['MediumPurple2Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa50222fd671c2f6a5f81108f8e4b05aa9',1,'ftxui::Color']]], + ['mediumpurple3_16',['MediumPurple3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa6d22ae8ac2c4e98b291f40225a8874e8',1,'ftxui::Color']]], + ['mediumpurple3bis_17',['MediumPurple3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2d0fa96a55bf3d9763b465ecbd72566d',1,'ftxui::Color']]], + ['mediumpurple4_18',['MediumPurple4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfae90010fe78fb7605fc25e5e08f07e596',1,'ftxui::Color']]], + ['mediumspringgreen_19',['MediumSpringGreen',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfae4e73e4c0464a9ded093be857551d290',1,'ftxui::Color']]], + ['mediumturquoise_20',['MediumTurquoise',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7875d2ea24878490b89176952e9db784',1,'ftxui::Color']]], + ['mediumvioletred_21',['MediumVioletRed',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa8ca5789305e4c75d51a3acc1f1b8c0a9',1,'ftxui::Color']]], + ['middle_22',['Middle',['../group__component.html#a03bfec859eac87be20f8952c1eb89de0a673e6efef9aafe98078c5552e99c923c',1,'ftxui::Mouse']]], + ['midletter_23',['MidLetter',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aab681d24011467edf425478fed96fbcde',1,'ftxui']]], + ['midnum_24',['MidNum',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aa876e36e8a85514e9c141b2aa3a7bfb5c',1,'ftxui']]], + ['midnumlet_25',['MidNumLet',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aa4d4a2ec3c1ff2c647ff25b61136aabff',1,'ftxui']]], + ['mistyrose1_26',['MistyRose1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa11d00787c0df60110d76fc3d098b2c1b',1,'ftxui::Color']]], + ['mistyrose3_27',['MistyRose3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfab7afa85f412a5bcede9674099b956a78',1,'ftxui::Color']]], + ['moved_28',['Moved',['../group__component.html#a099c889d2b948b264c7a665b66e3a9b6a9bf35ab1cecfbb50d8f1d708a4921fc6',1,'ftxui::Mouse']]] +]; diff --git a/search/enumvalues_c.js b/search/enumvalues_c.js new file mode 100644 index 000000000..fe8cfc4c0 --- /dev/null +++ b/search/enumvalues_c.js @@ -0,0 +1,10 @@ +var searchData= +[ + ['navajowhite1_0',['NavajoWhite1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa78e7bd911b2b1619237ec497cd3727a7',1,'ftxui::Color']]], + ['navajowhite3_1',['NavajoWhite3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa345621aa87c50e806627e1f4a1e50a2',1,'ftxui::Color']]], + ['navyblue_2',['NavyBlue',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0358bb70d298b289263c397f49820844',1,'ftxui::Color']]], + ['newline_3',['Newline',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aa755fee300780823fcf4df98383331745',1,'ftxui']]], + ['none_4',['None',['../group__component.html#a03bfec859eac87be20f8952c1eb89de0ac9d3e887722f2bc482bcca9d41c512af',1,'ftxui::Mouse']]], + ['nowrap_5',['NoWrap',['../group__dom.html#a6c844a611650cf7e956dbe269a0e72aba93ac740a98eb4cc45b853c780ed16c44',1,'ftxui::FlexboxConfig']]], + ['numeric_6',['Numeric',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aa87322391cc6e8948ce9fd5d6cb84fced',1,'ftxui']]] +]; diff --git a/search/enumvalues_d.js b/search/enumvalues_d.js new file mode 100644 index 000000000..954dcd891 --- /dev/null +++ b/search/enumvalues_d.js @@ -0,0 +1,11 @@ +var searchData= +[ + ['orange1_0',['Orange1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa204b0d328d6009cf3947fee021fd8f9e',1,'ftxui::Color']]], + ['orange3_1',['Orange3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa00cd573911b5b30d18a11a33c6fc522b',1,'ftxui::Color']]], + ['orange4_2',['Orange4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa89cffa8b9f4fee6609397ae4070f9d6d',1,'ftxui::Color']]], + ['orange4bis_3',['Orange4Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfad2e88ff3a0d3feeec0b894602de2bdf8',1,'ftxui::Color']]], + ['orangered1_4',['OrangeRed1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa38540818f938e6576a3444b70118dbae',1,'ftxui::Color']]], + ['orchid_5',['Orchid',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2a4b392d52ff5f8074a7ddded3984e75',1,'ftxui::Color']]], + ['orchid1_6',['Orchid1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa8c9438fb930107e9c02fc9418fe1d24a',1,'ftxui::Color']]], + ['orchid2_7',['Orchid2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfadbf13507a7e98310795b8c59c3ec2f92',1,'ftxui::Color']]] +]; diff --git a/search/enumvalues_e.js b/search/enumvalues_e.js new file mode 100644 index 000000000..85bf7a447 --- /dev/null +++ b/search/enumvalues_e.js @@ -0,0 +1,25 @@ +var searchData= +[ + ['palegreen1_0',['PaleGreen1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa37e5d9f46ab5a7952f9cdf0a3cc8925',1,'ftxui::Color']]], + ['palegreen1bis_1',['PaleGreen1Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa115628c4a676f43dc9a5791c927e7048',1,'ftxui::Color']]], + ['palegreen3_2',['PaleGreen3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa73f2e82908260a1c80e9cdffd7c80b05',1,'ftxui::Color']]], + ['palegreen3bis_3',['PaleGreen3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa05657d514246de9444d35bfd78da177d',1,'ftxui::Color']]], + ['palette1_4',['Palette1',['../group__screen.html#ggab87bacfdad76e61b9412d7124be44c1caf8fee1420fe204b3dafbacf27a545c41',1,'ftxui::Terminal']]], + ['palette16_5',['Palette16',['../group__screen.html#ggab87bacfdad76e61b9412d7124be44c1cae5a76102d821ec8233fee04273c60349',1,'ftxui::Terminal']]], + ['palette256_6',['Palette256',['../group__screen.html#ggab87bacfdad76e61b9412d7124be44c1ca7b88ab2a5c8fe8866c96ea4acb623876',1,'ftxui::Terminal']]], + ['paleturquoise1_7',['PaleTurquoise1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2c1b8b84117604af63923758665c0762',1,'ftxui::Color']]], + ['paleturquoise4_8',['PaleTurquoise4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfafebf48dd9c5efb72a880db1800b70cb4',1,'ftxui::Color']]], + ['palevioletred1_9',['PaleVioletRed1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa7b52566a531a122cc807cd5698659f6f',1,'ftxui::Color']]], + ['pink1_10',['Pink1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfab1b14b4665532f810353fbd89ba7bf69',1,'ftxui::Color']]], + ['pink3_11',['Pink3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa18d97cfab35116e2049378e4410b0563',1,'ftxui::Color']]], + ['plum1_12',['Plum1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa3c254e3ced4cbe2836a246270317ac1',1,'ftxui::Color']]], + ['plum2_13',['Plum2',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa383cc742bb6efae64c17af4b0159f2f1',1,'ftxui::Color']]], + ['plum3_14',['Plum3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfab2b302d3a548112c82dbe295f1cace40',1,'ftxui::Color']]], + ['plum4_15',['Plum4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa69b6a24bf00f2a9278f12241e176106c',1,'ftxui::Color']]], + ['pressed_16',['Pressed',['../group__component.html#a099c889d2b948b264c7a665b66e3a9b6a05f4abb2322aa023aba9570c327aff25',1,'ftxui::Mouse']]], + ['purple_17',['Purple',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0102772e56e7f068bdb57bf2905f7c09',1,'ftxui::Color']]], + ['purple3_18',['Purple3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa3ba6254f6df4ad7c05ee0be4ccd4bce0',1,'ftxui::Color']]], + ['purple4_19',['Purple4',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfacb508ce5a099dbfa4e04cd59530f7f0c',1,'ftxui::Color']]], + ['purple4bis_20',['Purple4Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa1dfe93e583d4f1a3538c40ce29208e64',1,'ftxui::Color']]], + ['purplebis_21',['PurpleBis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfae855e26440338753abef27e7b999ce5b',1,'ftxui::Color']]] +]; diff --git a/search/enumvalues_f.js b/search/enumvalues_f.js new file mode 100644 index 000000000..00049d44d --- /dev/null +++ b/search/enumvalues_f.js @@ -0,0 +1,16 @@ +var searchData= +[ + ['red_0',['Red',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802fad3163c1fcda01965b692ec2c3122b743',1,'ftxui::Color']]], + ['red1_1',['Red1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa62acd44726f02a17ba2a17c1cf253639',1,'ftxui::Color']]], + ['red3_2',['Red3',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa37bd25cf1e1fe1eeb8e4840dbc863dac',1,'ftxui::Color']]], + ['red3bis_3',['Red3Bis',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa2925c3081d309e0d11612a0dcd564379',1,'ftxui::Color']]], + ['redlight_4',['RedLight',['../group__screen.html#ae2b6d9670960e89c66d7b76167a0802fa0a04dda6f997cd48c0ca74203c501d27',1,'ftxui::Color']]], + ['regional_5findicator_5',['Regional_Indicator',['../namespaceftxui.html#a5a8ec19f52346e9aad9dbab9108b968aa7f219844b91c2bb3bdb5fb7ffbdfca72',1,'ftxui']]], + ['released_6',['Released',['../group__component.html#a099c889d2b948b264c7a665b66e3a9b6ad9417ac74f0134b9577d1d85cf422c25',1,'ftxui::Mouse']]], + ['right_7',['Right',['../group__component.html#a03bfec859eac87be20f8952c1eb89de0ad48f7af8c070184f3774c8e85854eb66',1,'ftxui::Mouse::Right'],['../group__dom.html#gga224b9163917ac32fc95a60d8c1eec3aaa92b09c7c48c520c3c55e497875da437c',1,'ftxui::Right']]], + ['rosybrown_8',['RosyBrown',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfaa5104c5c0a54bc5ac1dc83e20c75dbea',1,'ftxui::Color']]], + ['rounded_9',['ROUNDED',['../group__dom.html#ggafe3103dd0b8240c5443892484ef5af9ca655074b92b285adff7d18a45748bf493',1,'ftxui']]], + ['row_10',['Row',['../group__dom.html#a224b9163917ac32fc95a60d8c1eec3aaaa70367aa7cb74e510f4f9413ccf059d3',1,'ftxui::FlexboxConfig']]], + ['rowinversed_11',['RowInversed',['../group__dom.html#a224b9163917ac32fc95a60d8c1eec3aaabba4d6f3a9cec9c96600e3e0d17b9f6a',1,'ftxui::FlexboxConfig']]], + ['royalblue1_12',['RoyalBlue1',['../group__screen.html#abd07c48f62cc507fafa2486a43130fcfa0dbe4adc6031521d77fc91e09f8d3fbf',1,'ftxui::Color']]] +]; diff --git a/search/files_0.js b/search/files_0.js new file mode 100644 index 000000000..667cd0edc --- /dev/null +++ b/search/files_0.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['animation_2ecpp_0',['animation.cpp',['../animation_8cpp.html',1,'']]], + ['animation_2ecppm_1',['animation.cppm',['../animation_8cppm.html',1,'']]], + ['animation_2ehpp_2',['animation.hpp',['../animation_8hpp.html',1,'']]], + ['automerge_2ecpp_3',['automerge.cpp',['../automerge_8cpp.html',1,'']]], + ['autoreset_2ecppm_4',['autoreset.cppm',['../autoreset_8cppm.html',1,'']]], + ['autoreset_2ehpp_5',['autoreset.hpp',['../autoreset_8hpp.html',1,'']]] +]; diff --git a/search/files_1.js b/search/files_1.js new file mode 100644 index 000000000..1a6d3e155 --- /dev/null +++ b/search/files_1.js @@ -0,0 +1,15 @@ +var searchData= +[ + ['blink_2ecpp_0',['blink.cpp',['../blink_8cpp.html',1,'']]], + ['bold_2ecpp_1',['bold.cpp',['../bold_8cpp.html',1,'']]], + ['border_5fcolored_2ecpp_2',['border_colored.cpp',['../border__colored_8cpp.html',1,'']]], + ['border_5fstyle_2ecpp_3',['border_style.cpp',['../border__style_8cpp.html',1,'']]], + ['box_2ecpp_4',['box.cpp',['../box_8cpp.html',1,'']]], + ['box_2ecppm_5',['box.cppm',['../box_8cppm.html',1,'']]], + ['box_2ehpp_6',['box.hpp',['../box_8hpp.html',1,'']]], + ['box_5fhelper_2ecpp_7',['box_helper.cpp',['../box__helper_8cpp.html',1,'']]], + ['box_5fhelper_2ehpp_8',['box_helper.hpp',['../box__helper_8hpp.html',1,'']]], + ['button_5fanimated_2ecpp_9',['button_animated.cpp',['../button__animated_8cpp.html',1,'']]], + ['button_5fin_5fframe_2ecpp_10',['button_in_frame.cpp',['../button__in__frame_8cpp.html',1,'']]], + ['button_5fstyle_2ecpp_11',['button_style.cpp',['../button__style_8cpp.html',1,'']]] +]; diff --git a/search/files_10.js b/search/files_10.js new file mode 100644 index 000000000..7941bfdb0 --- /dev/null +++ b/search/files_10.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['underlined_2ecpp_0',['underlined.cpp',['../underlined_8cpp.html',1,'']]], + ['underlined_5fdouble_2ecpp_1',['underlined_double.cpp',['../underlined__double_8cpp.html',1,'']]], + ['util_2ecppm_2',['util.cppm',['../util_8cppm.html',1,'']]], + ['util_2ehpp_3',['util.hpp',['../util_8hpp.html',1,'']]] +]; diff --git a/search/files_11.js b/search/files_11.js new file mode 100644 index 000000000..718cdf5f1 --- /dev/null +++ b/search/files_11.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['vbox_2ecpp_0',['vbox.cpp',['../vbox_8cpp.html',1,'']]], + ['vbox_5fhbox_2ecpp_1',['vbox_hbox.cpp',['../vbox__hbox_8cpp.html',1,'']]], + ['vflow_2ecpp_2',['vflow.cpp',['../vflow_8cpp.html',1,'']]] +]; diff --git a/search/files_12.js b/search/files_12.js new file mode 100644 index 000000000..65bfe67d5 --- /dev/null +++ b/search/files_12.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['warn_5fwindows_5fmacro_2ehpp_0',['warn_windows_macro.hpp',['../warn__windows__macro_8hpp.html',1,'']]], + ['with_5frestored_5fio_2ecpp_1',['with_restored_io.cpp',['../with__restored__io_8cpp.html',1,'']]] +]; diff --git a/search/files_2.js b/search/files_2.js new file mode 100644 index 000000000..15d7993b9 --- /dev/null +++ b/search/files_2.js @@ -0,0 +1,38 @@ +var searchData= +[ + ['canvas_2ecppm_0',['canvas.cppm',['../canvas_8cppm.html',1,'']]], + ['canvas_2ehpp_1',['canvas.hpp',['../canvas_8hpp.html',1,'']]], + ['canvas_5fanimated_2ecpp_2',['canvas_animated.cpp',['../canvas__animated_8cpp.html',1,'']]], + ['captured_5fmouse_2ecppm_3',['captured_mouse.cppm',['../captured__mouse_8cppm.html',1,'']]], + ['captured_5fmouse_2ehpp_4',['captured_mouse.hpp',['../captured__mouse_8hpp.html',1,'']]], + ['catch_5fevent_2ecpp_5',['catch_event.cpp',['../catch__event_8cpp.html',1,'']]], + ['checkbox_5fin_5fframe_2ecpp_6',['checkbox_in_frame.cpp',['../checkbox__in__frame_8cpp.html',1,'']]], + ['clear_5funder_2ecpp_7',['clear_under.cpp',['../clear__under_8cpp.html',1,'']]], + ['color_2ecppm_8',['color.cppm',['../color_8cppm.html',1,'']]], + ['color_2ehpp_9',['color.hpp',['../color_8hpp.html',1,'']]], + ['color_5fgallery_2ecpp_10',['color_gallery.cpp',['../color__gallery_8cpp.html',1,'']]], + ['color_5finfo_2ecpp_11',['color_info.cpp',['../color__info_8cpp.html',1,'']]], + ['color_5finfo_2ecppm_12',['color_info.cppm',['../color__info_8cppm.html',1,'']]], + ['color_5finfo_2ehpp_13',['color_info.hpp',['../color__info_8hpp.html',1,'']]], + ['color_5finfo_5fpalette256_2ecpp_14',['color_info_palette256.cpp',['../color__info__palette256_8cpp.html',1,'']]], + ['color_5finfo_5fsorted_5f2d_2eipp_15',['color_info_sorted_2d.ipp',['../color__info__sorted__2d_8ipp.html',1,'']]], + ['color_5ftruecolor_5fhsv_2ecpp_16',['color_truecolor_HSV.cpp',['../color__truecolor__HSV_8cpp.html',1,'']]], + ['color_5ftruecolor_5frgb_2ecpp_17',['color_truecolor_RGB.cpp',['../color__truecolor__RGB_8cpp.html',1,'']]], + ['component_2ecpp_18',['component.cpp',['../component_8cpp.html',1,'']]], + ['component_2ecppm_19',['component.cppm',['../component_8cppm.html',1,'']]], + ['component_2ehpp_20',['component.hpp',['../component_8hpp.html',1,'']]], + ['component_2fcomponent_2ecppm_21',['component.cppm',['../component_2component_8cppm.html',1,'']]], + ['component_2futil_2ecpp_22',['util.cpp',['../component_2util_8cpp.html',1,'']]], + ['component_5fbase_2ecppm_23',['component_base.cppm',['../component__base_8cppm.html',1,'']]], + ['component_5fbase_2ehpp_24',['component_base.hpp',['../component__base_8hpp.html',1,'']]], + ['component_5fexamples_2emd_25',['component_examples.md',['../component__examples_8md.html',1,'']]], + ['component_5ffuzzer_2ecpp_26',['component_fuzzer.cpp',['../component__fuzzer_8cpp.html',1,'']]], + ['component_5foptions_2ecpp_27',['component_options.cpp',['../component__options_8cpp.html',1,'']]], + ['component_5foptions_2ecppm_28',['component_options.cppm',['../component__options_8cppm.html',1,'']]], + ['component_5foptions_2ehpp_29',['component_options.hpp',['../component__options_8hpp.html',1,'']]], + ['composite_5fdecorator_2ecpp_30',['composite_decorator.cpp',['../composite__decorator_8cpp.html',1,'']]], + ['composition_2ecpp_31',['composition.cpp',['../composition_8cpp.html',1,'']]], + ['container_2ecpp_32',['container.cpp',['../container_8cpp.html',1,'']]], + ['cpp20_2dmodules_2emd_33',['cpp20-modules.md',['../cpp20-modules_8md.html',1,'']]], + ['custom_5floop_2ecpp_34',['custom_loop.cpp',['../custom__loop_8cpp.html',1,'']]] +]; diff --git a/search/files_3.js b/search/files_3.js new file mode 100644 index 000000000..7ab3efdef --- /dev/null +++ b/search/files_3.js @@ -0,0 +1,13 @@ +var searchData= +[ + ['dim_2ecpp_0',['dim.cpp',['../dim_8cpp.html',1,'']]], + ['direction_2ecppm_1',['direction.cppm',['../direction_8cppm.html',1,'']]], + ['direction_2ehpp_2',['direction.hpp',['../direction_8hpp.html',1,'']]], + ['dom_2ecppm_3',['dom.cppm',['../dom_8cppm.html',1,'']]], + ['dom_2fcolor_2ecpp_4',['color.cpp',['../dom_2color_8cpp.html',1,'']]], + ['dom_2fdeprecated_2ecppm_5',['deprecated.cppm',['../dom_2deprecated_8cppm.html',1,'']]], + ['dom_2fdeprecated_2ehpp_6',['deprecated.hpp',['../dom_2deprecated_8hpp.html',1,'']]], + ['dom_2futil_2ecpp_7',['util.cpp',['../dom_2util_8cpp.html',1,'']]], + ['dom_5fexamples_2emd_8',['dom_examples.md',['../dom__examples_8md.html',1,'']]], + ['dropdown_5fcustom_2ecpp_9',['dropdown_custom.cpp',['../dropdown__custom_8cpp.html',1,'']]] +]; diff --git a/search/files_4.js b/search/files_4.js new file mode 100644 index 000000000..548ca9c21 --- /dev/null +++ b/search/files_4.js @@ -0,0 +1,34 @@ +var searchData= +[ + ['elements_2ecppm_0',['elements.cppm',['../elements_8cppm.html',1,'']]], + ['elements_2ehpp_1',['elements.hpp',['../elements_8hpp.html',1,'']]], + ['event_2ecpp_2',['event.cpp',['../event_8cpp.html',1,'']]], + ['event_2ecppm_3',['event.cppm',['../event_8cppm.html',1,'']]], + ['event_2ehpp_4',['event.hpp',['../event_8hpp.html',1,'']]], + ['examples_2fcomponent_2fbutton_2ecpp_5',['button.cpp',['../examples_2component_2button_8cpp.html',1,'']]], + ['examples_2fcomponent_2fcheckbox_2ecpp_6',['checkbox.cpp',['../examples_2component_2checkbox_8cpp.html',1,'']]], + ['examples_2fcomponent_2fcollapsible_2ecpp_7',['collapsible.cpp',['../examples_2component_2collapsible_8cpp.html',1,'']]], + ['examples_2fcomponent_2fdropdown_2ecpp_8',['dropdown.cpp',['../examples_2component_2dropdown_8cpp.html',1,'']]], + ['examples_2fcomponent_2ffocus_2ecpp_9',['focus.cpp',['../examples_2component_2focus_8cpp.html',1,'']]], + ['examples_2fcomponent_2finput_2ecpp_10',['input.cpp',['../examples_2component_2input_8cpp.html',1,'']]], + ['examples_2fcomponent_2fmaybe_2ecpp_11',['maybe.cpp',['../examples_2component_2maybe_8cpp.html',1,'']]], + ['examples_2fcomponent_2fmenu_2ecpp_12',['menu.cpp',['../examples_2component_2menu_8cpp.html',1,'']]], + ['examples_2fcomponent_2fradiobox_2ecpp_13',['radiobox.cpp',['../examples_2component_2radiobox_8cpp.html',1,'']]], + ['examples_2fcomponent_2frenderer_2ecpp_14',['renderer.cpp',['../examples_2component_2renderer_8cpp.html',1,'']]], + ['examples_2fcomponent_2fresizable_5fsplit_2ecpp_15',['resizable_split.cpp',['../examples_2component_2resizable__split_8cpp.html',1,'']]], + ['examples_2fcomponent_2fselection_2ecpp_16',['selection.cpp',['../examples_2component_2selection_8cpp.html',1,'']]], + ['examples_2fcomponent_2fslider_2ecpp_17',['slider.cpp',['../examples_2component_2slider_8cpp.html',1,'']]], + ['examples_2fcomponent_2fwindow_2ecpp_18',['window.cpp',['../examples_2component_2window_8cpp.html',1,'']]], + ['examples_2fdom_2fborder_2ecpp_19',['border.cpp',['../examples_2dom_2border_8cpp.html',1,'']]], + ['examples_2fdom_2fcanvas_2ecpp_20',['canvas.cpp',['../examples_2dom_2canvas_8cpp.html',1,'']]], + ['examples_2fdom_2fdbox_2ecpp_21',['dbox.cpp',['../examples_2dom_2dbox_8cpp.html',1,'']]], + ['examples_2fdom_2fgauge_2ecpp_22',['gauge.cpp',['../examples_2dom_2gauge_8cpp.html',1,'']]], + ['examples_2fdom_2fgraph_2ecpp_23',['graph.cpp',['../examples_2dom_2graph_8cpp.html',1,'']]], + ['examples_2fdom_2fgridbox_2ecpp_24',['gridbox.cpp',['../examples_2dom_2gridbox_8cpp.html',1,'']]], + ['examples_2fdom_2flinear_5fgradient_2ecpp_25',['linear_gradient.cpp',['../examples_2dom_2linear__gradient_8cpp.html',1,'']]], + ['examples_2fdom_2fparagraph_2ecpp_26',['paragraph.cpp',['../examples_2dom_2paragraph_8cpp.html',1,'']]], + ['examples_2fdom_2fseparator_2ecpp_27',['separator.cpp',['../examples_2dom_2separator_8cpp.html',1,'']]], + ['examples_2fdom_2fsize_2ecpp_28',['size.cpp',['../examples_2dom_2size_8cpp.html',1,'']]], + ['examples_2fdom_2fspinner_2ecpp_29',['spinner.cpp',['../examples_2dom_2spinner_8cpp.html',1,'']]], + ['examples_2fdom_2ftable_2ecpp_30',['table.cpp',['../examples_2dom_2table_8cpp.html',1,'']]] +]; diff --git a/search/files_5.js b/search/files_5.js new file mode 100644 index 000000000..91064c685 --- /dev/null +++ b/search/files_5.js @@ -0,0 +1,14 @@ +var searchData= +[ + ['flex_2ecpp_0',['flex.cpp',['../flex_8cpp.html',1,'']]], + ['flexbox_2ecpp_1',['flexbox.cpp',['../flexbox_8cpp.html',1,'']]], + ['flexbox_5fconfig_2ecpp_2',['flexbox_config.cpp',['../flexbox__config_8cpp.html',1,'']]], + ['flexbox_5fconfig_2ecppm_3',['flexbox_config.cppm',['../flexbox__config_8cppm.html',1,'']]], + ['flexbox_5fconfig_2ehpp_4',['flexbox_config.hpp',['../flexbox__config_8hpp.html',1,'']]], + ['flexbox_5fgallery_2ecpp_5',['flexbox_gallery.cpp',['../flexbox__gallery_8cpp.html',1,'']]], + ['flexbox_5fhelper_2ecpp_6',['flexbox_helper.cpp',['../flexbox__helper_8cpp.html',1,'']]], + ['flexbox_5fhelper_2ehpp_7',['flexbox_helper.hpp',['../flexbox__helper_8hpp.html',1,'']]], + ['focus_5fcursor_2ecpp_8',['focus_cursor.cpp',['../focus__cursor_8cpp.html',1,'']]], + ['frame_2ecpp_9',['frame.cpp',['../frame_8cpp.html',1,'']]], + ['ftxui_2ecppm_10',['ftxui.cppm',['../ftxui_8cppm.html',1,'']]] +]; diff --git a/search/files_6.js b/search/files_6.js new file mode 100644 index 000000000..bace776d0 --- /dev/null +++ b/search/files_6.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['gallery_2ecpp_0',['gallery.cpp',['../gallery_8cpp.html',1,'']]], + ['gauge_5fdirection_2ecpp_1',['gauge_direction.cpp',['../gauge__direction_8cpp.html',1,'']]], + ['getting_2dstarted_2emd_2',['getting-started.md',['../getting-started_8md.html',1,'']]] +]; diff --git a/search/files_7.js b/search/files_7.js new file mode 100644 index 000000000..6ec77cb6a --- /dev/null +++ b/search/files_7.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['hbox_2ecpp_0',['hbox.cpp',['../hbox_8cpp.html',1,'']]], + ['hflow_2ecpp_1',['hflow.cpp',['../hflow_8cpp.html',1,'']]], + ['homescreen_2ecpp_2',['homescreen.cpp',['../homescreen_8cpp.html',1,'']]], + ['hoverable_2ecpp_3',['hoverable.cpp',['../hoverable_8cpp.html',1,'']]], + ['html_5flike_2ecpp_4',['html_like.cpp',['../html__like_8cpp.html',1,'']]], + ['hyperlink_2ecpp_5',['hyperlink.cpp',['../hyperlink_8cpp.html',1,'']]] +]; diff --git a/search/files_8.js b/search/files_8.js new file mode 100644 index 000000000..f6012983d --- /dev/null +++ b/search/files_8.js @@ -0,0 +1,22 @@ +var searchData= +[ + ['image_2ecpp_0',['image.cpp',['../image_8cpp.html',1,'']]], + ['image_2ecppm_1',['image.cppm',['../image_8cppm.html',1,'']]], + ['image_2ehpp_2',['image.hpp',['../image_8hpp.html',1,'']]], + ['input_5fin_5fframe_2ecpp_3',['input_in_frame.cpp',['../input__in__frame_8cpp.html',1,'']]], + ['input_5fstyle_2ecpp_4',['input_style.cpp',['../input__style_8cpp.html',1,'']]], + ['installation_2emd_5',['installation.md',['../installation_8md.html',1,'']]], + ['installation_5farch_2emd_6',['installation_arch.md',['../installation__arch_8md.html',1,'']]], + ['installation_5fbazel_2emd_7',['installation_bazel.md',['../installation__bazel_8md.html',1,'']]], + ['installation_5fcmake_2emd_8',['installation_cmake.md',['../installation__cmake_8md.html',1,'']]], + ['installation_5fconan_2emd_9',['installation_conan.md',['../installation__conan_8md.html',1,'']]], + ['installation_5fdebian_2emd_10',['installation_debian.md',['../installation__debian_8md.html',1,'']]], + ['installation_5fmanual_2emd_11',['installation_manual.md',['../installation__manual_8md.html',1,'']]], + ['installation_5fnix_2emd_12',['installation_nix.md',['../installation__nix_8md.html',1,'']]], + ['installation_5fopensuse_2emd_13',['installation_opensuse.md',['../installation__opensuse_8md.html',1,'']]], + ['installation_5fvcpkg_2emd_14',['installation_vcpkg.md',['../installation__vcpkg_8md.html',1,'']]], + ['installation_5fxmake_2emd_15',['installation_xmake.md',['../installation__xmake_8md.html',1,'']]], + ['introduction_2emd_16',['introduction.md',['../introduction_8md.html',1,'']]], + ['inverted_2ecpp_17',['inverted.cpp',['../inverted_8cpp.html',1,'']]], + ['italic_2ecpp_18',['italic.cpp',['../italic_8cpp.html',1,'']]] +]; diff --git a/search/files_9.js b/search/files_9.js new file mode 100644 index 000000000..0ba87268a --- /dev/null +++ b/search/files_9.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['linear_5fgradient_2ecppm_0',['linear_gradient.cppm',['../linear__gradient_8cppm.html',1,'']]], + ['linear_5fgradient_2ehpp_1',['linear_gradient.hpp',['../linear__gradient_8hpp.html',1,'']]], + ['linear_5fgradient_5fgallery_2ecpp_2',['linear_gradient_gallery.cpp',['../linear__gradient__gallery_8cpp.html',1,'']]], + ['loop_2ecpp_3',['loop.cpp',['../loop_8cpp.html',1,'']]], + ['loop_2ecppm_4',['loop.cppm',['../loop_8cppm.html',1,'']]], + ['loop_2ehpp_5',['loop.hpp',['../loop_8hpp.html',1,'']]] +]; diff --git a/search/files_a.js b/search/files_a.js new file mode 100644 index 000000000..fec6192e3 --- /dev/null +++ b/search/files_a.js @@ -0,0 +1,20 @@ +var searchData= +[ + ['menu2_2ecpp_0',['menu2.cpp',['../menu2_8cpp.html',1,'']]], + ['menu_5fentries_2ecpp_1',['menu_entries.cpp',['../menu__entries_8cpp.html',1,'']]], + ['menu_5fentries_5fanimated_2ecpp_2',['menu_entries_animated.cpp',['../menu__entries__animated_8cpp.html',1,'']]], + ['menu_5fin_5fframe_2ecpp_3',['menu_in_frame.cpp',['../menu__in__frame_8cpp.html',1,'']]], + ['menu_5fin_5fframe_5fhorizontal_2ecpp_4',['menu_in_frame_horizontal.cpp',['../menu__in__frame__horizontal_8cpp.html',1,'']]], + ['menu_5fmultiple_2ecpp_5',['menu_multiple.cpp',['../menu__multiple_8cpp.html',1,'']]], + ['menu_5fstyle_2ecpp_6',['menu_style.cpp',['../menu__style_8cpp.html',1,'']]], + ['menu_5funderline_5fanimated_5fgallery_2ecpp_7',['menu_underline_animated_gallery.cpp',['../menu__underline__animated__gallery_8cpp.html',1,'']]], + ['modal_2ecpp_8',['modal.cpp',['../modal_8cpp.html',1,'']]], + ['modal_5fdialog_2ecpp_9',['modal_dialog.cpp',['../modal__dialog_8cpp.html',1,'']]], + ['modal_5fdialog_5fcustom_2ecpp_10',['modal_dialog_custom.cpp',['../modal__dialog__custom_8cpp.html',1,'']]], + ['module_2dcomponent_2emd_11',['module-component.md',['../module-component_8md.html',1,'']]], + ['module_2ddom_2emd_12',['module-dom.md',['../module-dom_8md.html',1,'']]], + ['module_2dscreen_2emd_13',['module-screen.md',['../module-screen_8md.html',1,'']]], + ['module_2emd_14',['module.md',['../module_8md.html',1,'']]], + ['mouse_2ecppm_15',['mouse.cppm',['../mouse_8cppm.html',1,'']]], + ['mouse_2ehpp_16',['mouse.hpp',['../mouse_8hpp.html',1,'']]] +]; diff --git a/search/files_b.js b/search/files_b.js new file mode 100644 index 000000000..7cbf0a043 --- /dev/null +++ b/search/files_b.js @@ -0,0 +1,9 @@ +var searchData= +[ + ['nested_5fscreen_2ecpp_0',['nested_screen.cpp',['../nested__screen_8cpp.html',1,'']]], + ['node_2ecpp_1',['node.cpp',['../node_8cpp.html',1,'']]], + ['node_2ecppm_2',['node.cppm',['../node_8cppm.html',1,'']]], + ['node_2ehpp_3',['node.hpp',['../node_8hpp.html',1,'']]], + ['node_5fdecorator_2ecpp_4',['node_decorator.cpp',['../node__decorator_8cpp.html',1,'']]], + ['node_5fdecorator_2ehpp_5',['node_decorator.hpp',['../node__decorator_8hpp.html',1,'']]] +]; diff --git a/search/files_c.js b/search/files_c.js new file mode 100644 index 000000000..1111c9913 --- /dev/null +++ b/search/files_c.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['package_5fmanager_2ecpp_0',['package_manager.cpp',['../package__manager_8cpp.html',1,'']]], + ['pixel_2ecppm_1',['pixel.cppm',['../pixel_8cppm.html',1,'']]], + ['pixel_2ehpp_2',['pixel.hpp',['../pixel_8hpp.html',1,'']]], + ['print_5fkey_5fpress_2ecpp_3',['print_key_press.cpp',['../print__key__press_8cpp.html',1,'']]] +]; diff --git a/search/files_d.js b/search/files_d.js new file mode 100644 index 000000000..0b775c667 --- /dev/null +++ b/search/files_d.js @@ -0,0 +1,11 @@ +var searchData= +[ + ['radiobox_5fin_5fframe_2ecpp_0',['radiobox_in_frame.cpp',['../radiobox__in__frame_8cpp.html',1,'']]], + ['receiver_2ecppm_1',['receiver.cppm',['../receiver_8cppm.html',1,'']]], + ['receiver_2ehpp_2',['receiver.hpp',['../receiver_8hpp.html',1,'']]], + ['ref_2ecppm_3',['ref.cppm',['../ref_8cppm.html',1,'']]], + ['ref_2ehpp_4',['ref.hpp',['../ref_8hpp.html',1,'']]], + ['reflect_2ecpp_5',['reflect.cpp',['../reflect_8cpp.html',1,'']]], + ['requirement_2ecppm_6',['requirement.cppm',['../requirement_8cppm.html',1,'']]], + ['requirement_2ehpp_7',['requirement.hpp',['../requirement_8hpp.html',1,'']]] +]; diff --git a/search/files_e.js b/search/files_e.js new file mode 100644 index 000000000..e72497a16 --- /dev/null +++ b/search/files_e.js @@ -0,0 +1,63 @@ +var searchData= +[ + ['screen_2ecpp_0',['screen.cpp',['../screen_8cpp.html',1,'']]], + ['screen_2ecppm_1',['screen.cppm',['../screen_8cppm.html',1,'']]], + ['screen_2ehpp_2',['screen.hpp',['../screen_8hpp.html',1,'']]], + ['screen_2fcolor_2ecpp_3',['color.cpp',['../screen_2color_8cpp.html',1,'']]], + ['screen_2fdeprecated_2ecppm_4',['deprecated.cppm',['../screen_2deprecated_8cppm.html',1,'']]], + ['screen_2fdeprecated_2ehpp_5',['deprecated.hpp',['../screen_2deprecated_8hpp.html',1,'']]], + ['screen_2fscreen_2ecppm_6',['screen.cppm',['../screen_2screen_8cppm.html',1,'']]], + ['screen_5finteractive_2ecpp_7',['screen_interactive.cpp',['../screen__interactive_8cpp.html',1,'']]], + ['screen_5finteractive_2ecppm_8',['screen_interactive.cppm',['../screen__interactive_8cppm.html',1,'']]], + ['screen_5finteractive_2ehpp_9',['screen_interactive.hpp',['../screen__interactive_8hpp.html',1,'']]], + ['scroll_5findicator_2ecpp_10',['scroll_indicator.cpp',['../scroll__indicator_8cpp.html',1,'']]], + ['scrollbar_2ecpp_11',['scrollbar.cpp',['../scrollbar_8cpp.html',1,'']]], + ['selection_2ecppm_12',['selection.cppm',['../selection_8cppm.html',1,'']]], + ['selection_2ehpp_13',['selection.hpp',['../selection_8hpp.html',1,'']]], + ['selection_5fstyle_2ecpp_14',['selection_style.cpp',['../selection__style_8cpp.html',1,'']]], + ['separator_5fstyle_2ecpp_15',['separator_style.cpp',['../separator__style_8cpp.html',1,'']]], + ['slider_5fdirection_2ecpp_16',['slider_direction.cpp',['../slider__direction_8cpp.html',1,'']]], + ['slider_5frgb_2ecpp_17',['slider_rgb.cpp',['../slider__rgb_8cpp.html',1,'']]], + ['src_2fftxui_2fcomponent_2fbutton_2ecpp_18',['button.cpp',['../src_2ftxui_2component_2button_8cpp.html',1,'']]], + ['src_2fftxui_2fcomponent_2fcheckbox_2ecpp_19',['checkbox.cpp',['../src_2ftxui_2component_2checkbox_8cpp.html',1,'']]], + ['src_2fftxui_2fcomponent_2fcollapsible_2ecpp_20',['collapsible.cpp',['../src_2ftxui_2component_2collapsible_8cpp.html',1,'']]], + ['src_2fftxui_2fcomponent_2fdropdown_2ecpp_21',['dropdown.cpp',['../src_2ftxui_2component_2dropdown_8cpp.html',1,'']]], + ['src_2fftxui_2fcomponent_2finput_2ecpp_22',['input.cpp',['../src_2ftxui_2component_2input_8cpp.html',1,'']]], + ['src_2fftxui_2fcomponent_2fmaybe_2ecpp_23',['maybe.cpp',['../src_2ftxui_2component_2maybe_8cpp.html',1,'']]], + ['src_2fftxui_2fcomponent_2fmenu_2ecpp_24',['menu.cpp',['../src_2ftxui_2component_2menu_8cpp.html',1,'']]], + ['src_2fftxui_2fcomponent_2fradiobox_2ecpp_25',['radiobox.cpp',['../src_2ftxui_2component_2radiobox_8cpp.html',1,'']]], + ['src_2fftxui_2fcomponent_2frenderer_2ecpp_26',['renderer.cpp',['../src_2ftxui_2component_2renderer_8cpp.html',1,'']]], + ['src_2fftxui_2fcomponent_2fresizable_5fsplit_2ecpp_27',['resizable_split.cpp',['../src_2ftxui_2component_2resizable__split_8cpp.html',1,'']]], + ['src_2fftxui_2fcomponent_2fslider_2ecpp_28',['slider.cpp',['../src_2ftxui_2component_2slider_8cpp.html',1,'']]], + ['src_2fftxui_2fcomponent_2fwindow_2ecpp_29',['window.cpp',['../src_2ftxui_2component_2window_8cpp.html',1,'']]], + ['src_2fftxui_2fdom_2fborder_2ecpp_30',['border.cpp',['../src_2ftxui_2dom_2border_8cpp.html',1,'']]], + ['src_2fftxui_2fdom_2fcanvas_2ecpp_31',['canvas.cpp',['../src_2ftxui_2dom_2canvas_8cpp.html',1,'']]], + ['src_2fftxui_2fdom_2fdbox_2ecpp_32',['dbox.cpp',['../src_2ftxui_2dom_2dbox_8cpp.html',1,'']]], + ['src_2fftxui_2fdom_2ffocus_2ecpp_33',['focus.cpp',['../src_2ftxui_2dom_2focus_8cpp.html',1,'']]], + ['src_2fftxui_2fdom_2fgauge_2ecpp_34',['gauge.cpp',['../src_2ftxui_2dom_2gauge_8cpp.html',1,'']]], + ['src_2fftxui_2fdom_2fgraph_2ecpp_35',['graph.cpp',['../src_2ftxui_2dom_2graph_8cpp.html',1,'']]], + ['src_2fftxui_2fdom_2fgridbox_2ecpp_36',['gridbox.cpp',['../src_2ftxui_2dom_2gridbox_8cpp.html',1,'']]], + ['src_2fftxui_2fdom_2flinear_5fgradient_2ecpp_37',['linear_gradient.cpp',['../src_2ftxui_2dom_2linear__gradient_8cpp.html',1,'']]], + ['src_2fftxui_2fdom_2fparagraph_2ecpp_38',['paragraph.cpp',['../src_2ftxui_2dom_2paragraph_8cpp.html',1,'']]], + ['src_2fftxui_2fdom_2fselection_2ecpp_39',['selection.cpp',['../src_2ftxui_2dom_2selection_8cpp.html',1,'']]], + ['src_2fftxui_2fdom_2fseparator_2ecpp_40',['separator.cpp',['../src_2ftxui_2dom_2separator_8cpp.html',1,'']]], + ['src_2fftxui_2fdom_2fsize_2ecpp_41',['size.cpp',['../src_2ftxui_2dom_2size_8cpp.html',1,'']]], + ['src_2fftxui_2fdom_2fspinner_2ecpp_42',['spinner.cpp',['../src_2ftxui_2dom_2spinner_8cpp.html',1,'']]], + ['src_2fftxui_2fdom_2ftable_2ecpp_43',['table.cpp',['../src_2ftxui_2dom_2table_8cpp.html',1,'']]], + ['strikethrough_2ecpp_44',['strikethrough.cpp',['../strikethrough_8cpp.html',1,'']]], + ['string_2ecpp_45',['string.cpp',['../string_8cpp.html',1,'']]], + ['string_2ecppm_46',['string.cppm',['../string_8cppm.html',1,'']]], + ['string_2ehpp_47',['string.hpp',['../string_8hpp.html',1,'']]], + ['string_5finternal_2ehpp_48',['string_internal.hpp',['../string__internal_8hpp.html',1,'']]], + ['style_5fblink_2ecpp_49',['style_blink.cpp',['../style__blink_8cpp.html',1,'']]], + ['style_5fbold_2ecpp_50',['style_bold.cpp',['../style__bold_8cpp.html',1,'']]], + ['style_5fcolor_2ecpp_51',['style_color.cpp',['../style__color_8cpp.html',1,'']]], + ['style_5fdim_2ecpp_52',['style_dim.cpp',['../style__dim_8cpp.html',1,'']]], + ['style_5fgallery_2ecpp_53',['style_gallery.cpp',['../style__gallery_8cpp.html',1,'']]], + ['style_5fhyperlink_2ecpp_54',['style_hyperlink.cpp',['../style__hyperlink_8cpp.html',1,'']]], + ['style_5finverted_2ecpp_55',['style_inverted.cpp',['../style__inverted_8cpp.html',1,'']]], + ['style_5fitalic_2ecpp_56',['style_italic.cpp',['../style__italic_8cpp.html',1,'']]], + ['style_5fstrikethrough_2ecpp_57',['style_strikethrough.cpp',['../style__strikethrough_8cpp.html',1,'']]], + ['style_5funderlined_2ecpp_58',['style_underlined.cpp',['../style__underlined_8cpp.html',1,'']]], + ['style_5funderlined_5fdouble_2ecpp_59',['style_underlined_double.cpp',['../style__underlined__double_8cpp.html',1,'']]] +]; diff --git a/search/files_f.js b/search/files_f.js new file mode 100644 index 000000000..452ac5930 --- /dev/null +++ b/search/files_f.js @@ -0,0 +1,24 @@ +var searchData= +[ + ['tab_5fhorizontal_2ecpp_0',['tab_horizontal.cpp',['../tab__horizontal_8cpp.html',1,'']]], + ['tab_5fvertical_2ecpp_1',['tab_vertical.cpp',['../tab__vertical_8cpp.html',1,'']]], + ['table_2ecppm_2',['table.cppm',['../table_8cppm.html',1,'']]], + ['table_2ehpp_3',['table.hpp',['../table_8hpp.html',1,'']]], + ['task_2ecpp_4',['task.cpp',['../task_8cpp.html',1,'']]], + ['task_2ecppm_5',['task.cppm',['../task_8cppm.html',1,'']]], + ['task_2ehpp_6',['task.hpp',['../task_8hpp.html',1,'']]], + ['task_5finternal_2ehpp_7',['task_internal.hpp',['../task__internal_8hpp.html',1,'']]], + ['task_5fqueue_2ecpp_8',['task_queue.cpp',['../task__queue_8cpp.html',1,'']]], + ['task_5fqueue_2ehpp_9',['task_queue.hpp',['../task__queue_8hpp.html',1,'']]], + ['task_5frunner_2ecpp_10',['task_runner.cpp',['../task__runner_8cpp.html',1,'']]], + ['task_5frunner_2ehpp_11',['task_runner.hpp',['../task__runner_8hpp.html',1,'']]], + ['terminal_2ecpp_12',['terminal.cpp',['../terminal_8cpp.html',1,'']]], + ['terminal_2ecppm_13',['terminal.cppm',['../terminal_8cppm.html',1,'']]], + ['terminal_2ehpp_14',['terminal.hpp',['../terminal_8hpp.html',1,'']]], + ['terminal_5finput_5fparser_2ecpp_15',['terminal_input_parser.cpp',['../terminal__input__parser_8cpp.html',1,'']]], + ['terminal_5finput_5fparser_2ehpp_16',['terminal_input_parser.hpp',['../terminal__input__parser_8hpp.html',1,'']]], + ['terminal_5finput_5fparser_5ftest_5ffuzzer_2ecpp_17',['terminal_input_parser_test_fuzzer.cpp',['../terminal__input__parser__test__fuzzer_8cpp.html',1,'']]], + ['text_2ecpp_18',['text.cpp',['../text_8cpp.html',1,'']]], + ['textarea_2ecpp_19',['textarea.cpp',['../textarea_8cpp.html',1,'']]], + ['toggle_2ecpp_20',['toggle.cpp',['../toggle_8cpp.html',1,'']]] +]; diff --git a/search/functions_0.js b/search/functions_0.js new file mode 100644 index 000000000..a2ea2d4ba --- /dev/null +++ b/search/functions_0.js @@ -0,0 +1,17 @@ +var searchData= +[ + ['active_0',['Active',['../group__component.html#a52beef6d7a687d4d109e6cec1606e32e',1,'ftxui::ComponentBase::Active()'],['../group__component.html#a9dc30615370889030396a239ceee2a77',1,'ftxui::ScreenInteractive::Active()']]], + ['activechild_1',['ActiveChild',['../group__component.html#a5c421f00a2a7f50c542c5c286d2e696c',1,'ftxui::ComponentBase']]], + ['adapter_2',['Adapter',['../classftxui_1_1ConstStringListRef_1_1Adapter.html#aeeff28a487da7a74856b51e966773246',1,'ftxui::ConstStringListRef::Adapter::Adapter()=default'],['../classftxui_1_1ConstStringListRef_1_1Adapter.html#afaf35b0fc91e998543942da0b2b9a3ee',1,'ftxui::ConstStringListRef::Adapter::Adapter(const Adapter &)=default'],['../classftxui_1_1ConstStringListRef_1_1Adapter.html#a5bcc41e3dec29c90da901ab45c95774a',1,'ftxui::ConstStringListRef::Adapter::Adapter(Adapter &&)=default']]], + ['add_3',['Add',['../group__component.html#a21f040bec9104e164bfa6c3ad45be3a1',1,'ftxui::ComponentBase::Add()'],['../classftxui_1_1TerminalInputParser.html#a4b2f1e271dd6ebbf5bad2418d960832a',1,'ftxui::TerminalInputParser::Add()']]], + ['addpart_4',['AddPart',['../group__dom.html#a9887e25feddebbf840876824cb3cbf61',1,'ftxui::Selection']]], + ['align_5fright_5',['align_right',['../group__dom.html#ga778e52afe28f1978f1f7ef065ed92d6d',1,'ftxui']]], + ['angle_6',['Angle',['../group__dom.html#a251d447c54f49914a2cbf5dc16fc8b5b',1,'ftxui::LinearGradient']]], + ['animated_7',['Animated',['../group__component.html#a008018822835ed0f3758af3c6e72837d',1,'ftxui::ButtonOption::Animated()'],['../group__component.html#a1a78fe7bb802251805a3867ba1a31e15',1,'ftxui::ButtonOption::Animated(Color color)'],['../group__component.html#a0295430ca4a317b0cbba9ee5faa4a324',1,'ftxui::ButtonOption::Animated(Color background, Color foreground)'],['../group__component.html#adf705e582d884e89211b540a97f2e090',1,'ftxui::ButtonOption::Animated(Color background, Color foreground, Color background_active, Color foreground_active)']]], + ['animator_8',['Animator',['../classftxui_1_1animation_1_1Animator.html#a03909a0243b559e18e21996ccacdc8b6',1,'ftxui::animation::Animator']]], + ['applyshader_9',['ApplyShader',['../group__screen.html#a04d18c0cb0df3ed7a01ca5c3b8711ff7',1,'ftxui::Screen']]], + ['ascii_10',['Ascii',['../group__component.html#a66e244b326f3cdc7b80ea836c391c34b',1,'ftxui::ButtonOption']]], + ['at_11',['at',['../group__screen.html#a55b0a995463c6936efb33391f29565bc',1,'ftxui::Image::at(int x, int y)'],['../group__screen.html#a0882d58bb8ca1be9953135338456cf9e',1,'ftxui::Image::at(int x, int y) const']]], + ['automerge_12',['automerge',['../group__dom.html#gaca42bd6c44d8d366d5c1014330402086',1,'ftxui']]], + ['autoreset_13',['AutoReset',['../classftxui_1_1AutoReset.html#ae393855d753027bcb3d4d1e1514e6ad4',1,'ftxui::AutoReset::AutoReset(T *variable, T new_value)'],['../classftxui_1_1AutoReset.html#a5280cdbbbecce1de0ae69bfdca10d7ed',1,'ftxui::AutoReset::AutoReset(const AutoReset &)=delete'],['../classftxui_1_1AutoReset.html#aaef5fed3c034c065dfc218244e112a4e',1,'ftxui::AutoReset::AutoReset(AutoReset &&)=delete']]] +]; diff --git a/search/functions_1.js b/search/functions_1.js new file mode 100644 index 000000000..b1050bba6 --- /dev/null +++ b/search/functions_1.js @@ -0,0 +1,28 @@ +var searchData= +[ + ['backin_0',['BackIn',['../namespaceftxui_1_1animation_1_1easing.html#ae9cca3240dd9f14a807364e322bbdf79',1,'ftxui::animation::easing']]], + ['backinout_1',['BackInOut',['../namespaceftxui_1_1animation_1_1easing.html#a4dfa1e95971ff8e4d0f7539f2e8ae577',1,'ftxui::animation::easing']]], + ['backout_2',['BackOut',['../namespaceftxui_1_1animation_1_1easing.html#a440085789f25b7f3ffa1391f09e154f3',1,'ftxui::animation::easing']]], + ['bgcolor_3',['bgcolor',['../group__dom.html#ga01d4c5aaf0447e862246849111782245',1,'ftxui::bgcolor(Color color)'],['../group__dom.html#gaee41f3eaff28a123214e81231f8f4593',1,'ftxui::bgcolor(const LinearGradient &gradient)'],['../group__dom.html#gaae86eacae0a0626b41e9964ac7f4f532',1,'ftxui::bgcolor(Color color, Element child)'],['../group__dom.html#gaaac1622d43662a6a02113d9230a4fdd4',1,'ftxui::bgcolor(const LinearGradient &gradient, Element child)']]], + ['blend_4',['Blend',['../group__screen.html#a3422660268648b5a260ac94336e7e405',1,'ftxui::Color']]], + ['blink_5',['blink',['../group__dom.html#gad57613de5895e774218d91dea48d074b',1,'ftxui']]], + ['bold_6',['bold',['../group__dom.html#ga353c769068e25303eb41fa2da565c604',1,'ftxui']]], + ['border_7',['Border',['../group__component.html#a2f8ead79a770376a36e9b9b7fa6bc966',1,'ftxui::ButtonOption::Border()'],['../classftxui_1_1TableSelection.html#af47b05e5a3f01cafc419ce94388cae51',1,'ftxui::TableSelection::Border()']]], + ['border_8',['border',['../group__dom.html#gae8537acd423d47cf07e61bd774fb1098',1,'ftxui']]], + ['borderbottom_9',['BorderBottom',['../classftxui_1_1TableSelection.html#ab3efbe517730170703eba50cf23b150d',1,'ftxui::TableSelection']]], + ['borderdashed_10',['borderDashed',['../group__dom.html#ga181c80f8ada12d1356f6bfa0ebb7219f',1,'ftxui']]], + ['borderdouble_11',['borderDouble',['../group__dom.html#ga052b504344f3bc1ff86b3493cd934215',1,'ftxui']]], + ['borderempty_12',['borderEmpty',['../group__dom.html#gaf20f7d6fb275d109f0bdc01a2e4d3f3e',1,'ftxui']]], + ['borderheavy_13',['borderHeavy',['../group__dom.html#ga666c31419cc31cdadc9f8178ed63529e',1,'ftxui']]], + ['borderleft_14',['BorderLeft',['../classftxui_1_1TableSelection.html#a5b822ad80ff44922a9d6551743f64259',1,'ftxui::TableSelection']]], + ['borderlight_15',['borderLight',['../group__dom.html#gaa074cdab57eeb47b99f1699bcc8addd8',1,'ftxui']]], + ['borderright_16',['BorderRight',['../classftxui_1_1TableSelection.html#af36f1d9893a26293f24da431c5a344cc',1,'ftxui::TableSelection']]], + ['borderrounded_17',['borderRounded',['../group__dom.html#ga3cf2db223a5efaa370f0ca6bb405b80e',1,'ftxui']]], + ['borderstyled_18',['borderStyled',['../group__dom.html#gabc9db79957d4dd36deb8ca79938e4c41',1,'ftxui::borderStyled(BorderStyle style)'],['../group__dom.html#ga5aab98b289d2e7b2ce8ca0eeee51ce78',1,'ftxui::borderStyled(BorderStyle style, Color foreground_color)'],['../group__dom.html#gad1dbf36194dcb77674085df9e11c1e22',1,'ftxui::borderStyled(Color foreground_color)']]], + ['bordertop_19',['BorderTop',['../classftxui_1_1TableSelection.html#aa9002be87d1fc0c5c6416b8006a902e4',1,'ftxui::TableSelection']]], + ['borderwith_20',['borderWith',['../group__dom.html#gaa97cfcfbe6df92dac085454395ec7b2f',1,'ftxui']]], + ['bouncein_21',['BounceIn',['../namespaceftxui_1_1animation_1_1easing.html#a3a136fc5aedb4e99e08e5bea138463cb',1,'ftxui::animation::easing']]], + ['bounceinout_22',['BounceInOut',['../namespaceftxui_1_1animation_1_1easing.html#a1a048fdae839f9493331cf1745767519',1,'ftxui::animation::easing']]], + ['bounceout_23',['BounceOut',['../namespaceftxui_1_1animation_1_1easing.html#aba7f60496f13f39385d9a47349e97c09',1,'ftxui::animation::easing']]], + ['button_24',['Button',['../group__component.html#ga4e8295ec77dd31b0acc5063b134473e7',1,'ftxui::Button(ButtonOption option)'],['../group__component.html#ga0488e28ee9388e0ddca26f1d03d827d1',1,'ftxui::Button(ConstStringRef label, std::function< void()> on_click, ButtonOption option)']]] +]; diff --git a/search/functions_10.js b/search/functions_10.js new file mode 100644 index 000000000..ec6f20484 --- /dev/null +++ b/search/functions_10.js @@ -0,0 +1,66 @@ +var searchData= +[ + ['saturatehorizontal_0',['SaturateHorizontal',['../group__dom.html#af3f2674604d907fbce26d4217cfa9324',1,'ftxui::Selection']]], + ['saturatevertical_1',['SaturateVertical',['../group__dom.html#ace69e1e7c6e64b7ae0c4402e0e1e3336',1,'ftxui::Selection']]], + ['screen_2',['Screen',['../group__screen.html#a7ecf7c5fb3d90a1620098a60cfafc215',1,'ftxui::Screen']]], + ['select_3',['Select',['../group__dom.html#a05352f5a353f1e86630a978060e77305',1,'ftxui::Node']]], + ['select_4',['select',['../namespaceftxui.html#a9e3e2988ed61a129d82d634ad66f7eb1',1,'ftxui']]], + ['selectall_5',['SelectAll',['../group__dom.html#ad5f50927f54334b84514bc4b11a14d71',1,'ftxui::Table']]], + ['selectcell_6',['SelectCell',['../group__dom.html#a3c2f178ef9f94da293a53b467ef8643b',1,'ftxui::Table']]], + ['selectcolumn_7',['SelectColumn',['../group__dom.html#a4ee8ddbab36f592fba81c6430d26545e',1,'ftxui::Table']]], + ['selectcolumns_8',['SelectColumns',['../group__dom.html#a79109565fe65710f725eb474778cae36',1,'ftxui::Table']]], + ['selection_9',['Selection',['../group__dom.html#ade00d4039f147221b9fd6b6b402b43b1',1,'ftxui::Selection::Selection()'],['../group__dom.html#a76eafd8bc098ec9f0405e3b1f6fb42c4',1,'ftxui::Selection::Selection(int start_x, int start_y, int end_x, int end_y)']]], + ['selectionbackgroundcolor_10',['selectionBackgroundColor',['../namespaceftxui.html#a6c965b8f6450a50a938120b5f6ddea96',1,'ftxui']]], + ['selectionchange_11',['SelectionChange',['../group__component.html#ad6daabb2df61b6be6f0b2a8950ac3281',1,'ftxui::ScreenInteractive']]], + ['selectioncolor_12',['selectionColor',['../namespaceftxui.html#a925a73b7f0eb4b5bc11af23f4ca18019',1,'ftxui']]], + ['selectionforegroundcolor_13',['selectionForegroundColor',['../namespaceftxui.html#a5d98498c51cfbc03f37e46d46ec8acf5',1,'ftxui']]], + ['selectionstyle_14',['selectionStyle',['../namespaceftxui.html#a4080865d947eea48cf695531f66a5160',1,'ftxui']]], + ['selectionstylereset_15',['selectionStyleReset',['../namespaceftxui.html#aa7e1317c76cefc5018503de4f6e09ea3',1,'ftxui']]], + ['selectrectangle_16',['SelectRectangle',['../group__dom.html#af0021915d0cbda394077929601b8ab8f',1,'ftxui::Table']]], + ['selectrow_17',['SelectRow',['../group__dom.html#a64435bbfbdefd7408241c69b6b8283e7',1,'ftxui::Table']]], + ['selectrows_18',['SelectRows',['../group__dom.html#ab36d32e3675a9353ee79e84405cd7a44',1,'ftxui::Table']]], + ['send_19',['Send',['../classftxui_1_1SenderImpl.html#af3a961fb9b4025671b6122a392a5bc3f',1,'ftxui::SenderImpl']]], + ['senderimpl_20',['SenderImpl',['../classftxui_1_1SenderImpl.html#a7770521e8bff392402a1539bf4eb8ff4',1,'ftxui::SenderImpl::SenderImpl(const SenderImpl &)=delete'],['../classftxui_1_1SenderImpl.html#a61b3d68c26b829848661ca875b0cdb13',1,'ftxui::SenderImpl::SenderImpl(SenderImpl &&)=delete']]], + ['separator_21',['Separator',['../classftxui_1_1TableSelection.html#ab1c6e11d86131eddb095c8211b824b18',1,'ftxui::TableSelection']]], + ['separator_22',['separator',['../group__dom.html#gac1ef1cf6bf7cd0759ffa195071edb2a0',1,'ftxui::separator()'],['../group__dom.html#ga71d9a6a32f65b6d172f9696b3b9579b4',1,'ftxui::separator(Pixel pixel)']]], + ['separatorcharacter_23',['separatorCharacter',['../group__dom.html#ga97a10482d591aade2958da0f2f19b371',1,'ftxui']]], + ['separatordashed_24',['separatorDashed',['../group__dom.html#ga81f2d3256c0cfbc70f820129286f08c6',1,'ftxui']]], + ['separatordouble_25',['separatorDouble',['../group__dom.html#gadd376830fdb51b0bf52672ef17515989',1,'ftxui']]], + ['separatorempty_26',['separatorEmpty',['../group__dom.html#ga1934703e56ab66f6f259b9f8da331f1b',1,'ftxui']]], + ['separatorheavy_27',['separatorHeavy',['../group__dom.html#gaf0649e89a9960f1c2703e48c1817645b',1,'ftxui']]], + ['separatorhorizontal_28',['SeparatorHorizontal',['../classftxui_1_1TableSelection.html#affd2ab7143cb388fdedad3bd51995802',1,'ftxui::TableSelection']]], + ['separatorhselector_29',['separatorHSelector',['../namespaceftxui.html#a50413065cee4757447b35c3a500667d3',1,'ftxui']]], + ['separatorlight_30',['separatorLight',['../group__dom.html#ga37c2b93daf557f68064bc9fbf93ebde0',1,'ftxui']]], + ['separatorstyled_31',['separatorStyled',['../group__dom.html#ga13cb559cfc7e409b3f211f0bb35ea7fa',1,'ftxui']]], + ['separatorvertical_32',['SeparatorVertical',['../classftxui_1_1TableSelection.html#a2334aed76610138905c96dc298b7e9df',1,'ftxui::TableSelection']]], + ['separatorvselector_33',['separatorVSelector',['../namespaceftxui.html#a1a0211233bacd4eb4d31a8e3d58b5f48',1,'ftxui']]], + ['set_34',['Set',['../group__component.html#ad186d5a36e45174bbc7c50df85c2e91e',1,'ftxui::AnimatedColorOption::Set()'],['../group__dom.html#ae47b5b0d793d0c2312e4805a1f40012a',1,'ftxui::FlexboxConfig::Set(FlexboxConfig::Direction)'],['../group__dom.html#a5afe52066ea76ddc7948b77ac155a011',1,'ftxui::FlexboxConfig::Set(FlexboxConfig::Wrap)'],['../group__dom.html#a3de11197951ee3c9037ba7f2a2586a06',1,'ftxui::FlexboxConfig::Set(FlexboxConfig::JustifyContent)'],['../group__dom.html#a07ef12f61272636369543b34932614f3',1,'ftxui::FlexboxConfig::Set(FlexboxConfig::AlignItems)'],['../group__dom.html#a6df4ec3da7d3d2cd0b216f5d2c72cbd6',1,'ftxui::FlexboxConfig::Set(FlexboxConfig::AlignContent)']]], + ['setactivechild_35',['SetActiveChild',['../group__component.html#a8cbf27680c6154e15c8b32d6601340de',1,'ftxui::ComponentBase::SetActiveChild(ComponentBase *child)'],['../group__component.html#a50ad32ad14dd7912e681fab0ee294be2',1,'ftxui::ComponentBase::SetActiveChild(Component child)']]], + ['setanimation_36',['SetAnimation',['../group__component.html#a754d89398aac6051ced26fd452c62589',1,'ftxui::UnderlineOption']]], + ['setanimationduration_37',['SetAnimationDuration',['../group__component.html#a798360474be7511364b8171f0c62f6d5',1,'ftxui::UnderlineOption']]], + ['setanimationfunction_38',['SetAnimationFunction',['../group__component.html#a34e6222dbf10e899074054160870816c',1,'ftxui::UnderlineOption::SetAnimationFunction(animation::easing::Function f)'],['../group__component.html#a7d978b34c37e9d08c57a22477016204c',1,'ftxui::UnderlineOption::SetAnimationFunction(animation::easing::Function f_leader, animation::easing::Function f_follower)']]], + ['setbox_39',['SetBox',['../group__dom.html#a2ed318aaadb07efc50e76fce1ccf9637',1,'ftxui::Node::SetBox()'],['../classftxui_1_1NodeDecorator.html#aafcc9bd6538ccb37babf4d56c4c1c238',1,'ftxui::NodeDecorator::SetBox()']]], + ['setcolorsupport_40',['SetColorSupport',['../group__dom.html#ga65945a706131f407a47a1b9960dc1a4a',1,'ftxui::Terminal']]], + ['setcursor_41',['SetCursor',['../group__screen.html#a1aa24862a3d050b3aea2ade1300d51a7',1,'ftxui::Screen']]], + ['setfallbacksize_42',['SetFallbackSize',['../namespaceftxui_1_1Terminal.html#a765662bcabb59dc93884674ee2fcc9fc',1,'ftxui::Terminal']]], + ['setgap_43',['SetGap',['../group__dom.html#a98d9a43033c09c7f967cdec791408bad',1,'ftxui::FlexboxConfig']]], + ['setselectionstyle_44',['SetSelectionStyle',['../group__screen.html#aba0d30b90db17d6b7561f704ed63b5e6',1,'ftxui::Screen']]], + ['shift_45',['Shift',['../group__screen.html#a507dad970b4732caab79e5922bdc5fb5',1,'ftxui::Box']]], + ['signal_46',['Signal',['../classftxui_1_1ScreenInteractive_1_1Private.html#aa831d3b9234cd15d4bcb5a42dec43943',1,'ftxui::ScreenInteractive::Private']]], + ['simple_47',['Simple',['../group__component.html#a553fe18f102e8e62aec516d4d3213eac',1,'ftxui::ButtonOption::Simple()'],['../group__component.html#a41b17a916980353033366c01b15d3cb1',1,'ftxui::CheckboxOption::Simple()'],['../group__component.html#af2b048773665961fae6c104762533908',1,'ftxui::RadioboxOption::Simple()']]], + ['sinein_48',['SineIn',['../namespaceftxui_1_1animation_1_1easing.html#af48c179e363c6656e904045b33756aeb',1,'ftxui::animation::easing']]], + ['sineinout_49',['SineInOut',['../namespaceftxui_1_1animation_1_1easing.html#a0eddac1c5f32c9f874ed1c6687a3c830',1,'ftxui::animation::easing']]], + ['sineout_50',['SineOut',['../namespaceftxui_1_1animation_1_1easing.html#a92e397623fa5a607f64ba58d5c3dc56a',1,'ftxui::animation::easing']]], + ['size_51',['Size',['../group__screen.html#gad890c37601448c82ed0d5051c29e2f0c',1,'ftxui::Terminal']]], + ['size_52',['size',['../classftxui_1_1ConstStringListRef_1_1Adapter.html#aa983ddaeded5756189f46428be79c631',1,'ftxui::ConstStringListRef::Adapter::size()'],['../classftxui_1_1ConstStringListRef.html#a259cb5a711406a8c3e5d937eb9350cca',1,'ftxui::ConstStringListRef::size()'],['../group__dom.html#ga201220986fbdc539e42efe067985cbdb',1,'ftxui::size(WidthOrHeight direction, Constraint constraint, int value)']]], + ['slider_53',['Slider',['../namespaceftxui.html#aa3558d992a72679e5e9c9c7b67abd727',1,'ftxui::Slider(SliderOption< T > options)'],['../group__component.html#gafdce74ff1421c2f1bda336c8dacefcbd',1,'ftxui::Slider(ConstStringRef label, Ref< int > value, ConstRef< int > min, ConstRef< int > max, ConstRef< int > increment)'],['../namespaceftxui.html#a8bfa2757905a4fb50e0ec263976d1f96',1,'ftxui::Slider(ConstStringRef label, Ref< float > value, ConstRef< float > min=0.f, ConstRef< float > max=100.f, ConstRef< float > increment=5.f)'],['../namespaceftxui.html#aba34419b025c881c07808816c81c5230',1,'ftxui::Slider(ConstStringRef label, Ref< long > value, ConstRef< long > min=0L, ConstRef< long > max=100L, ConstRef< long > increment=5L)'],['../namespaceftxui.html#a877bf1673c86ac33e24facf81068e693',1,'ftxui::Slider(SliderOption< int8_t >)'],['../namespaceftxui.html#a551dff4f473bdb27fde654341d08c618',1,'ftxui::Slider(SliderOption< int16_t >)'],['../namespaceftxui.html#a8d1ae475487cb22769f127449380925e',1,'ftxui::Slider(SliderOption< int32_t >)'],['../namespaceftxui.html#a217d120bd78c7e5fbe21c60d58f411ba',1,'ftxui::Slider(SliderOption< int64_t >)'],['../namespaceftxui.html#a83667b04778e0206c7c9f05652c9110a',1,'ftxui::Slider(SliderOption< uint8_t >)'],['../namespaceftxui.html#a41e0cb91026c84d8767958a6c3d65d88',1,'ftxui::Slider(SliderOption< uint16_t >)'],['../namespaceftxui.html#a17babf521947301435a4f7c47835032c',1,'ftxui::Slider(SliderOption< uint32_t >)'],['../namespaceftxui.html#a69e9803a9d52936adf22dabd14df4289',1,'ftxui::Slider(SliderOption< uint64_t >)'],['../namespaceftxui.html#a453d7fc2e7bd34b00775062018daf96d',1,'ftxui::Slider(SliderOption< float >)'],['../namespaceftxui.html#a9d64c6ad8cbbae0735eac76e4f4f5811',1,'ftxui::Slider(SliderOption< double >)']]], + ['spacious_54',['Spacious',['../group__component.html#a36c56131167eaaae707f64bbb9d07ef2',1,'ftxui::InputOption']]], + ['special_55',['Special',['../group__component.html#afe901de476c29382cc358333f10e5ee7',1,'ftxui::Event']]], + ['spinner_56',['spinner',['../group__dom.html#ga3b08e0030a0831d3ec3e2a505908273b',1,'ftxui']]], + ['stacked_57',['Stacked',['../group__component.html#gaafd394665b0c231380a143b810339d8e',1,'ftxui::Container']]], + ['stop_58',['Stop',['../group__dom.html#a03b10012f78e1c731616ce760d28df40',1,'ftxui::LinearGradient::Stop(Color color, float position)'],['../group__dom.html#ab85b009cd214d3bd1b3bb7f704af0da6',1,'ftxui::LinearGradient::Stop(Color color)']]], + ['strikethrough_59',['strikethrough',['../group__dom.html#ga8594d70f0491def903370e86132fbf01',1,'ftxui']]], + ['string_5fwidth_60',['string_width',['../namespaceftxui.html#a517b35c7721e632812d8b3a7697c4099',1,'ftxui']]], + ['stringref_61',['StringRef',['../classftxui_1_1StringRef.html#ad3cfa31525e075cbd5f50c2476e665ce',1,'ftxui::StringRef::StringRef(const wchar_t *ref)'],['../classftxui_1_1StringRef.html#a9133717e5c00b480a4a4a120ba7fb886',1,'ftxui::StringRef::StringRef(const char *ref)']]], + ['style_62',['Style',['../group__dom.html#ae9e7d3f5b753cf2650057623960d4cb4',1,'ftxui::Canvas::Style()'],['../examples_2component_2button_8cpp.html#a98e3b8d17caf902b7bf0fe47562cea08',1,'Style(): button.cpp']]] +]; diff --git a/search/functions_11.js b/search/functions_11.js new file mode 100644 index 000000000..1226c82b9 --- /dev/null +++ b/search/functions_11.js @@ -0,0 +1,19 @@ +var searchData= +[ + ['tab_0',['Tab',['../group__component.html#gaea9fe244eeeb420276bcc5760b46953d',1,'ftxui::Container']]], + ['table_1',['Table',['../group__dom.html#a2a7f82c625b00a53f710b2ed305248d2',1,'ftxui::Table::Table()'],['../group__dom.html#a2055337c538a82ae13d92db1838fc454',1,'ftxui::Table::Table(std::vector< std::vector< std::string > >)'],['../group__dom.html#acbd904dfec77b46b257e33f9c7d1e71d',1,'ftxui::Table::Table(std::vector< std::vector< Element > >)'],['../group__dom.html#a22a1b5a5b90feb5ebbfe20d7dec5c650',1,'ftxui::Table::Table(std::initializer_list< std::vector< std::string > > init)']]], + ['takefocus_2',['TakeFocus',['../group__component.html#a2cf27e9d7128a6a4b3263ecd34c19105',1,'ftxui::ComponentBase']]], + ['taskrunner_3',['TaskRunner',['../classftxui_1_1task_1_1TaskRunner.html#aa2a63894916e321a8a93add257aad2c7',1,'ftxui::task::TaskRunner']]], + ['terminalinputparser_4',['TerminalInputParser',['../classftxui_1_1TerminalInputParser.html#acbc8ed784fd28db571aece82b20c9855',1,'ftxui::TerminalInputParser']]], + ['terminaloutput_5',['TerminalOutput',['../group__component.html#a0b7de0467b4e57ce5f337ba8634d8d13',1,'ftxui::ScreenInteractive']]], + ['text_6',['Text',['../menu__underline__animated__gallery_8cpp.html#abd88e1b2ce2a860c64bbcd44c0e0282b',1,'menu_underline_animated_gallery.cpp']]], + ['text_7',['text',['../group__dom.html#ga75baaa2734ed76a9f478beaafa87ae57',1,'ftxui::text(std::wstring text)'],['../group__dom.html#ga366051704fd333c23460f7932598a5e3',1,'ftxui::text(std::string text)']]], + ['timeout_8',['Timeout',['../classftxui_1_1TerminalInputParser.html#a9e4aeeff8f55e0b1c7a8f9c282a77823',1,'ftxui::TerminalInputParser']]], + ['to_9',['to',['../classftxui_1_1animation_1_1Animator.html#a5d3b8db14f3f21f9169cfbebf247d854',1,'ftxui::animation::Animator']]], + ['to_5fstring_10',['to_string',['../namespaceftxui.html#a757b345f73bb6cde5165a4d7f0c0a298',1,'ftxui']]], + ['to_5fwstring_11',['to_wstring',['../namespaceftxui.html#a57429a83a46c643a81dee81e49384439',1,'ftxui::to_wstring(const std::string &s)'],['../namespaceftxui.html#a24ea52e8ef70889ef1da986837e0ff34',1,'ftxui::to_wstring(T s)']]], + ['toggle_12',['Toggle',['../group__component.html#a133a8caaf0246db0902f7abce37a9b6d',1,'ftxui::MenuOption::Toggle()'],['../group__component.html#ga3537fccac66b07cd792874c9a6086811',1,'ftxui::Toggle()']]], + ['tostring_13',['ToString',['../group__screen.html#a19c380b03cea21d7ac7325136a131ff0',1,'ftxui::Screen']]], + ['trackmouse_14',['TrackMouse',['../group__component.html#ad5961c1d4caf0ba9a030e5675162a164',1,'ftxui::ScreenInteractive']]], + ['triangle_15',['triangle',['../examples_2dom_2graph_8cpp.html#a5ab45e2cb218468666c7dc7b2b957396',1,'graph.cpp']]] +]; diff --git a/search/functions_12.js b/search/functions_12.js new file mode 100644 index 000000000..a0dd6a182 --- /dev/null +++ b/search/functions_12.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['underlined_0',['underlined',['../group__dom.html#ga5ad450c97c4d084b64ffb5b5ca942664',1,'ftxui']]], + ['underlineddouble_1',['underlinedDouble',['../group__dom.html#ga16d1b74107610750276499ddb3dde8da',1,'ftxui']]], + ['union_2',['Union',['../group__screen.html#adbc0a2693f6a78124076ef53bfd4207e',1,'ftxui::Box']]], + ['utf8toglyphs_3',['Utf8ToGlyphs',['../namespaceftxui.html#a389c58d385e861cd2ef109b53fc6ef96',1,'ftxui']]], + ['utf8towordbreakproperty_4',['Utf8ToWordBreakProperty',['../namespaceftxui.html#ad15724e497f0001e146da530183ca552',1,'ftxui']]] +]; diff --git a/search/functions_13.js b/search/functions_13.js new file mode 100644 index 000000000..0da48bb43 --- /dev/null +++ b/search/functions_13.js @@ -0,0 +1,18 @@ +var searchData= +[ + ['vbox_0',['vbox',['../group__dom.html#gafd28058f0ccbbdf34691a85a7cc9b2e3',1,'ftxui']]], + ['vcenter_1',['vcenter',['../group__dom.html#gad907a8a48bb9f9dfdb06402e9fc12316',1,'ftxui']]], + ['vertical_2',['Vertical',['../group__component.html#a617c59fdb94db99100d0e7a569c31d75',1,'ftxui::MenuOption::Vertical()'],['../group__component.html#ga6471e39f5664d059144746c5801d37e6',1,'ftxui::Container::Vertical(Components children)'],['../group__component.html#ga25099e2d2ead8a46c8d9a899982070b7',1,'ftxui::Container::Vertical(Components children, int *selector)']]], + ['verticalanimated_3',['VerticalAnimated',['../group__component.html#a6079a7637256d70b30aacb92d2034205',1,'ftxui::MenuOption']]], + ['vflow_4',['vflow',['../namespaceftxui.html#ae0da51b614e95a0687727644b5898a23',1,'ftxui']]], + ['vmenu1_5',['VMenu1',['../menu__style_8cpp.html#abc833415e917ac2a93b5a4f35df2f0fb',1,'menu_style.cpp']]], + ['vmenu2_6',['VMenu2',['../menu__style_8cpp.html#ab1c7204fedc90016a50553cdcdc9b58b',1,'menu_style.cpp']]], + ['vmenu3_7',['VMenu3',['../menu__style_8cpp.html#aec99d3a88e71643df15281e0041e44a2',1,'menu_style.cpp']]], + ['vmenu4_8',['VMenu4',['../menu__style_8cpp.html#afc540158e9fcd015af9e24d4ef072214',1,'menu_style.cpp']]], + ['vmenu5_9',['VMenu5',['../menu__style_8cpp.html#a62669e7b3cf3a388a714910a16cce19b',1,'menu_style.cpp']]], + ['vmenu6_10',['VMenu6',['../menu__style_8cpp.html#aeeb06101b3a771616149626f203be146',1,'menu_style.cpp']]], + ['vmenu7_11',['VMenu7',['../menu__style_8cpp.html#af07f6b560af2a9d723b3e53360d280b5',1,'menu_style.cpp']]], + ['vmenu8_12',['VMenu8',['../menu__style_8cpp.html#afade922e195c0cda670066485469de56',1,'menu_style.cpp']]], + ['vscroll_5findicator_13',['vscroll_indicator',['../group__dom.html#ga1974176e676afdb96d203e8e0f579219',1,'ftxui']]], + ['vtext_14',['vtext',['../group__dom.html#ga9f9f7485a45aa9d432726ca9845d1eac',1,'ftxui::vtext(std::wstring text)'],['../group__dom.html#ga64172a43b4b526afeb6313e6e1a6d5a1',1,'ftxui::vtext(std::string text)']]] +]; diff --git a/search/functions_14.js b/search/functions_14.js new file mode 100644 index 000000000..251b04fc7 --- /dev/null +++ b/search/functions_14.js @@ -0,0 +1,10 @@ +var searchData= +[ + ['wchar_5fwidth_0',['wchar_width',['../namespaceftxui.html#a1bb4947f62228380f5c415f69b34021f',1,'ftxui']]], + ['width_1',['width',['../group__dom.html#ad72663daf610f2a0833a2fc3d78e4fdf',1,'ftxui::Canvas']]], + ['window_2',['Window',['../group__component.html#ga638693abef9289912f5fa39606390b20',1,'ftxui::Window()'],['../menu__multiple_8cpp.html#ac2013764d7f0c7eb57876c3755e98bb3',1,'Window(): menu_multiple.cpp']]], + ['window_3',['window',['../group__dom.html#ga03049def08fa7a5eaa4d5e897152bc1a',1,'ftxui']]], + ['withrestoredio_4',['WithRestoredIO',['../group__component.html#af9df2de690486078fea4a7151b83b089',1,'ftxui::ScreenInteractive']]], + ['wrap_5',['Wrap',['../gallery_8cpp.html#a0a320000c5a485508c57030f605b800a',1,'gallery.cpp']]], + ['wstring_5fwidth_6',['wstring_width',['../namespaceftxui.html#adedb4aa528ad2aef48177dea69ca7a9d',1,'ftxui']]] +]; diff --git a/search/functions_15.js b/search/functions_15.js new file mode 100644 index 000000000..7505b2572 --- /dev/null +++ b/search/functions_15.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['xflex_0',['xflex',['../group__dom.html#ga0dbba98e14f63f1dd5163cbdc4f42da8',1,'ftxui']]], + ['xflex_5fgrow_1',['xflex_grow',['../group__dom.html#ga1618cb15307f29eb3d531e7b44c280d3',1,'ftxui']]], + ['xflex_5fshrink_2',['xflex_shrink',['../group__dom.html#ga95275a9271934cf76e970c6650cc224d',1,'ftxui']]], + ['xframe_3',['xframe',['../namespaceftxui.html#a2d0617c0912b732f059cf360ac951c49',1,'ftxui']]] +]; diff --git a/search/functions_16.js b/search/functions_16.js new file mode 100644 index 000000000..ccd47430b --- /dev/null +++ b/search/functions_16.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['yflex_0',['yflex',['../group__dom.html#ga42c7a33df6d890de30fc1ebb2d1b3ca6',1,'ftxui']]], + ['yflex_5fgrow_1',['yflex_grow',['../group__dom.html#ga7eac3f709e905af8f583aed52093b7ce',1,'ftxui']]], + ['yflex_5fshrink_2',['yflex_shrink',['../group__dom.html#gaf7d0757f5965aa579bccc125ff909256',1,'ftxui']]], + ['yframe_3',['yframe',['../namespaceftxui.html#a7ea9d3ceb2a977955125c6e4a6072325',1,'ftxui']]] +]; diff --git a/search/functions_17.js b/search/functions_17.js new file mode 100644 index 000000000..fc9b8c4d1 --- /dev/null +++ b/search/functions_17.js @@ -0,0 +1,17 @@ +var searchData= +[ + ['_7eadapter_0',['~Adapter',['../classftxui_1_1ConstStringListRef_1_1Adapter.html#acc343e0991b39fbf9b66f2faf7cb7f11',1,'ftxui::ConstStringListRef::Adapter']]], + ['_7eautoreset_1',['~AutoReset',['../classftxui_1_1AutoReset.html#ad7e022164fb38a279cca7c6cf478f379',1,'ftxui::AutoReset']]], + ['_7ecapturedmouseinterface_2',['~CapturedMouseInterface',['../classftxui_1_1CapturedMouseInterface.html#af35148d7f798953f8d7e8c1a0e2b2ef0',1,'ftxui::CapturedMouseInterface']]], + ['_7ecomponentbase_3',['~ComponentBase',['../group__component.html#ae490d465a018a9d81bb4e30604708fba',1,'ftxui::ComponentBase']]], + ['_7econstref_4',['~ConstRef',['../classftxui_1_1ConstRef.html#a4ab7aed14f1e68d9be361d5ccfcd4e0f',1,'ftxui::ConstRef']]], + ['_7econststringlistref_5',['~ConstStringListRef',['../classftxui_1_1ConstStringListRef.html#a517a6924cc5fa2fff3e6c08bc504f0fa',1,'ftxui::ConstStringListRef']]], + ['_7eimage_6',['~Image',['../group__screen.html#af7348fef7a61244855ed83dfb1fcbfa1',1,'ftxui::Image']]], + ['_7eloop_7',['~Loop',['../group__component.html#a84c72a09400ffc01ce3257d2109453a2',1,'ftxui::Loop']]], + ['_7enode_8',['~Node',['../group__dom.html#a6fa6bf60f34f1e3efb0e59333428c9c8',1,'ftxui::Node']]], + ['_7eref_9',['~Ref',['../classftxui_1_1Ref.html#a3950a05eee649724ae206d5dd33355f5',1,'ftxui::Ref']]], + ['_7escreen_10',['~Screen',['../group__screen.html#a20d80448fe5bd4ce01dcd821d4d67a5b',1,'ftxui::Screen']]], + ['_7escreeninteractive_11',['~ScreenInteractive',['../group__component.html#a2c4f2d0819fb7afa3ce40cc0e3107053',1,'ftxui::ScreenInteractive']]], + ['_7esenderimpl_12',['~SenderImpl',['../classftxui_1_1SenderImpl.html#ac23f2c8d2bf8c021dcce059afd2c3405',1,'ftxui::SenderImpl']]], + ['_7etaskrunner_13',['~TaskRunner',['../classftxui_1_1task_1_1TaskRunner.html#afab0128a700661663463c90c9a33d71d',1,'ftxui::task::TaskRunner']]] +]; diff --git a/search/functions_2.js b/search/functions_2.js new file mode 100644 index 000000000..14882df1c --- /dev/null +++ b/search/functions_2.js @@ -0,0 +1,51 @@ +var searchData= +[ + ['canvas_0',['Canvas',['../group__dom.html#a3cbcd839ac8597df2e0f351850ec4735',1,'ftxui::Canvas::Canvas()=default'],['../group__dom.html#a6a78dda2095054ffa03f215f0153bdbb',1,'ftxui::Canvas::Canvas(int width, int height)']]], + ['canvas_1',['canvas',['../namespaceftxui.html#a57d7bdf155e190de514a689abb4e9a35',1,'ftxui::canvas(ConstRef< Canvas > canvas)'],['../namespaceftxui.html#ac781c6530fb74b861af7d52c03ffb2b9',1,'ftxui::canvas(int width, int height, std::function< void(Canvas &)> fn)'],['../namespaceftxui.html#a8bef154e558868d259c52380e1e5ead9',1,'ftxui::canvas(std::function< void(Canvas &)> fn)']]], + ['capturedmouseinterface_2',['CapturedMouseInterface',['../classftxui_1_1CapturedMouseInterface.html#abc72c038150d1866199c28dffe7ace7b',1,'ftxui::CapturedMouseInterface::CapturedMouseInterface()=default'],['../classftxui_1_1CapturedMouseInterface.html#abb21b580f6362d9f5f4d25c6b8ca54cb',1,'ftxui::CapturedMouseInterface::CapturedMouseInterface(const CapturedMouseInterface &)=default'],['../classftxui_1_1CapturedMouseInterface.html#a2f92bdd8e2c098ade383916b8e47b7e0',1,'ftxui::CapturedMouseInterface::CapturedMouseInterface(CapturedMouseInterface &&)=delete']]], + ['capturemouse_3',['CaptureMouse',['../group__component.html#a164d10a2cf367bdd4ae14318a6c7d769',1,'ftxui::ComponentBase::CaptureMouse()'],['../group__component.html#aad61519d291dcc216d2ac618618a45a2',1,'ftxui::ScreenInteractive::CaptureMouse()']]], + ['catchevent_4',['CatchEvent',['../namespaceftxui.html#afa5872ba3f9889c7487e57e745e56857',1,'ftxui::CatchEvent(Component child, std::function< bool(Event)>)'],['../group__component.html#gad2948235799c010c76c6de861c050c59',1,'ftxui::CatchEvent(std::function< bool(Event)> on_event)'],['../group__component.html#ga0bfd67a2815807dc6fc9bc0f79bce29e',1,'ftxui::CatchEvent(Component child, std::function< bool(Event event)> on_event)']]], + ['celltoglyphindex_5',['CellToGlyphIndex',['../namespaceftxui.html#a9769a28baa6a84d5de6a8bd624a29294',1,'ftxui']]], + ['center_6',['center',['../group__dom.html#ga5b11656305fce8427b81daf1c35883f1',1,'ftxui']]], + ['character_7',['Character',['../group__component.html#a769519ed730b72a53a2e770d6ee44365',1,'ftxui::Event::Character(std::string)'],['../group__component.html#a9970fcb99b3c5ed50753111edf1d2cae',1,'ftxui::Event::Character(char)'],['../group__component.html#a2f33d5ea7fca5423861773f891f5ba07',1,'ftxui::Event::Character(wchar_t)']]], + ['character_8',['character',['../group__component.html#a07022c6e92b9144a0e5b337b562f9892',1,'ftxui::Event']]], + ['check_9',['Check',['../group__dom.html#a5b71d891a102197f2856f53702425581',1,'ftxui::Node']]], + ['checkbox_10',['Checkbox',['../group__component.html#gae0d441d2c83740f187f62db566bbefcd',1,'ftxui::Checkbox(CheckboxOption option)'],['../group__component.html#ga5e9dbb03c44d549f10c96f134269366f',1,'ftxui::Checkbox(ConstStringRef label, bool *checked, CheckboxOption option)']]], + ['childat_11',['ChildAt',['../group__component.html#aceb41a98abe10fb0b521ff8b65529b7f',1,'ftxui::ComponentBase']]], + ['childcount_12',['ChildCount',['../group__component.html#a9ae5f77e923e2f0f8b0e26dcd4affb5b',1,'ftxui::ComponentBase']]], + ['circularin_13',['CircularIn',['../namespaceftxui_1_1animation_1_1easing.html#a9af9e9dc6ba657b5ab681eb8be39ddb5',1,'ftxui::animation::easing']]], + ['circularinout_14',['CircularInOut',['../namespaceftxui_1_1animation_1_1easing.html#a0d1df50c1810db4a8b16416b62ac7db0',1,'ftxui::animation::easing']]], + ['circularout_15',['CircularOut',['../namespaceftxui_1_1animation_1_1easing.html#a4188d3f98b876d0e0f181f9fd707f476',1,'ftxui::animation::easing']]], + ['clamp_16',['clamp',['../namespaceftxui_1_1util.html#aab9f0232e41c960b4a09629eac33aef3',1,'ftxui::util']]], + ['clear_17',['Clear',['../group__screen.html#aa71d36872f416feaa853788a7a7a7ef8',1,'ftxui::Image::Clear()'],['../group__screen.html#aa71d36872f416feaa853788a7a7a7ef8',1,'ftxui::Screen::Clear()']]], + ['clear_5funder_18',['clear_under',['../group__dom.html#ga17a89519e6b87e12b1e5811a702f7847',1,'ftxui']]], + ['clone_19',['Clone',['../classftxui_1_1SenderImpl.html#a575817a7bf1afd8bc9af4973e4f38481',1,'ftxui::SenderImpl']]], + ['code_20',['Code',['../print__key__press_8cpp.html#a1bbdd0071095abee0e28134bd4ad9213',1,'print_key_press.cpp']]], + ['codepointtowordbreakproperty_21',['CodepointToWordBreakProperty',['../namespaceftxui.html#a191b3278846ceb6ac35d2e4eb26db759',1,'ftxui']]], + ['collapsible_22',['Collapsible',['../namespaceftxui.html#a760cd5eb9a72c008ca18f1e6b366c796',1,'ftxui']]], + ['color_23',['Color',['../group__screen.html#a1589b83974b42a2f3315624f14c3c92c',1,'ftxui::Color::Color()'],['../group__screen.html#a3c93cb793b88256235f17235c9359b35',1,'ftxui::Color::Color(Palette1 index)'],['../group__screen.html#a55decaa0b2ab846729582f5f7b6acb49',1,'ftxui::Color::Color(Palette16 index)'],['../group__screen.html#a4f2602aacaf27a6482580fea0f7de0d2',1,'ftxui::Color::Color(Palette256 index)'],['../group__screen.html#a92d70d7572b7a07d2af4ff650e272e08',1,'ftxui::Color::Color(uint8_t red, uint8_t green, uint8_t blue, uint8_t alpha=255)']]], + ['color_24',['color',['../group__dom.html#gaf61b489da39ca5e24b68e6e1a2b09c0d',1,'ftxui::color(Color c)'],['../group__dom.html#ga8af6b5a06b03fd53bf30a6b050b96968',1,'ftxui::color(const LinearGradient &gradient)'],['../group__dom.html#gadef6e6e66199153de6d3b21b14dcf868',1,'ftxui::color(Color color, Element child)'],['../group__dom.html#ga050df9c8ed04eec13309d6c0542c636d',1,'ftxui::color(const LinearGradient &gradient, Element child)']]], + ['colored_25',['Colored',['../menu__entries_8cpp.html#a12f3ca405f8238e1d03dff81d4cf6997',1,'Colored(ftxui::Color c): menu_entries.cpp'],['../menu__entries__animated_8cpp.html#a12f3ca405f8238e1d03dff81d4cf6997',1,'Colored(ftxui::Color c): menu_entries_animated.cpp']]], + ['colorinfosorted2d_26',['ColorInfoSorted2D',['../color__info__sorted__2d_8ipp.html#a0f08918d6064cd2a0e56cb9ec74033ca',1,'color_info_sorted_2d.ipp']]], + ['colorstring_27',['ColorString',['../slider__rgb_8cpp.html#acfbf512737b012658b0c3b6997da144e',1,'slider_rgb.cpp']]], + ['colorsupport_28',['ColorSupport',['../group__screen.html#gae6e034f37aa66cfe4458a8cb6e8fc526',1,'ftxui::Terminal']]], + ['colortile_29',['ColorTile',['../slider__rgb_8cpp.html#ac5038fb3740e7d9137dfb4969a9a8035',1,'slider_rgb.cpp']]], + ['componentbase_30',['ComponentBase',['../group__component.html#ad2a5b6ce11bc7a8ce1150cf0ba9144c0',1,'ftxui::ComponentBase::ComponentBase(Components children)'],['../group__component.html#acda4c8b63ffbc2e9e2e28f056edbf01c',1,'ftxui::ComponentBase::ComponentBase()=default'],['../group__component.html#abd8cf6a9df5eb4678fb9925b686c7aea',1,'ftxui::ComponentBase::ComponentBase(const ComponentBase &)=delete'],['../group__component.html#a9b3cf357cf150023641969d5fcb7d08f',1,'ftxui::ComponentBase::ComponentBase(ComponentBase &&)=delete']]], + ['compute_31',['Compute',['../namespaceftxui_1_1box__helper.html#aede4ed6e71fbe0689a500ff8db06f3a3',1,'ftxui::box_helper::Compute()'],['../namespaceftxui_1_1flexbox__helper.html#aaf9df834cf83e439dd0e74cb1999c83d',1,'ftxui::flexbox_helper::Compute()']]], + ['computerequirement_32',['ComputeRequirement',['../group__dom.html#a40bd818c5de23bb2d208360d275ae59d',1,'ftxui::Node::ComputeRequirement()'],['../classftxui_1_1NodeDecorator.html#ac68a91492bfe8a6dd7ea2b3f7f295720',1,'ftxui::NodeDecorator::ComputeRequirement()']]], + ['constref_33',['ConstRef',['../classftxui_1_1ConstRef.html#a2949426897a0bd427771597c7cc34f08',1,'ftxui::ConstRef::ConstRef()=default'],['../classftxui_1_1ConstRef.html#aa33f2e3c9020518540c2850c7ad2669f',1,'ftxui::ConstRef::ConstRef(T t)'],['../classftxui_1_1ConstRef.html#a7dde5cd8bdbcd4c83a7b3bbddfc31bd9',1,'ftxui::ConstRef::ConstRef(const T *t)'],['../classftxui_1_1ConstRef.html#a184e14dab2e9bca47f7d172ca7126c60',1,'ftxui::ConstRef::ConstRef(const ConstRef< T > &)=default'],['../classftxui_1_1ConstRef.html#aa89dd79143a428e57480cda1cc7b675e',1,'ftxui::ConstRef::ConstRef(ConstRef< T > &&) noexcept=default']]], + ['conststringlistref_34',['ConstStringListRef',['../classftxui_1_1ConstStringListRef.html#a425bc6a013bf3a539794b7a874fc722f',1,'ftxui::ConstStringListRef::ConstStringListRef()=default'],['../classftxui_1_1ConstStringListRef.html#a4d5f9a6302f997c4ef51b36370b84042',1,'ftxui::ConstStringListRef::ConstStringListRef(ConstStringListRef &&)=default'],['../classftxui_1_1ConstStringListRef.html#abfb65b9a4a2648e7b9f110cecefa57a4',1,'ftxui::ConstStringListRef::ConstStringListRef(const ConstStringListRef &)=default'],['../classftxui_1_1ConstStringListRef.html#a143d850d76c8d8f8b4f8750c94ce1a52',1,'ftxui::ConstStringListRef::ConstStringListRef(std::vector< std::string > value)'],['../classftxui_1_1ConstStringListRef.html#a1dea39816b5515bb126f980ed0839d63',1,'ftxui::ConstStringListRef::ConstStringListRef(const std::vector< std::string > *value)'],['../classftxui_1_1ConstStringListRef.html#a8f2ca283f552f4cdd835401e3b177b4a',1,'ftxui::ConstStringListRef::ConstStringListRef(const std::vector< std::wstring > *value)'],['../classftxui_1_1ConstStringListRef.html#ae1af1937e833f81fe7013261ec0ee1ef',1,'ftxui::ConstStringListRef::ConstStringListRef(Adapter *adapter)'],['../classftxui_1_1ConstStringListRef.html#a79bb658d6bae69e91da078978d5ded33',1,'ftxui::ConstStringListRef::ConstStringListRef(std::unique_ptr< AdapterType > adapter)']]], + ['conststringref_35',['ConstStringRef',['../classftxui_1_1ConstStringRef.html#a9a4560dc18026ec3753e87d569fa5103',1,'ftxui::ConstStringRef::ConstStringRef(const std::wstring *ref)'],['../classftxui_1_1ConstStringRef.html#a1e8c54776eada9969ebbadb21d8e689a',1,'ftxui::ConstStringRef::ConstStringRef(const std::wstring ref)'],['../classftxui_1_1ConstStringRef.html#ad8b24bac5669d8787ac2109068094938',1,'ftxui::ConstStringRef::ConstStringRef(const wchar_t *ref)'],['../classftxui_1_1ConstStringRef.html#a013cd384d028ab8f67fa4cf8e9c521cd',1,'ftxui::ConstStringRef::ConstStringRef(const char *ref)']]], + ['contain_36',['Contain',['../group__screen.html#a2f31c89738607b84e65992a7005d35a9',1,'ftxui::Box']]], + ['create_37',['Create',['../group__screen.html#a32b98be0603ace46d6dc9d05b330a9fd',1,'ftxui::Screen::Create(Dimensions dimension)'],['../group__screen.html#a29a8d230cd1913d26626158fc4fc0a0c',1,'ftxui::Screen::Create(Dimensions width, Dimensions height)']]], + ['cubicin_38',['CubicIn',['../namespaceftxui_1_1animation_1_1easing.html#a2288ba740a847ea0e565017cb16c24f2',1,'ftxui::animation::easing']]], + ['cubicinout_39',['CubicInOut',['../namespaceftxui_1_1animation_1_1easing.html#a2aa1d45766fe10c3b16b7dd4f65db859',1,'ftxui::animation::easing']]], + ['cubicout_40',['CubicOut',['../namespaceftxui_1_1animation_1_1easing.html#acd3c619812de25f3613b36735a5cdc91',1,'ftxui::animation::easing']]], + ['current_41',['Current',['../classftxui_1_1task_1_1TaskRunner.html#a4e90ab04a37a29bb0e3432d1290a4565',1,'ftxui::task::TaskRunner']]], + ['cursor_42',['cursor',['../group__screen.html#a94febaac347b83267ff6a10b7837d612',1,'ftxui::Screen']]], + ['cursor_5fshape_43',['cursor_shape',['../group__component.html#a022c841864c305d5e3ef69f6957dc367',1,'ftxui::Event']]], + ['cursor_5fx_44',['cursor_x',['../group__component.html#a1ef75084a5f2a9d26df8cafcf048526e',1,'ftxui::Event']]], + ['cursor_5fy_45',['cursor_y',['../group__component.html#a1a24372c00e6485f2648350df4301ae3',1,'ftxui::Event']]], + ['cursorposition_46',['CursorPosition',['../group__component.html#acef096fb0273c844877408912445988c',1,'ftxui::Event']]], + ['cursorshape_47',['CursorShape',['../group__component.html#a0e2ede93a1146707a4f5e540056e13bc',1,'ftxui::Event']]] +]; diff --git a/search/functions_3.js b/search/functions_3.js new file mode 100644 index 000000000..375fa2414 --- /dev/null +++ b/search/functions_3.js @@ -0,0 +1,42 @@ +var searchData= +[ + ['dbox_0',['dbox',['../group__dom.html#ga901ab1b6b2e0e8c295552168ab206441',1,'ftxui']]], + ['debugstring_1',['DebugString',['../group__component.html#a764be64f3029f8b8e23511061d8de355',1,'ftxui::Event']]], + ['decorate_2',['Decorate',['../classftxui_1_1TableSelection.html#a8e7e9329ee7f557eef6d037fef8003e0',1,'ftxui::TableSelection']]], + ['decoratealternatecolumn_3',['DecorateAlternateColumn',['../classftxui_1_1TableSelection.html#a00b7d84571ed47043e55cd879ed851a3',1,'ftxui::TableSelection']]], + ['decoratealternaterow_4',['DecorateAlternateRow',['../classftxui_1_1TableSelection.html#a9cadee0ff95e66e2ca90e15648ad592d',1,'ftxui::TableSelection']]], + ['decoratecells_5',['DecorateCells',['../classftxui_1_1TableSelection.html#a335808a6c8beb4744bfe91b359ebf0bb',1,'ftxui::TableSelection']]], + ['decoratecellsalternatecolumn_6',['DecorateCellsAlternateColumn',['../classftxui_1_1TableSelection.html#a751593eb3bc2e704eb6667ed518f614e',1,'ftxui::TableSelection']]], + ['decoratecellsalternaterow_7',['DecorateCellsAlternateRow',['../classftxui_1_1TableSelection.html#ac2810f38a5f722916f364f354c204cb7',1,'ftxui::TableSelection']]], + ['default_8',['Default',['../group__component.html#a2108670f055ede2fdc4993f6ffc8ff07',1,'ftxui::InputOption']]], + ['detach_9',['Detach',['../group__component.html#abb7a2b60240651d16e17d02eb6f636cf',1,'ftxui::ComponentBase']]], + ['detachallchildren_10',['DetachAllChildren',['../group__component.html#a84bd6480cf5e8f51cf5965f81b1f2460',1,'ftxui::ComponentBase']]], + ['dim_11',['dim',['../group__dom.html#gac6a3b77604739516e809369810896646',1,'ftxui']]], + ['dimx_12',['dimx',['../group__screen.html#ae7a460c9dacd70ed81b1adfea46b492e',1,'ftxui::Image']]], + ['dimy_13',['dimy',['../group__screen.html#a0d283cfb1ec16b3fc13d344ebfea93d4',1,'ftxui::Image']]], + ['drawblock_14',['DrawBlock',['../group__dom.html#ae38b2e4f5bcda94c060bb77779d1e339',1,'ftxui::Canvas::DrawBlock(int x, int y, bool value)'],['../group__dom.html#a0a51b12eb4089c9a3afb8d3052599b98',1,'ftxui::Canvas::DrawBlock(int x, int y, bool value, const Stylizer &s)'],['../group__dom.html#ab5717755b773771ef642e9e774dbb1a0',1,'ftxui::Canvas::DrawBlock(int x, int y, bool value, const Color &color)']]], + ['drawblockcircle_15',['DrawBlockCircle',['../group__dom.html#ac3977d4b06ca96ff799a3b72437c8a0b',1,'ftxui::Canvas::DrawBlockCircle(int x1, int y1, int radius)'],['../group__dom.html#a685bec108334c6a43ceb5ca8a0666cd7',1,'ftxui::Canvas::DrawBlockCircle(int x1, int y1, int radius, const Stylizer &s)'],['../group__dom.html#ab2bf509dc9519bd9f76a7721b5b152bf',1,'ftxui::Canvas::DrawBlockCircle(int x1, int y1, int radius, const Color &color)']]], + ['drawblockcirclefilled_16',['DrawBlockCircleFilled',['../group__dom.html#acffdcd5bae224992e155facb0baf4119',1,'ftxui::Canvas::DrawBlockCircleFilled(int x1, int y1, int radius)'],['../group__dom.html#a60a31c3685d296333e594feb8ec04c48',1,'ftxui::Canvas::DrawBlockCircleFilled(int x1, int y1, int radius, const Stylizer &s)'],['../group__dom.html#a70cd877698afe354ca070c6b93ef3847',1,'ftxui::Canvas::DrawBlockCircleFilled(int x1, int y1, int radius, const Color &color)']]], + ['drawblockellipse_17',['DrawBlockEllipse',['../group__dom.html#a8dd75f2dfc5bef37aa2c8bc8cfaf0579',1,'ftxui::Canvas::DrawBlockEllipse(int x1, int y1, int r1, int r2)'],['../group__dom.html#ac53509c067c979cc6ec766b4db8e6e2c',1,'ftxui::Canvas::DrawBlockEllipse(int x1, int y1, int r1, int r2, const Stylizer &s)'],['../group__dom.html#a0916ab1d55ac16c158571d135893e88a',1,'ftxui::Canvas::DrawBlockEllipse(int x1, int y1, int r1, int r2, const Color &color)']]], + ['drawblockellipsefilled_18',['DrawBlockEllipseFilled',['../group__dom.html#a78dc3c908f7ce1c30837bd3043f19526',1,'ftxui::Canvas::DrawBlockEllipseFilled(int x1, int y1, int r1, int r2)'],['../group__dom.html#aa3f717282aab0cee9835503ef1eb6f1b',1,'ftxui::Canvas::DrawBlockEllipseFilled(int x1, int y1, int r1, int r2, const Stylizer &s)'],['../group__dom.html#a616781dd82158e306ebf71d87283e6f8',1,'ftxui::Canvas::DrawBlockEllipseFilled(int x1, int y1, int r1, int r2, const Color &color)']]], + ['drawblockline_19',['DrawBlockLine',['../group__dom.html#a182a915a7e3fc863f5c222253de01ff1',1,'ftxui::Canvas::DrawBlockLine(int x1, int y1, int x2, int y2)'],['../group__dom.html#a2911f015b5085dd2f74a4f88910eabe3',1,'ftxui::Canvas::DrawBlockLine(int x1, int y1, int x2, int y2, const Stylizer &s)'],['../group__dom.html#a8543417c0289090a5eefb2d6fcd521fc',1,'ftxui::Canvas::DrawBlockLine(int x1, int y1, int x2, int y2, const Color &color)']]], + ['drawblockoff_20',['DrawBlockOff',['../group__dom.html#ad626747e5e54412d0376ba870565dce6',1,'ftxui::Canvas']]], + ['drawblockon_21',['DrawBlockOn',['../group__dom.html#a43cd60e79e418d3173e757a1809fde09',1,'ftxui::Canvas']]], + ['drawblocktoggle_22',['DrawBlockToggle',['../group__dom.html#ab4154641384d18497de60c2626b71a94',1,'ftxui::Canvas']]], + ['drawimage_23',['DrawImage',['../group__dom.html#a02b6e8bab532a2c43d3102674e1e1647',1,'ftxui::Canvas']]], + ['drawpixel_24',['DrawPixel',['../group__dom.html#afde1b1962124ef417569bef59c6dcdcc',1,'ftxui::Canvas']]], + ['drawpoint_25',['DrawPoint',['../group__dom.html#a8707f2585ed8b787b6b14032a5c761a1',1,'ftxui::Canvas::DrawPoint(int x, int y, bool value)'],['../group__dom.html#a356677acf431f88673b59526f290eb0c',1,'ftxui::Canvas::DrawPoint(int x, int y, bool value, const Stylizer &s)'],['../group__dom.html#ab89d4e0bd8bf78ba40dde08cd5779fa7',1,'ftxui::Canvas::DrawPoint(int x, int y, bool value, const Color &color)']]], + ['drawpointcircle_26',['DrawPointCircle',['../group__dom.html#ad21641f8f1fd60aa5f1d149379eba3eb',1,'ftxui::Canvas::DrawPointCircle(int x, int y, int radius)'],['../group__dom.html#a644133eccde18caeaf06e5b7fdb5ef51',1,'ftxui::Canvas::DrawPointCircle(int x, int y, int radius, const Stylizer &s)'],['../group__dom.html#adcc98793cdb931c3438b5ec35ed7a0dd',1,'ftxui::Canvas::DrawPointCircle(int x, int y, int radius, const Color &color)']]], + ['drawpointcirclefilled_27',['DrawPointCircleFilled',['../group__dom.html#a5b6388d2515edcfb6c88a39ea56805b2',1,'ftxui::Canvas::DrawPointCircleFilled(int x, int y, int radius)'],['../group__dom.html#af7a213e8dbed8debae0155f1b707fd74',1,'ftxui::Canvas::DrawPointCircleFilled(int x, int y, int radius, const Stylizer &s)'],['../group__dom.html#adace7c348090660c1a6a5fffce18b7d2',1,'ftxui::Canvas::DrawPointCircleFilled(int x, int y, int radius, const Color &color)']]], + ['drawpointellipse_28',['DrawPointEllipse',['../group__dom.html#a79ee88b3cfe258309041469f707dcf68',1,'ftxui::Canvas::DrawPointEllipse(int x, int y, int r1, int r2)'],['../group__dom.html#a6926683a29ff97d77e40ae533bb51eed',1,'ftxui::Canvas::DrawPointEllipse(int x, int y, int r1, int r2, const Color &color)'],['../group__dom.html#acdafc386934cf7e11b529c0c38b788a3',1,'ftxui::Canvas::DrawPointEllipse(int x, int y, int r1, int r2, const Stylizer &s)']]], + ['drawpointellipsefilled_29',['DrawPointEllipseFilled',['../group__dom.html#a2633b8a556a82c74438fe41b253b39ee',1,'ftxui::Canvas::DrawPointEllipseFilled(int x, int y, int r1, int r2)'],['../group__dom.html#a395ec10a91d15be650afddcb85757945',1,'ftxui::Canvas::DrawPointEllipseFilled(int x, int y, int r1, int r2, const Color &color)'],['../group__dom.html#a22ec58bdf5a3578ce68c52ace9324fb6',1,'ftxui::Canvas::DrawPointEllipseFilled(int x, int y, int r1, int r2, const Stylizer &s)']]], + ['drawpointline_30',['DrawPointLine',['../group__dom.html#a2b6800c9a6a93457a921d9b570fb2f30',1,'ftxui::Canvas::DrawPointLine(int x1, int y1, int x2, int y2)'],['../group__dom.html#a4eb34a7688220b3b8ad274ff9d0f3649',1,'ftxui::Canvas::DrawPointLine(int x1, int y1, int x2, int y2, const Stylizer &s)'],['../group__dom.html#a6a3d2396239afce89f1cda3c69665095',1,'ftxui::Canvas::DrawPointLine(int x1, int y1, int x2, int y2, const Color &color)']]], + ['drawpointoff_31',['DrawPointOff',['../group__dom.html#a64ad8a12830a3341d4a5afb380913474',1,'ftxui::Canvas']]], + ['drawpointon_32',['DrawPointOn',['../group__dom.html#a5f488ea43e72f25cc25d055bf18dac5b',1,'ftxui::Canvas']]], + ['drawpointtoggle_33',['DrawPointToggle',['../group__dom.html#afd64176f05f91df2d96e8f3bb0631c51',1,'ftxui::Canvas']]], + ['drawtext_34',['DrawText',['../group__dom.html#a3791777bd6d3c6f8ff6281efd19a5161',1,'ftxui::Canvas::DrawText(int x, int y, const std::string &value)'],['../group__dom.html#a389991302f9a1d5554eff24b48d6b6ec',1,'ftxui::Canvas::DrawText(int x, int y, const std::string &value, const Color &color)'],['../group__dom.html#a648ed3b48973ac1dc58ca22d54ecf6af',1,'ftxui::Canvas::DrawText(int x, int y, const std::string &value, const Stylizer &style)']]], + ['dropdown_35',['Dropdown',['../group__component.html#gaa22bddff4aeed66e20f30d0715596999',1,'ftxui::Dropdown(ConstStringListRef entries, int *selected)'],['../group__component.html#gaa4b353566017558bac648ee1409930de',1,'ftxui::Dropdown(DropdownOption option)']]], + ['dummycomponent_36',['DummyComponent',['../menu__underline__animated__gallery_8cpp.html#a488a81f58d76f17bf95ef222f68e0dfe',1,'menu_underline_animated_gallery.cpp']]], + ['dummywindowcontent_37',['DummyWindowContent',['../scrollbar_8cpp.html#a83db372d294b69185f7a26148935cfc3',1,'DummyWindowContent(): scrollbar.cpp'],['../examples_2component_2window_8cpp.html#a83db372d294b69185f7a26148935cfc3',1,'DummyWindowContent(): window.cpp']]], + ['duration_38',['duration',['../classftxui_1_1animation_1_1Params.html#a2cf2e0a4288915aee8f100d2f0ee3e50',1,'ftxui::animation::Params']]] +]; diff --git a/search/functions_4.js b/search/functions_4.js new file mode 100644 index 000000000..e1b058ca7 --- /dev/null +++ b/search/functions_4.js @@ -0,0 +1,15 @@ +var searchData= +[ + ['eatcodepoint_0',['EatCodePoint',['../namespaceftxui.html#a903cd2e24b3b7cf8d7d4daa680e0a8d5',1,'ftxui::EatCodePoint(const std::string &input, size_t start, size_t *end, uint32_t *ucs)'],['../namespaceftxui.html#a88b8b2f726acaf2aca140a403989d8d0',1,'ftxui::EatCodePoint(const std::wstring &input, size_t start, size_t *end, uint32_t *ucs)']]], + ['elasticin_1',['ElasticIn',['../namespaceftxui_1_1animation_1_1easing.html#a0cc4cc8d40617d7b21dea78f71917bbc',1,'ftxui::animation::easing']]], + ['elasticinout_2',['ElasticInOut',['../namespaceftxui_1_1animation_1_1easing.html#a537ce88e07af5658175f95eb70369fb9',1,'ftxui::animation::easing']]], + ['elasticout_3',['ElasticOut',['../namespaceftxui_1_1animation_1_1easing.html#ad771aec6f0170cb9039446699d1d2295',1,'ftxui::animation::easing']]], + ['empty_4',['Empty',['../examples_2component_2collapsible_8cpp.html#aacbbfcb3c5bc93d26a5c681172e27eae',1,'collapsible.cpp']]], + ['emptyelement_5',['emptyElement',['../group__dom.html#ga40451515a5b3049e7a1276cad8b9356c',1,'ftxui']]], + ['executedtasks_6',['ExecutedTasks',['../classftxui_1_1task_1_1TaskRunner.html#aab6716a5f504f5985e73fb6d2b0dd677',1,'ftxui::task::TaskRunner']]], + ['exit_7',['Exit',['../group__component.html#a1a6a7739e9cc01ba888b57d1f9457f4c',1,'ftxui::ScreenInteractive']]], + ['exitloopclosure_8',['ExitLoopClosure',['../group__component.html#ae295157a88e6300609df83769ed885f2',1,'ftxui::ScreenInteractive']]], + ['exponentialin_9',['ExponentialIn',['../namespaceftxui_1_1animation_1_1easing.html#ab0ca381749febbe74887c9fff0522434',1,'ftxui::animation::easing']]], + ['exponentialinout_10',['ExponentialInOut',['../namespaceftxui_1_1animation_1_1easing.html#a502f9e65e97d295f46c6a6435a84464d',1,'ftxui::animation::easing']]], + ['exponentialout_11',['ExponentialOut',['../namespaceftxui_1_1animation_1_1easing.html#a9de59af8a36489121dace3f2a996f029',1,'ftxui::animation::easing']]] +]; diff --git a/search/functions_5.js b/search/functions_5.js new file mode 100644 index 000000000..275fcebe2 --- /dev/null +++ b/search/functions_5.js @@ -0,0 +1,30 @@ +var searchData= +[ + ['filler_0',['filler',['../group__dom.html#gac2a9ed2d22ec3c8811b61f4a901ed367',1,'ftxui']]], + ['fit_1',['Fit',['../namespaceftxui_1_1Dimension.html#aee138f0b60ddc07682a785f55eb5fda6',1,'ftxui::Dimension']]], + ['fitcomponent_2',['FitComponent',['../group__component.html#a4f458e443ed672c2aea9fdd96531a621',1,'ftxui::ScreenInteractive']]], + ['fixed_3',['Fixed',['../namespaceftxui_1_1Dimension.html#a36e539ed36f88d7f01233974da485937',1,'ftxui::Dimension']]], + ['fixedsize_4',['FixedSize',['../group__component.html#a267cfc2d693fa96a82ae74029214d02e',1,'ftxui::ScreenInteractive']]], + ['flex_5',['flex',['../group__dom.html#ga257acd2bd47bab7db879cca2c0e67e23',1,'ftxui']]], + ['flex_5fgrow_6',['flex_grow',['../group__dom.html#ga81ed6b31f512e849247f13d249f6f20e',1,'ftxui']]], + ['flex_5fshrink_7',['flex_shrink',['../group__dom.html#ga4629196b5ffc280054d35f2a9977e829',1,'ftxui']]], + ['flexbox_8',['flexbox',['../namespaceftxui.html#a168a235aa438b6c72df5861322154be3',1,'ftxui']]], + ['focus_9',['focus',['../group__dom.html#gaa2d7d671f184f85e0f396f2610fa6c2e',1,'ftxui']]], + ['focusable_10',['Focusable',['../group__component.html#a02ccd3db74312f1c66aa8e7931489318',1,'ftxui::ComponentBase']]], + ['focuscursorbar_11',['focusCursorBar',['../group__dom.html#ga4f89e72e7001064e3eb8189c8317e95b',1,'ftxui']]], + ['focuscursorbarblinking_12',['focusCursorBarBlinking',['../group__dom.html#ga085a7c997e7364c5a54e73c7b84145db',1,'ftxui']]], + ['focuscursorblock_13',['focusCursorBlock',['../group__dom.html#ga509ef7e7f8913ea3de7efd45e3301ea1',1,'ftxui']]], + ['focuscursorblockblinking_14',['focusCursorBlockBlinking',['../group__dom.html#gadda589914ba8fe863c905b6566557768',1,'ftxui']]], + ['focuscursorunderline_15',['focusCursorUnderline',['../group__dom.html#ga61e1fe02a18c2b18e31ccc9cd3943823',1,'ftxui']]], + ['focuscursorunderlineblinking_16',['focusCursorUnderlineBlinking',['../group__dom.html#ga33637d59d1e52aa06dd2a94162adbfe9',1,'ftxui']]], + ['focused_17',['Focused',['../group__component.html#a0cc612fa3d753b456e0f480f44654a9f',1,'ftxui::ComponentBase']]], + ['focusposition_18',['focusPosition',['../group__dom.html#ga78447ba1ccb792963ad6d306f4ed1256',1,'ftxui']]], + ['focuspositionrelative_19',['focusPositionRelative',['../group__dom.html#ga13befad33cb4125e2143f2af3eddcc71',1,'ftxui']]], + ['forcehandlectrlc_20',['ForceHandleCtrlC',['../group__component.html#ae48c11a6c9160dc14cd5504ebe69304b',1,'ftxui::ScreenInteractive']]], + ['forcehandlectrlz_21',['ForceHandleCtrlZ',['../group__component.html#af1c772ab581e587daad086227435f2ec',1,'ftxui::ScreenInteractive']]], + ['frame_22',['frame',['../namespaceftxui.html#ad0d6a96f6e1fb6d67d9fa6323062a737',1,'ftxui']]], + ['full_23',['Full',['../namespaceftxui_1_1Dimension.html#af795790b995132f62de607ddfd07f9fa',1,'ftxui::Dimension']]], + ['fullscreen_24',['Fullscreen',['../group__component.html#a53dc5c3030151713857cf1a898d0f897',1,'ftxui::ScreenInteractive']]], + ['fullscreenalternatescreen_25',['FullscreenAlternateScreen',['../group__component.html#acad4646ece7569fd39a3a5c847ebb4a8',1,'ftxui::ScreenInteractive']]], + ['fullscreenprimaryscreen_26',['FullscreenPrimaryScreen',['../group__component.html#a6be13532d5bef8f566c12090db2dffba',1,'ftxui::ScreenInteractive']]] +]; diff --git a/search/functions_6.js b/search/functions_6.js new file mode 100644 index 000000000..b0d800fbc --- /dev/null +++ b/search/functions_6.js @@ -0,0 +1,24 @@ +var searchData= +[ + ['gauge_0',['gauge',['../group__dom.html#gae0b8041a60629fd790716038738c93ce',1,'ftxui']]], + ['gaugedirection_1',['gaugeDirection',['../group__dom.html#ga1265cc8a52448e1b98d7abe84a04681e',1,'ftxui']]], + ['gaugedown_2',['gaugeDown',['../group__dom.html#gafe537f915cac5613261580bae3a8fe33',1,'ftxui']]], + ['gaugeleft_3',['gaugeLeft',['../group__dom.html#ga97898b9f77b3edd330eaef22fce7cf2b',1,'ftxui']]], + ['gaugeright_4',['gaugeRight',['../group__dom.html#ga333d781a44885ed4b5ea8444015b86f7',1,'ftxui']]], + ['gaugeup_5',['gaugeUp',['../group__dom.html#ga6e9a97b66c14404a2b3f95f4dae414c2',1,'ftxui']]], + ['get_6',['Get',['../structftxui_1_1task_1_1TaskQueue.html#aa79dc0bf12b85e6ac05adf59818e3939',1,'ftxui::task::TaskQueue']]], + ['getbox_7',['GetBox',['../group__dom.html#a03f5cc5dcad10fecb7a0b8203c86a13e',1,'ftxui::Selection']]], + ['getcolorinfo_8',['GetColorInfo',['../namespaceftxui.html#a883a81f30fb771a82f6c87b77ac3658e',1,'ftxui::GetColorInfo(Color::Palette256 index)'],['../namespaceftxui.html#ad5dd7fa2651003bf7c9f8b58de9b0a93',1,'ftxui::GetColorInfo(Color::Palette16 index)']]], + ['getnodeselectedcontent_9',['GetNodeSelectedContent',['../namespaceftxui.html#a1a3d5804148186b3d4bcc07391ba5f30',1,'ftxui']]], + ['getparts_10',['GetParts',['../group__dom.html#a4d4387d24d418b865c77ed592602d08d',1,'ftxui::Selection']]], + ['getpixel_11',['GetPixel',['../group__dom.html#a656c4e679bf9254e4688f2049989a9bd',1,'ftxui::Canvas']]], + ['getselectedcontent_12',['GetSelectedContent',['../group__dom.html#a2c5cebe05557529299e649867b499680',1,'ftxui::Node']]], + ['getselection_13',['GetSelection',['../group__component.html#ac25769e248caa01d336f5eaa79cd6160',1,'ftxui::ScreenInteractive']]], + ['getselectionstyle_14',['GetSelectionStyle',['../group__screen.html#a056c2ad43affdac744b6907e9ea81463',1,'ftxui::Screen']]], + ['glyphcount_15',['GlyphCount',['../namespaceftxui.html#a9b4f3faecfbeb6b2c0fdf9c30e3f1553',1,'ftxui']]], + ['glyphiterate_16',['GlyphIterate',['../namespaceftxui.html#ad74a7d623ff7a09787469021d30c9461',1,'ftxui']]], + ['glyphnext_17',['GlyphNext',['../namespaceftxui.html#a02453c4504a5cfbc83b38abd4ec6d8ba',1,'ftxui']]], + ['glyphprevious_18',['GlyphPrevious',['../namespaceftxui.html#ae2ef74edc55750554e97ea71c5887650',1,'ftxui']]], + ['graph_19',['graph',['../namespaceftxui.html#ae78c2b2b147e65701493465f8e3f4d89',1,'ftxui']]], + ['gridbox_20',['gridbox',['../namespaceftxui.html#abcdf409d605edafd3191cd7ba47bcbd1',1,'ftxui']]] +]; diff --git a/search/functions_7.js b/search/functions_7.js new file mode 100644 index 000000000..81a3d63e3 --- /dev/null +++ b/search/functions_7.js @@ -0,0 +1,23 @@ +var searchData= +[ + ['hasimmediatetasks_0',['HasImmediateTasks',['../structftxui_1_1task_1_1TaskQueue.html#a257afcb3d4b649b1a39a697cea2843ce',1,'ftxui::task::TaskQueue::HasImmediateTasks()'],['../classftxui_1_1task_1_1TaskRunner.html#a257afcb3d4b649b1a39a697cea2843ce',1,'ftxui::task::TaskRunner::HasImmediateTasks()']]], + ['haspending_1',['HasPending',['../classftxui_1_1ReceiverImpl.html#a49f2a9285b485f25694f48732b0c2554',1,'ftxui::ReceiverImpl']]], + ['hasquitted_2',['HasQuitted',['../group__component.html#a0f10869cb1cad212e8885deac6960a41',1,'ftxui::Loop::HasQuitted()'],['../classftxui_1_1ReceiverImpl.html#a0f10869cb1cad212e8885deac6960a41',1,'ftxui::ReceiverImpl::HasQuitted()']]], + ['hbox_3',['hbox',['../namespaceftxui.html#a552ba6d33b3c9bec586b99fba4c243ac',1,'ftxui']]], + ['hcenter_4',['hcenter',['../group__dom.html#gaf7d0d1e44c1a5424e42a5cddceacf7f7',1,'ftxui']]], + ['height_5',['height',['../group__dom.html#ad3774f6419003470f54fd495124ef51f',1,'ftxui::Canvas']]], + ['hflow_6',['hflow',['../namespaceftxui.html#a345b31919048562675615d5af78e6322',1,'ftxui']]], + ['hmenu1_7',['HMenu1',['../menu__style_8cpp.html#a909976f4b60ea372663d733e16011767',1,'menu_style.cpp']]], + ['hmenu2_8',['HMenu2',['../menu__style_8cpp.html#a9ec2a6df3ad7dd845b4d4ab507d9d5fe',1,'menu_style.cpp']]], + ['hmenu3_9',['HMenu3',['../menu__style_8cpp.html#ab5a58c425dbca17b57cfcbf4b8c98e2e',1,'menu_style.cpp']]], + ['hmenu4_10',['HMenu4',['../menu__style_8cpp.html#a1aead66022c928952b560ebab9913346',1,'menu_style.cpp']]], + ['hmenu5_11',['HMenu5',['../menu__style_8cpp.html#a16cc679d7e91d82d484eff7e443539cb',1,'menu_style.cpp']]], + ['horizontal_12',['Horizontal',['../group__component.html#a5ee36f528383cc1db765fa2140797837',1,'ftxui::MenuOption::Horizontal()'],['../group__component.html#ga01563bae9454fe64c0b29b0eb3755e68',1,'ftxui::Container::Horizontal(Components children)'],['../group__component.html#ga337564f8a13c98222025d8fe7e47df4c',1,'ftxui::Container::Horizontal(Components children, int *selector)']]], + ['horizontalanimated_13',['HorizontalAnimated',['../group__component.html#aedc93fba91339d9713812821cb140c50',1,'ftxui::MenuOption']]], + ['hoverable_14',['Hoverable',['../group__component.html#ga562d984d3830d63285643565cd55d16f',1,'ftxui::Hoverable(Component component, bool *hover)'],['../group__component.html#ga92ec2f5ccb509da2e2c24ae6a1f6b12b',1,'ftxui::Hoverable(Component component, std::function< void()> on_enter, std::function< void()> on_leave)'],['../group__component.html#ga91cac81077c483efdb952268aee9a523',1,'ftxui::Hoverable(Component component, std::function< void(bool)> on_change)'],['../group__component.html#ga9d94b37352be13d3551a9d5785f75439',1,'ftxui::Hoverable(bool *hover)'],['../group__component.html#ga34adfc9c76cf3603156cba32ad5d7142',1,'ftxui::Hoverable(std::function< void()> on_enter, std::function< void()> on_leave)'],['../group__component.html#gafd7cbaef5378a907111a64ee69aed56a',1,'ftxui::Hoverable(std::function< void(bool)> on_change)']]], + ['hscroll_5findicator_15',['hscroll_indicator',['../group__dom.html#ga7f48136f949ccbde722dd93a6de4d0de',1,'ftxui']]], + ['hsv_16',['HSV',['../group__screen.html#a1a119fd00beafc7d2aa5f94518e38fc5',1,'ftxui::Color']]], + ['hsva_17',['HSVA',['../group__screen.html#af067d3410c55684d727aeb29bc8d2af2',1,'ftxui::Color']]], + ['hyperlink_18',['Hyperlink',['../group__screen.html#a0b55b16969dfccc79195fe61c5ba6d1a',1,'ftxui::Screen']]], + ['hyperlink_19',['hyperlink',['../group__dom.html#gad0eac58eac9e6cd9a04879b20f8e123b',1,'ftxui::hyperlink(std::string link)'],['../group__dom.html#ga8bacc04e0cbde663ccc4a4891e8b50d5',1,'ftxui::hyperlink(std::string link, Element child)']]] +]; diff --git a/search/functions_8.js b/search/functions_8.js new file mode 100644 index 000000000..fed973d11 --- /dev/null +++ b/search/functions_8.js @@ -0,0 +1,23 @@ +var searchData= +[ + ['image_0',['Image',['../group__screen.html#a7c483c751b9c859ef08cecb32f1d1994',1,'ftxui::Image::Image()=delete'],['../group__screen.html#aecbd97261c37fa89ea6df7ccaba216c3',1,'ftxui::Image::Image(int dimx, int dimy)']]], + ['index_1',['Index',['../group__component.html#a8ef12397d1682615bc3108c397734179',1,'ftxui::ComponentBase']]], + ['inner_2',['Inner',['../examples_2component_2collapsible_8cpp.html#a74bf63b8448df7b03bd98ae6de127c0a',1,'collapsible.cpp']]], + ['input_3',['Input',['../group__component.html#ga7f285fcbc4dd0a0767b89a255fd062dc',1,'ftxui::Input(InputOption option)'],['../group__component.html#ga9d118d596e33bf5bee9d5eccb6265d15',1,'ftxui::Input(StringRef content, InputOption option)'],['../group__component.html#ga82ba18065d2c29514f034c7278dead74',1,'ftxui::Input(StringRef content, StringRef placeholder, InputOption option)']]], + ['input_4',['input',['../group__component.html#a947e2de698c4bef07c78674218330677',1,'ftxui::Event']]], + ['instance_5',['Instance',['../focus__cursor_8cpp.html#a96da73e7fb75cca8a91e59559ce1dba2',1,'focus_cursor.cpp']]], + ['interpolate_6',['Interpolate',['../group__screen.html#ae5d82c5fbae4f6561c9471c11c0a461b',1,'ftxui::Color']]], + ['intersection_7',['Intersection',['../group__screen.html#a83d40499d9e8740c35dc2352c2ac84a8',1,'ftxui::Box']]], + ['inverted_8',['inverted',['../group__dom.html#ga672456b8f2091b615a30ff755418b37b',1,'ftxui']]], + ['is_5fcharacter_9',['is_character',['../group__component.html#ae75703788c6f68b39fc51f8db3ba156d',1,'ftxui::Event']]], + ['is_5fcursor_5fposition_10',['is_cursor_position',['../group__component.html#a4464a1cace713dc3544922cc6d5acdc1',1,'ftxui::Event']]], + ['is_5fcursor_5fshape_11',['is_cursor_shape',['../group__component.html#af795895177b7686bf63ab113e70159c8',1,'ftxui::Event']]], + ['is_5fmouse_12',['is_mouse',['../group__component.html#a2c835925299d56941ffd2e2421f0fd13',1,'ftxui::Event']]], + ['iscombining_13',['IsCombining',['../namespaceftxui.html#a506e6b467ddd8d11646942fd101d8e9e',1,'ftxui']]], + ['iscontrol_14',['IsControl',['../namespaceftxui.html#a037df033cc26c960faa54b52bdbea900',1,'ftxui']]], + ['isempty_15',['IsEmpty',['../group__dom.html#a8e12342fc420701fbffd97025421575a',1,'ftxui::Selection::IsEmpty()'],['../group__screen.html#a8e12342fc420701fbffd97025421575a',1,'ftxui::Box::IsEmpty()']]], + ['isfullwidth_16',['IsFullWidth',['../namespaceftxui.html#abd13f584efddd3a7e5749c9c5e841a11',1,'ftxui']]], + ['isopaque_17',['IsOpaque',['../group__screen.html#a74deffc6b6c7e07b3ec67766ff35abba',1,'ftxui::Color']]], + ['iswordbreakingcharacter_18',['IsWordBreakingCharacter',['../namespaceftxui.html#a64a9bd1df7ca3ffb1622507d01cd0b13',1,'ftxui']]], + ['italic_19',['italic',['../group__dom.html#ga8a8d190765de7bbd9e78f9e639c2a96d',1,'ftxui']]] +]; diff --git a/search/functions_9.js b/search/functions_9.js new file mode 100644 index 000000000..20da5147b --- /dev/null +++ b/search/functions_9.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['linear_0',['Linear',['../namespaceftxui_1_1animation_1_1easing.html#a39923c8d62cdaacdc179c2ece3ee16b4',1,'ftxui::animation::easing']]], + ['lineargradient_1',['LinearGradient',['../group__dom.html#a5e989e4841fbba91e1714f977c5c58b9',1,'ftxui::LinearGradient::LinearGradient()'],['../group__dom.html#ac57e39e64c79b5389f234eeaebfbb2fd',1,'ftxui::LinearGradient::LinearGradient(Color begin, Color end)'],['../group__dom.html#adbf0567cfc8e05051a4236d6541f63b8',1,'ftxui::LinearGradient::LinearGradient(float angle, Color begin, Color end)']]], + ['llvmfuzzertestoneinput_2',['LLVMFuzzerTestOneInput',['../component__fuzzer_8cpp.html#af5589fffd86439465eeb19c9774d1982',1,'LLVMFuzzerTestOneInput(const char *data, size_t size): component_fuzzer.cpp'],['../terminal__input__parser__test__fuzzer_8cpp.html#af5589fffd86439465eeb19c9774d1982',1,'LLVMFuzzerTestOneInput(const char *data, size_t size): terminal_input_parser_test_fuzzer.cpp']]], + ['loop_3',['Loop',['../group__component.html#aacbc899babaac445c3b9b831322e8c70',1,'ftxui::Loop::Loop(ScreenInteractive *screen, Component component)'],['../group__component.html#ad72ac0aa7a08850990b76f15e13dbe79',1,'ftxui::Loop::Loop(const Loop &)=default'],['../group__component.html#adfc045f0113bbf7f6dc5895ff7ce3ac5',1,'ftxui::Loop::Loop(Loop &&)=delete'],['../group__component.html#a734882bfa3e357e4bb57581494e8699b',1,'ftxui::Loop::Loop(const ScreenInteractive &)=delete'],['../group__component.html#a9bd3dbd471fce0038700caaa47dddc1a',1,'ftxui::ScreenInteractive::Loop()']]], + ['loremipsum_4',['LoremIpsum',['../examples_2component_2selection_8cpp.html#a693bf20426978b4a6d5114374d8c521d',1,'selection.cpp']]] +]; diff --git a/search/functions_a.js b/search/functions_a.js new file mode 100644 index 000000000..d2f81db79 --- /dev/null +++ b/search/functions_a.js @@ -0,0 +1,17 @@ +var searchData= +[ + ['main_0',['main',['../examples_2component_2button_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): button.cpp'],['../button__animated_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): button_animated.cpp'],['../button__in__frame_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): button_in_frame.cpp'],['../button__style_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): button_style.cpp'],['../canvas__animated_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): canvas_animated.cpp'],['../examples_2component_2checkbox_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): checkbox.cpp'],['../checkbox__in__frame_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): checkbox_in_frame.cpp'],['../examples_2component_2collapsible_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): collapsible.cpp'],['../composition_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): composition.cpp'],['../custom__loop_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): custom_loop.cpp'],['../examples_2component_2dropdown_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): dropdown.cpp'],['../dropdown__custom_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): dropdown_custom.cpp'],['../flexbox__gallery_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): flexbox_gallery.cpp'],['../examples_2component_2focus_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): focus.cpp'],['../focus__cursor_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): focus_cursor.cpp'],['../gallery_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): gallery.cpp'],['../homescreen_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): homescreen.cpp'],['../examples_2component_2input_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): input.cpp'],['../input__in__frame_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): input_in_frame.cpp'],['../input__style_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): input_style.cpp'],['../linear__gradient__gallery_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): linear_gradient_gallery.cpp'],['../examples_2component_2maybe_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): maybe.cpp'],['../examples_2component_2menu_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): menu.cpp'],['../menu2_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): menu2.cpp'],['../menu__entries_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): menu_entries.cpp'],['../menu__entries__animated_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): menu_entries_animated.cpp'],['../menu__in__frame_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): menu_in_frame.cpp'],['../menu__in__frame__horizontal_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): menu_in_frame_horizontal.cpp'],['../menu__multiple_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): menu_multiple.cpp'],['../menu__style_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): menu_style.cpp'],['../menu__underline__animated__gallery_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): menu_underline_animated_gallery.cpp'],['../modal__dialog_8cpp.html#ac0f2228420376f4db7e1274f2b41667c',1,'main(int argc, const char *argv[]): modal_dialog.cpp'],['../modal__dialog__custom_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): modal_dialog_custom.cpp'],['../nested__screen_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): nested_screen.cpp'],['../print__key__press_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): print_key_press.cpp'],['../examples_2component_2radiobox_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): radiobox.cpp'],['../radiobox__in__frame_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): radiobox_in_frame.cpp'],['../examples_2component_2renderer_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): renderer.cpp'],['../examples_2component_2resizable__split_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): resizable_split.cpp'],['../scrollbar_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): scrollbar.cpp'],['../examples_2component_2selection_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): selection.cpp'],['../examples_2component_2slider_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): slider.cpp'],['../slider__direction_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): slider_direction.cpp'],['../slider__rgb_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): slider_rgb.cpp'],['../tab__horizontal_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): tab_horizontal.cpp'],['../tab__vertical_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): tab_vertical.cpp'],['../textarea_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): textarea.cpp'],['../toggle_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): toggle.cpp'],['../examples_2component_2window_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): window.cpp'],['../with__restored__io_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): with_restored_io.cpp'],['../examples_2dom_2border_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): border.cpp'],['../border__colored_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): border_colored.cpp'],['../border__style_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): border_style.cpp'],['../examples_2dom_2canvas_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): canvas.cpp'],['../color__gallery_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): color_gallery.cpp'],['../color__info__palette256_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): color_info_palette256.cpp'],['../color__truecolor__HSV_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): color_truecolor_HSV.cpp'],['../color__truecolor__RGB_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): color_truecolor_RGB.cpp'],['../examples_2dom_2dbox_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): dbox.cpp'],['../examples_2dom_2gauge_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): gauge.cpp'],['../gauge__direction_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): gauge_direction.cpp'],['../examples_2dom_2graph_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): graph.cpp'],['../examples_2dom_2gridbox_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): gridbox.cpp'],['../hflow_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): hflow.cpp'],['../html__like_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): html_like.cpp'],['../examples_2dom_2linear__gradient_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): linear_gradient.cpp'],['../package__manager_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): package_manager.cpp'],['../examples_2dom_2paragraph_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): paragraph.cpp'],['../examples_2dom_2separator_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): separator.cpp'],['../separator__style_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): separator_style.cpp'],['../examples_2dom_2size_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): size.cpp'],['../examples_2dom_2spinner_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): spinner.cpp'],['../style__blink_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): style_blink.cpp'],['../style__bold_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): style_bold.cpp'],['../style__color_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): style_color.cpp'],['../style__dim_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): style_dim.cpp'],['../style__gallery_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): style_gallery.cpp'],['../style__hyperlink_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): style_hyperlink.cpp'],['../style__inverted_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): style_inverted.cpp'],['../style__italic_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): style_italic.cpp'],['../style__strikethrough_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): style_strikethrough.cpp'],['../style__underlined_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): style_underlined.cpp'],['../style__underlined__double_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): style_underlined_double.cpp'],['../examples_2dom_2table_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): table.cpp'],['../vbox__hbox_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): vbox_hbox.cpp'],['../vflow_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4',1,'main(): vflow.cpp']]], + ['maincomponent_1',['MainComponent',['../modal__dialog_8cpp.html#aa61b015248766b6067b6d3c99f04c389',1,'modal_dialog.cpp']]], + ['make_2',['Make',['../namespaceftxui.html#a2b8973dc71334f1d98e2e6f55de8b5ae',1,'ftxui']]], + ['make_5fbox_3',['make_box',['../examples_2component_2focus_8cpp.html#a9ffb8a33ec5d0133f63f791d526df1c7',1,'focus.cpp']]], + ['make_5fgrid_4',['make_grid',['../examples_2component_2focus_8cpp.html#a9543e1b98f00db8484ee0c856a1d4cca',1,'focus.cpp']]], + ['makereceiver_5',['MakeReceiver',['../namespaceftxui.html#a57abe3e11733b1d3ebacc56692d3537c',1,'ftxui']]], + ['makesender_6',['MakeSender',['../classftxui_1_1ReceiverImpl.html#aee8560dccb6ab3df27f0a0fc6a1f8442',1,'ftxui::ReceiverImpl']]], + ['maybe_7',['Maybe',['../group__component.html#ga20b66a70c1cd4ff3f0ff571a4507d2b4',1,'ftxui::Maybe(Component child, const bool *show)'],['../group__component.html#ga70afe9695167fb736631173201969730',1,'ftxui::Maybe(Component child, std::function< bool()> show)'],['../group__component.html#ga83b6fd5e1524023722a7450f987f15d0',1,'ftxui::Maybe(const bool *show)'],['../group__component.html#gae39ad8b223e6bb7704c77a3708571a7d',1,'ftxui::Maybe(std::function< bool()> show)']]], + ['menu_8',['Menu',['../group__component.html#ga27828fc39da10a18478ba84b1b162039',1,'ftxui::Menu(MenuOption option)'],['../group__component.html#gad793a3a507766ffa711c4332a3815e24',1,'ftxui::Menu(ConstStringListRef entries, int *selected, MenuOption option)']]], + ['menuentry_9',['MenuEntry',['../group__component.html#ga2c0a27959e6a5d90109f6d4506e00f69',1,'ftxui::MenuEntry(MenuEntryOption option)'],['../group__component.html#gafca94c5cdae5fbf3c6aa81fc1cd7b1c0',1,'ftxui::MenuEntry(ConstStringRef label, MenuEntryOption option)']]], + ['modal_10',['Modal',['../group__component.html#ga5185342fbba215496cb8a6805f36089c',1,'ftxui::Modal(Component main, Component modal, const bool *show_modal)'],['../group__component.html#ga5babae0bb25f8cada57784cc5d27fb74',1,'ftxui::Modal(Component modal, const bool *show_modal)']]], + ['modalcomponent_11',['ModalComponent',['../modal__dialog_8cpp.html#a3b73476f6f304dce17f808a7c3789f5c',1,'modal_dialog.cpp']]], + ['mouse_12',['Mouse',['../group__component.html#a382859ca10d98eb9c03713de4a95d3f9',1,'ftxui::Event']]], + ['mouse_13',['mouse',['../group__component.html#a37daf59df57eb6415eb34c8df11a4892',1,'ftxui::Event']]] +]; diff --git a/search/functions_b.js b/search/functions_b.js new file mode 100644 index 000000000..b4e6d74d1 --- /dev/null +++ b/search/functions_b.js @@ -0,0 +1,8 @@ +var searchData= +[ + ['nested_0',['Nested',['../nested__screen_8cpp.html#a77fdac0113a8c43983469efa26ce7276',1,'nested_screen.cpp']]], + ['node_1',['Node',['../group__dom.html#a0d313fac56abd7ebe58a17f1530b879e',1,'ftxui::Node::Node()'],['../group__dom.html#a19fa1eae4c02e514c62a95e395b383a1',1,'ftxui::Node::Node(Elements children)'],['../group__dom.html#a7eb6a9efa23e5f6f7fc53b5aa3759dff',1,'ftxui::Node::Node(const Node &)=delete'],['../group__dom.html#ac6365e35a2029b3e58eca97905f8124d',1,'ftxui::Node::Node(const Node &&)=delete']]], + ['nodedecorator_2',['NodeDecorator',['../classftxui_1_1NodeDecorator.html#a7e9d74ba5d480d87e8bfcaf2df66fbbe',1,'ftxui::NodeDecorator']]], + ['notflex_3',['notflex',['../group__dom.html#ga845b0ea50d51024aa4e050447b46e1dd',1,'ftxui']]], + ['nothing_4',['nothing',['../group__dom.html#ga1bfd3885ac8b40dc82a1103725003c07',1,'ftxui']]] +]; diff --git a/search/functions_c.js b/search/functions_c.js new file mode 100644 index 000000000..7b0b5f932 --- /dev/null +++ b/search/functions_c.js @@ -0,0 +1,17 @@ +var searchData= +[ + ['onanimation_0',['OnAnimation',['../classftxui_1_1animation_1_1Animator.html#ac956aa7c105ad418392f69219711117d',1,'ftxui::animation::Animator::OnAnimation()'],['../group__component.html#aebad858485d02f035a8ea34af66a7fa7',1,'ftxui::ComponentBase::OnAnimation(animation::Params &params)']]], + ['onevent_1',['OnEvent',['../group__component.html#ab84629a8fecad2e1cdd426b7ddc72277',1,'ftxui::ComponentBase']]], + ['onrender_2',['OnRender',['../group__component.html#ab79303652dad19eac0540848487cf8c5',1,'ftxui::ComponentBase']]], + ['operator_21_3d_3',['operator!=',['../group__component.html#ae4581774f4417f68d335de865fd2e6d3',1,'ftxui::Event::operator!=()'],['../group__screen.html#a1ff481fa3b55fcc402c98c7564990c17',1,'ftxui::Box::operator!=()'],['../group__screen.html#a5db052159bd2c738ea453d9b9600513a',1,'ftxui::Color::operator!=()']]], + ['operator_22_22_5frgb_4',['operator""_rgb',['../namespaceftxui_1_1literals.html#a66d988ecc082819b1671ee2bbadebccd',1,'ftxui::operator""_rgb()'],['../namespaceftxui_1_1literals.html#a66d988ecc082819b1671ee2bbadebccd',1,'ftxui::literals::operator""_rgb()']]], + ['operator_28_29_5',['operator()',['../classftxui_1_1ConstRef.html#afdc36f6a5716b29a5d81a2dd93376d82',1,'ftxui::ConstRef::operator()()'],['../classftxui_1_1Ref.html#a625855a4f62948f4f1ad06354be9ca09',1,'ftxui::Ref::operator()()'],['../classftxui_1_1Ref.html#afdc36f6a5716b29a5d81a2dd93376d82',1,'ftxui::Ref::operator()() const']]], + ['operator_2a_6',['operator*',['../classftxui_1_1ConstRef.html#a241c04e3ce86e1fd5a946eb2aa8b1f22',1,'ftxui::ConstRef::operator*()'],['../classftxui_1_1Ref.html#a3f534efce0b043d603eb8f5653268e7d',1,'ftxui::Ref::operator*()'],['../classftxui_1_1Ref.html#a241c04e3ce86e1fd5a946eb2aa8b1f22',1,'ftxui::Ref::operator*() const']]], + ['operator_2d_3e_7',['operator->',['../classftxui_1_1ConstRef.html#abaade5c780b539b94de660e314cb0c90',1,'ftxui::ConstRef::operator->()'],['../classftxui_1_1Ref.html#a4442b1b9eab40e7939e1e01cdedcb7ae',1,'ftxui::Ref::operator->()'],['../classftxui_1_1Ref.html#abaade5c780b539b94de660e314cb0c90',1,'ftxui::Ref::operator->() const']]], + ['operator_3c_8',['operator<',['../group__component.html#a7590045e19360277dfc54320b627002c',1,'ftxui::Event::operator<()'],['../structftxui_1_1task_1_1PendingTask.html#abca1f607e0e907841b7a6d88190995db',1,'ftxui::task::PendingTask::operator<()']]], + ['operator_3d_9',['operator=',['../classftxui_1_1CapturedMouseInterface.html#adfa362c249253f9570e5c1cf42fc16c3',1,'ftxui::CapturedMouseInterface::operator=(const CapturedMouseInterface &)=default'],['../classftxui_1_1CapturedMouseInterface.html#ac349c4e493dbe8aa7c47052d91e0f411',1,'ftxui::CapturedMouseInterface::operator=(CapturedMouseInterface &&)=delete'],['../group__component.html#ac444ac233dcbd4b2ad7972d2086ecc73',1,'ftxui::ComponentBase::operator=(const ComponentBase &)=delete'],['../group__component.html#a9e3b99c8fc32f2ce151e2ba737c0d546',1,'ftxui::ComponentBase::operator=(ComponentBase &&)=delete'],['../group__component.html#add07fd33947183c42a79cb4759129ff8',1,'ftxui::Loop::operator=(Loop &&)=delete'],['../group__component.html#ab35ce310313b96f28233ebc9279b5dd3',1,'ftxui::Loop::operator=(const Loop &)=delete'],['../classftxui_1_1SenderImpl.html#a571b0715efdefbfbc80bebc4ba3f16c3',1,'ftxui::SenderImpl::operator=(const SenderImpl &)=delete'],['../classftxui_1_1SenderImpl.html#aec884eaa70eed221721d0ae963974927',1,'ftxui::SenderImpl::operator=(SenderImpl &&)=delete'],['../group__dom.html#a7e12a390c13d283fc06cafbbfef7eba7',1,'ftxui::Node::operator=(const Node &)=delete'],['../group__dom.html#abe938f0d7bfdca112e345590d4887de6',1,'ftxui::Node::operator=(const Node &&)=delete'],['../classftxui_1_1AutoReset.html#a72b3c7613f9ecfb66005b1c30a5189d4',1,'ftxui::AutoReset::operator=(const AutoReset &)=delete'],['../classftxui_1_1AutoReset.html#a63fb3bea42919c7f183d4fb315451f6a',1,'ftxui::AutoReset::operator=(AutoReset &&)=delete'],['../classftxui_1_1ConstRef.html#ad144149e6f6f0d59610da4b28e22aef1',1,'ftxui::ConstRef::operator=(ConstRef &&) noexcept=default'],['../classftxui_1_1ConstRef.html#a834cee3b2f409135c37c188c583bce91',1,'ftxui::ConstRef::operator=(const ConstRef< T > &)=default'],['../classftxui_1_1Ref.html#abd99a8175d3ef482e70c239aef26322a',1,'ftxui::Ref::operator=(Ref &&) noexcept=default'],['../classftxui_1_1Ref.html#a2219840465715bbca4b1467132c686a5',1,'ftxui::Ref::operator=(const Ref< T > &)=default'],['../classftxui_1_1ConstStringListRef_1_1Adapter.html#a99e89ddbd26ca55a6696a12a819c8dac',1,'ftxui::ConstStringListRef::Adapter::operator=(const Adapter &)=default'],['../classftxui_1_1ConstStringListRef_1_1Adapter.html#a159afff9273b4ba2315d0fe5c0dc3629',1,'ftxui::ConstStringListRef::Adapter::operator=(Adapter &&)=default'],['../classftxui_1_1ConstStringListRef.html#a616528ee5b9a372e16ae2125e8dee3b7',1,'ftxui::ConstStringListRef::operator=(const ConstStringListRef &)=default'],['../classftxui_1_1ConstStringListRef.html#a51744ac3bfa14639955248e51313ba1f',1,'ftxui::ConstStringListRef::operator=(ConstStringListRef &&)=default']]], + ['operator_3d_3d_10',['operator==',['../group__component.html#ad5b326fac977a9c1c832ddb508f713da',1,'ftxui::Event::operator==()'],['../group__screen.html#ad75c695cfa18e51d88a0984af5df2f69',1,'ftxui::Box::operator==()'],['../group__screen.html#a66275ebe4681464e082660fa6be9ba28',1,'ftxui::Color::operator==()']]], + ['operator_5b_5d_11',['operator[]',['../classftxui_1_1ConstStringListRef_1_1Adapter.html#aaec2cde2cf71a044ba3305632c7a867c',1,'ftxui::ConstStringListRef::Adapter::operator[]()'],['../classftxui_1_1ConstStringListRef.html#afa13214cc014e69f7dc95b1df7c90d4e',1,'ftxui::ConstStringListRef::operator[]()']]], + ['operator_7c_12',['operator|',['../namespaceftxui.html#a65a2e15f64ae3bc205c485abc3a5aeb9',1,'ftxui::operator|(Component component, ComponentDecorator decorator)'],['../namespaceftxui.html#a9c4cf8bcb7012f740b146bfe89cbd3eb',1,'ftxui::operator|(Component component, ElementDecorator decorator)'],['../group__dom.html#ga7e9a69f0592b4013bd725d662f4a76e7',1,'ftxui::operator|(Element element, Decorator decorator)'],['../group__dom.html#ga6cbc84eb24a655ae084b3c7d26f9abfc',1,'ftxui::operator|(Elements elements, Decorator decorator)'],['../group__dom.html#ga027fbc9cf6fef9e86ae6a2a79e8bf23a',1,'ftxui::operator|(Decorator a, Decorator b)']]], + ['operator_7c_3d_13',['operator|=',['../namespaceftxui.html#ade35e69d695327db85be01c9787c39f8',1,'ftxui::operator|=(Component &component, ComponentDecorator decorator)'],['../namespaceftxui.html#aa480c58bcaeae204fbe68b192c5ede92',1,'ftxui::operator|=(Component &component, ElementDecorator decorator)'],['../group__dom.html#ga0be26ac5dcbe6c707857c791d8eec720',1,'ftxui::operator|=(Element &e, Decorator d)']]] +]; diff --git a/search/functions_d.js b/search/functions_d.js new file mode 100644 index 000000000..061304d70 --- /dev/null +++ b/search/functions_d.js @@ -0,0 +1,19 @@ +var searchData= +[ + ['paragraph_0',['paragraph',['../namespaceftxui.html#ac54cdd05db30871ce082a8fa650545da',1,'ftxui::paragraph(std::wstring text)'],['../group__dom.html#ga3f9093ae1a2790d396fc2cff9990fbbd',1,'ftxui::paragraph(const std::string &the_text)']]], + ['paragraphaligncenter_1',['paragraphAlignCenter',['../group__dom.html#ga6a105f6b0d07d7933379ff1ae9282fb8',1,'ftxui']]], + ['paragraphalignjustify_2',['paragraphAlignJustify',['../group__dom.html#gae4de548aa67ab77cb345e4ddec6b248b',1,'ftxui']]], + ['paragraphalignleft_3',['paragraphAlignLeft',['../group__dom.html#gaa334a836eccc573e1137a1ba29d07d8a',1,'ftxui']]], + ['paragraphalignright_4',['paragraphAlignRight',['../group__dom.html#ga28a69f06a88c89fe7a507e33ab486411',1,'ftxui']]], + ['params_5',['Params',['../classftxui_1_1animation_1_1Params.html#a27854a0925475df9b926b03808cc8d8c',1,'ftxui::animation::Params']]], + ['parent_6',['Parent',['../group__component.html#aaf284a408631f31558694973a04186c2',1,'ftxui::ComponentBase']]], + ['pendingtask_7',['PendingTask',['../structftxui_1_1task_1_1PendingTask.html#afc8e67df1a9259a50e7afa49765cb7c8',1,'ftxui::task::PendingTask::PendingTask(Task t)'],['../structftxui_1_1task_1_1PendingTask.html#a5e36044e86c7936eee25d0ff222b7235',1,'ftxui::task::PendingTask::PendingTask(Task t, std::chrono::steady_clock::duration duration)']]], + ['pixel_8',['Pixel',['../group__screen.html#a3d22dc2630f1c1c69ec973cd4648b5d5',1,'ftxui::Pixel']]], + ['pixelat_9',['PixelAt',['../group__screen.html#a483f8ee1967e200cfc9e277b3ce00174',1,'ftxui::Image::PixelAt(int x, int y)'],['../group__screen.html#a03b2b39bb8f4d72068744776093125b3',1,'ftxui::Image::PixelAt(int x, int y) const']]], + ['post_10',['Post',['../group__component.html#a49209b09dcf8bc540f79e2bfd0a7ee88',1,'ftxui::ScreenInteractive']]], + ['postdelayedtask_11',['PostDelayedTask',['../classftxui_1_1task_1_1TaskRunner.html#a9ed72fa10b2d44bb1af7bd8af64dd28b',1,'ftxui::task::TaskRunner']]], + ['postevent_12',['PostEvent',['../group__component.html#a29e75bdaa1d5465518787ec014b2c3bf',1,'ftxui::ScreenInteractive']]], + ['posttask_13',['PostTask',['../structftxui_1_1task_1_1TaskQueue.html#ada41a34871c48f856bf3659e0b0c4f81',1,'ftxui::task::TaskQueue::PostTask()'],['../classftxui_1_1task_1_1TaskRunner.html#a6265a2d99ef09d491365c21a4a703c71',1,'ftxui::task::TaskRunner::PostTask()']]], + ['prefer_14',['Prefer',['../structftxui_1_1Requirement_1_1Focused.html#a8a204963959c73e971c7d030cbc34134',1,'ftxui::Requirement::Focused']]], + ['print_15',['Print',['../group__screen.html#acfe358aa128835387b6c2b7ffe22bab5',1,'ftxui::Color::Print()'],['../group__screen.html#ad93edbe885499a712129356f1ffd506b',1,'ftxui::Screen::Print()']]] +]; diff --git a/search/functions_e.js b/search/functions_e.js new file mode 100644 index 000000000..ee9a4b332 --- /dev/null +++ b/search/functions_e.js @@ -0,0 +1,12 @@ +var searchData= +[ + ['quadraticin_0',['QuadraticIn',['../namespaceftxui_1_1animation_1_1easing.html#ab0b9303e7f956c36960e601f158e488f',1,'ftxui::animation::easing']]], + ['quadraticinout_1',['QuadraticInOut',['../namespaceftxui_1_1animation_1_1easing.html#a8155757f48a6e85e27da99c0a93f7e8d',1,'ftxui::animation::easing']]], + ['quadraticout_2',['QuadraticOut',['../namespaceftxui_1_1animation_1_1easing.html#aa1618a8f59ae7bae191d0ab36bf90e66',1,'ftxui::animation::easing']]], + ['quarticin_3',['QuarticIn',['../namespaceftxui_1_1animation_1_1easing.html#af60268bac4059d32b3f7680042dba350',1,'ftxui::animation::easing']]], + ['quarticinout_4',['QuarticInOut',['../namespaceftxui_1_1animation_1_1easing.html#a72dd2cb5c7ffddfe3a3d8b455f68d37e',1,'ftxui::animation::easing']]], + ['quarticout_5',['QuarticOut',['../namespaceftxui_1_1animation_1_1easing.html#a8878f359f37551ae64eb183af3ca93b8',1,'ftxui::animation::easing']]], + ['quinticin_6',['QuinticIn',['../namespaceftxui_1_1animation_1_1easing.html#ab4eae8c5808cc6ab161037659e761a50',1,'ftxui::animation::easing']]], + ['quinticinout_7',['QuinticInOut',['../namespaceftxui_1_1animation_1_1easing.html#afcbc9e6b461fe3418a59faf4a5f9284d',1,'ftxui::animation::easing']]], + ['quinticout_8',['QuinticOut',['../namespaceftxui_1_1animation_1_1easing.html#aae2598b1aa6a2fc944f52edbf0453fd5',1,'ftxui::animation::easing']]] +]; diff --git a/search/functions_f.js b/search/functions_f.js new file mode 100644 index 000000000..c187dcd08 --- /dev/null +++ b/search/functions_f.js @@ -0,0 +1,26 @@ +var searchData= +[ + ['radiobox_0',['Radiobox',['../group__component.html#ga3e7a44f321fa910f07aef5879e67af95',1,'ftxui::Radiobox(RadioboxOption option)'],['../group__component.html#gac73eebf15ff6b5386b7ee6c6cb4a4890',1,'ftxui::Radiobox(ConstStringListRef entries, int *selected, RadioboxOption option)']]], + ['receive_1',['Receive',['../classftxui_1_1ReceiverImpl.html#a2d2bc6945a964ecb739002cc58291bee',1,'ftxui::ReceiverImpl']]], + ['receivenonblocking_2',['ReceiveNonBlocking',['../classftxui_1_1ReceiverImpl.html#a3afe67ce4b9296787d4133866e0b2b00',1,'ftxui::ReceiverImpl']]], + ['receiverimpl_3',['ReceiverImpl',['../classftxui_1_1ReceiverImpl.html#a06cce9969ba99f4e42c24dbce9662a3a',1,'ftxui::ReceiverImpl']]], + ['ref_4',['Ref',['../classftxui_1_1Ref.html#a6170df9accd9f47736e97385233017b3',1,'ftxui::Ref::Ref()=default'],['../classftxui_1_1Ref.html#ab19bb3d5a2b0867c790f00f339915c56',1,'ftxui::Ref::Ref(T t)'],['../classftxui_1_1Ref.html#ae16b183b63cb1d7ef3d11ff47c158a8b',1,'ftxui::Ref::Ref(T *t)'],['../classftxui_1_1Ref.html#aec110a549f4e384fb89896bd013cc8fe',1,'ftxui::Ref::Ref(const Ref< T > &)=default'],['../classftxui_1_1Ref.html#af37c209213693451d05f4b089402ee07',1,'ftxui::Ref::Ref(Ref< T > &&) noexcept=default']]], + ['reflect_5',['reflect',['../namespaceftxui.html#aaff8245861617a3d9e846e99de582a63',1,'ftxui']]], + ['registerhyperlink_6',['RegisterHyperlink',['../group__screen.html#a38015a8bc3dda474354ec8a374a6e2de',1,'ftxui::Screen']]], + ['render_7',['Render',['../group__component.html#a28d41d6113c5b29c8dd45846582b3299',1,'ftxui::ComponentBase::Render()'],['../group__dom.html#a7e286fe14880614686ceeec84a9a9702',1,'ftxui::Node::Render()'],['../group__dom.html#a28d41d6113c5b29c8dd45846582b3299',1,'ftxui::Table::Render()'],['../group__dom.html#gad4b8aa9392f56ba41e2b421e046a7d83',1,'ftxui::Render(Screen &screen, const Element &element)'],['../group__dom.html#ga32a24db985fa1b37bf686b00f7e1b4ff',1,'ftxui::Render(Screen &screen, Node *node)'],['../namespaceftxui.html#ab35030b64136afa183d474d11bd1f6dd',1,'ftxui::Render(Screen &screen, Node *node, Selection &selection)']]], + ['renderer_8',['Renderer',['../group__component.html#ga533e883e2aeea28de2b60564fcaf0361',1,'ftxui::Renderer(Component child, std::function< Element()> render)'],['../group__component.html#gaf03d3df7243bf71bb1a73686628f7f2b',1,'ftxui::Renderer(std::function< Element()> render)'],['../group__component.html#ga099cb57274a99396ee10f38acbfe62a7',1,'ftxui::Renderer(std::function< Element(bool)> render)'],['../group__component.html#ga41d63b7af41dee1570b54915821abd30',1,'ftxui::Renderer(ElementDecorator decorator)']]], + ['requestanimationframe_9',['RequestAnimationFrame',['../group__component.html#ad94d3d42aba3359550759aae5bcffbe9',1,'ftxui::ScreenInteractive::RequestAnimationFrame()'],['../group__component.html#gad94d3d42aba3359550759aae5bcffbe9',1,'ftxui::animation::RequestAnimationFrame()']]], + ['requirement_10',['requirement',['../group__dom.html#a39a263e8c8786dc62fcb4d734aad7fe6',1,'ftxui::Node']]], + ['resetposition_11',['ResetPosition',['../group__screen.html#a9677c078c4270afdb7451cdc0b0871d4',1,'ftxui::Screen']]], + ['resizablesplit_12',['ResizableSplit',['../namespaceftxui.html#a5ce41caeafc35dedc5c7da5347386e80',1,'ftxui']]], + ['resizablesplitbottom_13',['ResizableSplitBottom',['../group__component.html#gacb75e6e61a021829893f7b57aeb7e3a2',1,'ftxui']]], + ['resizablesplitleft_14',['ResizableSplitLeft',['../group__component.html#gae2205fc172615b43e1e3307bb614be4c',1,'ftxui']]], + ['resizablesplitright_15',['ResizableSplitRight',['../group__component.html#ga9030d0beb64f653603cab382b02750a8',1,'ftxui']]], + ['resizablesplittop_16',['ResizableSplitTop',['../group__component.html#ga238b4b650aca14716b82b2198695e008',1,'ftxui']]], + ['rgb_17',['RGB',['../group__screen.html#aacec69e0aa1063fbec2cc305e7b076dd',1,'ftxui::Color']]], + ['rgba_18',['RGBA',['../group__screen.html#a2649c83ca263094811d2c537d44b59b4',1,'ftxui::Color']]], + ['run_19',['Run',['../group__component.html#aa3eca255b6be227d7d901cc2a72017a5',1,'ftxui::Loop::Run()'],['../classftxui_1_1task_1_1TaskRunner.html#a58f2f0e6ed3d38c3e6a081f7c99a544f',1,'ftxui::task::TaskRunner::Run()']]], + ['runonce_20',['RunOnce',['../group__component.html#ad638ec512bc0d9876c2bf1c15913e9d3',1,'ftxui::Loop']]], + ['runonceblocking_21',['RunOnceBlocking',['../group__component.html#afe89c4e52cb64cd7271c3fa8a04e7b61',1,'ftxui::Loop']]], + ['rununtilidle_22',['RunUntilIdle',['../classftxui_1_1task_1_1TaskRunner.html#a7865ea610276e71d61633de0aab71753',1,'ftxui::task::TaskRunner']]] +]; diff --git a/search/groups_0.js b/search/groups_0.js new file mode 100644 index 000000000..b06b72406 --- /dev/null +++ b/search/groups_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['component_0',['ftxui/component',['../group__component.html',1,'']]] +]; diff --git a/search/groups_1.js b/search/groups_1.js new file mode 100644 index 000000000..74821f862 --- /dev/null +++ b/search/groups_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['dom_0',['ftxui/dom',['../group__dom.html',1,'']]] +]; diff --git a/search/groups_2.js b/search/groups_2.js new file mode 100644 index 000000000..ce86a2e24 --- /dev/null +++ b/search/groups_2.js @@ -0,0 +1,6 @@ +var searchData= +[ + ['ftxui_20component_0',['ftxui/component',['../group__component.html',1,'']]], + ['ftxui_20dom_1',['ftxui/dom',['../group__dom.html',1,'']]], + ['ftxui_20screen_2',['ftxui/screen',['../group__screen.html',1,'']]] +]; diff --git a/search/groups_3.js b/search/groups_3.js new file mode 100644 index 000000000..a0bebd5a1 --- /dev/null +++ b/search/groups_3.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['screen_0',['ftxui/screen',['../group__screen.html',1,'']]] +]; diff --git a/search/mag.svg b/search/mag.svg new file mode 100644 index 000000000..ffb6cf0d0 --- /dev/null +++ b/search/mag.svg @@ -0,0 +1,24 @@ + + + + + + + diff --git a/search/mag_d.svg b/search/mag_d.svg new file mode 100644 index 000000000..4122773f9 --- /dev/null +++ b/search/mag_d.svg @@ -0,0 +1,24 @@ + + + + + + + diff --git a/search/mag_sel.svg b/search/mag_sel.svg new file mode 100644 index 000000000..553dba877 --- /dev/null +++ b/search/mag_sel.svg @@ -0,0 +1,31 @@ + + + + + + + + + diff --git a/search/mag_seld.svg b/search/mag_seld.svg new file mode 100644 index 000000000..c906f84c8 --- /dev/null +++ b/search/mag_seld.svg @@ -0,0 +1,31 @@ + + + + + + + + + diff --git a/search/modules_0.js b/search/modules_0.js new file mode 100644 index 000000000..1f476046a --- /dev/null +++ b/search/modules_0.js @@ -0,0 +1,40 @@ +var searchData= +[ + ['ftxui_0',['ftxui',['../module__ftxui.html',1,'']]], + ['ftxui_2ecomponent_1',['ftxui.component',['../module__ftxui_8component.html',1,'']]], + ['ftxui_2ecomponent_2eanimation_2',['ftxui.component.animation',['../module__ftxui_8component_8animation.html',1,'']]], + ['ftxui_2ecomponent_2ecaptured_5fmouse_3',['ftxui.component.captured_mouse',['../module__ftxui_8component_8captured__mouse.html',1,'']]], + ['ftxui_2ecomponent_2ecomponent_4',['ftxui.component.component',['../module__ftxui_8component_8component.html',1,'']]], + ['ftxui_2ecomponent_2ecomponent_5fbase_5',['ftxui.component.component_base',['../module__ftxui_8component_8component__base.html',1,'']]], + ['ftxui_2ecomponent_2ecomponent_5foptions_6',['ftxui.component.component_options',['../module__ftxui_8component_8component__options.html',1,'']]], + ['ftxui_2ecomponent_2eevent_7',['ftxui.component.event',['../module__ftxui_8component_8event.html',1,'']]], + ['ftxui_2ecomponent_2eloop_8',['ftxui.component.loop',['../module__ftxui_8component_8loop.html',1,'']]], + ['ftxui_2ecomponent_2emouse_9',['ftxui.component.mouse',['../module__ftxui_8component_8mouse.html',1,'']]], + ['ftxui_2ecomponent_2ereceiver_10',['ftxui.component.receiver',['../module__ftxui_8component_8receiver.html',1,'']]], + ['ftxui_2ecomponent_2escreen_5finteractive_11',['ftxui.component.screen_interactive',['../module__ftxui_8component_8screen__interactive.html',1,'']]], + ['ftxui_2ecomponent_2etask_12',['ftxui.component.task',['../module__ftxui_8component_8task.html',1,'']]], + ['ftxui_2edom_13',['ftxui.dom',['../module__ftxui_8dom.html',1,'']]], + ['ftxui_2edom_2ecanvas_14',['ftxui.dom.canvas',['../module__ftxui_8dom_8canvas.html',1,'']]], + ['ftxui_2edom_2edeprecated_15',['ftxui.dom.deprecated',['../module__ftxui_8dom_8deprecated.html',1,'']]], + ['ftxui_2edom_2edirection_16',['ftxui.dom.direction',['../module__ftxui_8dom_8direction.html',1,'']]], + ['ftxui_2edom_2eelements_17',['ftxui.dom.elements',['../module__ftxui_8dom_8elements.html',1,'']]], + ['ftxui_2edom_2eflexbox_5fconfig_18',['ftxui.dom.flexbox_config',['../module__ftxui_8dom_8flexbox__config.html',1,'']]], + ['ftxui_2edom_2elinear_5fgradient_19',['ftxui.dom.linear_gradient',['../module__ftxui_8dom_8linear__gradient.html',1,'']]], + ['ftxui_2edom_2enode_20',['ftxui.dom.node',['../module__ftxui_8dom_8node.html',1,'']]], + ['ftxui_2edom_2erequirement_21',['ftxui.dom.requirement',['../module__ftxui_8dom_8requirement.html',1,'']]], + ['ftxui_2edom_2eselection_22',['ftxui.dom.selection',['../module__ftxui_8dom_8selection.html',1,'']]], + ['ftxui_2edom_2etable_23',['ftxui.dom.table',['../module__ftxui_8dom_8table.html',1,'']]], + ['ftxui_2escreen_24',['ftxui.screen',['../module__ftxui_8screen.html',1,'']]], + ['ftxui_2escreen_2ebox_25',['ftxui.screen.box',['../module__ftxui_8screen_8box.html',1,'']]], + ['ftxui_2escreen_2ecolor_26',['ftxui.screen.color',['../module__ftxui_8screen_8color.html',1,'']]], + ['ftxui_2escreen_2ecolor_5finfo_27',['ftxui.screen.color_info',['../module__ftxui_8screen_8color__info.html',1,'']]], + ['ftxui_2escreen_2edeprecated_28',['ftxui.screen.deprecated',['../module__ftxui_8screen_8deprecated.html',1,'']]], + ['ftxui_2escreen_2eimage_29',['ftxui.screen.image',['../module__ftxui_8screen_8image.html',1,'']]], + ['ftxui_2escreen_2epixel_30',['ftxui.screen.pixel',['../module__ftxui_8screen_8pixel.html',1,'']]], + ['ftxui_2escreen_2escreen_31',['ftxui.screen.screen',['../module__ftxui_8screen_8screen.html',1,'']]], + ['ftxui_2escreen_2estring_32',['ftxui.screen.string',['../module__ftxui_8screen_8string.html',1,'']]], + ['ftxui_2escreen_2eterminal_33',['ftxui.screen.terminal',['../module__ftxui_8screen_8terminal.html',1,'']]], + ['ftxui_2eutil_34',['ftxui.util',['../module__ftxui_8util.html',1,'']]], + ['ftxui_2eutil_2eautoreset_35',['ftxui.util.autoreset',['../module__ftxui_8util_8autoreset.html',1,'']]], + ['ftxui_2eutil_2eref_36',['ftxui.util.ref',['../module__ftxui_8util_8ref.html',1,'']]] +]; diff --git a/search/namespaces_0.js b/search/namespaces_0.js new file mode 100644 index 000000000..c69815f7f --- /dev/null +++ b/search/namespaces_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['easing_0',['easing',['../namespaceeasing.html',1,'']]] +]; diff --git a/search/namespaces_1.js b/search/namespaces_1.js new file mode 100644 index 000000000..4ea61d6a3 --- /dev/null +++ b/search/namespaces_1.js @@ -0,0 +1,14 @@ +var searchData= +[ + ['ftxui_0',['ftxui',['../namespaceftxui.html',1,'']]], + ['ftxui_3a_3aanimation_1',['animation',['../namespaceftxui_1_1animation.html',1,'ftxui']]], + ['ftxui_3a_3aanimation_3a_3aeasing_2',['easing',['../namespaceftxui_1_1animation_1_1easing.html',1,'ftxui::animation']]], + ['ftxui_3a_3abox_5fhelper_3',['box_helper',['../namespaceftxui_1_1box__helper.html',1,'ftxui']]], + ['ftxui_3a_3acontainer_4',['Container',['../namespaceftxui_1_1Container.html',1,'ftxui']]], + ['ftxui_3a_3adimension_5',['Dimension',['../namespaceftxui_1_1Dimension.html',1,'ftxui']]], + ['ftxui_3a_3aflexbox_5fhelper_6',['flexbox_helper',['../namespaceftxui_1_1flexbox__helper.html',1,'ftxui']]], + ['ftxui_3a_3aliterals_7',['literals',['../namespaceftxui_1_1literals.html',1,'ftxui']]], + ['ftxui_3a_3atask_8',['task',['../namespaceftxui_1_1task.html',1,'ftxui']]], + ['ftxui_3a_3aterminal_9',['Terminal',['../namespaceftxui_1_1Terminal.html',1,'ftxui']]], + ['ftxui_3a_3autil_10',['util',['../namespaceftxui_1_1util.html',1,'ftxui']]] +]; diff --git a/search/pages_0.js b/search/pages_0.js new file mode 100644 index 000000000..e4388f31c --- /dev/null +++ b/search/pages_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['20_20modules_0',['C++20 Modules',['../cpp20-modules.html',1,'']]] +]; diff --git a/search/pages_1.js b/search/pages_1.js new file mode 100644 index 000000000..a89a44d7a --- /dev/null +++ b/search/pages_1.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['arch_20linux_0',['Arch Linux',['../installation_arch.html',1,'installation']]] +]; diff --git a/search/pages_10.js b/search/pages_10.js new file mode 100644 index 000000000..57efe2435 --- /dev/null +++ b/search/pages_10.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['vcpkg_0',['Vcpkg',['../installation_vcpkg.html',1,'installation']]] +]; diff --git a/search/pages_11.js b/search/pages_11.js new file mode 100644 index 000000000..920258b15 --- /dev/null +++ b/search/pages_11.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['xmake_0',['XMake',['../installation_xmake.html',1,'installation']]] +]; diff --git a/search/pages_2.js b/search/pages_2.js new file mode 100644 index 000000000..88536ee81 --- /dev/null +++ b/search/pages_2.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['bazel_0',['Bazel',['../installation_bazel.html',1,'installation']]] +]; diff --git a/search/pages_3.js b/search/pages_3.js new file mode 100644 index 000000000..c9dd37b0a --- /dev/null +++ b/search/pages_3.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['c_2020_20modules_0',['C++20 Modules',['../cpp20-modules.html',1,'']]], + ['cmake_1',['CMake',['../installation_cmake.html',1,'installation']]], + ['component_2',['ftxui / component',['../module-component.html',1,'']]], + ['conan_3',['Conan',['../installation_conan.html',1,'installation']]] +]; diff --git a/search/pages_4.js b/search/pages_4.js new file mode 100644 index 000000000..9df6d9011 --- /dev/null +++ b/search/pages_4.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['debian_20ubuntu_0',['Debian/Ubuntu',['../installation_debian.html',1,'installation']]], + ['dom_1',['ftxui / dom',['../module-dom.html',1,'']]] +]; diff --git a/search/pages_5.js b/search/pages_5.js new file mode 100644 index 000000000..53fe39199 --- /dev/null +++ b/search/pages_5.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['example_0',['Example',['../module-component-examples.html',1,'Example'],['../module-dom-examples.html',1,'Example']]] +]; diff --git a/search/pages_6.js b/search/pages_6.js new file mode 100644 index 000000000..7429facb9 --- /dev/null +++ b/search/pages_6.js @@ -0,0 +1,7 @@ +var searchData= +[ + ['ftxui_0',['ftxui',['../ftxui.html',1,'']]], + ['ftxui_20component_1',['ftxui / component',['../module-component.html',1,'']]], + ['ftxui_20dom_2',['ftxui / dom',['../module-dom.html',1,'']]], + ['ftxui_20screen_3',['ftxui / screen',['../module-screen.html',1,'']]] +]; diff --git a/search/pages_7.js b/search/pages_7.js new file mode 100644 index 000000000..0f4d48807 --- /dev/null +++ b/search/pages_7.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['getting_20started_0',['Getting Started',['../getting-started.html',1,'']]] +]; diff --git a/search/pages_8.js b/search/pages_8.js new file mode 100644 index 000000000..b8420beff --- /dev/null +++ b/search/pages_8.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['installation_0',['Installation',['../installation.html',1,'']]], + ['introduction_1',['Introduction',['../index.html',1,'']]] +]; diff --git a/search/pages_9.js b/search/pages_9.js new file mode 100644 index 000000000..3c298c8d3 --- /dev/null +++ b/search/pages_9.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['linux_0',['Arch Linux',['../installation_arch.html',1,'installation']]], + ['list_1',['Todo List',['../todo.html',1,'']]] +]; diff --git a/search/pages_a.js b/search/pages_a.js new file mode 100644 index 000000000..4aa4557d3 --- /dev/null +++ b/search/pages_a.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['manual_0',['Manual',['../installation_manual.html',1,'installation']]], + ['modules_1',['C++20 Modules',['../cpp20-modules.html',1,'']]] +]; diff --git a/search/pages_b.js b/search/pages_b.js new file mode 100644 index 000000000..306b65760 --- /dev/null +++ b/search/pages_b.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['nix_0',['Nix',['../installation_nix.html',1,'installation']]] +]; diff --git a/search/pages_c.js b/search/pages_c.js new file mode 100644 index 000000000..04dffed31 --- /dev/null +++ b/search/pages_c.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['opensuse_0',['openSUSE',['../installation_opensuse.html',1,'installation']]] +]; diff --git a/search/pages_d.js b/search/pages_d.js new file mode 100644 index 000000000..98dd2ad76 --- /dev/null +++ b/search/pages_d.js @@ -0,0 +1,5 @@ +var searchData= +[ + ['screen_0',['ftxui / screen',['../module-screen.html',1,'']]], + ['started_1',['Getting Started',['../getting-started.html',1,'']]] +]; diff --git a/search/pages_e.js b/search/pages_e.js new file mode 100644 index 000000000..83220efb8 --- /dev/null +++ b/search/pages_e.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['todo_20list_0',['Todo List',['../todo.html',1,'']]] +]; diff --git a/search/pages_f.js b/search/pages_f.js new file mode 100644 index 000000000..add3757f3 --- /dev/null +++ b/search/pages_f.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['ubuntu_0',['Debian/Ubuntu',['../installation_debian.html',1,'installation']]] +]; diff --git a/search/related_0.js b/search/related_0.js new file mode 100644 index 000000000..748e28a12 --- /dev/null +++ b/search/related_0.js @@ -0,0 +1,4 @@ +var searchData= +[ + ['render_0',['Render',['../group__dom.html#ab35030b64136afa183d474d11bd1f6dd',1,'ftxui::Node']]] +]; diff --git a/search/search.css b/search/search.css new file mode 100644 index 000000000..0789eba4d --- /dev/null +++ b/search/search.css @@ -0,0 +1,291 @@ +/*---------------- Search Box positioning */ + +#main-menu > li:last-child { + /* This
  • object is the parent of the search bar */ + display: flex; + justify-content: center; + align-items: center; + height: 36px; + margin-right: 1em; +} + +/*---------------- Search box styling */ + +.SRPage * { + font-weight: normal; + line-height: normal; +} + +dark-mode-toggle { + margin-left: 5px; + display: flex; + float: right; +} + +#MSearchBox { + display: inline-block; + white-space : nowrap; + background: white; + border-radius: 0.65em; + box-shadow: inset 0.5px 0.5px 3px 0px #555; + z-index: 102; +} + +#MSearchBox .left { + display: inline-block; + vertical-align: middle; + height: 1.4em; +} + +#MSearchSelect { + display: inline-block; + vertical-align: middle; + width: 20px; + height: 19px; + background-image: url('mag_sel.svg'); + margin: 0 0 0 0.3em; + padding: 0; +} + +#MSearchSelectExt { + display: inline-block; + vertical-align: middle; + width: 10px; + height: 19px; + background-image: url('mag.svg'); + margin: 0 0 0 0.5em; + padding: 0; +} + + +#MSearchField { + display: inline-block; + vertical-align: middle; + width: 7.5em; + height: 19px; + margin: 0 0.15em; + padding: 0; + line-height: 1em; + border:none; + color: #909090; + outline: none; + font-family: Arial,Verdana,sans-serif; + -webkit-border-radius: 0px; + border-radius: 0px; + background: none; +} + +@media(hover: none) { + /* to avoid zooming on iOS */ + #MSearchField { + font-size: 16px; + } +} + +#MSearchBox .right { + display: inline-block; + vertical-align: middle; + width: 1.4em; + height: 1.4em; +} + +#MSearchClose { + display: none; + font-size: inherit; + background : none; + border: none; + margin: 0; + padding: 0; + outline: none; + +} + +#MSearchCloseImg { + padding: 0.3em; + margin: 0; +} + +.MSearchBoxActive #MSearchField { + color: black; +} + + + +/*---------------- Search filter selection */ + +#MSearchSelectWindow { + display: none; + position: absolute; + left: 0; top: 0; + border: 1px solid #719AED; + background-color: #F7F9FE; + z-index: 10001; + padding-top: 4px; + padding-bottom: 4px; + -moz-border-radius: 4px; + -webkit-border-top-left-radius: 4px; + -webkit-border-top-right-radius: 4px; + -webkit-border-bottom-left-radius: 4px; + -webkit-border-bottom-right-radius: 4px; + -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15); +} + +.SelectItem { + font: 8pt Arial,Verdana,sans-serif; + padding-left: 2px; + padding-right: 12px; + border: 0px; +} + +span.SelectionMark { + margin-right: 4px; + font-family: 'JetBrains Mono',Consolas,Monaco,'Andale Mono','Ubuntu Mono',monospace,fixed; + outline-style: none; + text-decoration: none; +} + +a.SelectItem { + display: block; + outline-style: none; + color: black; + text-decoration: none; + padding-left: 6px; + padding-right: 12px; +} + +a.SelectItem:focus, +a.SelectItem:active { + color: black; + outline-style: none; + text-decoration: none; +} + +a.SelectItem:hover { + color: white; + background-color: #154AB3; + outline-style: none; + text-decoration: none; + cursor: pointer; + display: block; +} + +/*---------------- Search results window */ + +iframe#MSearchResults { + /*width: 60ex;*/ + height: 15em; +} + +#MSearchResultsWindow { + display: none; + position: absolute; + left: 0; top: 0; + border: 1px solid black; + background-color: #E9EFFC; + z-index:10000; + width: 300px; + height: 400px; + overflow: auto; +} + +/* ----------------------------------- */ + + +#SRIndex { + clear:both; +} + +.SREntry { + font-size: 10pt; + padding-left: 1ex; +} + +.SRPage .SREntry { + font-size: 8pt; + padding: 1px 5px; +} + +div.SRPage { + margin: 5px 2px; + background-color: #E9EFFC; +} + +.SRChildren { + padding-left: 3ex; padding-bottom: .5em +} + +.SRPage .SRChildren { + display: none; +} + +.SRSymbol { + font-weight: bold; + color: #1750C2; + font-family: Arial,Verdana,sans-serif; + text-decoration: none; + outline: none; +} + +a.SRScope { + display: block; + color: #1750C2; + font-family: Arial,Verdana,sans-serif; + font-size: 8pt; + text-decoration: none; + outline: none; +} + +a.SRSymbol:focus, a.SRSymbol:active, +a.SRScope:focus, a.SRScope:active { + text-decoration: underline; +} + +span.SRScope { + padding-left: 4px; + font-family: Arial,Verdana,sans-serif; +} + +.SRPage .SRStatus { + padding: 2px 5px; + font-size: 8pt; + font-style: italic; + font-family: Arial,Verdana,sans-serif; +} + +.SRResult { + display: none; +} + +div.searchresults { + margin-left: 10px; + margin-right: 10px; +} + +/*---------------- External search page results */ + +.pages b { + color: white; + padding: 5px 5px 3px 5px; + background-image: url("../tab_a.png"); + background-repeat: repeat-x; + text-shadow: 0 1px 1px #000000; +} + +.pages { + line-height: 17px; + margin-left: 4px; + text-decoration: none; +} + +.hl { + font-weight: bold; +} + +#searchresults { + margin-bottom: 20px; +} + +.searchpages { + margin-top: 10px; +} + diff --git a/search/search.js b/search/search.js new file mode 100644 index 000000000..666af01e5 --- /dev/null +++ b/search/search.js @@ -0,0 +1,694 @@ +/* + @licstart The following is the entire license notice for the JavaScript code in this file. + + The MIT License (MIT) + + Copyright (C) 1997-2020 by Dimitri van Heesch + + Permission is hereby granted, free of charge, to any person obtaining a copy of this software + and associated documentation files (the "Software"), to deal in the Software without restriction, + including without limitation the rights to use, copy, modify, merge, publish, distribute, + sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all copies or + substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING + BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, + DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + @licend The above is the entire license notice for the JavaScript code in this file + */ +const SEARCH_COOKIE_NAME = ''+'search_grp'; + +const searchResults = new SearchResults(); + +/* A class handling everything associated with the search panel. + + Parameters: + name - The name of the global variable that will be + storing this instance. Is needed to be able to set timeouts. + resultPath - path to use for external files +*/ +function SearchBox(name, resultsPath, extension) { + if (!name || !resultsPath) { alert("Missing parameters to SearchBox."); } + if (!extension || extension == "") { extension = ".html"; } + + function getXPos(item) { + let x = 0; + if (item.offsetWidth) { + while (item && item!=document.body) { + x += item.offsetLeft; + item = item.offsetParent; + } + } + return x; + } + + function getYPos(item) { + let y = 0; + if (item.offsetWidth) { + while (item && item!=document.body) { + y += item.offsetTop; + item = item.offsetParent; + } + } + return y; + } + + // ---------- Instance variables + this.name = name; + this.resultsPath = resultsPath; + this.keyTimeout = 0; + this.keyTimeoutLength = 500; + this.closeSelectionTimeout = 300; + this.lastSearchValue = ""; + this.lastResultsPage = ""; + this.hideTimeout = 0; + this.searchIndex = 0; + this.searchActive = false; + this.extension = extension; + + // ----------- DOM Elements + + this.DOMSearchField = () => document.getElementById("MSearchField"); + this.DOMSearchSelect = () => document.getElementById("MSearchSelect"); + this.DOMSearchSelectWindow = () => document.getElementById("MSearchSelectWindow"); + this.DOMPopupSearchResults = () => document.getElementById("MSearchResults"); + this.DOMPopupSearchResultsWindow = () => document.getElementById("MSearchResultsWindow"); + this.DOMSearchClose = () => document.getElementById("MSearchClose"); + this.DOMSearchBox = () => document.getElementById("MSearchBox"); + + // ------------ Event Handlers + + // Called when focus is added or removed from the search field. + this.OnSearchFieldFocus = function(isActive) { + this.Activate(isActive); + } + + this.OnSearchSelectShow = function() { + const searchSelectWindow = this.DOMSearchSelectWindow(); + const searchField = this.DOMSearchSelect(); + + const left = getXPos(searchField); + const top = getYPos(searchField) + searchField.offsetHeight; + + // show search selection popup + searchSelectWindow.style.display='block'; + searchSelectWindow.style.left = left + 'px'; + searchSelectWindow.style.top = top + 'px'; + + // stop selection hide timer + if (this.hideTimeout) { + clearTimeout(this.hideTimeout); + this.hideTimeout=0; + } + return false; // to avoid "image drag" default event + } + + this.OnSearchSelectHide = function() { + this.hideTimeout = setTimeout(this.CloseSelectionWindow.bind(this), + this.closeSelectionTimeout); + } + + // Called when the content of the search field is changed. + this.OnSearchFieldChange = function(evt) { + if (this.keyTimeout) { // kill running timer + clearTimeout(this.keyTimeout); + this.keyTimeout = 0; + } + + const e = evt ? evt : window.event; // for IE + if (e.keyCode==40 || e.keyCode==13) { + if (e.shiftKey==1) { + this.OnSearchSelectShow(); + const win=this.DOMSearchSelectWindow(); + for (let i=0;i do a search + this.Search(); + } + } + + this.OnSearchSelectKey = function(evt) { + const e = (evt) ? evt : window.event; // for IE + if (e.keyCode==40 && this.searchIndex0) { // Up + this.searchIndex--; + this.OnSelectItem(this.searchIndex); + } else if (e.keyCode==13 || e.keyCode==27) { + e.stopPropagation(); + this.OnSelectItem(this.searchIndex); + this.CloseSelectionWindow(); + this.DOMSearchField().focus(); + } + return false; + } + + // --------- Actions + + // Closes the results window. + this.CloseResultsWindow = function() { + this.DOMPopupSearchResultsWindow().style.display = 'none'; + this.DOMSearchClose().style.display = 'none'; + this.Activate(false); + } + + this.CloseSelectionWindow = function() { + this.DOMSearchSelectWindow().style.display = 'none'; + } + + // Performs a search. + this.Search = function() { + this.keyTimeout = 0; + + // strip leading whitespace + const searchValue = this.DOMSearchField().value.replace(/^ +/, ""); + + const code = searchValue.toLowerCase().charCodeAt(0); + let idxChar = searchValue.substr(0, 1).toLowerCase(); + if ( 0xD800 <= code && code <= 0xDBFF && searchValue > 1) { // surrogate pair + idxChar = searchValue.substr(0, 2); + } + + let jsFile; + let idx = indexSectionsWithContent[this.searchIndex].indexOf(idxChar); + if (idx!=-1) { + const hexCode=idx.toString(16); + jsFile = this.resultsPath + indexSectionNames[this.searchIndex] + '_' + hexCode + '.js'; + } + + const loadJS = function(url, impl, loc) { + const scriptTag = document.createElement('script'); + scriptTag.src = url; + scriptTag.onload = impl; + scriptTag.onreadystatechange = impl; + loc.appendChild(scriptTag); + } + + const domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow(); + const domSearchBox = this.DOMSearchBox(); + const domPopupSearchResults = this.DOMPopupSearchResults(); + const domSearchClose = this.DOMSearchClose(); + const resultsPath = this.resultsPath; + + const handleResults = function() { + document.getElementById("Loading").style.display="none"; + if (typeof searchData !== 'undefined') { + createResults(resultsPath); + document.getElementById("NoMatches").style.display="none"; + } + + if (idx!=-1) { + searchResults.Search(searchValue); + } else { // no file with search results => force empty search results + searchResults.Search('===='); + } + + if (domPopupSearchResultsWindow.style.display!='block') { + domSearchClose.style.display = 'inline-block'; + let left = getXPos(domSearchBox) + 150; + let top = getYPos(domSearchBox) + 20; + domPopupSearchResultsWindow.style.display = 'block'; + left -= domPopupSearchResults.offsetWidth; + const maxWidth = document.body.clientWidth; + const maxHeight = document.body.clientHeight; + let width = 300; + if (left<10) left=10; + if (width+left+8>maxWidth) width=maxWidth-left-8; + let height = 400; + if (height+top+8>maxHeight) height=maxHeight-top-8; + domPopupSearchResultsWindow.style.top = top + 'px'; + domPopupSearchResultsWindow.style.left = left + 'px'; + domPopupSearchResultsWindow.style.width = width + 'px'; + domPopupSearchResultsWindow.style.height = height + 'px'; + } + } + + if (jsFile) { + loadJS(jsFile, handleResults, this.DOMPopupSearchResultsWindow()); + } else { + handleResults(); + } + + this.lastSearchValue = searchValue; + } + + // -------- Activation Functions + + // Activates or deactivates the search panel, resetting things to + // their default values if necessary. + this.Activate = function(isActive) { + if (isActive || // open it + this.DOMPopupSearchResultsWindow().style.display == 'block' + ) { + this.DOMSearchBox().className = 'MSearchBoxActive'; + this.searchActive = true; + } else if (!isActive) { // directly remove the panel + this.DOMSearchBox().className = 'MSearchBoxInactive'; + this.searchActive = false; + this.lastSearchValue = '' + this.lastResultsPage = ''; + this.DOMSearchField().value = ''; + } + } +} + +// ----------------------------------------------------------------------- + +// The class that handles everything on the search results page. +function SearchResults() { + + function convertToId(search) { + let result = ''; + for (let i=0;i. + this.lastMatchCount = 0; + this.lastKey = 0; + this.repeatOn = false; + + // Toggles the visibility of the passed element ID. + this.FindChildElement = function(id) { + const parentElement = document.getElementById(id); + let element = parentElement.firstChild; + + while (element && element!=parentElement) { + if (element.nodeName.toLowerCase() == 'div' && element.className == 'SRChildren') { + return element; + } + + if (element.nodeName.toLowerCase() == 'div' && element.hasChildNodes()) { + element = element.firstChild; + } else if (element.nextSibling) { + element = element.nextSibling; + } else { + do { + element = element.parentNode; + } + while (element && element!=parentElement && !element.nextSibling); + + if (element && element!=parentElement) { + element = element.nextSibling; + } + } + } + } + + this.Toggle = function(id) { + const element = this.FindChildElement(id); + if (element) { + if (element.style.display == 'block') { + element.style.display = 'none'; + } else { + element.style.display = 'block'; + } + } + } + + // Searches for the passed string. If there is no parameter, + // it takes it from the URL query. + // + // Always returns true, since other documents may try to call it + // and that may or may not be possible. + this.Search = function(search) { + if (!search) { // get search word from URL + search = window.location.search; + search = search.substring(1); // Remove the leading '?' + search = unescape(search); + } + + search = search.replace(/^ +/, ""); // strip leading spaces + search = search.replace(/ +$/, ""); // strip trailing spaces + search = search.toLowerCase(); + search = convertToId(search); + + const resultRows = document.getElementsByTagName("div"); + let matches = 0; + + let i = 0; + while (i < resultRows.length) { + const row = resultRows.item(i); + if (row.className == "SRResult") { + let rowMatchName = row.id.toLowerCase(); + rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_' + + if (search.length<=rowMatchName.length && + rowMatchName.substr(0, search.length)==search) { + row.style.display = 'block'; + matches++; + } else { + row.style.display = 'none'; + } + } + i++; + } + document.getElementById("Searching").style.display='none'; + if (matches == 0) { // no results + document.getElementById("NoMatches").style.display='block'; + } else { // at least one result + document.getElementById("NoMatches").style.display='none'; + } + this.lastMatchCount = matches; + return true; + } + + // return the first item with index index or higher that is visible + this.NavNext = function(index) { + let focusItem; + for (;;) { + const focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') { + break; + } else if (!focusItem) { // last element + break; + } + focusItem=null; + index++; + } + return focusItem; + } + + this.NavPrev = function(index) { + let focusItem; + for (;;) { + const focusName = 'Item'+index; + focusItem = document.getElementById(focusName); + if (focusItem && focusItem.parentNode.parentNode.style.display=='block') { + break; + } else if (!focusItem) { // last element + break; + } + focusItem=null; + index--; + } + return focusItem; + } + + this.ProcessKeys = function(e) { + if (e.type == "keydown") { + this.repeatOn = false; + this.lastKey = e.keyCode; + } else if (e.type == "keypress") { + if (!this.repeatOn) { + if (this.lastKey) this.repeatOn = true; + return false; // ignore first keypress after keydown + } + } else if (e.type == "keyup") { + this.lastKey = 0; + this.repeatOn = false; + } + return this.lastKey!=0; + } + + this.Nav = function(evt,itemIndex) { + const e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) { // Up + const newIndex = itemIndex-1; + let focusItem = this.NavPrev(newIndex); + if (focusItem) { + let child = this.FindChildElement(focusItem.parentNode.parentNode.id); + if (child && child.style.display == 'block') { // children visible + let n=0; + let tmpElem; + for (;;) { // search for last child + tmpElem = document.getElementById('Item'+newIndex+'_c'+n); + if (tmpElem) { + focusItem = tmpElem; + } else { // found it! + break; + } + n++; + } + } + } + if (focusItem) { + focusItem.focus(); + } else { // return focus to search field + document.getElementById("MSearchField").focus(); + } + } else if (this.lastKey==40) { // Down + const newIndex = itemIndex+1; + let focusItem; + const item = document.getElementById('Item'+itemIndex); + const elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem && elem.style.display == 'block') { // children visible + focusItem = document.getElementById('Item'+itemIndex+'_c0'); + } + if (!focusItem) focusItem = this.NavNext(newIndex); + if (focusItem) focusItem.focus(); + } else if (this.lastKey==39) { // Right + const item = document.getElementById('Item'+itemIndex); + const elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'block'; + } else if (this.lastKey==37) { // Left + const item = document.getElementById('Item'+itemIndex); + const elem = this.FindChildElement(item.parentNode.parentNode.id); + if (elem) elem.style.display = 'none'; + } else if (this.lastKey==27) { // Escape + e.stopPropagation(); + searchBox.CloseResultsWindow(); + document.getElementById("MSearchField").focus(); + } else if (this.lastKey==13) { // Enter + return true; + } + return false; + } + + this.NavChild = function(evt,itemIndex,childIndex) { + const e = (evt) ? evt : window.event; // for IE + if (e.keyCode==13) return true; + if (!this.ProcessKeys(e)) return false; + + if (this.lastKey==38) { // Up + if (childIndex>0) { + const newIndex = childIndex-1; + document.getElementById('Item'+itemIndex+'_c'+newIndex).focus(); + } else { // already at first child, jump to parent + document.getElementById('Item'+itemIndex).focus(); + } + } else if (this.lastKey==40) { // Down + const newIndex = childIndex+1; + let elem = document.getElementById('Item'+itemIndex+'_c'+newIndex); + if (!elem) { // last child, jump to parent next parent + elem = this.NavNext(itemIndex+1); + } + if (elem) { + elem.focus(); + } + } else if (this.lastKey==27) { // Escape + e.stopPropagation(); + searchBox.CloseResultsWindow(); + document.getElementById("MSearchField").focus(); + } else if (this.lastKey==13) { // Enter + return true; + } + return false; + } +} + +function createResults(resultsPath) { + + function setKeyActions(elem,action) { + elem.setAttribute('onkeydown',action); + elem.setAttribute('onkeypress',action); + elem.setAttribute('onkeyup',action); + } + + function setClassAttr(elem,attr) { + elem.setAttribute('class',attr); + elem.setAttribute('className',attr); + } + + const results = document.getElementById("SRResults"); + results.innerHTML = ''; + searchData.forEach((elem,index) => { + const id = elem[0]; + const srResult = document.createElement('div'); + srResult.setAttribute('id','SR_'+id); + setClassAttr(srResult,'SRResult'); + const srEntry = document.createElement('div'); + setClassAttr(srEntry,'SREntry'); + const srLink = document.createElement('a'); + srLink.setAttribute('id','Item'+index); + setKeyActions(srLink,'return searchResults.Nav(event,'+index+')'); + setClassAttr(srLink,'SRSymbol'); + srLink.innerHTML = elem[1][0]; + srEntry.appendChild(srLink); + if (elem[1].length==2) { // single result + srLink.setAttribute('href',resultsPath+elem[1][1][0]); + srLink.setAttribute('onclick','searchBox.CloseResultsWindow()'); + if (elem[1][1][1]) { + srLink.setAttribute('target','_parent'); + } else { + srLink.setAttribute('target','_blank'); + } + const srScope = document.createElement('span'); + setClassAttr(srScope,'SRScope'); + srScope.innerHTML = elem[1][1][2]; + srEntry.appendChild(srScope); + } else { // multiple results + srLink.setAttribute('href','javascript:searchResults.Toggle("SR_'+id+'")'); + const srChildren = document.createElement('div'); + setClassAttr(srChildren,'SRChildren'); + for (let c=0; c + + + + + + + +FTXUI: selection.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    selection.cppm File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    +
    +
    + + + + + diff --git a/selection_8cppm_source.html b/selection_8cppm_source.html new file mode 100644 index 000000000..309c72399 --- /dev/null +++ b/selection_8cppm_source.html @@ -0,0 +1,229 @@ + + + + + + + + +FTXUI: selection.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    selection.cppm
    +
    +
    +Go to the documentation of this file.
    1/// @module ftxui.dom.selection
    +
    2/// @brief Module file for the Selection class of the Dom module
    +
    3
    +
    4module;
    +
    5
    + +
    7
    +
    8export module ftxui.dom.selection;
    +
    9
    +
    10/**
    +
    11 * @namespace ftxui
    +
    12 * @brief The FTXUI ftxui:: namespace
    +
    13 */
    +
    14export namespace ftxui {
    +
    15 using ftxui::Selection;
    +
    16}
    +
    Represents a selection in a terminal user interface.
    Definition selection.hpp:22
    +
    Module file for the Selection class of the Dom module.
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + +
    +
    + + + + + diff --git a/selection_8hpp.html b/selection_8hpp.html new file mode 100644 index 000000000..1111a6a62 --- /dev/null +++ b/selection_8hpp.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: selection.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    selection.hpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Classes

    class  Selection
     Represents a selection in a terminal user interface. More...
     
    + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    +
    +
    + + + + + diff --git a/selection_8hpp_source.html b/selection_8hpp_source.html new file mode 100644 index 000000000..74e89b20c --- /dev/null +++ b/selection_8hpp_source.html @@ -0,0 +1,280 @@ + + + + + + + + +FTXUI: selection.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    selection.hpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2024 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4
    +
    5#ifndef FTXUI_DOM_SELECTION_HPP
    +
    6#define FTXUI_DOM_SELECTION_HPP
    +
    7
    +
    8#include <functional>
    +
    9
    +
    10#include <sstream>
    +
    11#include "ftxui/screen/box.hpp" // for Box
    +
    12#include "ftxui/screen/pixel.hpp" // for Pixel
    +
    13
    +
    14namespace ftxui {
    +
    15
    +
    16/// @brief Represents a selection in a terminal user interface.
    +
    17///
    +
    18/// Selection is a class that represents the two endpoints of a selection in a
    +
    19/// terminal user interface.
    +
    20///
    +
    21/// @ingroup dom
    +
    +
    22class Selection {
    +
    23 public:
    +
    24 Selection(); // Empty selection.
    +
    25 Selection(int start_x, int start_y, int end_x, int end_y);
    +
    26
    +
    27 const Box& GetBox() const;
    +
    28
    + + +
    31 bool IsEmpty() const { return empty_; }
    +
    32
    +
    33 void AddPart(const std::string& part, int y, int left, int right);
    +
    34 std::string GetParts() { return parts_.str(); }
    +
    35
    +
    36 private:
    +
    37 Selection(int start_x, int start_y, int end_x, int end_y, Selection* parent);
    +
    38
    +
    39 const int start_x_ = 0;
    +
    40 const int start_y_ = 0;
    +
    41 const int end_x_ = 0;
    +
    42 const int end_y_ = 0;
    +
    43 const Box box_ = {};
    +
    44 Selection* const parent_ = this;
    +
    45 const bool empty_ = true;
    +
    46 std::stringstream parts_;
    +
    47
    +
    48 // The position of the last inserted part.
    +
    49 int x_ = 0;
    +
    50 int y_ = 0;
    +
    51};
    +
    +
    52
    +
    53} // namespace ftxui
    +
    54
    +
    55#endif /* end of include guard: FTXUI_DOM_SELECTION_HPP */
    + +
    const Box & GetBox() const
    Get the box of the selection.
    +
    std::string GetParts()
    Definition selection.hpp:34
    +
    bool IsEmpty() const
    Definition selection.hpp:31
    +
    void AddPart(const std::string &part, int y, int left, int right)
    +
    Selection SaturateVertical(Box box)
    Saturate the selection to be inside the box. This is called by vbox to propagate the selection to its...
    +
    Selection()
    Create an empty selection.
    +
    Selection SaturateHorizontal(Box box)
    Saturate the selection to be inside the box. This is called by hbox to propagate the selection to its...
    +
    Represents a selection in a terminal user interface.
    Definition selection.hpp:22
    +
    Box is a structure that represents a rectangular area in a 2D space.
    Definition box.hpp:16
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + +
    std::uint8_t left
    Definition screen.cpp:130
    +
    std::uint8_t right
    Definition screen.cpp:132
    +
    +
    + + + + + diff --git a/selection__style_8cpp.html b/selection__style_8cpp.html new file mode 100644 index 000000000..af6de0b49 --- /dev/null +++ b/selection__style_8cpp.html @@ -0,0 +1,256 @@ + + + + + + + + +FTXUI: selection_style.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    selection_style.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + + + + + + + + + + + + + +

    +Functions

    Element selectionStyleReset (Element child)
     Reset the selection style of an element.
     
    Decorator selectionBackgroundColor (Color foreground)
     Set the background color of an element when selected. Note that the style is applied on top of the existing style.
     
    Decorator selectionForegroundColor (Color foreground)
     Set the foreground color of an element when selected. Note that the style is applied on top of the existing style.
     
    Decorator selectionColor (Color foreground)
     Set the color of an element when selected.
     
    Decorator selectionStyle (std::function< void(Pixel &)> style)
     Set the style of an element when selected.
     
    +

    Variable Documentation

    + +

    ◆ style_

    + +
    +
    + + + + +
    std::function<void(Pixel&)> style_
    +
    + +

    Definition at line 47 of file selection_style.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/selection__style_8cpp.js b/selection__style_8cpp.js new file mode 100644 index 000000000..b753844ae --- /dev/null +++ b/selection__style_8cpp.js @@ -0,0 +1,9 @@ +var selection__style_8cpp = +[ + [ "selectionStyleReset", "selection__style_8cpp.html#aa7e1317c76cefc5018503de4f6e09ea3", null ], + [ "selectionBackgroundColor", "selection__style_8cpp.html#a6c965b8f6450a50a938120b5f6ddea96", null ], + [ "selectionForegroundColor", "selection__style_8cpp.html#a5d98498c51cfbc03f37e46d46ec8acf5", null ], + [ "selectionColor", "selection__style_8cpp.html#a925a73b7f0eb4b5bc11af23f4ca18019", null ], + [ "selectionStyle", "selection__style_8cpp.html#a4080865d947eea48cf695531f66a5160", null ], + [ "style_", "selection__style_8cpp.html#a4e933ebfcd587caa8c7a7c518ee9e4f6", null ] +]; \ No newline at end of file diff --git a/selection__style_8cpp_source.html b/selection__style_8cpp_source.html new file mode 100644 index 000000000..1b32051ad --- /dev/null +++ b/selection__style_8cpp_source.html @@ -0,0 +1,331 @@ + + + + + + + + +FTXUI: selection_style.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    selection_style.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2024 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <functional> // for function
    +
    5#include <memory> // for make_shared
    +
    6#include <utility> // for move
    +
    7
    +
    8#include "ftxui/dom/elements.hpp" // for Element, Decorator, bgcolor, color
    +
    9#include "ftxui/dom/node_decorator.hpp" // for NodeDecorator
    +
    10#include "ftxui/screen/color.hpp" // for Color
    +
    11#include "ftxui/screen/pixel.hpp" // for Pixel
    +
    12#include "ftxui/screen/screen.hpp" // for Screen
    +
    13
    +
    14namespace ftxui {
    +
    15
    +
    16namespace {
    +
    17
    +
    18class SelectionStyleReset : public NodeDecorator {
    +
    19 public:
    +
    20 explicit SelectionStyleReset(Element child)
    +
    21 : NodeDecorator(std::move(child)) {}
    +
    22
    +
    23 void Render(Screen& screen) final {
    +
    24 auto old_style = screen.GetSelectionStyle();
    +
    25 screen.SetSelectionStyle([](Pixel&) {});
    + +
    27 screen.SetSelectionStyle(old_style);
    +
    28 }
    +
    29};
    +
    30
    +
    31class SelectionStyle : public NodeDecorator {
    +
    32 public:
    +
    33 SelectionStyle(Element child, const std::function<void(Pixel&)>& style)
    +
    34 : NodeDecorator(std::move(child)), style_(style) {}
    +
    35
    +
    36 void Render(Screen& screen) final {
    +
    37 auto old_style = screen.GetSelectionStyle();
    +
    38 auto new_style = [&, old_style](Pixel& pixel) {
    +
    39 old_style(pixel);
    +
    40 style_(pixel);
    +
    41 };
    +
    42 screen.SetSelectionStyle(new_style);
    + +
    44 screen.SetSelectionStyle(old_style);
    +
    45 }
    +
    46
    +
    47 std::function<void(Pixel&)> style_;
    +
    48};
    +
    49
    +
    50} // namespace
    +
    51
    +
    52/// @brief Reset the selection style of an element.
    +
    53/// @param child The input element.
    +
    54/// @return The output element with the selection style reset.
    +
    + +
    56 return std::make_shared<SelectionStyleReset>(std::move(child));
    +
    57}
    +
    +
    58
    +
    59/// @brief Set the background color of an element when selected.
    +
    60/// Note that the style is applied on top of the existing style.
    +
    + +
    62 return selectionStyle([foreground](Pixel& pixel) { //
    +
    63 pixel.background_color = foreground;
    +
    64 });
    +
    65}
    +
    +
    66
    +
    67/// @brief Set the foreground color of an element when selected.
    +
    68/// Note that the style is applied on top of the existing style.
    +
    + +
    70 return selectionStyle([foreground](Pixel& pixel) { //
    +
    71 pixel.foreground_color = foreground;
    +
    72 });
    +
    73}
    +
    +
    74
    +
    75/// @brief Set the color of an element when selected.
    +
    76/// @param foreground The color to be applied.
    +
    77/// Note that the style is applied on top of the existing style.
    +
    + +
    79 return selectionForegroundColor(foreground);
    +
    80}
    +
    +
    81
    +
    82/// @brief Set the style of an element when selected.
    +
    83/// @param style The style to be applied.
    +
    84/// Note that the style is applied on top of the existing style.
    +
    85// NOLINTNEXTLINE
    +
    +
    86Decorator selectionStyle(std::function<void(Pixel&)> style) {
    +
    87 return [style](Element child) -> Element {
    +
    88 return std::make_shared<SelectionStyle>(std::move(child), style);
    +
    89 };
    +
    90}
    +
    +
    91
    +
    92} // namespace ftxui
    + + +
    friend void Render(Screen &screen, Node *node, Selection &selection)
    Definition node.cpp:96
    +
    void Render(Screen &screen, const Element &element)
    Display an element on a ftxui::Screen.
    Definition node.cpp:84
    +
    Color foreground_color
    Definition pixel.hpp:49
    +
    Color background_color
    Definition pixel.hpp:48
    +
    Color is a class that represents a color in the terminal user interface.
    Definition color.hpp:22
    +
    A Unicode character and its associated style.
    Definition pixel.hpp:15
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::function< Element(Element)> Decorator
    Definition elements.hpp:24
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    Decorator selectionStyle(std::function< void(Pixel &)> style)
    Set the style of an element when selected.
    +
    Decorator selectionForegroundColor(Color foreground)
    Set the foreground color of an element when selected. Note that the style is applied on top of the ex...
    +
    Decorator selectionBackgroundColor(Color foreground)
    Set the background color of an element when selected. Note that the style is applied on top of the ex...
    +
    Decorator selectionColor(Color foreground)
    Set the color of an element when selected.
    +
    Element selectionStyleReset(Element)
    Reset the selection style of an element.
    + + + +
    std::function< void(Pixel &)> style_
    +
    +
    + + + + + diff --git a/separator__style_8cpp.html b/separator__style_8cpp.html new file mode 100644 index 000000000..de0642fdf --- /dev/null +++ b/separator__style_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: separator_style.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    separator_style.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Functions

    int main ()
     
    +

    Function Documentation

    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 12 of file separator_style.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/separator__style_8cpp.js b/separator__style_8cpp.js new file mode 100644 index 000000000..2b7daf6e2 --- /dev/null +++ b/separator__style_8cpp.js @@ -0,0 +1,4 @@ +var separator__style_8cpp = +[ + [ "main", "separator__style_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/separator__style_8cpp_source.html b/separator__style_8cpp_source.html new file mode 100644 index 000000000..0a53fd261 --- /dev/null +++ b/separator__style_8cpp_source.html @@ -0,0 +1,263 @@ + + + + + + + + +FTXUI: separator_style.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    separator_style.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <ftxui/screen/screen.hpp> // for Screen
    +
    5#include <iostream> // for endl, cout, ostream
    +
    6#include <memory> // for allocator
    +
    7
    +
    8#include "ftxui/dom/elements.hpp" // for text, hbox, separatorDouble, separatorHeavy, separatorLight, vbox, operator|, Element, Fit, borderDouble, borderHeavy, borderLight
    +
    9#include "ftxui/dom/node.hpp" // for Render
    +
    10#include "ftxui/screen/box.hpp" // for ftxui
    +
    11
    +
    +
    12int main() {
    +
    13 using namespace ftxui;
    +
    14
    +
    15 auto document = vbox({
    +
    16 vbox({
    +
    17 text("separatorLight"),
    +
    18 separatorLight(),
    +
    19 hbox(text("left"), separatorLight(), text("right")),
    +
    20 }) | borderLight,
    +
    21
    +
    22 vbox({
    +
    23 text("separatorDashed"),
    +
    24 separatorDashed(),
    +
    25 hbox(text("left"), separatorDashed(), text("right")),
    +
    26 }) | borderDashed,
    +
    27
    +
    28 vbox({
    +
    29 text("separatorHeavy"),
    +
    30 separatorHeavy(),
    +
    31 hbox(text("left"), separatorHeavy(), text("right")),
    +
    32 }) | borderHeavy,
    +
    33
    +
    34 vbox({
    +
    35 text("separatorDouble"),
    +
    36 separatorDouble(),
    +
    37 hbox(text("left"), separatorDouble(), text("right")),
    +
    38 }) | borderDouble,
    +
    39 });
    +
    40
    +
    41 auto screen =
    +
    42 Screen::Create(Dimension::Fit(document), Dimension::Fit(document));
    +
    43 Render(screen, document);
    +
    44 screen.Print();
    +
    45 std::cout << std::endl;
    +
    46}
    +
    + + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + + +
    int main()
    +
    +
    + + + + + diff --git a/slider__direction_8cpp.html b/slider__direction_8cpp.html new file mode 100644 index 000000000..3d8b34bc5 --- /dev/null +++ b/slider__direction_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: slider_direction.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    slider_direction.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Functions

    int main ()
     
    +

    Function Documentation

    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 19 of file slider_direction.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/slider__direction_8cpp.js b/slider__direction_8cpp.js new file mode 100644 index 000000000..f3d603603 --- /dev/null +++ b/slider__direction_8cpp.js @@ -0,0 +1,4 @@ +var slider__direction_8cpp = +[ + [ "main", "slider__direction_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/slider__direction_8cpp_source.html b/slider__direction_8cpp_source.html new file mode 100644 index 000000000..e393a895e --- /dev/null +++ b/slider__direction_8cpp_source.html @@ -0,0 +1,281 @@ + + + + + + + + +FTXUI: slider_direction.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    slider_direction.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <array> // for array
    +
    5#include <cmath> // for sin
    +
    6#include <ftxui/component/component_base.hpp> // for ComponentBase
    +
    7#include <ftxui/component/component_options.hpp> // for SliderOption
    +
    8#include <ftxui/dom/direction.hpp> // for Direction, Direction::Up
    +
    9#include <ftxui/dom/elements.hpp> // for size, GREATER_THAN, HEIGHT
    +
    10#include <ftxui/util/ref.hpp> // for ConstRef, Ref
    +
    11#include <memory> // for shared_ptr, __shared_ptr_access
    +
    12
    +
    13#include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    14#include "ftxui/component/component.hpp" // for Horizontal, Slider, operator|=
    +
    15#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    16
    +
    17using namespace ftxui;
    +
    18
    +
    +
    19int main() {
    + +
    21 std::array<int, 30> values;
    +
    22 for (size_t i = 0; i < values.size(); ++i) {
    +
    23 values[i] = 50 + 20 * std::sin(i * 0.3);
    +
    24 }
    +
    25
    +
    26 auto layout_horizontal = Container::Horizontal({});
    +
    27 for (auto& value : values) {
    +
    28 // In C++17:
    +
    29 SliderOption<int> option;
    +
    30 option.value = &value;
    +
    31 option.max = 100;
    +
    32 option.increment = 5;
    +
    33 option.direction = Direction::Up;
    +
    34 layout_horizontal->Add(Slider<int>(option));
    +
    35
    +
    36 /* In C++20:
    +
    37 layout_horizontal->Add(Slider<int>({
    +
    38 .value = &values[i],
    +
    39 .max = 100,
    +
    40 .increment = 5,
    +
    41 .direction = Direction::Up,
    +
    42 }));
    +
    43 */
    +
    44 }
    +
    45
    +
    46 layout_horizontal |= size(HEIGHT, GREATER_THAN, 20);
    +
    47
    +
    48 screen.Loop(layout_horizontal);
    +
    49}
    +
    + + + + + + +
    static ScreenInteractive TerminalOutput()
    +
    Component Horizontal(Components children)
    A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow...
    +
    Decorator size(WidthOrHeight, Constraint, int value)
    Apply a constraint on the size of an element.
    + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + +
    @ GREATER_THAN
    Definition elements.hpp:162
    + + +
    int main()
    + + + + + +
    +
    + + + + + diff --git a/slider__rgb_8cpp.html b/slider__rgb_8cpp.html new file mode 100644 index 000000000..e1958ca20 --- /dev/null +++ b/slider__rgb_8cpp.html @@ -0,0 +1,303 @@ + + + + + + + + +FTXUI: slider_rgb.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    slider_rgb.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + + + + +

    +Functions

    Element ColorTile (int red, int green, int blue)
     
    Element ColorString (int red, int green, int blue)
     
    int main ()
     
    +

    Function Documentation

    + +

    ◆ ColorTile()

    + +
    +
    + + + + + + + + + + + + + + + + +
    Element ColorTile (int red,
    int green,
    int blue )
    +
    +
    Examples
    examples/component/slider_rgb.cpp.
    +
    + +

    Definition at line 16 of file slider_rgb.cpp.

    + +
    +
    + +

    ◆ ColorString()

    + +
    +
    + + + + + + + + + + + + + + + + +
    Element ColorString (int red,
    int green,
    int blue )
    +
    +
    Examples
    examples/component/slider_rgb.cpp.
    +
    + +

    Definition at line 21 of file slider_rgb.cpp.

    + +
    +
    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 29 of file slider_rgb.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/slider__rgb_8cpp.js b/slider__rgb_8cpp.js new file mode 100644 index 000000000..3b0875234 --- /dev/null +++ b/slider__rgb_8cpp.js @@ -0,0 +1,6 @@ +var slider__rgb_8cpp = +[ + [ "ColorTile", "slider__rgb_8cpp.html#ac5038fb3740e7d9137dfb4969a9a8035", null ], + [ "ColorString", "slider__rgb_8cpp.html#acfbf512737b012658b0c3b6997da144e", null ], + [ "main", "slider__rgb_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/slider__rgb_8cpp_source.html b/slider__rgb_8cpp_source.html new file mode 100644 index 000000000..513ebcf36 --- /dev/null +++ b/slider__rgb_8cpp_source.html @@ -0,0 +1,303 @@ + + + + + + + + +FTXUI: slider_rgb.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    slider_rgb.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <memory> // for allocator, shared_ptr, __shared_ptr_access
    +
    5#include <string> // for char_traits, operator+, to_string
    +
    6
    +
    7#include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    8#include "ftxui/component/component.hpp" // for Slider, Renderer, Vertical
    +
    9#include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    10#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    11#include "ftxui/dom/elements.hpp" // for separator, operator|, Element, size, text, vbox, xflex, bgcolor, hbox, GREATER_THAN, WIDTH, border, HEIGHT, LESS_THAN
    +
    12#include "ftxui/screen/color.hpp" // for Color
    +
    13
    +
    14using namespace ftxui;
    +
    15
    +
    +
    16Element ColorTile(int red, int green, int blue) {
    +
    17 return text("") | size(WIDTH, GREATER_THAN, 14) |
    +
    18 size(HEIGHT, GREATER_THAN, 7) | bgcolor(Color::RGB(red, green, blue));
    +
    19}
    +
    +
    20
    +
    +
    21Element ColorString(int red, int green, int blue) {
    +
    22 return text("RGB = (" + //
    +
    23 std::to_string(red) + "," + //
    +
    24 std::to_string(green) + "," + //
    +
    25 std::to_string(blue) + ")" //
    +
    26 );
    +
    27}
    +
    +
    28
    +
    +
    29int main() {
    +
    30 int red = 128;
    +
    31 int green = 25;
    +
    32 int blue = 100;
    +
    33 auto slider_red = Slider("Red :", &red, 0, 255, 1);
    +
    34 auto slider_green = Slider("Green:", &green, 0, 255, 1);
    +
    35 auto slider_blue = Slider("Blue :", &blue, 0, 255, 1);
    +
    36
    +
    37 auto container = Container::Vertical({
    +
    38 slider_red,
    +
    39 slider_green,
    +
    40 slider_blue,
    +
    41 });
    +
    42
    +
    43 auto renderer = Renderer(container, [&] {
    +
    44 return hbox({
    +
    45 ColorTile(red, green, blue),
    +
    46 separator(),
    +
    47 vbox({
    +
    48 slider_red->Render(),
    +
    49 separator(),
    +
    50 slider_green->Render(),
    +
    51 separator(),
    +
    52 slider_blue->Render(),
    +
    53 separator(),
    +
    54 ColorString(red, green, blue),
    +
    55 }) | xflex,
    +
    56 }) |
    +
    57 border | size(WIDTH, LESS_THAN, 80);
    +
    58 });
    + +
    60 screen.Loop(renderer);
    +
    61}
    +
    + + + + + +
    static ScreenInteractive TerminalOutput()
    +
    Component Renderer(Component child, std::function< Element()>)
    Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
    +
    Component Vertical(Components children)
    A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
    +
    virtual void Render(Screen &screen)
    Display an element on a ftxui::Screen.
    Definition node.cpp:59
    +
    Decorator bgcolor(Color)
    Decorate using a background color.
    +
    Decorator size(WidthOrHeight, Constraint, int value)
    Apply a constraint on the size of an element.
    +
    Element text(std::wstring text)
    Display a piece of unicode text.
    Definition text.cpp:160
    +
    Element separator()
    Draw a vertical or horizontal separation in between two other elements.
    +
    Element vbox(Elements)
    A container displaying elements vertically one by one.
    Definition vbox.cpp:96
    +
    static Color RGB(uint8_t red, uint8_t green, uint8_t blue)
    Build a Color from its RGB representation. https://en.wikipedia.org/wiki/RGB_color_model.
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + + +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    Element hbox(Elements)
    A container displaying elements horizontally one by one.
    Definition hbox.cpp:94
    +
    Component Slider(SliderOption< T > options)
    A slider in any direction.
    +
    @ LESS_THAN
    Definition elements.hpp:162
    +
    @ GREATER_THAN
    Definition elements.hpp:162
    + +
    Element ColorTile(int red, int green, int blue)
    +
    Element ColorString(int red, int green, int blue)
    +
    int main()
    +
    +
    + + + + + diff --git a/splitbar.png b/splitbar.png new file mode 100644 index 000000000..7ff2524fc Binary files /dev/null and b/splitbar.png differ diff --git a/splitbard.png b/splitbard.png new file mode 100644 index 000000000..fed0d8633 Binary files /dev/null and b/splitbard.png differ diff --git a/src_2ftxui_2component_2button_8cpp.html b/src_2ftxui_2component_2button_8cpp.html new file mode 100644 index 000000000..20405b6f8 --- /dev/null +++ b/src_2ftxui_2component_2button_8cpp.html @@ -0,0 +1,230 @@ + + + + + + + + +FTXUI: button.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    button.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + + + + +

    +Functions

    Component Button (ButtonOption option)
     Draw a button. Execute a function when clicked.
     
    Component Button (ConstStringRef label, std::function< void()> on_click, ButtonOption option)
     Draw a button. Execute a function when clicked.
     
    +
    +
    + + + + + diff --git a/src_2ftxui_2component_2button_8cpp.js b/src_2ftxui_2component_2button_8cpp.js new file mode 100644 index 000000000..5c993ed05 --- /dev/null +++ b/src_2ftxui_2component_2button_8cpp.js @@ -0,0 +1,5 @@ +var src_2ftxui_2component_2button_8cpp = +[ + [ "Button", "src_2ftxui_2component_2button_8cpp.html#ga4e8295ec77dd31b0acc5063b134473e7", null ], + [ "Button", "src_2ftxui_2component_2button_8cpp.html#ga0488e28ee9388e0ddca26f1d03d827d1", null ] +]; \ No newline at end of file diff --git a/src_2ftxui_2component_2button_8cpp_source.html b/src_2ftxui_2component_2button_8cpp_source.html new file mode 100644 index 000000000..702741c76 --- /dev/null +++ b/src_2ftxui_2component_2button_8cpp_source.html @@ -0,0 +1,458 @@ + + + + + + + + +FTXUI: button.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    src/ftxui/component/button.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4
    +
    5#include <functional> // for function
    +
    6#include <utility> // for move
    +
    7
    +
    8#include "ftxui/component/animation.hpp" // for Animator, Params (ptr only)
    +
    9#include "ftxui/component/component.hpp" // for Make, Button
    +
    10#include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    11#include "ftxui/component/component_options.hpp" // for ButtonOption, AnimatedColorOption, AnimatedColorsOption, EntryState
    +
    12#include "ftxui/component/event.hpp" // for Event, Event::Return
    +
    13#include "ftxui/component/mouse.hpp" // for Mouse, Mouse::Left, Mouse::Pressed
    +
    14#include "ftxui/component/screen_interactive.hpp" // for Component
    +
    15#include "ftxui/dom/elements.hpp" // for operator|, Decorator, Element, operator|=, bgcolor, color, reflect, text, bold, border, inverted, nothing
    +
    16#include "ftxui/screen/box.hpp" // for Box
    +
    17#include "ftxui/screen/color.hpp" // for Color
    +
    18#include "ftxui/util/ref.hpp" // for Ref, ConstStringRef
    +
    19
    +
    20namespace ftxui {
    +
    21
    +
    22namespace {
    +
    23
    +
    24Element DefaultTransform(EntryState params) { // NOLINT
    +
    25 auto element = text(params.label) | border;
    +
    26 if (params.active) {
    +
    27 element |= bold;
    +
    28 }
    +
    29 if (params.focused) {
    +
    30 element |= inverted;
    +
    31 }
    +
    32 return element;
    +
    33}
    +
    34
    +
    35class ButtonBase : public ComponentBase, public ButtonOption {
    +
    36 public:
    +
    37 explicit ButtonBase(ButtonOption option) : ButtonOption(std::move(option)) {}
    +
    38
    +
    39 // Component implementation:
    +
    40 Element OnRender() override {
    +
    41 const bool active = Active();
    +
    42 const bool focused = Focused();
    +
    43 const bool focused_or_hover = focused || mouse_hover_;
    +
    44
    +
    45 float target = focused_or_hover ? 1.f : 0.f; // NOLINT
    +
    46 if (target != animator_background_.to()) {
    +
    47 SetAnimationTarget(target);
    +
    48 }
    +
    49
    +
    50 const EntryState state{
    +
    51 *label, false, active, focused_or_hover, Index(),
    +
    52 };
    +
    53
    +
    54 auto element = (transform ? transform : DefaultTransform) //
    +
    55 (state);
    +
    56 element |= AnimatedColorStyle();
    +
    57 element |= focus;
    +
    58 element |= reflect(box_);
    +
    59 return element;
    +
    60 }
    +
    61
    +
    62 Decorator AnimatedColorStyle() {
    +
    63 Decorator style = nothing;
    +
    64 if (animated_colors.background.enabled) {
    +
    65 style = style |
    +
    66 bgcolor(Color::Interpolate(animation_foreground_, //
    +
    67 animated_colors.background.inactive,
    +
    68 animated_colors.background.active));
    +
    69 }
    +
    70 if (animated_colors.foreground.enabled) {
    +
    71 style =
    +
    72 style | color(Color::Interpolate(animation_foreground_, //
    +
    73 animated_colors.foreground.inactive,
    +
    74 animated_colors.foreground.active));
    +
    75 }
    +
    76 return style;
    +
    77 }
    +
    78
    +
    79 void SetAnimationTarget(float target) {
    +
    80 if (animated_colors.foreground.enabled) {
    +
    81 animator_foreground_ = animation::Animator(
    +
    82 &animation_foreground_, target, animated_colors.foreground.duration,
    +
    83 animated_colors.foreground.function);
    +
    84 }
    +
    85 if (animated_colors.background.enabled) {
    +
    86 animator_background_ = animation::Animator(
    +
    87 &animation_background_, target, animated_colors.background.duration,
    +
    88 animated_colors.background.function);
    +
    89 }
    +
    90 }
    +
    91
    +
    92 void OnAnimation(animation::Params& p) override {
    +
    93 animator_background_.OnAnimation(p);
    +
    94 animator_foreground_.OnAnimation(p);
    +
    95 }
    +
    96
    +
    97 void OnClick() {
    +
    98 animation_background_ = 0.5F; // NOLINT
    +
    99 animation_foreground_ = 0.5F; // NOLINT
    +
    100 SetAnimationTarget(1.F); // NOLINT
    +
    101
    +
    102 // TODO(arthursonzogni): Consider posting the task to the main loop, instead
    +
    103 // of invoking it immediately.
    +
    104 on_click(); // May delete this.
    +
    105 }
    +
    106
    +
    107 bool OnEvent(Event event) override {
    +
    108 if (event.is_mouse()) {
    +
    109 return OnMouseEvent(event);
    +
    110 }
    +
    111
    +
    112 if (event == Event::Return) {
    +
    113 OnClick(); // May delete this.
    +
    114 return true;
    +
    115 }
    +
    116 return false;
    +
    117 }
    +
    118
    +
    119 bool OnMouseEvent(Event event) {
    +
    120 mouse_hover_ =
    +
    121 box_.Contain(event.mouse().x, event.mouse().y) && CaptureMouse(event);
    +
    122
    +
    123 if (!mouse_hover_) {
    +
    124 return false;
    +
    125 }
    +
    126
    +
    127 if (event.mouse().button == Mouse::Left &&
    +
    128 event.mouse().motion == Mouse::Pressed) {
    +
    129 TakeFocus();
    +
    130 OnClick(); // May delete this.
    +
    131 return true;
    +
    132 }
    +
    133
    +
    134 return false;
    +
    135 }
    +
    136
    +
    137 bool Focusable() const final { return true; }
    +
    138
    +
    139 private:
    +
    140 bool mouse_hover_ = false;
    +
    141 Box box_;
    +
    142 float animation_background_ = 0;
    +
    143 float animation_foreground_ = 0;
    +
    144 animation::Animator animator_background_ =
    +
    145 animation::Animator(&animation_background_);
    +
    146 animation::Animator animator_foreground_ =
    +
    147 animation::Animator(&animation_foreground_);
    +
    148};
    +
    149
    +
    150} // namespace
    +
    151
    +
    152/// @brief Draw a button. Execute a function when clicked.
    +
    153/// @param option Additional optional parameters.
    +
    154/// @ingroup component
    +
    155/// @see ButtonBase
    +
    156///
    +
    157/// ### Example
    +
    158///
    +
    159/// ```cpp
    +
    160/// auto screen = ScreenInteractive::FitComponent();
    +
    161/// Component button = Button({
    +
    162/// .label = "Click to quit",
    +
    163/// .on_click = screen.ExitLoopClosure(),
    +
    164/// });
    +
    165/// screen.Loop(button)
    +
    166/// ```
    +
    167///
    +
    168/// ### Output
    +
    169///
    +
    170/// ```bash
    +
    171/// ┌─────────────┐
    +
    172/// │Click to quit│
    +
    173/// └─────────────┘
    +
    174/// ```
    +
    + +
    176 return Make<ButtonBase>(std::move(option));
    +
    177}
    +
    +
    178
    +
    179/// @brief Draw a button. Execute a function when clicked.
    +
    180/// @param label The label of the button.
    +
    181/// @param on_click The action to execute when clicked.
    +
    182/// @param option Additional optional parameters.
    +
    183/// @ingroup component
    +
    184/// @see ButtonBase
    +
    185///
    +
    186/// ### Example
    +
    187///
    +
    188/// ```cpp
    +
    189/// auto screen = ScreenInteractive::FitComponent();
    +
    190/// std::string label = "Click to quit";
    +
    191/// Component button = Button(&label, screen.ExitLoopClosure());
    +
    192/// screen.Loop(button)
    +
    193/// ```
    +
    194///
    +
    195/// ### Output
    +
    196///
    +
    197/// ```bash
    +
    198/// ┌─────────────┐
    +
    199/// │Click to quit│
    +
    200/// └─────────────┘
    +
    201/// ```
    +
    202// NOLINTNEXTLINE
    +
    + +
    204 std::function<void()> on_click,
    +
    205 ButtonOption option) {
    +
    206 option.label = std::move(label);
    +
    207 option.on_click = std::move(on_click);
    +
    208 return Make<ButtonBase>(std::move(option));
    +
    209}
    +
    +
    210
    +
    211} // namespace ftxui
    + + +
    An adapter. Own or reference a constant string. For convenience, this class convert multiple immutabl...
    Definition ref.hpp:94
    + + + + + + + + +
    std::function< void()> on_click
    + +
    static const Event Return
    Definition event.hpp:53
    +
    Component Button(ButtonOption options)
    Draw a button. Execute a function when clicked.
    +
    Option for the AnimatedButton component.
    +
    Decorator bgcolor(Color)
    Decorate using a background color.
    +
    Element nothing(Element element)
    A decoration doing absolutely nothing.
    Definition dom/util.cpp:28
    +
    Element bold(Element)
    Use a bold font, for elements with more emphasis.
    Definition bold.cpp:33
    +
    Element inverted(Element)
    Add a filter that will invert the foreground and the background colors.
    Definition inverted.cpp:34
    +
    Element text(std::wstring text)
    Display a piece of unicode text.
    Definition text.cpp:160
    +
    Element focus(Element)
    Set the child to be the one focused among its siblings.
    Definition frame.cpp:101
    +
    Element border(Element)
    Draw a border around the element.
    +
    Decorator color(Color)
    Decorate using a foreground color.
    +
    static Color Interpolate(float t, const Color &a, const Color &b)
    + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::function< Element(Element)> Decorator
    Definition elements.hpp:24
    +
    std::shared_ptr< T > Make(Args &&... args)
    Definition component.hpp:27
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    Decorator reflect(Box &box)
    Definition reflect.cpp:43
    +
    std::shared_ptr< ComponentBase > Component
    + + +
    +
    + + + + + diff --git a/src_2ftxui_2component_2checkbox_8cpp.html b/src_2ftxui_2component_2checkbox_8cpp.html new file mode 100644 index 000000000..2447ef1c5 --- /dev/null +++ b/src_2ftxui_2component_2checkbox_8cpp.html @@ -0,0 +1,230 @@ + + + + + + + + +FTXUI: checkbox.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    checkbox.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + + + + +

    +Functions

    Component Checkbox (CheckboxOption option)
     Draw checkable element.
     
    Component Checkbox (ConstStringRef label, bool *checked, CheckboxOption option)
     Draw checkable element.
     
    +
    +
    + + + + + diff --git a/src_2ftxui_2component_2checkbox_8cpp.js b/src_2ftxui_2component_2checkbox_8cpp.js new file mode 100644 index 000000000..608b0f733 --- /dev/null +++ b/src_2ftxui_2component_2checkbox_8cpp.js @@ -0,0 +1,5 @@ +var src_2ftxui_2component_2checkbox_8cpp = +[ + [ "Checkbox", "src_2ftxui_2component_2checkbox_8cpp.html#gae0d441d2c83740f187f62db566bbefcd", null ], + [ "Checkbox", "src_2ftxui_2component_2checkbox_8cpp.html#ga5e9dbb03c44d549f10c96f134269366f", null ] +]; \ No newline at end of file diff --git a/src_2ftxui_2component_2checkbox_8cpp_source.html b/src_2ftxui_2component_2checkbox_8cpp_source.html new file mode 100644 index 000000000..769ead14e --- /dev/null +++ b/src_2ftxui_2component_2checkbox_8cpp_source.html @@ -0,0 +1,378 @@ + + + + + + + + +FTXUI: checkbox.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    src/ftxui/component/checkbox.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <functional> // for function
    +
    5#include <utility> // for move
    +
    6
    +
    7#include "ftxui/component/component.hpp" // for Make, Checkbox
    +
    8#include "ftxui/component/component_base.hpp" // for Component, ComponentBase
    +
    9#include "ftxui/component/component_options.hpp" // for CheckboxOption, EntryState
    +
    10#include "ftxui/component/event.hpp" // for Event, Event::Return
    +
    11#include "ftxui/component/mouse.hpp" // for Mouse, Mouse::Left, Mouse::Pressed
    +
    12#include "ftxui/dom/elements.hpp" // for operator|, Element, reflect, focus, nothing, select
    +
    13#include "ftxui/screen/box.hpp" // for Box
    +
    14#include "ftxui/util/ref.hpp" // for Ref, ConstStringRef
    +
    15
    +
    16namespace ftxui {
    +
    17
    +
    18namespace {
    +
    19class CheckboxBase : public ComponentBase, public CheckboxOption {
    +
    20 public:
    +
    21 explicit CheckboxBase(CheckboxOption option)
    +
    22 : CheckboxOption(std::move(option)) {}
    +
    23
    +
    24 private:
    +
    25 // Component implementation.
    +
    26 Element OnRender() override {
    +
    27 const bool is_focused = Focused();
    +
    28 const bool is_active = Active();
    +
    29 auto entry_state = EntryState{
    +
    30 *label, *checked, is_active, is_focused || hovered_, -1,
    +
    31 };
    +
    32 auto element = (transform ? transform : CheckboxOption::Simple().transform)(
    +
    33 entry_state);
    +
    34 element |= focus;
    +
    35 element |= reflect(box_);
    +
    36 return element;
    +
    37 }
    +
    38
    +
    39 bool OnEvent(Event event) override {
    +
    40 if (!CaptureMouse(event)) {
    +
    41 return false;
    +
    42 }
    +
    43
    +
    44 if (event.is_mouse()) {
    +
    45 return OnMouseEvent(event);
    +
    46 }
    +
    47
    +
    48 hovered_ = false;
    +
    49 if (event == Event::Character(' ') || event == Event::Return) {
    +
    50 *checked = !*checked;
    +
    51 on_change();
    +
    52 TakeFocus();
    +
    53 return true;
    +
    54 }
    +
    55 return false;
    +
    56 }
    +
    57
    +
    58 bool OnMouseEvent(Event event) {
    +
    59 hovered_ = box_.Contain(event.mouse().x, event.mouse().y);
    +
    60
    +
    61 if (!CaptureMouse(event)) {
    +
    62 return false;
    +
    63 }
    +
    64
    +
    65 if (!hovered_) {
    +
    66 return false;
    +
    67 }
    +
    68
    +
    69 if (event.mouse().button == Mouse::Left &&
    +
    70 event.mouse().motion == Mouse::Pressed) {
    +
    71 *checked = !*checked;
    +
    72 on_change();
    +
    73 return true;
    +
    74 }
    +
    75
    +
    76 return false;
    +
    77 }
    +
    78
    +
    79 bool Focusable() const final { return true; }
    +
    80
    +
    81 bool hovered_ = false;
    +
    82 Box box_;
    +
    83};
    +
    84} // namespace
    +
    85
    +
    86/// @brief Draw checkable element.
    +
    87/// @param option Additional optional parameters.
    +
    88/// @ingroup component
    +
    89/// @see CheckboxBase
    +
    90///
    +
    91/// ### Example
    +
    92///
    +
    93/// ```cpp
    +
    94/// auto screen = ScreenInteractive::FitComponent();
    +
    95/// CheckboxOption option;
    +
    96/// option.label = "Make a sandwidth";
    +
    97/// option.checked = false;
    +
    98/// Component checkbox = Checkbox(option);
    +
    99/// screen.Loop(checkbox)
    +
    100/// ```
    +
    101///
    +
    102/// ### Output
    +
    103///
    +
    104/// ```bash
    +
    105/// ☐ Make a sandwitch
    +
    106/// ```
    +
    107// NOLINTNEXTLINE
    +
    + +
    109 return Make<CheckboxBase>(std::move(option));
    +
    110}
    +
    +
    111
    +
    112/// @brief Draw checkable element.
    +
    113/// @param label The label of the checkbox.
    +
    114/// @param checked Whether the checkbox is checked or not.
    +
    115/// @param option Additional optional parameters.
    +
    116/// @ingroup component
    +
    117/// @see CheckboxBase
    +
    118///
    +
    119/// ### Example
    +
    120///
    +
    121/// ```cpp
    +
    122/// auto screen = ScreenInteractive::FitComponent();
    +
    123/// std::string label = "Make a sandwidth";
    +
    124/// bool checked = false;
    +
    125/// Component checkbox = Checkbox(&label, &checked);
    +
    126/// screen.Loop(checkbox)
    +
    127/// ```
    +
    128///
    +
    129/// ### Output
    +
    130///
    +
    131/// ```bash
    +
    132/// ☐ Make a sandwitch
    +
    133/// ```
    +
    134// NOLINTNEXTLINE
    +
    +
    135Component Checkbox(ConstStringRef label, bool* checked, CheckboxOption option) {
    +
    136 option.label = std::move(label);
    +
    137 option.checked = checked;
    +
    138 return Make<CheckboxBase>(std::move(option));
    +
    139}
    +
    +
    140
    +
    141} // namespace ftxui
    + +
    An adapter. Own or reference a constant string. For convenience, this class convert multiple immutabl...
    Definition ref.hpp:94
    + + + + + + + + +
    static CheckboxOption Simple()
    Option for standard Checkbox.
    + +
    static const Event Return
    Definition event.hpp:53
    +
    std::function< Element(const EntryState &)> transform
    +
    Component Checkbox(CheckboxOption options)
    Draw checkable element.
    +
    Option for the Checkbox component.
    +
    Element focus(Element)
    Set the child to be the one focused among its siblings.
    Definition frame.cpp:101
    + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::shared_ptr< T > Make(Args &&... args)
    Definition component.hpp:27
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    Decorator reflect(Box &box)
    Definition reflect.cpp:43
    +
    std::shared_ptr< ComponentBase > Component
    + +
    +
    + + + + + diff --git a/src_2ftxui_2component_2collapsible_8cpp.html b/src_2ftxui_2component_2collapsible_8cpp.html new file mode 100644 index 000000000..066fdf281 --- /dev/null +++ b/src_2ftxui_2component_2collapsible_8cpp.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: collapsible.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    collapsible.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + +

    +Functions

    Component Collapsible (ConstStringRef label, Component child, Ref< bool > show)
     A collapsible component. It displays a checkbox with an arrow. Once activated, the child is displayed.
     
    +
    +
    + + + + + diff --git a/src_2ftxui_2component_2collapsible_8cpp.js b/src_2ftxui_2component_2collapsible_8cpp.js new file mode 100644 index 000000000..cd5c55639 --- /dev/null +++ b/src_2ftxui_2component_2collapsible_8cpp.js @@ -0,0 +1,4 @@ +var src_2ftxui_2component_2collapsible_8cpp = +[ + [ "Collapsible", "src_2ftxui_2component_2collapsible_8cpp.html#a760cd5eb9a72c008ca18f1e6b366c796", null ] +]; \ No newline at end of file diff --git a/src_2ftxui_2component_2collapsible_8cpp_source.html b/src_2ftxui_2component_2collapsible_8cpp_source.html new file mode 100644 index 000000000..ddb39cefe --- /dev/null +++ b/src_2ftxui_2component_2collapsible_8cpp_source.html @@ -0,0 +1,286 @@ + + + + + + + + +FTXUI: collapsible.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    src/ftxui/component/collapsible.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2021 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <functional> // for function
    +
    5#include <utility> // for move
    +
    6
    +
    7#include "ftxui/component/component.hpp" // for Checkbox, Maybe, Make, Vertical, Collapsible
    +
    8#include "ftxui/component/component_base.hpp" // for Component, ComponentBase
    +
    9#include "ftxui/component/component_options.hpp" // for CheckboxOption, EntryState
    +
    10#include "ftxui/dom/elements.hpp" // for operator|=, text, hbox, Element, bold, inverted
    +
    11#include "ftxui/util/ref.hpp" // for Ref, ConstStringRef
    +
    12
    +
    13namespace ftxui {
    +
    14
    +
    15/// @brief A collapsible component. It displays a checkbox with an arrow. Once
    +
    16/// activated, the child is displayed.
    +
    17/// @param label The label of the checkbox.
    +
    18/// @param child The child to display.
    +
    19/// @param show Hold the state about whether the child is displayed or not.
    +
    20///
    +
    21/// ### Example
    +
    22/// ```cpp
    +
    23/// auto component = Collapsible("Show details", details);
    +
    24/// ```
    +
    25///
    +
    26/// ### Output
    +
    27/// ```
    +
    28///
    +
    29/// ▼ Show details
    +
    30/// <details component>
    +
    31/// ```
    +
    32// NOLINTNEXTLINE
    +
    + +
    34 class Impl : public ComponentBase {
    +
    35 public:
    +
    36 Impl(ConstStringRef label, Component child, Ref<bool> show) : show_(show) {
    + +
    38 opt.transform = [](EntryState s) { // NOLINT
    +
    39 auto prefix = text(s.state ? "▼ " : "▶ "); // NOLINT
    +
    40 auto t = text(s.label);
    +
    41 if (s.active) {
    +
    42 t |= bold;
    +
    43 }
    +
    44 if (s.focused) {
    +
    45 t |= inverted;
    +
    46 }
    +
    47 return hbox({prefix, t});
    +
    48 };
    +
    49 Add(Container::Vertical({
    +
    50 Checkbox(std::move(label), show_.operator->(), opt),
    +
    51 Maybe(std::move(child), show_.operator->()),
    +
    52 }));
    +
    53 }
    +
    54 Ref<bool> show_;
    +
    55 };
    +
    56
    +
    57 return Make<Impl>(std::move(label), std::move(child), show);
    +
    58}
    +
    +
    59
    +
    60} // namespace ftxui
    +
    An adapter. Own or reference a constant string. For convenience, this class convert multiple immutabl...
    Definition ref.hpp:94
    +
    An adapter. Own or reference an mutable object.
    Definition ref.hpp:46
    + + + + +
    std::function< Element(const EntryState &)> transform
    +
    It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ft...
    +
    Option for the Checkbox component.
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::shared_ptr< T > Make(Args &&... args)
    Definition component.hpp:27
    +
    Component Collapsible(ConstStringRef label, Component child, Ref< bool > show=false)
    A collapsible component. It displays a checkbox with an arrow. Once activated, the child is displayed...
    +
    std::shared_ptr< ComponentBase > Component
    + +
    arguments for transform from |ButtonOption|, |CheckboxOption|, |RadioboxOption|, |MenuEntryOption|,...
    +
    +
    + + + + + diff --git a/src_2ftxui_2component_2dropdown_8cpp.html b/src_2ftxui_2component_2dropdown_8cpp.html new file mode 100644 index 000000000..c39af6d5f --- /dev/null +++ b/src_2ftxui_2component_2dropdown_8cpp.html @@ -0,0 +1,230 @@ + + + + + + + + +FTXUI: dropdown.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    dropdown.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + + + + +

    +Functions

    Component Dropdown (ConstStringListRef entries, int *selected)
     A dropdown menu.
     
    Component Dropdown (DropdownOption option)
     A dropdown menu.
     
    +
    +
    + + + + + diff --git a/src_2ftxui_2component_2dropdown_8cpp.js b/src_2ftxui_2component_2dropdown_8cpp.js new file mode 100644 index 000000000..808c4ce55 --- /dev/null +++ b/src_2ftxui_2component_2dropdown_8cpp.js @@ -0,0 +1,5 @@ +var src_2ftxui_2component_2dropdown_8cpp = +[ + [ "Dropdown", "src_2ftxui_2component_2dropdown_8cpp.html#gaa22bddff4aeed66e20f30d0715596999", null ], + [ "Dropdown", "src_2ftxui_2component_2dropdown_8cpp.html#gaa4b353566017558bac648ee1409930de", null ] +]; \ No newline at end of file diff --git a/src_2ftxui_2component_2dropdown_8cpp_source.html b/src_2ftxui_2component_2dropdown_8cpp_source.html new file mode 100644 index 000000000..e2ddb3ede --- /dev/null +++ b/src_2ftxui_2component_2dropdown_8cpp_source.html @@ -0,0 +1,380 @@ + + + + + + + + +FTXUI: dropdown.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    src/ftxui/component/dropdown.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2021 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    + +
    5#include <functional> // for function
    +
    6#include <string> // for string
    +
    7
    +
    8#include <utility>
    +
    9#include "ftxui/component/component.hpp" // for Maybe, Checkbox, Make, Radiobox, Vertical, Dropdown
    +
    10#include "ftxui/component/component_base.hpp" // for Component, ComponentBase
    +
    11#include "ftxui/component/component_options.hpp" // for CheckboxOption, EntryState
    +
    12#include "ftxui/dom/elements.hpp" // for operator|, Element, border, filler, operator|=, separator, size, text, vbox, frame, vscroll_indicator, hbox, HEIGHT, LESS_THAN, bold, inverted
    +
    13#include "ftxui/screen/util.hpp" // for clamp
    +
    14#include "ftxui/util/ref.hpp" // for ConstStringListRef
    +
    15
    +
    16namespace ftxui {
    +
    17
    +
    18/// @brief A dropdown menu.
    +
    19/// @ingroup component
    +
    20/// @param entries The list of entries to display.
    +
    21/// @param selected The index of the selected entry.
    +
    +
    22Component Dropdown(ConstStringListRef entries, int* selected) {
    +
    23 DropdownOption option;
    +
    24 option.radiobox.entries = std::move(entries);
    +
    25 option.radiobox.selected = selected;
    +
    26 return Dropdown(option);
    +
    27}
    +
    +
    28
    +
    29/// @brief A dropdown menu.
    +
    30/// @ingroup component
    +
    31/// @param option The options for the dropdown.
    +
    32// NOLINTNEXTLINE
    +
    + +
    34 class Impl : public ComponentBase, public DropdownOption {
    +
    35 public:
    +
    36 explicit Impl(DropdownOption option) : DropdownOption(std::move(option)) {
    +
    37 FillDefault();
    +
    38 checkbox_ = Checkbox(checkbox);
    +
    39 radiobox_ = Radiobox(radiobox);
    +
    40
    +
    41 Add(Container::Vertical({
    +
    42 checkbox_,
    +
    43 Maybe(radiobox_, checkbox.checked),
    +
    44 }));
    +
    45 }
    +
    46
    +
    47 Element OnRender() override {
    +
    48 selected_ =
    +
    49 util::clamp(radiobox.selected(), 0, int(radiobox.entries.size()) - 1);
    +
    50 selected_ = util::clamp(selected_(), 0, int(radiobox.entries.size()) - 1);
    +
    51
    +
    52 if (selected_() >= 0 && selected_() < int(radiobox.entries.size())) {
    +
    53 title_ = radiobox.entries[selected_()];
    +
    54 }
    +
    55
    +
    56 return transform(*open_, checkbox_->Render(), radiobox_->Render());
    +
    57 }
    +
    58
    +
    59 // Switch focus in between the checkbox and the radiobox when selecting it.
    +
    60 bool OnEvent(ftxui::Event event) override {
    +
    61 const bool open_old = open_();
    +
    62 const int selected_old = selected_();
    +
    63 bool handled = ComponentBase::OnEvent(event);
    +
    64
    +
    65 // Transfer focus to the radiobox when the dropdown is opened.
    +
    66 if (!open_old && open_()) {
    +
    67 radiobox_->TakeFocus();
    +
    68 }
    +
    69
    +
    70 // Auto-close the dropdown when the user selects an item, even if the item
    +
    71 // it the same as the previous one.
    +
    72 if (open_old && open_()) {
    +
    73 const bool should_close =
    +
    74 (selected_() != selected_old) || //
    +
    75 (event == Event::Return) || //
    +
    76 (event == Event::Character(' ')) || //
    +
    77 (event == Event::Escape) || //
    +
    78 (event.is_mouse() && event.mouse().button == Mouse::Left &&
    +
    79 event.mouse().motion == Mouse::Pressed);
    +
    80
    +
    81 if (should_close) {
    +
    82 checkbox_->TakeFocus();
    +
    83 open_ = false;
    +
    84 handled = true;
    +
    85 }
    +
    86 }
    +
    87
    +
    88 return handled;
    +
    89 }
    +
    90
    +
    91 void FillDefault() {
    +
    92 open_ = checkbox.checked;
    +
    93 selected_ = radiobox.selected;
    +
    94 checkbox.checked = &*open_;
    +
    95 radiobox.selected = &*selected_;
    +
    96 checkbox.label = &title_;
    +
    97
    +
    98 if (!checkbox.transform) {
    +
    99 checkbox.transform = [](const EntryState& s) {
    +
    100 auto prefix = text(s.state ? "↓ " : "→ "); // NOLINT
    +
    101 auto t = text(s.label);
    +
    102 if (s.active) {
    +
    103 t |= bold;
    +
    104 }
    +
    105 if (s.focused) {
    +
    106 t |= inverted;
    +
    107 }
    +
    108 return hbox({prefix, t});
    +
    109 };
    +
    110 }
    +
    111
    +
    112 if (!transform) {
    +
    113 transform = [](bool is_open, Element checkbox_element,
    +
    114 Element radiobox_element) {
    +
    115 if (is_open) {
    +
    116 const int max_height = 12;
    +
    117 return vbox({
    +
    118 std::move(checkbox_element),
    +
    119 separator(),
    +
    120 std::move(radiobox_element) | vscroll_indicator | frame |
    +
    121 size(HEIGHT, LESS_THAN, max_height),
    +
    122 }) |
    +
    123 border;
    +
    124 }
    +
    125 return vbox({std::move(checkbox_element), filler()}) | border;
    +
    126 };
    +
    127 }
    +
    128 }
    +
    129
    +
    130 private:
    +
    131 Ref<bool> open_;
    +
    132 Ref<int> selected_;
    +
    133 Component checkbox_;
    +
    134 Component radiobox_;
    +
    135 std::string title_;
    +
    136 };
    +
    137
    +
    138 return Make<Impl>(option);
    +
    139}
    +
    +
    140
    +
    141} // namespace ftxui
    +
    An adapter. Reference a list of strings.
    Definition ref.hpp:116
    +
    An adapter. Own or reference an mutable object.
    Definition ref.hpp:46
    + + + + + +
    struct Mouse mouse
    Definition event.hpp:144
    +
    ConstStringListRef entries
    + +
    Button button
    Definition mouse.hpp:30
    + +
    Motion motion
    Definition mouse.hpp:33
    +
    It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ft...
    +
    Component Dropdown(ConstStringListRef entries, int *selected)
    A dropdown menu.
    +
    Option for the Dropdown component.A dropdown menu is a checkbox opening/closing a radiobox.
    +
    Represent an event. It can be key press event, a terminal resize, or more ...
    Definition event.hpp:29
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + +
    std::shared_ptr< T > Make(Args &&... args)
    Definition component.hpp:27
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    @ LESS_THAN
    Definition elements.hpp:162
    +
    std::shared_ptr< ComponentBase > Component
    + +
    arguments for transform from |ButtonOption|, |CheckboxOption|, |RadioboxOption|, |MenuEntryOption|,...
    + +
    +
    + + + + + diff --git a/src_2ftxui_2component_2input_8cpp.html b/src_2ftxui_2component_2input_8cpp.html new file mode 100644 index 000000000..397f00c8b --- /dev/null +++ b/src_2ftxui_2component_2input_8cpp.html @@ -0,0 +1,233 @@ + + + + + + + + +FTXUI: input.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    input.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + + + + + + + +

    +Functions

    Component Input (InputOption option)
     An input box for editing text.
     
    Component Input (StringRef content, InputOption option)
     An input box for editing text.
     
    Component Input (StringRef content, StringRef placeholder, InputOption option)
     An input box for editing text.
     
    +
    +
    + + + + + diff --git a/src_2ftxui_2component_2input_8cpp.js b/src_2ftxui_2component_2input_8cpp.js new file mode 100644 index 000000000..48eb10c9d --- /dev/null +++ b/src_2ftxui_2component_2input_8cpp.js @@ -0,0 +1,6 @@ +var src_2ftxui_2component_2input_8cpp = +[ + [ "Input", "src_2ftxui_2component_2input_8cpp.html#ga7f285fcbc4dd0a0767b89a255fd062dc", null ], + [ "Input", "src_2ftxui_2component_2input_8cpp.html#ga9d118d596e33bf5bee9d5eccb6265d15", null ], + [ "Input", "src_2ftxui_2component_2input_8cpp.html#ga82ba18065d2c29514f034c7278dead74", null ] +]; \ No newline at end of file diff --git a/src_2ftxui_2component_2input_8cpp_source.html b/src_2ftxui_2component_2input_8cpp_source.html new file mode 100644 index 000000000..2207ce97a --- /dev/null +++ b/src_2ftxui_2component_2input_8cpp_source.html @@ -0,0 +1,918 @@ + + + + + + + + +FTXUI: input.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    src/ftxui/component/input.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2022 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <algorithm> // for max, min
    +
    5#include <cstddef> // for size_t
    +
    6#include <cstdint> // for uint32_t
    +
    7#include <functional> // for function
    +
    8#include <sstream> // for basic_istream, stringstream
    +
    9#include <string> // for string, basic_string, operator==, getline
    +
    10#include <utility> // for move
    +
    11#include <vector> // for vector
    +
    12
    +
    13#include "ftxui/component/component.hpp" // for Make, Input
    +
    14#include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    15#include "ftxui/component/component_options.hpp" // for InputOption
    +
    16#include "ftxui/component/event.hpp" // for Event, Event::ArrowDown, Event::ArrowLeft, Event::ArrowLeftCtrl, Event::ArrowRight, Event::ArrowRightCtrl, Event::ArrowUp, Event::Backspace, Event::Delete, Event::End, Event::Home, Event::Return
    +
    17#include "ftxui/component/mouse.hpp" // for Mouse, Mouse::Left, Mouse::Pressed
    +
    18#include "ftxui/component/screen_interactive.hpp" // for Component
    +
    19#include "ftxui/dom/elements.hpp" // for operator|, reflect, text, Element, xflex, hbox, Elements, frame, operator|=, vbox, focus, focusCursorBarBlinking, select
    +
    20#include "ftxui/screen/box.hpp" // for Box
    +
    21#include "ftxui/screen/string.hpp" // for string_width
    +
    22#include "ftxui/screen/string_internal.hpp" // for GlyphNext, GlyphPrevious, WordBreakProperty, EatCodePoint, CodepointToWordBreakProperty, IsFullWidth, WordBreakProperty::ALetter, WordBreakProperty::CR, WordBreakProperty::Double_Quote, WordBreakProperty::Extend, WordBreakProperty::ExtendNumLet, WordBreakProperty::Format, WordBreakProperty::Hebrew_Letter, WordBreakProperty::Katakana, WordBreakProperty::LF, WordBreakProperty::MidLetter, WordBreakProperty::MidNum, WordBreakProperty::MidNumLet, WordBreakProperty::Newline, WordBreakProperty::Numeric, WordBreakProperty::Regional_Indicator, WordBreakProperty::Single_Quote, WordBreakProperty::WSegSpace, WordBreakProperty::ZWJ
    +
    23#include "ftxui/screen/util.hpp" // for clamp
    +
    24#include "ftxui/util/ref.hpp" // for StringRef, Ref
    +
    25
    +
    26namespace ftxui {
    +
    27
    +
    28namespace {
    +
    29
    +
    30std::vector<std::string> Split(const std::string& input) {
    +
    31 std::vector<std::string> output;
    +
    32 std::stringstream ss(input);
    +
    33 std::string line;
    +
    34 while (std::getline(ss, line)) {
    +
    35 output.push_back(line);
    +
    36 }
    +
    37 if (input.back() == '\n') {
    +
    38 output.emplace_back("");
    +
    39 }
    +
    40 return output;
    +
    41}
    +
    42
    +
    43size_t GlyphWidth(const std::string& input, size_t iter) {
    +
    44 uint32_t ucs = 0;
    +
    45 if (!EatCodePoint(input, iter, &iter, &ucs)) {
    +
    46 return 0;
    +
    47 }
    +
    48 if (IsFullWidth(ucs)) {
    +
    49 return 2;
    +
    50 }
    +
    51 return 1;
    +
    52}
    +
    53
    +
    54bool IsWordCodePoint(uint32_t codepoint) {
    +
    55 switch (CodepointToWordBreakProperty(codepoint)) {
    + + + + +
    60 return true;
    +
    61
    + + + + + + + + + +
    71 // Unexpected/Unsure
    + + + + + +
    77 return false;
    +
    78 }
    +
    79 return false; // NOT_REACHED();
    +
    80}
    +
    81
    +
    82bool IsWordCharacter(const std::string& input, size_t iter) {
    +
    83 uint32_t ucs = 0;
    +
    84 if (!EatCodePoint(input, iter, &iter, &ucs)) {
    +
    85 return false;
    +
    86 }
    +
    87
    +
    88 return IsWordCodePoint(ucs);
    +
    89}
    +
    90
    +
    91// An input box. The user can type text into it.
    +
    92class InputBase : public ComponentBase, public InputOption {
    +
    93 public:
    +
    94 // NOLINTNEXTLINE
    +
    95 InputBase(InputOption option) : InputOption(std::move(option)) {}
    +
    96
    +
    97 private:
    +
    98 // Component implementation:
    +
    99 Element OnRender() override {
    +
    100 const bool is_focused = Focused();
    +
    101 const auto focused = (!is_focused && !hovered_) ? nothing
    +
    102 : insert() ? focusCursorBarBlinking
    +
    103 : focusCursorBlockBlinking;
    +
    104
    +
    105 auto transform_func =
    +
    106 transform ? transform : InputOption::Default().transform;
    +
    107
    +
    108 // placeholder.
    +
    109 if (content->empty()) {
    +
    110 auto element = text(placeholder()) | xflex | frame;
    +
    111
    +
    112 return transform_func({
    +
    113 std::move(element), hovered_, is_focused,
    +
    114 true // placeholder
    +
    115 }) |
    +
    116 focus | reflect(box_);
    +
    117 }
    +
    118
    +
    119 Elements elements;
    +
    120 const std::vector<std::string> lines = Split(*content);
    +
    121
    +
    122 cursor_position() = util::clamp(cursor_position(), 0, (int)content->size());
    +
    123
    +
    124 // Find the line and index of the cursor.
    +
    125 int cursor_line = 0;
    +
    126 int cursor_char_index = cursor_position();
    +
    127 for (const auto& line : lines) {
    +
    128 if (cursor_char_index <= (int)line.size()) {
    +
    129 break;
    +
    130 }
    +
    131
    +
    132 cursor_char_index -= static_cast<int>(line.size() + 1);
    +
    133 cursor_line++;
    +
    134 }
    +
    135
    +
    136 if (lines.empty()) {
    +
    137 elements.push_back(text("") | focused);
    +
    138 }
    +
    139
    +
    140 elements.reserve(lines.size());
    +
    141 for (size_t i = 0; i < lines.size(); ++i) {
    +
    142 const std::string& line = lines[i];
    +
    143
    +
    144 // This is not the cursor line.
    +
    145 if (int(i) != cursor_line) {
    +
    146 elements.push_back(Text(line));
    +
    147 continue;
    +
    148 }
    +
    149
    +
    150 // The cursor is at the end of the line.
    +
    151 if (cursor_char_index >= (int)line.size()) {
    +
    152 elements.push_back(hbox({
    +
    153 Text(line),
    +
    154 text(" ") | focused | reflect(cursor_box_),
    +
    155 }) |
    +
    156 xflex);
    +
    157 continue;
    +
    158 }
    +
    159
    +
    160 // The cursor is on this line.
    +
    161 const int glyph_start = cursor_char_index;
    +
    162 const int glyph_end = static_cast<int>(GlyphNext(line, glyph_start));
    +
    163 const std::string part_before_cursor = line.substr(0, glyph_start);
    +
    164 const std::string part_at_cursor =
    +
    165 line.substr(glyph_start, glyph_end - glyph_start);
    +
    166 const std::string part_after_cursor = line.substr(glyph_end);
    +
    167 auto element = hbox({
    +
    168 Text(part_before_cursor),
    +
    169 Text(part_at_cursor) | focused | reflect(cursor_box_),
    +
    170 Text(part_after_cursor),
    +
    171 }) |
    +
    172 xflex;
    +
    173 elements.push_back(element);
    +
    174 }
    +
    175
    +
    176 auto element = vbox(std::move(elements), cursor_line) | frame;
    +
    177 return transform_func({
    +
    178 std::move(element), hovered_, is_focused,
    +
    179 false // placeholder
    +
    180 }) |
    +
    181 xflex | reflect(box_);
    +
    182 }
    +
    183
    +
    184 Element Text(const std::string& input) {
    +
    185 if (!password()) {
    +
    186 return text(input);
    +
    187 }
    +
    188
    +
    189 std::string out;
    +
    190 out.reserve(10 + input.size() * 3 / 2);
    +
    191 for (size_t i = 0; i < input.size(); ++i) {
    +
    192 out += "•";
    +
    193 }
    +
    194 return text(out);
    +
    195 }
    +
    196
    +
    197 bool HandleBackspace() {
    +
    198 if (cursor_position() == 0) {
    +
    199 return false;
    +
    200 }
    +
    201 const size_t start = GlyphPrevious(content(), cursor_position());
    +
    202 const size_t end = cursor_position();
    +
    203 content->erase(start, end - start);
    +
    204 cursor_position() = static_cast<int>(start);
    +
    205 on_change();
    +
    206 return true;
    +
    207 }
    +
    208
    +
    209 bool DeleteImpl() {
    +
    210 if (cursor_position() == (int)content->size()) {
    +
    211 return false;
    +
    212 }
    +
    213 const size_t start = cursor_position();
    +
    214 const size_t end = GlyphNext(content(), cursor_position());
    +
    215 content->erase(start, end - start);
    +
    216 return true;
    +
    217 }
    +
    218
    +
    219 bool HandleDelete() {
    +
    220 if (DeleteImpl()) {
    +
    221 on_change();
    +
    222 return true;
    +
    223 }
    +
    224 return false;
    +
    225 }
    +
    226
    +
    227 bool HandleArrowLeft() {
    +
    228 if (cursor_position() == 0) {
    +
    229 return false;
    +
    230 }
    +
    231
    +
    232 cursor_position() =
    +
    233 static_cast<int>(GlyphPrevious(content(), cursor_position()));
    +
    234 return true;
    +
    235 }
    +
    236
    +
    237 bool HandleArrowRight() {
    +
    238 if (cursor_position() == (int)content->size()) {
    +
    239 return false;
    +
    240 }
    +
    241
    +
    242 cursor_position() =
    +
    243 static_cast<int>(GlyphNext(content(), cursor_position()));
    +
    244 return true;
    +
    245 }
    +
    246
    +
    247 size_t CursorColumn() {
    +
    248 size_t iter = cursor_position();
    +
    249 int width = 0;
    +
    250 while (true) {
    +
    251 if (iter == 0) {
    +
    252 break;
    +
    253 }
    +
    254 iter = GlyphPrevious(content(), iter);
    +
    255 if (content()[iter] == '\n') {
    +
    256 break;
    +
    257 }
    +
    258 width += static_cast<int>(GlyphWidth(content(), iter));
    +
    259 }
    +
    260 return width;
    +
    261 }
    +
    262
    +
    263 // Move the cursor `columns` on the right, if possible.
    +
    264 void MoveCursorColumn(int columns) {
    +
    265 while (columns > 0) {
    +
    266 if (cursor_position() == (int)content().size() ||
    +
    267 content()[cursor_position()] == '\n') {
    +
    268 return;
    +
    269 }
    +
    270
    +
    271 columns -= static_cast<int>(GlyphWidth(content(), cursor_position()));
    +
    272 cursor_position() =
    +
    273 static_cast<int>(GlyphNext(content(), cursor_position()));
    +
    274 }
    +
    275 }
    +
    276
    +
    277 bool HandleArrowUp() {
    +
    278 if (cursor_position() == 0) {
    +
    279 return false;
    +
    280 }
    +
    281
    +
    282 const size_t columns = CursorColumn();
    +
    283
    +
    284 // Move cursor at the beginning of 2 lines above.
    +
    285 while (true) {
    +
    286 if (cursor_position() == 0) {
    +
    287 return true;
    +
    288 }
    +
    289 const size_t previous = GlyphPrevious(content(), cursor_position());
    +
    290 if (content()[previous] == '\n') {
    +
    291 break;
    +
    292 }
    +
    293 cursor_position() = static_cast<int>(previous);
    +
    294 }
    +
    295 cursor_position() =
    +
    296 static_cast<int>(GlyphPrevious(content(), cursor_position()));
    +
    297 while (true) {
    +
    298 if (cursor_position() == 0) {
    +
    299 break;
    +
    300 }
    +
    301 const size_t previous = GlyphPrevious(content(), cursor_position());
    +
    302 if (content()[previous] == '\n') {
    +
    303 break;
    +
    304 }
    +
    305 cursor_position() = static_cast<int>(previous);
    +
    306 }
    +
    307
    +
    308 MoveCursorColumn(static_cast<int>(columns));
    +
    309 return true;
    +
    310 }
    +
    311
    +
    312 bool HandleArrowDown() {
    +
    313 if (cursor_position() == (int)content->size()) {
    +
    314 return false;
    +
    315 }
    +
    316
    +
    317 const size_t columns = CursorColumn();
    +
    318
    +
    319 // Move cursor at the beginning of the next line
    +
    320 while (true) {
    +
    321 if (content()[cursor_position()] == '\n') {
    +
    322 break;
    +
    323 }
    +
    324 cursor_position() =
    +
    325 static_cast<int>(GlyphNext(content(), cursor_position()));
    +
    326 if (cursor_position() == (int)content().size()) {
    +
    327 return true;
    +
    328 }
    +
    329 }
    +
    330 cursor_position() =
    +
    331 static_cast<int>(GlyphNext(content(), cursor_position()));
    +
    332
    +
    333 MoveCursorColumn(static_cast<int>(columns));
    +
    334 return true;
    +
    335 }
    +
    336
    +
    337 bool HandleHome() {
    +
    338 cursor_position() = 0;
    +
    339 return true;
    +
    340 }
    +
    341
    +
    342 bool HandleEnd() {
    +
    343 cursor_position() = static_cast<int>(content->size());
    +
    344 return true;
    +
    345 }
    +
    346
    +
    347 bool HandleReturn() {
    +
    348 if (multiline()) {
    +
    349 HandleCharacter("\n");
    +
    350 }
    +
    351 on_enter();
    +
    352 return true;
    +
    353 }
    +
    354
    +
    355 bool HandleCharacter(const std::string& character) {
    +
    356 if (!insert() && cursor_position() < (int)content->size() &&
    +
    357 content()[cursor_position()] != '\n') {
    +
    358 DeleteImpl();
    +
    359 }
    +
    360 content->insert(cursor_position(), character);
    +
    361 cursor_position() += static_cast<int>(character.size());
    +
    362 on_change();
    +
    363 return true;
    +
    364 }
    +
    365
    +
    366 bool OnEvent(Event event) override {
    +
    367 cursor_position() = util::clamp(cursor_position(), 0, (int)content->size());
    +
    368
    +
    369 if (event == Event::Return) {
    +
    370 return HandleReturn();
    +
    371 }
    +
    372 if (event.is_character()) {
    +
    373 return HandleCharacter(event.character());
    +
    374 }
    +
    375 if (event.is_mouse()) {
    +
    376 return HandleMouse(event);
    +
    377 }
    +
    378 if (event == Event::Backspace) {
    +
    379 return HandleBackspace();
    +
    380 }
    +
    381 if (event == Event::Delete) {
    +
    382 return HandleDelete();
    +
    383 }
    +
    384 if (event == Event::ArrowLeft) {
    +
    385 return HandleArrowLeft();
    +
    386 }
    +
    387 if (event == Event::ArrowRight) {
    +
    388 return HandleArrowRight();
    +
    389 }
    +
    390 if (event == Event::ArrowUp) {
    +
    391 return HandleArrowUp();
    +
    392 }
    +
    393 if (event == Event::ArrowDown) {
    +
    394 return HandleArrowDown();
    +
    395 }
    +
    396 if (event == Event::Home) {
    +
    397 return HandleHome();
    +
    398 }
    +
    399 if (event == Event::End) {
    +
    400 return HandleEnd();
    +
    401 }
    +
    402 if (event == Event::ArrowLeftCtrl) {
    +
    403 return HandleLeftCtrl();
    +
    404 }
    +
    405 if (event == Event::ArrowRightCtrl) {
    +
    406 return HandleRightCtrl();
    +
    407 }
    +
    408 if (event == Event::Insert) {
    +
    409 return HandleInsert();
    +
    410 }
    +
    411 return false;
    +
    412 }
    +
    413
    +
    414 bool HandleLeftCtrl() {
    +
    415 if (cursor_position() == 0) {
    +
    416 return false;
    +
    417 }
    +
    418
    +
    419 // Move left, as long as left it not a word.
    +
    420 while (cursor_position()) {
    +
    421 const size_t previous = GlyphPrevious(content(), cursor_position());
    +
    422 if (IsWordCharacter(content(), previous)) {
    +
    423 break;
    +
    424 }
    +
    425 cursor_position() = static_cast<int>(previous);
    +
    426 }
    +
    427 // Move left, as long as left is a word character:
    +
    428 while (cursor_position()) {
    +
    429 const size_t previous = GlyphPrevious(content(), cursor_position());
    +
    430 if (!IsWordCharacter(content(), previous)) {
    +
    431 break;
    +
    432 }
    +
    433 cursor_position() = static_cast<int>(previous);
    +
    434 }
    +
    435 return true;
    +
    436 }
    +
    437
    +
    438 bool HandleRightCtrl() {
    +
    439 if (cursor_position() == (int)content().size()) {
    +
    440 return false;
    +
    441 }
    +
    442
    +
    443 // Move right, until entering a word.
    +
    444 while (cursor_position() < (int)content().size()) {
    +
    445 cursor_position() =
    +
    446 static_cast<int>(GlyphNext(content(), cursor_position()));
    +
    447 if (IsWordCharacter(content(), cursor_position())) {
    +
    448 break;
    +
    449 }
    +
    450 }
    +
    451 // Move right, as long as right is a word character:
    +
    452 while (cursor_position() < (int)content().size()) {
    +
    453 const size_t next = GlyphNext(content(), cursor_position());
    +
    454 if (!IsWordCharacter(content(), cursor_position())) {
    +
    455 break;
    +
    456 }
    +
    457 cursor_position() = static_cast<int>(next);
    +
    458 }
    +
    459
    +
    460 return true;
    +
    461 }
    +
    462
    +
    463 bool HandleMouse(Event event) {
    +
    464 hovered_ = box_.Contain(event.mouse().x, //
    +
    465 event.mouse().y) &&
    +
    466 CaptureMouse(event);
    +
    467 if (!hovered_) {
    +
    468 return false;
    +
    469 }
    +
    470
    +
    471 if (event.mouse().button != Mouse::Left) {
    +
    472 return false;
    +
    473 }
    +
    474 if (event.mouse().motion != Mouse::Pressed) {
    +
    475 return false;
    +
    476 }
    +
    477
    +
    478 TakeFocus();
    +
    479
    +
    480 if (content->empty()) {
    +
    481 cursor_position() = 0;
    +
    482 return true;
    +
    483 }
    +
    484
    +
    485 // Find the line and index of the cursor.
    +
    486 std::vector<std::string> lines = Split(*content);
    +
    487 int cursor_line = 0;
    +
    488 int cursor_char_index = cursor_position();
    +
    489 for (const auto& line : lines) {
    +
    490 if (cursor_char_index <= (int)line.size()) {
    +
    491 break;
    +
    492 }
    +
    493
    +
    494 cursor_char_index -= static_cast<int>(line.size() + 1);
    +
    495 cursor_line++;
    +
    496 }
    +
    497 const int cursor_column =
    +
    498 string_width(lines[cursor_line].substr(0, cursor_char_index));
    +
    499
    +
    500 int new_cursor_column = cursor_column + event.mouse().x - cursor_box_.x_min;
    +
    501 int new_cursor_line = cursor_line + event.mouse().y - cursor_box_.y_min;
    +
    502
    +
    503 // Fix the new cursor position:
    +
    504 new_cursor_line = std::max(std::min(new_cursor_line, (int)lines.size()), 0);
    +
    505
    +
    506 const std::string empty_string;
    +
    507 const std::string& line = new_cursor_line < (int)lines.size()
    +
    508 ? lines[new_cursor_line]
    +
    509 : empty_string;
    +
    510 new_cursor_column = util::clamp(new_cursor_column, 0, string_width(line));
    +
    511
    +
    512 if (new_cursor_column == cursor_column && //
    +
    513 new_cursor_line == cursor_line) {
    +
    514 return false;
    +
    515 }
    +
    516
    +
    517 // Convert back the new_cursor_{line,column} toward cursor_position:
    +
    518 cursor_position() = 0;
    +
    519 for (int i = 0; i < new_cursor_line; ++i) {
    +
    520 cursor_position() += static_cast<int>(lines[i].size() + 1);
    +
    521 }
    +
    522 while (new_cursor_column > 0) {
    +
    523 new_cursor_column -=
    +
    524 static_cast<int>(GlyphWidth(content(), cursor_position()));
    +
    525 cursor_position() =
    +
    526 static_cast<int>(GlyphNext(content(), cursor_position()));
    +
    527 }
    +
    528
    +
    529 on_change();
    +
    530 return true;
    +
    531 }
    +
    532
    +
    533 bool HandleInsert() {
    +
    534 insert() = !insert();
    +
    535 return true;
    +
    536 }
    +
    537
    +
    538 bool Focusable() const final { return true; }
    +
    539
    +
    540 bool hovered_ = false;
    +
    541
    +
    542 Box box_;
    +
    543 Box cursor_box_;
    +
    544};
    +
    545
    +
    546} // namespace
    +
    547
    +
    548/// @brief An input box for editing text.
    +
    549/// @param option Additional optional parameters.
    +
    550/// @ingroup component
    +
    551/// @see InputBase
    +
    552///
    +
    553/// ### Example
    +
    554///
    +
    555/// ```cpp
    +
    556/// auto screen = ScreenInteractive::FitComponent();
    +
    557/// std::string content= "";
    +
    558/// std::string placeholder = "placeholder";
    +
    559/// Component input = Input({
    +
    560/// .content = &content,
    +
    561/// .placeholder = &placeholder,
    +
    562/// })
    +
    563/// screen.Loop(input);
    +
    564/// ```
    +
    565///
    +
    566/// ### Output
    +
    567///
    +
    568/// ```bash
    +
    569/// placeholder
    +
    570/// ```
    +
    + +
    572 return Make<InputBase>(std::move(option));
    +
    573}
    +
    +
    574
    +
    575/// @brief An input box for editing text.
    +
    576/// @param content The editable content.
    +
    577/// @param option Additional optional parameters.
    +
    578/// @ingroup component
    +
    579/// @see InputBase
    +
    580///
    +
    581/// ### Example
    +
    582///
    +
    583/// ```cpp
    +
    584/// auto screen = ScreenInteractive::FitComponent();
    +
    585/// std::string content= "";
    +
    586/// std::string placeholder = "placeholder";
    +
    587/// Component input = Input(content, {
    +
    588/// .placeholder = &placeholder,
    +
    589/// .password = true,
    +
    590/// })
    +
    591/// screen.Loop(input);
    +
    592/// ```
    +
    593///
    +
    594/// ### Output
    +
    595///
    +
    596/// ```bash
    +
    597/// placeholder
    +
    598/// ```
    +
    + +
    600 option.content = std::move(content);
    +
    601 return Make<InputBase>(std::move(option));
    +
    602}
    +
    +
    603
    +
    604/// @brief An input box for editing text.
    +
    605/// @param content The editable content.
    +
    606/// @param placeholder The placeholder text.
    +
    607/// @param option Additional optional parameters.
    +
    608/// @ingroup component
    +
    609/// @see InputBase
    +
    610///
    +
    611/// ### Example
    +
    612///
    +
    613/// ```cpp
    +
    614/// auto screen = ScreenInteractive::FitComponent();
    +
    615/// std::string content= "";
    +
    616/// std::string placeholder = "placeholder";
    +
    617/// Component input = Input(content, placeholder);
    +
    618/// screen.Loop(input);
    +
    619/// ```
    +
    620///
    +
    621/// ### Output
    +
    622///
    +
    623/// ```bash
    +
    624/// placeholder
    +
    625/// ```
    +
    +
    626Component Input(StringRef content, StringRef placeholder, InputOption option) {
    +
    627 option.content = std::move(content);
    +
    628 option.placeholder = std::move(placeholder);
    +
    629 return Make<InputBase>(std::move(option));
    +
    630}
    +
    +
    631
    +
    632} // namespace ftxui
    + +
    An adapter. Own or reference a constant string. For convenience, this class convert multiple mutable ...
    Definition ref.hpp:82
    + + + + + + +
    static const Event ArrowLeftCtrl
    Definition event.hpp:45
    + +
    static InputOption Default()
    Create the default input style:
    +
    static const Event Backspace
    Definition event.hpp:51
    +
    static const Event ArrowUp
    Definition event.hpp:42
    +
    std::function< Element(InputState)> transform
    +
    static const Event ArrowDown
    Definition event.hpp:43
    +
    static const Event End
    Definition event.hpp:61
    +
    StringRef placeholder
    The content of the input when it's empty.
    +
    static const Event Home
    Definition event.hpp:60
    +
    StringRef content
    The content of the input.
    +
    static const Event Return
    Definition event.hpp:53
    +
    static const Event ArrowLeft
    Definition event.hpp:40
    +
    static const Event Delete
    Definition event.hpp:52
    +
    static const Event Insert
    Definition event.hpp:59
    +
    static const Event ArrowRightCtrl
    Definition event.hpp:46
    +
    static const Event ArrowRight
    Definition event.hpp:41
    +
    Component Input(InputOption options={})
    An input box for editing text.
    +
    Option for the Input component.
    +
    Element xflex(Element)
    Expand/Minimize if possible/needed on the X axis.
    Definition flex.cpp:129
    +
    Decorator size(WidthOrHeight, Constraint, int value)
    Apply a constraint on the size of an element.
    +
    Element text(std::wstring text)
    Display a piece of unicode text.
    Definition text.cpp:160
    +
    Element vbox(Elements)
    A container displaying elements vertically one by one.
    Definition vbox.cpp:96
    + + +
    constexpr const T & clamp(const T &v, const T &lo, const T &hi)
    Definition util.hpp:11
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    size_t GlyphNext(const std::string &input, size_t start)
    Definition string.cpp:1425
    +
    WordBreakProperty CodepointToWordBreakProperty(uint32_t codepoint)
    Definition string.cpp:1308
    +
    std::shared_ptr< T > Make(Args &&... args)
    Definition component.hpp:27
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    int string_width(const std::string &)
    Definition string.cpp:1331
    +
    Element hbox(Elements)
    A container displaying elements horizontally one by one.
    Definition hbox.cpp:94
    + + + + + + + + + + + + + + + + + + +
    std::vector< Element > Elements
    Definition elements.hpp:23
    +
    bool EatCodePoint(const std::string &input, size_t start, size_t *end, uint32_t *ucs)
    Definition string.cpp:1174
    +
    Decorator reflect(Box &box)
    Definition reflect.cpp:43
    +
    bool IsFullWidth(uint32_t ucs)
    Definition string.cpp:1286
    +
    Element frame(Element)
    Allow an element to be displayed inside a 'virtual' area. It size can be larger than its container....
    Definition frame.cpp:118
    +
    size_t GlyphPrevious(const std::string &input, size_t start)
    Definition string.cpp:1400
    +
    std::shared_ptr< ComponentBase > Component
    + + + + + +
    +
    + + + + + diff --git a/src_2ftxui_2component_2maybe_8cpp.html b/src_2ftxui_2component_2maybe_8cpp.html new file mode 100644 index 000000000..803f8d303 --- /dev/null +++ b/src_2ftxui_2component_2maybe_8cpp.html @@ -0,0 +1,236 @@ + + + + + + + + +FTXUI: maybe.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    maybe.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + + + + + + + + + + +

    +Functions

    Component Maybe (Component child, std::function< bool()> show)
     Decorate a component |child|. It is shown only when |show| returns true.
     
    ComponentDecorator Maybe (std::function< bool()> show)
     Decorate a component. It is shown only when the |show| function returns true.
     
    Component Maybe (Component child, const bool *show)
     Decorate a component |child|. It is shown only when |show| is true.
     
    ComponentDecorator Maybe (const bool *show)
     Decorate a component. It is shown only when |show| is true.
     
    +
    +
    + + + + + diff --git a/src_2ftxui_2component_2maybe_8cpp.js b/src_2ftxui_2component_2maybe_8cpp.js new file mode 100644 index 000000000..2cac8c9cd --- /dev/null +++ b/src_2ftxui_2component_2maybe_8cpp.js @@ -0,0 +1,7 @@ +var src_2ftxui_2component_2maybe_8cpp = +[ + [ "Maybe", "src_2ftxui_2component_2maybe_8cpp.html#ga70afe9695167fb736631173201969730", null ], + [ "Maybe", "src_2ftxui_2component_2maybe_8cpp.html#gae39ad8b223e6bb7704c77a3708571a7d", null ], + [ "Maybe", "src_2ftxui_2component_2maybe_8cpp.html#ga20b66a70c1cd4ff3f0ff571a4507d2b4", null ], + [ "Maybe", "src_2ftxui_2component_2maybe_8cpp.html#ga83b6fd5e1524023722a7450f987f15d0", null ] +]; \ No newline at end of file diff --git a/src_2ftxui_2component_2maybe_8cpp_source.html b/src_2ftxui_2component_2maybe_8cpp_source.html new file mode 100644 index 000000000..26b9c8acd --- /dev/null +++ b/src_2ftxui_2component_2maybe_8cpp_source.html @@ -0,0 +1,322 @@ + + + + + + + + +FTXUI: maybe.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    src/ftxui/component/maybe.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2021 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <functional> // for function
    +
    5#include <memory> // for make_unique, __shared_ptr_access, __shared_ptr_access<>::element_type, shared_ptr
    +
    6#include <utility> // for move
    +
    7
    +
    8#include "ftxui/component/component.hpp" // for ComponentDecorator, Maybe, Make
    +
    9#include "ftxui/component/component_base.hpp" // for Component, ComponentBase
    +
    10#include "ftxui/component/event.hpp" // for Event
    +
    11#include "ftxui/dom/elements.hpp" // for Element
    +
    12#include "ftxui/dom/node.hpp" // for Node
    +
    13
    +
    14namespace ftxui {
    +
    15
    +
    16/// @brief Decorate a component |child|. It is shown only when |show| returns
    +
    17/// true.
    +
    18/// @param child the component to decorate.
    +
    19/// @param show a function returning whether |child| should shown.
    +
    20/// @ingroup component
    +
    +
    21Component Maybe(Component child, std::function<bool()> show) {
    +
    22 class Impl : public ComponentBase {
    +
    23 public:
    +
    24 explicit Impl(std::function<bool()> show) : show_(std::move(show)) {}
    +
    25
    +
    26 private:
    +
    27 Element OnRender() override {
    +
    28 return show_() ? ComponentBase::OnRender() : std::make_unique<Node>();
    +
    29 }
    +
    30 bool Focusable() const override {
    +
    31 return show_() && ComponentBase::Focusable();
    +
    32 }
    +
    33 bool OnEvent(Event event) override {
    +
    34 return show_() && ComponentBase::OnEvent(event);
    +
    35 }
    +
    36
    +
    37 std::function<bool()> show_;
    +
    38 };
    +
    39
    +
    40 auto maybe = Make<Impl>(std::move(show));
    +
    41 maybe->Add(std::move(child));
    +
    42 return maybe;
    +
    43}
    +
    +
    44
    +
    45/// @brief Decorate a component. It is shown only when the |show| function
    +
    46/// returns true.
    +
    47/// @param show a function returning whether the decorated component should
    +
    48/// be shown.
    +
    49/// @ingroup component
    +
    50///
    +
    51/// ### Example
    +
    52///
    +
    53/// ```cpp
    +
    54/// auto component = Renderer([]{ return text("Hello World!"); });
    +
    55/// auto maybe_component = component | Maybe([&]{ return counter == 42; });
    +
    56/// ```
    +
    +
    57ComponentDecorator Maybe(std::function<bool()> show) {
    +
    58 return [show = std::move(show)](Component child) mutable {
    +
    59 return Maybe(std::move(child), std::move(show));
    +
    60 };
    +
    61}
    +
    +
    62
    +
    63/// @brief Decorate a component |child|. It is shown only when |show| is true.
    +
    64/// @param child the component to decorate.
    +
    65/// @param show a boolean. |child| is shown when |show| is true.
    +
    66/// @ingroup component
    +
    67///
    +
    68/// ### Example
    +
    69///
    +
    70/// ```cpp
    +
    71/// auto component = Renderer([]{ return text("Hello World!"); });
    +
    72/// auto maybe_component = Maybe(component, &show);
    +
    73/// ```
    +
    +
    74Component Maybe(Component child, const bool* show) {
    +
    75 return Maybe(std::move(child), [show] { return *show; });
    +
    76}
    +
    +
    77
    +
    78/// @brief Decorate a component. It is shown only when |show| is true.
    +
    79/// @param show a boolean. |child| is shown when |show| is true.
    +
    80/// @ingroup component
    +
    81///
    +
    82/// ### Example
    +
    83///
    +
    84/// ```cpp
    +
    85/// auto component = Renderer([]{ return text("Hello World!"); });
    +
    86/// auto maybe_component = component | Maybe(&show);
    +
    87/// ```
    +
    +
    88ComponentDecorator Maybe(const bool* show) {
    +
    89 return [show](Component child) { return Maybe(std::move(child), show); };
    +
    90}
    +
    +
    91
    +
    92} // namespace ftxui
    + + + + +
    It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ft...
    +
    Component Maybe(Component, const bool *show)
    Decorate a component |child|. It is shown only when |show| is true.
    +
    Represent an event. It can be key press event, a terminal resize, or more ...
    Definition event.hpp:29
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::shared_ptr< T > Make(Args &&... args)
    Definition component.hpp:27
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    std::function< Component(Component)> ComponentDecorator
    Definition component.hpp:32
    +
    std::shared_ptr< ComponentBase > Component
    + +
    +
    + + + + + diff --git a/src_2ftxui_2component_2menu_8cpp.html b/src_2ftxui_2component_2menu_8cpp.html new file mode 100644 index 000000000..f73bea987 --- /dev/null +++ b/src_2ftxui_2component_2menu_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: menu.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    menu.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + + + + + + + + + + + + + +

    +Functions

    Component Menu (MenuOption option)
     A list of text. The focused element is selected.
     
    Component Menu (ConstStringListRef entries, int *selected, MenuOption option)
     A list of text. The focused element is selected.
     
    Component Toggle (ConstStringListRef entries, int *selected)
     An horizontal list of elements. The user can navigate through them.
     
    Component MenuEntry (ConstStringRef label, MenuEntryOption option)
     A specific menu entry. They can be put into a Container::Vertical to form a menu.
     
    Component MenuEntry (MenuEntryOption option)
     A specific menu entry. They can be put into a Container::Vertical to form a menu.
     
    +
    +
    + + + + + diff --git a/src_2ftxui_2component_2menu_8cpp.js b/src_2ftxui_2component_2menu_8cpp.js new file mode 100644 index 000000000..677be9035 --- /dev/null +++ b/src_2ftxui_2component_2menu_8cpp.js @@ -0,0 +1,8 @@ +var src_2ftxui_2component_2menu_8cpp = +[ + [ "Menu", "src_2ftxui_2component_2menu_8cpp.html#ga27828fc39da10a18478ba84b1b162039", null ], + [ "Menu", "src_2ftxui_2component_2menu_8cpp.html#gad793a3a507766ffa711c4332a3815e24", null ], + [ "Toggle", "src_2ftxui_2component_2menu_8cpp.html#ga3537fccac66b07cd792874c9a6086811", null ], + [ "MenuEntry", "src_2ftxui_2component_2menu_8cpp.html#gafca94c5cdae5fbf3c6aa81fc1cd7b1c0", null ], + [ "MenuEntry", "src_2ftxui_2component_2menu_8cpp.html#ga2c0a27959e6a5d90109f6d4506e00f69", null ] +]; \ No newline at end of file diff --git a/src_2ftxui_2component_2menu_8cpp_source.html b/src_2ftxui_2component_2menu_8cpp_source.html new file mode 100644 index 000000000..f0c6f6eaa --- /dev/null +++ b/src_2ftxui_2component_2menu_8cpp_source.html @@ -0,0 +1,1046 @@ + + + + + + + + +FTXUI: menu.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    src/ftxui/component/menu.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <algorithm> // for max, fill_n, reverse
    +
    5#include <chrono> // for milliseconds
    +
    6#include <ftxui/dom/direction.hpp> // for Direction, Direction::Down, Direction::Left, Direction::Right, Direction::Up
    +
    7#include <functional> // for function
    +
    8#include <string> // for operator+, string
    +
    9#include <utility> // for move
    +
    10#include <vector> // for vector, __alloc_traits<>::value_type
    +
    11
    +
    12#include "ftxui/component/animation.hpp" // for Animator, Linear
    +
    13#include "ftxui/component/component.hpp" // for Make, Menu, MenuEntry, Toggle
    +
    14#include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    15#include "ftxui/component/component_options.hpp" // for MenuOption, MenuEntryOption, UnderlineOption, AnimatedColorOption, AnimatedColorsOption, EntryState
    +
    16#include "ftxui/component/event.hpp" // for Event, Event::ArrowDown, Event::ArrowLeft, Event::ArrowRight, Event::ArrowUp, Event::End, Event::Home, Event::PageDown, Event::PageUp, Event::Return, Event::Tab, Event::TabReverse
    +
    17#include "ftxui/component/mouse.hpp" // for Mouse, Mouse::Left, Mouse::Released, Mouse::WheelDown, Mouse::WheelUp, Mouse::None
    +
    18#include "ftxui/component/screen_interactive.hpp" // for Component
    +
    19#include "ftxui/dom/elements.hpp" // for operator|, Element, reflect, Decorator, nothing, Elements, bgcolor, color, hbox, separatorHSelector, separatorVSelector, vbox, xflex, yflex, text, bold, focus, inverted, select
    +
    20#include "ftxui/screen/box.hpp" // for Box
    +
    21#include "ftxui/screen/color.hpp" // for Color
    +
    22#include "ftxui/screen/util.hpp" // for clamp
    +
    23#include "ftxui/util/ref.hpp" // for Ref, ConstStringListRef, ConstStringRef
    +
    24
    +
    25namespace ftxui {
    +
    26
    +
    27namespace {
    +
    28
    +
    29Element DefaultOptionTransform(const EntryState& state) {
    +
    30 std::string label = (state.active ? "> " : " ") + state.label; // NOLINT
    +
    31 Element e = text(std::move(label));
    +
    32 if (state.focused) {
    +
    33 e = e | inverted;
    +
    34 }
    +
    35 if (state.active) {
    +
    36 e = e | bold;
    +
    37 }
    +
    38 return e;
    +
    39}
    +
    40
    +
    41bool IsInverted(Direction direction) {
    +
    42 switch (direction) {
    +
    43 case Direction::Up:
    +
    44 case Direction::Left:
    +
    45 return true;
    +
    46 case Direction::Down:
    + +
    48 return false;
    +
    49 }
    +
    50 return false; // NOT_REACHED()
    +
    51}
    +
    52
    +
    53bool IsHorizontal(Direction direction) {
    +
    54 switch (direction) {
    +
    55 case Direction::Left:
    + +
    57 return true;
    +
    58 case Direction::Down:
    +
    59 case Direction::Up:
    +
    60 return false;
    +
    61 }
    +
    62 return false; // NOT_REACHED()
    +
    63}
    +
    64
    +
    65} // namespace
    +
    66
    +
    67/// @brief A list of items. The user can navigate through them.
    +
    68/// @ingroup component
    +
    69class MenuBase : public ComponentBase, public MenuOption {
    +
    70 public:
    +
    71 explicit MenuBase(const MenuOption& option) : MenuOption(option) {}
    +
    72
    +
    73 bool IsHorizontal() { return ftxui::IsHorizontal(direction); }
    +
    74 void OnChange() {
    +
    75 if (on_change) {
    +
    76 on_change();
    +
    77 }
    +
    78 }
    +
    79
    +
    80 void OnEnter() {
    +
    81 if (on_enter) {
    +
    82 on_enter();
    +
    83 }
    +
    84 }
    +
    85
    +
    86 void Clamp() {
    +
    87 if (selected() != selected_previous_) {
    +
    88 SelectedTakeFocus();
    +
    89 }
    +
    90 boxes_.resize(size());
    +
    91 selected() = util::clamp(selected(), 0, size() - 1);
    +
    92 selected_previous_ = util::clamp(selected_previous_, 0, size() - 1);
    +
    93 selected_focus_ = util::clamp(selected_focus_, 0, size() - 1);
    +
    94 focused_entry() = util::clamp(focused_entry(), 0, size() - 1);
    +
    95 }
    +
    96
    +
    97 void OnAnimation(animation::Params& params) override {
    +
    98 animator_first_.OnAnimation(params);
    +
    99 animator_second_.OnAnimation(params);
    +
    100 for (auto& animator : animator_background_) {
    +
    101 animator.OnAnimation(params);
    +
    102 }
    +
    103 for (auto& animator : animator_foreground_) {
    +
    104 animator.OnAnimation(params);
    +
    105 }
    +
    106 }
    +
    107
    +
    108 Element OnRender() override {
    +
    109 Clamp();
    +
    110 UpdateAnimationTarget();
    +
    111
    +
    112 Elements elements;
    +
    113 const bool is_menu_focused = Focused();
    +
    114 if (elements_prefix) {
    +
    115 elements.push_back(elements_prefix());
    +
    116 }
    +
    117 elements.reserve(size());
    +
    118 for (int i = 0; i < size(); ++i) {
    +
    119 if (i != 0 && elements_infix) {
    +
    120 elements.push_back(elements_infix());
    +
    121 }
    +
    122 const bool is_focused = (focused_entry() == i) && is_menu_focused;
    +
    123 const bool is_selected = (selected() == i);
    +
    124
    +
    125 const EntryState state = {
    +
    126 entries[i], false, is_selected, is_focused, i,
    +
    127 };
    +
    128
    + +
    130 : DefaultOptionTransform) //
    +
    131 (state);
    +
    132 if (selected_focus_ == i) {
    +
    133 element |= focus;
    +
    134 }
    +
    135 element |= AnimatedColorStyle(i);
    +
    136 element |= reflect(boxes_[i]);
    +
    137 elements.push_back(element);
    +
    138 }
    +
    139 if (elements_postfix) {
    +
    140 elements.push_back(elements_postfix());
    +
    141 }
    +
    142
    +
    143 if (IsInverted(direction)) {
    +
    144 std::reverse(elements.begin(), elements.end());
    +
    145 }
    +
    146
    +
    147 const Element bar = IsHorizontal()
    +
    148 ? hbox(std::move(elements), selected_focus_)
    +
    149 : vbox(std::move(elements), selected_focus_);
    +
    150
    +
    151 if (!underline.enabled) {
    +
    152 return bar | reflect(box_);
    +
    153 }
    +
    154
    +
    155 if (IsHorizontal()) {
    +
    156 return vbox({
    +
    157 bar | xflex,
    +
    158 separatorHSelector(first_, second_, //
    + + +
    161 }) |
    +
    162 reflect(box_);
    +
    163 } else {
    +
    164 return hbox({
    +
    165 separatorVSelector(first_, second_, //
    + + +
    168 bar | yflex,
    +
    169 }) |
    +
    170 reflect(box_);
    +
    171 }
    +
    172 }
    +
    173
    +
    174 void SelectedTakeFocus() {
    +
    175 selected_previous_ = selected();
    +
    176 selected_focus_ = selected();
    +
    177 }
    +
    178
    +
    179 void OnUp() {
    +
    180 switch (direction) {
    +
    181 case Direction::Up:
    +
    182 selected()++;
    +
    183 break;
    +
    184 case Direction::Down:
    +
    185 selected()--;
    +
    186 break;
    +
    187 case Direction::Left:
    +
    188 case Direction::Right:
    +
    189 break;
    +
    190 }
    +
    191 }
    +
    192
    +
    193 void OnDown() {
    +
    194 switch (direction) {
    +
    195 case Direction::Up:
    +
    196 selected()--;
    +
    197 break;
    +
    198 case Direction::Down:
    +
    199 selected()++;
    +
    200 break;
    +
    201 case Direction::Left:
    +
    202 case Direction::Right:
    +
    203 break;
    +
    204 }
    +
    205 }
    +
    206
    +
    207 void OnLeft() {
    +
    208 switch (direction) {
    +
    209 case Direction::Left:
    +
    210 selected()++;
    +
    211 break;
    +
    212 case Direction::Right:
    +
    213 selected()--;
    +
    214 break;
    +
    215 case Direction::Down:
    +
    216 case Direction::Up:
    +
    217 break;
    +
    218 }
    +
    219 }
    +
    220
    +
    221 void OnRight() {
    +
    222 switch (direction) {
    +
    223 case Direction::Left:
    +
    224 selected()--;
    +
    225 break;
    +
    226 case Direction::Right:
    +
    227 selected()++;
    +
    228 break;
    +
    229 case Direction::Down:
    +
    230 case Direction::Up:
    +
    231 break;
    +
    232 }
    +
    233 }
    +
    234
    +
    235 // NOLINTNEXTLINE(readability-function-cognitive-complexity)
    +
    236 bool OnEvent(Event event) override {
    +
    237 Clamp();
    +
    238 if (!CaptureMouse(event)) {
    +
    239 return false;
    +
    240 }
    +
    241
    +
    242 if (event.is_mouse()) {
    +
    243 return OnMouseEvent(event);
    +
    244 }
    +
    245
    +
    246 if (Focused()) {
    +
    247 const int old_selected = selected();
    +
    248 if (event == Event::ArrowUp || event == Event::Character('k')) {
    +
    249 OnUp();
    +
    250 }
    +
    251 if (event == Event::ArrowDown || event == Event::Character('j')) {
    +
    252 OnDown();
    +
    253 }
    +
    254 if (event == Event::ArrowLeft || event == Event::Character('h')) {
    +
    255 OnLeft();
    +
    256 }
    +
    257 if (event == Event::ArrowRight || event == Event::Character('l')) {
    +
    258 OnRight();
    +
    259 }
    +
    260 if (event == Event::PageUp) {
    +
    261 selected() -= box_.y_max - box_.y_min;
    +
    262 }
    +
    263 if (event == Event::PageDown) {
    +
    264 selected() += box_.y_max - box_.y_min;
    +
    265 }
    +
    266 if (event == Event::Home) {
    +
    267 selected() = 0;
    +
    268 }
    +
    269 if (event == Event::End) {
    +
    270 selected() = size() - 1;
    +
    271 }
    +
    272 if (event == Event::Tab && size()) {
    +
    273 selected() = (selected() + 1) % size();
    +
    274 }
    +
    275 if (event == Event::TabReverse && size()) {
    +
    276 selected() = (selected() + size() - 1) % size();
    +
    277 }
    +
    278
    +
    279 selected() = util::clamp(selected(), 0, size() - 1);
    +
    280
    +
    281 if (selected() != old_selected) {
    + +
    283 SelectedTakeFocus();
    +
    284 OnChange();
    +
    285 return true;
    +
    286 }
    +
    287 }
    +
    288
    +
    289 if (event == Event::Return) {
    +
    290 OnEnter();
    +
    291 return true;
    +
    292 }
    +
    293
    +
    294 return false;
    +
    295 }
    +
    296
    +
    297 bool OnMouseEvent(Event event) {
    +
    298 if (event.mouse().button == Mouse::WheelDown ||
    +
    299 event.mouse().button == Mouse::WheelUp) {
    +
    300 return OnMouseWheel(event);
    +
    301 }
    +
    302
    +
    303 if (event.mouse().button != Mouse::None &&
    +
    304 event.mouse().button != Mouse::Left) {
    +
    305 return false;
    +
    306 }
    +
    307 if (!CaptureMouse(event)) {
    +
    308 return false;
    +
    309 }
    +
    310 for (int i = 0; i < size(); ++i) {
    +
    311 if (!boxes_[i].Contain(event.mouse().x, event.mouse().y)) {
    +
    312 continue;
    +
    313 }
    +
    314
    +
    315 TakeFocus();
    +
    316 focused_entry() = i;
    +
    317
    +
    318 if (event.mouse().button == Mouse::Left &&
    +
    319 event.mouse().motion == Mouse::Pressed) {
    +
    320 if (selected() != i) {
    +
    321 selected() = i;
    +
    322 selected_previous_ = selected();
    +
    323 OnChange();
    +
    324 }
    +
    325 return true;
    +
    326 }
    +
    327 }
    +
    328 return false;
    +
    329 }
    +
    330
    +
    331 bool OnMouseWheel(Event event) {
    +
    332 if (!box_.Contain(event.mouse().x, event.mouse().y)) {
    +
    333 return false;
    +
    334 }
    +
    335 const int old_selected = selected();
    +
    336
    +
    337 if (event.mouse().button == Mouse::WheelUp) {
    +
    338 selected()--;
    +
    339 }
    +
    340 if (event.mouse().button == Mouse::WheelDown) {
    +
    341 selected()++;
    +
    342 }
    +
    343
    +
    344 selected() = util::clamp(selected(), 0, size() - 1);
    +
    345
    +
    346 if (selected() != old_selected) {
    +
    347 SelectedTakeFocus();
    +
    348 OnChange();
    +
    349 }
    +
    350 return true;
    +
    351 }
    +
    352
    +
    353 void UpdateAnimationTarget() {
    +
    354 UpdateColorTarget();
    +
    355 UpdateUnderlineTarget();
    +
    356 }
    +
    357
    +
    358 void UpdateColorTarget() {
    +
    359 if (size() != int(animation_background_.size())) {
    +
    360 animation_background_.resize(size());
    +
    361 animation_foreground_.resize(size());
    +
    362 animator_background_.clear();
    +
    363 animator_foreground_.clear();
    +
    364
    +
    365 const int len = size();
    +
    366 animator_background_.reserve(len);
    +
    367 animator_foreground_.reserve(len);
    +
    368 for (int i = 0; i < len; ++i) {
    +
    369 animation_background_[i] = 0.F;
    +
    370 animation_foreground_[i] = 0.F;
    +
    371 animator_background_.emplace_back(&animation_background_[i], 0.F,
    +
    372 std::chrono::milliseconds(0),
    + +
    374 animator_foreground_.emplace_back(&animation_foreground_[i], 0.F,
    +
    375 std::chrono::milliseconds(0),
    + +
    377 }
    +
    378 }
    +
    379
    +
    380 const bool is_menu_focused = Focused();
    +
    381 for (int i = 0; i < size(); ++i) {
    +
    382 const bool is_focused = (focused_entry() == i) && is_menu_focused;
    +
    383 const bool is_selected = (selected() == i);
    +
    384 float target = is_selected ? 1.F : is_focused ? 0.5F : 0.F; // NOLINT
    +
    385 if (animator_background_[i].to() != target) {
    +
    386 animator_background_[i] = animation::Animator(
    +
    387 &animation_background_[i], target,
    + + +
    390 animator_foreground_[i] = animation::Animator(
    +
    391 &animation_foreground_[i], target,
    + + +
    394 }
    +
    395 }
    +
    396 }
    +
    397
    +
    398 Decorator AnimatedColorStyle(int i) {
    +
    399 Decorator style = nothing;
    + +
    401 style = style | color(Color::Interpolate(
    +
    402 animation_foreground_[i],
    + + +
    405 }
    +
    406
    + +
    408 style = style | bgcolor(Color::Interpolate(
    +
    409 animation_background_[i],
    + + +
    412 }
    +
    413 return style;
    +
    414 }
    +
    415
    +
    416 void UpdateUnderlineTarget() {
    +
    417 if (!underline.enabled) {
    +
    418 return;
    +
    419 }
    +
    420
    +
    421 if (FirstTarget() == animator_first_.to() &&
    +
    422 SecondTarget() == animator_second_.to()) {
    +
    423 return;
    +
    424 }
    +
    425
    +
    426 if (FirstTarget() >= animator_first_.to()) {
    +
    427 animator_first_ = animation::Animator(
    +
    428 &first_, FirstTarget(), underline.follower_duration,
    + +
    430
    +
    431 animator_second_ = animation::Animator(
    +
    432 &second_, SecondTarget(), underline.leader_duration,
    + +
    434 } else {
    +
    435 animator_first_ = animation::Animator(
    +
    436 &first_, FirstTarget(), underline.leader_duration,
    + +
    438
    +
    439 animator_second_ = animation::Animator(
    +
    440 &second_, SecondTarget(), underline.follower_duration,
    + +
    442 }
    +
    443 }
    +
    444
    +
    445 bool Focusable() const final { return entries.size(); }
    +
    446 int size() const { return int(entries.size()); }
    +
    447 float FirstTarget() {
    +
    448 if (boxes_.empty()) {
    +
    449 return 0.F;
    +
    450 }
    +
    451 const int value = IsHorizontal() ? boxes_[selected()].x_min - box_.x_min
    +
    452 : boxes_[selected()].y_min - box_.y_min;
    +
    453 return float(value);
    +
    454 }
    +
    455 float SecondTarget() {
    +
    456 if (boxes_.empty()) {
    +
    457 return 0.F;
    +
    458 }
    +
    459 const int value = IsHorizontal() ? boxes_[selected()].x_max - box_.x_min
    +
    460 : boxes_[selected()].y_max - box_.y_min;
    +
    461 return float(value);
    +
    462 }
    +
    463
    +
    464 protected:
    +
    465 int selected_previous_ = selected();
    +
    466 int selected_focus_ = selected();
    +
    467
    +
    468 // Mouse click support:
    +
    469 std::vector<Box> boxes_;
    +
    470 Box box_;
    +
    471
    +
    472 // Animation support:
    +
    473 float first_ = 0.F;
    +
    474 float second_ = 0.F;
    +
    475 animation::Animator animator_first_ = animation::Animator(&first_, 0.F);
    +
    476 animation::Animator animator_second_ = animation::Animator(&second_, 0.F);
    +
    477 std::vector<animation::Animator> animator_background_;
    +
    478 std::vector<animation::Animator> animator_foreground_;
    +
    479 std::vector<float> animation_background_;
    +
    480 std::vector<float> animation_foreground_;
    +
    481};
    +
    482
    +
    483/// @brief A list of text. The focused element is selected.
    +
    484/// @param option a structure containing all the paramters.
    +
    485/// @ingroup component
    +
    486///
    +
    487/// ### Example
    +
    488///
    +
    489/// ```cpp
    +
    490/// auto screen = ScreenInteractive::TerminalOutput();
    +
    491/// std::vector<std::string> entries = {
    +
    492/// "entry 1",
    +
    493/// "entry 2",
    +
    494/// "entry 3",
    +
    495/// };
    +
    496/// int selected = 0;
    +
    497/// auto menu = Menu({
    +
    498/// .entries = &entries,
    +
    499/// .selected = &selected,
    +
    500/// });
    +
    501/// screen.Loop(menu);
    +
    502/// ```
    +
    503///
    +
    504/// ### Output
    +
    505///
    +
    506/// ```bash
    +
    507/// > entry 1
    +
    508/// entry 2
    +
    509/// entry 3
    +
    510/// ```
    +
    511// NOLINTNEXTLINE
    +
    + +
    513 return Make<MenuBase>(std::move(option));
    +
    514}
    +
    +
    515
    +
    516/// @brief A list of text. The focused element is selected.
    +
    517/// @param entries The list of entries in the menu.
    +
    518/// @param selected The index of the currently selected element.
    +
    519/// @param option Additional optional parameters.
    +
    520/// @ingroup component
    +
    521///
    +
    522/// ### Example
    +
    523///
    +
    524/// ```cpp
    +
    525/// auto screen = ScreenInteractive::TerminalOutput();
    +
    526/// std::vector<std::string> entries = {
    +
    527/// "entry 1",
    +
    528/// "entry 2",
    +
    529/// "entry 3",
    +
    530/// };
    +
    531/// int selected = 0;
    +
    532/// auto menu = Menu(&entries, &selected);
    +
    533/// screen.Loop(menu);
    +
    534/// ```
    +
    535///
    +
    536/// ### Output
    +
    537///
    +
    538/// ```bash
    +
    539/// > entry 1
    +
    540/// entry 2
    +
    541/// entry 3
    +
    542/// ```
    +
    +
    543Component Menu(ConstStringListRef entries, int* selected, MenuOption option) {
    +
    544 option.entries = std::move(entries);
    +
    545 option.selected = selected;
    +
    546 return Menu(option);
    +
    547}
    +
    +
    548
    +
    549/// @brief An horizontal list of elements. The user can navigate through them.
    +
    550/// @param entries The list of selectable entries to display.
    +
    551/// @param selected Reference the selected entry.
    +
    552/// See also |Menu|.
    +
    553/// @ingroup component
    +
    +
    554Component Toggle(ConstStringListRef entries, int* selected) {
    +
    555 return Menu(std::move(entries), selected, MenuOption::Toggle());
    +
    556}
    +
    +
    557
    +
    558/// @brief A specific menu entry. They can be put into a Container::Vertical to
    +
    559/// form a menu.
    +
    560/// @param label The text drawn representing this element.
    +
    561/// @param option Additional optional parameters.
    +
    562/// @ingroup component
    +
    563///
    +
    564/// ### Example
    +
    565///
    +
    566/// ```cpp
    +
    567/// auto screen = ScreenInteractive::TerminalOutput();
    +
    568/// int selected = 0;
    +
    569/// auto menu = Container::Vertical({
    +
    570/// MenuEntry("entry 1"),
    +
    571/// MenuEntry("entry 2"),
    +
    572/// MenuEntry("entry 3"),
    +
    573/// }, &selected);
    +
    574/// screen.Loop(menu);
    +
    575/// ```
    +
    576///
    +
    577/// ### Output
    +
    578///
    +
    579/// ```bash
    +
    580/// > entry 1
    +
    581/// entry 2
    +
    582/// entry 3
    +
    583/// ```
    +
    + +
    585 option.label = std::move(label);
    +
    586 return MenuEntry(std::move(option));
    +
    587}
    +
    +
    588
    +
    589/// @brief A specific menu entry. They can be put into a Container::Vertical to
    +
    590/// form a menu.
    +
    591/// @param option The parameters.
    +
    592/// @ingroup component
    +
    593///
    +
    594/// ### Example
    +
    595///
    +
    596/// ```cpp
    +
    597/// auto screen = ScreenInteractive::TerminalOutput();
    +
    598/// int selected = 0;
    +
    599/// auto menu = Container::Vertical({
    +
    600/// MenuEntry({.label = "entry 1"}),
    +
    601/// MenuEntry({.label = "entry 2"}),
    +
    602/// MenuEntry({.label = "entry 3"}),
    +
    603/// }, &selected);
    +
    604/// screen.Loop(menu);
    +
    605/// ```
    +
    606///
    +
    607/// ### Output
    +
    608///
    +
    609/// ```bash
    +
    610/// > entry 1
    +
    611/// entry 2
    +
    612/// entry 3
    +
    613/// ```
    +
    + +
    615 class Impl : public ComponentBase, public MenuEntryOption {
    +
    616 public:
    +
    617 explicit Impl(MenuEntryOption option)
    +
    618 : MenuEntryOption(std::move(option)) {}
    +
    619
    +
    620 private:
    +
    621 Element OnRender() override {
    +
    622 const bool is_focused = Focused();
    +
    623 UpdateAnimationTarget();
    +
    624
    +
    625 const EntryState state{
    +
    626 label(), false, hovered_, is_focused, Index(),
    +
    627 };
    +
    628
    +
    629 Element element = (transform ? transform : DefaultOptionTransform) //
    +
    630 (state);
    +
    631
    +
    632 if (is_focused) {
    +
    633 element |= focus;
    +
    634 }
    +
    635
    +
    636 return element | AnimatedColorStyle() | reflect(box_);
    +
    637 }
    +
    638
    +
    639 void UpdateAnimationTarget() {
    +
    640 const bool focused = Focused();
    +
    641 float target = focused ? 1.F : hovered_ ? 0.5F : 0.F; // NOLINT
    +
    642 if (target == animator_background_.to()) {
    +
    643 return;
    +
    644 }
    +
    645 animator_background_ = animation::Animator(
    +
    646 &animation_background_, target, animated_colors.background.duration,
    +
    647 animated_colors.background.function);
    +
    648 animator_foreground_ = animation::Animator(
    +
    649 &animation_foreground_, target, animated_colors.foreground.duration,
    +
    650 animated_colors.foreground.function);
    +
    651 }
    +
    652
    +
    653 Decorator AnimatedColorStyle() {
    +
    654 Decorator style = nothing;
    +
    655 if (animated_colors.foreground.enabled) {
    +
    656 style = style |
    +
    657 color(Color::Interpolate(animation_foreground_,
    +
    658 animated_colors.foreground.inactive,
    +
    659 animated_colors.foreground.active));
    +
    660 }
    +
    661
    +
    662 if (animated_colors.background.enabled) {
    +
    663 style = style |
    +
    664 bgcolor(Color::Interpolate(animation_background_,
    +
    665 animated_colors.background.inactive,
    +
    666 animated_colors.background.active));
    +
    667 }
    +
    668 return style;
    +
    669 }
    +
    670
    +
    671 bool Focusable() const override { return true; }
    +
    672 bool OnEvent(Event event) override {
    +
    673 if (!event.is_mouse()) {
    +
    674 return false;
    +
    675 }
    +
    676
    +
    677 hovered_ = box_.Contain(event.mouse().x, event.mouse().y);
    +
    678
    +
    679 if (!hovered_) {
    +
    680 return false;
    +
    681 }
    +
    682
    +
    683 if (event.mouse().button == Mouse::Left &&
    +
    684 event.mouse().motion == Mouse::Pressed) {
    +
    685 TakeFocus();
    +
    686 return true;
    +
    687 }
    +
    688
    +
    689 return false;
    +
    690 }
    +
    691
    +
    692 void OnAnimation(animation::Params& params) override {
    +
    693 animator_background_.OnAnimation(params);
    +
    694 animator_foreground_.OnAnimation(params);
    +
    695 }
    +
    696
    +
    697 Box box_;
    +
    698 bool hovered_ = false;
    +
    699
    +
    700 float animation_background_ = 0.F;
    +
    701 float animation_foreground_ = 0.F;
    +
    702 animation::Animator animator_background_ =
    +
    703 animation::Animator(&animation_background_, 0.F);
    +
    704 animation::Animator animator_foreground_ =
    +
    705 animation::Animator(&animation_foreground_, 0.F);
    +
    706 };
    +
    707
    +
    708 return Make<Impl>(std::move(option));
    +
    709}
    +
    +
    710
    +
    711} // namespace ftxui
    + + +
    An adapter. Reference a list of strings.
    Definition ref.hpp:116
    +
    size_t size() const
    Definition ref.hpp:167
    +
    An adapter. Own or reference a constant string. For convenience, this class convert multiple immutabl...
    Definition ref.hpp:94
    + + + + + + + + + + + +
    static const Event TabReverse
    Definition event.hpp:56
    + + + + + + +
    bool Focused() const
    Returns if the elements if focused by the user. True when the ComponentBase is focused by the user....
    +
    std::function< Element()> elements_prefix
    +
    static MenuOption Toggle()
    Standard options for a horizontal menu with some separator. This can be useful to implement a tab bar...
    +
    animation::Duration follower_duration
    +
    CapturedMouse CaptureMouse(const Event &event)
    Take the CapturedMouse if available. There is only one component of them. It represents a component t...
    +
    animation::easing::Function leader_function
    +
    MenuEntryOption entries_option
    +
    static const Event PageUp
    Definition event.hpp:62
    +
    animation::easing::Function function
    +
    animation::Duration follower_delay
    +
    bool is_mouse() const
    Definition event.hpp:109
    +
    void TakeFocus()
    Configure all the ancestors to give focus to this component.
    + +
    std::function< void()> on_enter
    + +
    UnderlineOption underline
    +
    std::function< Element(const EntryState &state)> transform
    + + +
    animation::Duration leader_duration
    + + +
    struct Mouse mouse
    Definition event.hpp:144
    +
    ConstStringListRef entries
    +
    animation::easing::Function follower_function
    + + +
    static const Event ArrowUp
    Definition event.hpp:42
    + +
    static const Event Tab
    Definition event.hpp:55
    +
    std::function< Element()> elements_infix
    +
    static const Event ArrowDown
    Definition event.hpp:43
    +
    static const Event End
    Definition event.hpp:61
    +
    Button button
    Definition mouse.hpp:30
    +
    static const Event Home
    Definition event.hpp:60
    +
    std::function< Element()> elements_postfix
    +
    AnimatedColorsOption animated_colors
    +
    std::function< void()> on_change
    + +
    static const Event PageDown
    Definition event.hpp:63
    +
    static const Event Return
    Definition event.hpp:53
    + +
    static const Event ArrowLeft
    Definition event.hpp:40
    +
    animation::Duration leader_delay
    +
    Motion motion
    Definition mouse.hpp:33
    +
    static const Event ArrowRight
    Definition event.hpp:41
    +
    It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ft...
    +
    Component Menu(MenuOption options)
    A list of text. The focused element is selected.
    +
    Component MenuEntry(MenuEntryOption options)
    A specific menu entry. They can be put into a Container::Vertical to form a menu.
    +
    Component Toggle(ConstStringListRef entries, int *selected)
    An horizontal list of elements. The user can navigate through them.
    +
    Represent an event. It can be key press event, a terminal resize, or more ...
    Definition event.hpp:29
    +
    Option for the MenuEntry component.
    +
    Option for the Menu component.
    +
    Decorator bgcolor(Color)
    Decorate using a background color.
    +
    Element xflex(Element)
    Expand/Minimize if possible/needed on the X axis.
    Definition flex.cpp:129
    +
    Element nothing(Element element)
    A decoration doing absolutely nothing.
    Definition dom/util.cpp:28
    +
    Direction
    Direction is an enumeration that represents the four cardinal directions.
    Definition direction.hpp:13
    +
    Element bold(Element)
    Use a bold font, for elements with more emphasis.
    Definition bold.cpp:33
    +
    Element yflex(Element)
    Expand/Minimize if possible/needed on the Y axis.
    Definition flex.cpp:135
    +
    Element inverted(Element)
    Add a filter that will invert the foreground and the background colors.
    Definition inverted.cpp:34
    +
    Element text(std::wstring text)
    Display a piece of unicode text.
    Definition text.cpp:160
    +
    Element focus(Element)
    Set the child to be the one focused among its siblings.
    Definition frame.cpp:101
    +
    Decorator color(Color)
    Decorate using a foreground color.
    +
    Element vbox(Elements)
    A container displaying elements vertically one by one.
    Definition vbox.cpp:96
    + + + + +
    bool Contain(int x, int y) const
    Definition box.cpp:42
    +
    int y_min
    Definition box.hpp:19
    +
    int y_max
    Definition box.hpp:20
    +
    int x_min
    Definition box.hpp:17
    +
    static Color Interpolate(float t, const Color &a, const Color &b)
    +
    Box is a structure that represents a rectangular area in a 2D space.
    Definition box.hpp:16
    + +
    float Linear(float p)
    Modeled after the line y = x.
    Definition animation.cpp:29
    +
    constexpr const T & clamp(const T &v, const T &lo, const T &hi)
    Definition util.hpp:11
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::function< Element(Element)> Decorator
    Definition elements.hpp:24
    +
    Element separatorVSelector(float up, float down, Color unselected_color, Color selected_color)
    Draw an vertical bar, with the area in between up/downcolored differently.
    +
    std::shared_ptr< T > Make(Args &&... args)
    Definition component.hpp:27
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    Element separatorHSelector(float left, float right, Color unselected_color, Color selected_color)
    Draw a horizontal bar, with the area in between left/right colored differently.
    +
    Element hbox(Elements)
    A container displaying elements horizontally one by one.
    Definition hbox.cpp:94
    +
    std::vector< Element > Elements
    Definition elements.hpp:23
    +
    Decorator reflect(Box &box)
    Definition reflect.cpp:43
    +
    std::shared_ptr< ComponentBase > Component
    + + + + +
    arguments for transform from |ButtonOption|, |CheckboxOption|, |RadioboxOption|, |MenuEntryOption|,...
    + +
    +
    + + + + + diff --git a/src_2ftxui_2component_2radiobox_8cpp.html b/src_2ftxui_2component_2radiobox_8cpp.html new file mode 100644 index 000000000..1fd071d05 --- /dev/null +++ b/src_2ftxui_2component_2radiobox_8cpp.html @@ -0,0 +1,230 @@ + + + + + + + + +FTXUI: radiobox.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    radiobox.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + + + + +

    +Functions

    Component Radiobox (RadioboxOption option)
     A list of element, where only one can be selected.
     
    Component Radiobox (ConstStringListRef entries, int *selected, RadioboxOption option)
     A list of element, where only one can be selected.
     
    +
    +
    + + + + + diff --git a/src_2ftxui_2component_2radiobox_8cpp.js b/src_2ftxui_2component_2radiobox_8cpp.js new file mode 100644 index 000000000..14f142465 --- /dev/null +++ b/src_2ftxui_2component_2radiobox_8cpp.js @@ -0,0 +1,5 @@ +var src_2ftxui_2component_2radiobox_8cpp = +[ + [ "Radiobox", "src_2ftxui_2component_2radiobox_8cpp.html#ga3e7a44f321fa910f07aef5879e67af95", null ], + [ "Radiobox", "src_2ftxui_2component_2radiobox_8cpp.html#gac73eebf15ff6b5386b7ee6c6cb4a4890", null ] +]; \ No newline at end of file diff --git a/src_2ftxui_2component_2radiobox_8cpp_source.html b/src_2ftxui_2component_2radiobox_8cpp_source.html new file mode 100644 index 000000000..b7012d950 --- /dev/null +++ b/src_2ftxui_2component_2radiobox_8cpp_source.html @@ -0,0 +1,497 @@ + + + + + + + + +FTXUI: radiobox.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    src/ftxui/component/radiobox.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <functional> // for function
    +
    5#include <utility> // for move
    +
    6#include <vector> // for vector
    +
    7
    +
    8#include "ftxui/component/component.hpp" // for Make, Radiobox
    +
    9#include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    10#include "ftxui/component/component_options.hpp" // for RadioboxOption, EntryState
    +
    11#include "ftxui/component/event.hpp" // for Event, Event::ArrowDown, Event::ArrowUp, Event::End, Event::Home, Event::PageDown, Event::PageUp, Event::Return, Event::Tab, Event::TabReverse
    +
    12#include "ftxui/component/mouse.hpp" // for Mouse, Mouse::WheelDown, Mouse::WheelUp, Mouse::Left, Mouse::Released
    +
    13#include "ftxui/component/screen_interactive.hpp" // for Component
    +
    14#include "ftxui/dom/elements.hpp" // for operator|, reflect, Element, vbox, Elements, focus, nothing, select
    +
    15#include "ftxui/screen/box.hpp" // for Box
    +
    16#include "ftxui/screen/util.hpp" // for clamp
    +
    17#include "ftxui/util/ref.hpp" // for Ref, ConstStringListRef
    +
    18
    +
    19namespace ftxui {
    +
    20
    +
    21namespace {
    +
    22/// @brief A list of selectable element. One and only one can be selected at
    +
    23/// the same time.
    +
    24/// @ingroup component
    +
    25class RadioboxBase : public ComponentBase, public RadioboxOption {
    +
    26 public:
    +
    27 explicit RadioboxBase(const RadioboxOption& option)
    +
    28 : RadioboxOption(option) {}
    +
    29
    +
    30 private:
    +
    31 Element OnRender() override {
    +
    32 Clamp();
    +
    33 Elements elements;
    +
    34 const bool is_menu_focused = Focused();
    +
    35 elements.reserve(size());
    +
    36 for (int i = 0; i < size(); ++i) {
    +
    37 const bool is_focused = (focused_entry() == i) && is_menu_focused;
    +
    38 const bool is_selected = (hovered_ == i);
    +
    39 auto state = EntryState{
    +
    40 entries[i], selected() == i, is_selected, is_focused, i,
    +
    41 };
    +
    42 auto element =
    +
    43 (transform ? transform : RadioboxOption::Simple().transform)(state);
    +
    44 if (is_selected) {
    +
    45 element |= focus;
    +
    46 }
    +
    47 elements.push_back(element | reflect(boxes_[i]));
    +
    48 }
    +
    49 return vbox(std::move(elements), hovered_) | reflect(box_);
    +
    50 }
    +
    51
    +
    52 // NOLINTNEXTLINE(readability-function-cognitive-complexity)
    +
    53 bool OnEvent(Event event) override {
    +
    54 Clamp();
    +
    55 if (!CaptureMouse(event)) {
    +
    56 return false;
    +
    57 }
    +
    58
    +
    59 if (event.is_mouse()) {
    +
    60 return OnMouseEvent(event);
    +
    61 }
    +
    62
    +
    63 if (Focused()) {
    +
    64 const int old_hovered = hovered_;
    +
    65 if (event == Event::ArrowUp || event == Event::Character('k')) {
    +
    66 (hovered_)--;
    +
    67 }
    +
    68 if (event == Event::ArrowDown || event == Event::Character('j')) {
    +
    69 (hovered_)++;
    +
    70 }
    +
    71 if (event == Event::PageUp) {
    +
    72 (hovered_) -= box_.y_max - box_.y_min;
    +
    73 }
    +
    74 if (event == Event::PageDown) {
    +
    75 (hovered_) += box_.y_max - box_.y_min;
    +
    76 }
    +
    77 if (event == Event::Home) {
    +
    78 (hovered_) = 0;
    +
    79 }
    +
    80 if (event == Event::End) {
    +
    81 (hovered_) = size() - 1;
    +
    82 }
    +
    83 if (event == Event::Tab && size()) {
    +
    84 hovered_ = (hovered_ + 1) % size();
    +
    85 }
    +
    86 if (event == Event::TabReverse && size()) {
    +
    87 hovered_ = (hovered_ + size() - 1) % size();
    +
    88 }
    +
    89
    +
    90 hovered_ = util::clamp(hovered_, 0, size() - 1);
    +
    91
    +
    92 if (hovered_ != old_hovered) {
    +
    93 focused_entry() = hovered_;
    +
    94 on_change();
    +
    95 return true;
    +
    96 }
    +
    97 }
    +
    98
    +
    99 if (event == Event::Character(' ') || event == Event::Return) {
    +
    100 selected() = hovered_;
    +
    101 on_change();
    +
    102 return true;
    +
    103 }
    +
    104
    +
    105 return false;
    +
    106 }
    +
    107
    +
    108 bool OnMouseEvent(Event event) {
    +
    109 if (event.mouse().button == Mouse::WheelDown ||
    +
    110 event.mouse().button == Mouse::WheelUp) {
    +
    111 return OnMouseWheel(event);
    +
    112 }
    +
    113
    +
    114 for (int i = 0; i < size(); ++i) {
    +
    115 if (!boxes_[i].Contain(event.mouse().x, event.mouse().y)) {
    +
    116 continue;
    +
    117 }
    +
    118
    +
    119 TakeFocus();
    +
    120 focused_entry() = i;
    +
    121 if (event.mouse().button == Mouse::Left &&
    +
    122 event.mouse().motion == Mouse::Pressed) {
    +
    123 if (selected() != i) {
    +
    124 selected() = i;
    +
    125 on_change();
    +
    126 }
    +
    127
    +
    128 return true;
    +
    129 }
    +
    130 }
    +
    131 return false;
    +
    132 }
    +
    133
    +
    134 bool OnMouseWheel(Event event) {
    +
    135 if (!box_.Contain(event.mouse().x, event.mouse().y)) {
    +
    136 return false;
    +
    137 }
    +
    138
    +
    139 const int old_hovered = hovered_;
    +
    140
    +
    141 if (event.mouse().button == Mouse::WheelUp) {
    +
    142 (hovered_)--;
    +
    143 }
    +
    144 if (event.mouse().button == Mouse::WheelDown) {
    +
    145 (hovered_)++;
    +
    146 }
    +
    147
    +
    148 hovered_ = util::clamp(hovered_, 0, size() - 1);
    +
    149
    +
    150 if (hovered_ != old_hovered) {
    +
    151 on_change();
    +
    152 }
    +
    153
    +
    154 return true;
    +
    155 }
    +
    156
    +
    157 void Clamp() {
    +
    158 boxes_.resize(size());
    +
    159 selected() = util::clamp(selected(), 0, size() - 1);
    +
    160 focused_entry() = util::clamp(focused_entry(), 0, size() - 1);
    +
    161 hovered_ = util::clamp(hovered_, 0, size() - 1);
    +
    162 }
    +
    163
    +
    164 bool Focusable() const final { return entries.size(); }
    +
    165 int size() const { return int(entries.size()); }
    +
    166
    +
    167 int hovered_ = selected();
    +
    168 std::vector<Box> boxes_;
    +
    169 Box box_;
    +
    170};
    +
    171
    +
    172} // namespace
    +
    173
    +
    174/// @brief A list of element, where only one can be selected.
    +
    175/// @param option The parameters
    +
    176/// @ingroup component
    +
    177/// @see RadioboxBase
    +
    178///
    +
    179/// ### Example
    +
    180///
    +
    181/// ```cpp
    +
    182/// auto screen = ScreenInteractive::TerminalOutput();
    +
    183/// std::vector<std::string> entries = {
    +
    184/// "entry 1",
    +
    185/// "entry 2",
    +
    186/// "entry 3",
    +
    187/// };
    +
    188/// int selected = 0;
    +
    189/// auto menu = Radiobox({
    +
    190/// .entries = entries,
    +
    191/// .selected = &selected,
    +
    192/// });
    +
    193/// screen.Loop(menu);
    +
    194/// ```
    +
    195///
    +
    196/// ### Output
    +
    197///
    +
    198/// ```bash
    +
    199/// ◉ entry 1
    +
    200/// ○ entry 2
    +
    201/// ○ entry 3
    +
    202/// ```
    +
    203/// NOLINTNEXTLINE
    +
    + +
    205 return Make<RadioboxBase>(std::move(option));
    +
    206}
    +
    +
    207
    +
    208/// @brief A list of element, where only one can be selected.
    +
    209/// @param entries The list of entries in the list.
    +
    210/// @param selected The index of the currently selected element.
    +
    211/// @param option Additional optional parameters.
    +
    212/// @ingroup component
    +
    213/// @see RadioboxBase
    +
    214///
    +
    215/// ### Example
    +
    216///
    +
    217/// ```cpp
    +
    218/// auto screen = ScreenInteractive::TerminalOutput();
    +
    219/// std::vector<std::string> entries = {
    +
    220/// "entry 1",
    +
    221/// "entry 2",
    +
    222/// "entry 3",
    +
    223/// };
    +
    224/// int selected = 0;
    +
    225/// auto menu = Radiobox(&entries, &selected);
    +
    226/// screen.Loop(menu);
    +
    227/// ```
    +
    228///
    +
    229/// ### Output
    +
    230///
    +
    231/// ```bash
    +
    232/// ◉ entry 1
    +
    233/// ○ entry 2
    +
    234/// ○ entry 3
    +
    235/// ```
    +
    + +
    237 int* selected,
    +
    238 RadioboxOption option) {
    +
    239 option.entries = std::move(entries);
    +
    240 option.selected = selected;
    +
    241 return Make<RadioboxBase>(std::move(option));
    +
    242}
    +
    +
    243
    +
    244} // namespace ftxui
    + +
    An adapter. Reference a list of strings.
    Definition ref.hpp:116
    + + + + + +
    static const Event TabReverse
    Definition event.hpp:56
    + + + + +
    static const Event PageUp
    Definition event.hpp:62
    +
    ConstStringListRef entries
    +
    static const Event ArrowUp
    Definition event.hpp:42
    +
    static const Event Tab
    Definition event.hpp:55
    +
    static const Event ArrowDown
    Definition event.hpp:43
    +
    static const Event End
    Definition event.hpp:61
    +
    static const Event Home
    Definition event.hpp:60
    + +
    static const Event PageDown
    Definition event.hpp:63
    +
    static const Event Return
    Definition event.hpp:53
    +
    static RadioboxOption Simple()
    Option for standard Radiobox.
    +
    std::function< Element(const EntryState &)> transform
    +
    Component Radiobox(RadioboxOption options)
    A list of element, where only one can be selected.
    +
    Option for the Radiobox component.
    +
    Decorator size(WidthOrHeight, Constraint, int value)
    Apply a constraint on the size of an element.
    +
    Element focus(Element)
    Set the child to be the one focused among its siblings.
    Definition frame.cpp:101
    +
    Element vbox(Elements)
    A container displaying elements vertically one by one.
    Definition vbox.cpp:96
    + +
    constexpr const T & clamp(const T &v, const T &lo, const T &hi)
    Definition util.hpp:11
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::shared_ptr< T > Make(Args &&... args)
    Definition component.hpp:27
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    std::vector< Element > Elements
    Definition elements.hpp:23
    +
    Decorator reflect(Box &box)
    Definition reflect.cpp:43
    +
    std::shared_ptr< ComponentBase > Component
    + + + +
    +
    + + + + + diff --git a/src_2ftxui_2component_2renderer_8cpp.html b/src_2ftxui_2component_2renderer_8cpp.html new file mode 100644 index 000000000..2ab7cea3e --- /dev/null +++ b/src_2ftxui_2component_2renderer_8cpp.html @@ -0,0 +1,236 @@ + + + + + + + + +FTXUI: renderer.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    renderer.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + + + + + + + + + + +

    +Functions

    Component Renderer (std::function< Element()> render)
     Return a component, using |render| to render its interface.
     
    Component Renderer (Component child, std::function< Element()> render)
     Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
     
    Component Renderer (std::function< Element(bool)> render)
     Return a focusable component, using |render| to render its interface.
     
    ComponentDecorator Renderer (ElementDecorator decorator)
     Decorate a component, by decorating what it renders.
     
    +
    +
    + + + + + diff --git a/src_2ftxui_2component_2renderer_8cpp.js b/src_2ftxui_2component_2renderer_8cpp.js new file mode 100644 index 000000000..0e40a2d7a --- /dev/null +++ b/src_2ftxui_2component_2renderer_8cpp.js @@ -0,0 +1,7 @@ +var src_2ftxui_2component_2renderer_8cpp = +[ + [ "Renderer", "src_2ftxui_2component_2renderer_8cpp.html#gaf03d3df7243bf71bb1a73686628f7f2b", null ], + [ "Renderer", "src_2ftxui_2component_2renderer_8cpp.html#ga533e883e2aeea28de2b60564fcaf0361", null ], + [ "Renderer", "src_2ftxui_2component_2renderer_8cpp.html#ga099cb57274a99396ee10f38acbfe62a7", null ], + [ "Renderer", "src_2ftxui_2component_2renderer_8cpp.html#ga41d63b7af41dee1570b54915821abd30", null ] +]; \ No newline at end of file diff --git a/src_2ftxui_2component_2renderer_8cpp_source.html b/src_2ftxui_2component_2renderer_8cpp_source.html new file mode 100644 index 000000000..e96939386 --- /dev/null +++ b/src_2ftxui_2component_2renderer_8cpp_source.html @@ -0,0 +1,371 @@ + + + + + + + + +FTXUI: renderer.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    src/ftxui/component/renderer.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2021 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <functional> // for function
    +
    5#include <utility> // for move
    +
    6
    +
    7#include "ftxui/component/component.hpp" // for Make, Renderer
    +
    8#include "ftxui/component/component_base.hpp" // for Component, ComponentBase
    +
    9#include "ftxui/component/event.hpp" // for Event
    +
    10#include "ftxui/component/mouse.hpp" // for Mouse
    +
    11#include "ftxui/dom/elements.hpp" // for Element, operator|, reflect
    +
    12#include "ftxui/screen/box.hpp" // for Box
    +
    13
    +
    14namespace ftxui {
    +
    15
    +
    16/// @brief Return a component, using |render| to render its interface.
    +
    17/// @param render The function drawing the interface.
    +
    18/// @ingroup component
    +
    19///
    +
    20/// ### Example
    +
    21///
    +
    22/// ```cpp
    +
    23/// auto screen = ScreenInteractive::TerminalOutput();
    +
    24/// auto renderer = Renderer([] {
    +
    25/// return text("My interface");
    +
    26/// });
    +
    27/// screen.Loop(renderer);
    +
    28/// ```
    +
    +
    29Component Renderer(std::function<Element()> render) {
    +
    30 class Impl : public ComponentBase {
    +
    31 public:
    +
    32 explicit Impl(std::function<Element()> render)
    +
    33 : render_(std::move(render)) {}
    +
    34 Element OnRender() override { return render_(); }
    +
    35 std::function<Element()> render_;
    +
    36 };
    +
    37
    +
    38 return Make<Impl>(std::move(render));
    +
    39}
    +
    +
    40
    +
    41/// @brief Return a new Component, similar to |child|, but using |render| as the
    +
    42/// Component::Render() event.
    +
    43/// @param child The component to forward events to.
    +
    44/// @param render The function drawing the interface.
    +
    45/// @ingroup component
    +
    46///
    +
    47/// ### Example
    +
    48///
    +
    49/// ```cpp
    +
    50/// auto screen = ScreenInteractive::TerminalOutput();
    +
    51/// std::string label = "Click to quit";
    +
    52/// auto button = Button(&label, screen.ExitLoopClosure());
    +
    53/// auto renderer = Renderer(button, [&] {
    +
    54/// return hbox({
    +
    55/// text("A button:"),
    +
    56/// button->Render(),
    +
    57/// });
    +
    58/// });
    +
    59/// screen.Loop(renderer);
    +
    60/// ```
    +
    +
    61Component Renderer(Component child, std::function<Element()> render) {
    +
    62 Component renderer = Renderer(std::move(render));
    +
    63 renderer->Add(std::move(child));
    +
    64 return renderer;
    +
    65}
    +
    +
    66
    +
    67/// @brief Return a focusable component, using |render| to render its interface.
    +
    68/// @param render The function drawing the interface, taking a boolean telling
    +
    69/// whether the component is focused or not.
    +
    70/// @ingroup component
    +
    71///
    +
    72/// ### Example
    +
    73///
    +
    74/// ```cpp
    +
    75/// auto screen = ScreenInteractive::TerminalOutput();
    +
    76/// auto renderer = Renderer([] (bool focused) {
    +
    77/// if (focused)
    +
    78/// return text("My interface") | inverted;
    +
    79/// else
    +
    80/// return text("My interface");
    +
    81/// });
    +
    82/// screen.Loop(renderer);
    +
    83/// ```
    +
    +
    84Component Renderer(std::function<Element(bool)> render) {
    +
    85 class Impl : public ComponentBase {
    +
    86 public:
    +
    87 explicit Impl(std::function<Element(bool)> render)
    +
    88 : render_(std::move(render)) {}
    +
    89
    +
    90 private:
    +
    91 Element OnRender() override { return render_(Focused()) | reflect(box_); }
    +
    92 bool Focusable() const override { return true; }
    +
    93 bool OnEvent(Event event) override {
    +
    94 if (event.is_mouse() && box_.Contain(event.mouse().x, event.mouse().y)) {
    +
    95 if (!CaptureMouse(event)) {
    +
    96 return false;
    +
    97 }
    +
    98
    +
    99 TakeFocus();
    +
    100 }
    +
    101
    +
    102 return false;
    +
    103 }
    +
    104 Box box_;
    +
    105
    +
    106 std::function<Element(bool)> render_;
    +
    107 };
    +
    108 return Make<Impl>(std::move(render));
    +
    109}
    +
    +
    110
    +
    111/// @brief Decorate a component, by decorating what it renders.
    +
    112/// @param decorator the function modifying the element it renders.
    +
    113/// @ingroup component
    +
    114///
    +
    115/// ### Example
    +
    116///
    +
    117/// ```cpp
    +
    118/// auto screen = ScreenInteractive::TerminalOutput();
    +
    119/// auto renderer =
    +
    120// Renderer([] { return text("Hello");)
    +
    121/// | Renderer(bold)
    +
    122/// | Renderer(inverted);
    +
    123/// screen.Loop(renderer);
    +
    124/// ```
    +
    + +
    126 return [decorator](Component component) { // NOLINT
    +
    127 return Renderer(component, [component, decorator] {
    +
    128 return component->Render() | decorator;
    +
    129 });
    +
    130 };
    +
    131}
    +
    +
    132
    +
    133} // namespace ftxui
    + + + + + + +
    void Add(Component children)
    Add a child. @param child The child to be attached.
    Definition component.cpp:70
    +
    bool is_mouse() const
    Definition event.hpp:109
    + +
    struct Mouse mouse
    Definition event.hpp:144
    +
    It implement rendering itself as ftxui::Element. It implement keyboard navigation by responding to ft...
    +
    Component Renderer(Component child, std::function< Element()>)
    Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
    +
    Represent an event. It can be key press event, a terminal resize, or more ...
    Definition event.hpp:29
    +
    Box is a structure that represents a rectangular area in a 2D space.
    Definition box.hpp:16
    + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::shared_ptr< T > Make(Args &&... args)
    Definition component.hpp:27
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    std::function< Element(Element)> ElementDecorator
    Definition component.hpp:33
    +
    std::function< Component(Component)> ComponentDecorator
    Definition component.hpp:32
    +
    std::shared_ptr< ComponentBase > Component
    +
    +
    + + + + + diff --git a/src_2ftxui_2component_2resizable__split_8cpp.html b/src_2ftxui_2component_2resizable__split_8cpp.html new file mode 100644 index 000000000..5b5066675 --- /dev/null +++ b/src_2ftxui_2component_2resizable__split_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: resizable_split.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    resizable_split.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + + + + + + + + + + + + + +

    +Functions

    Component ResizableSplit (ResizableSplitOption options)
     A split in between two components.
     
    Component ResizableSplitLeft (Component main, Component back, int *main_size)
     An horizontal split in between two components, configurable using the mouse.
     
    Component ResizableSplitRight (Component main, Component back, int *main_size)
     An horizontal split in between two components, configurable using the mouse.
     
    Component ResizableSplitTop (Component main, Component back, int *main_size)
     An vertical split in between two components, configurable using the mouse.
     
    Component ResizableSplitBottom (Component main, Component back, int *main_size)
     An vertical split in between two components, configurable using the mouse.
     
    +
    +
    + + + + + diff --git a/src_2ftxui_2component_2resizable__split_8cpp.js b/src_2ftxui_2component_2resizable__split_8cpp.js new file mode 100644 index 000000000..81639477a --- /dev/null +++ b/src_2ftxui_2component_2resizable__split_8cpp.js @@ -0,0 +1,8 @@ +var src_2ftxui_2component_2resizable__split_8cpp = +[ + [ "ResizableSplit", "src_2ftxui_2component_2resizable__split_8cpp.html#a5ce41caeafc35dedc5c7da5347386e80", null ], + [ "ResizableSplitLeft", "src_2ftxui_2component_2resizable__split_8cpp.html#gae2205fc172615b43e1e3307bb614be4c", null ], + [ "ResizableSplitRight", "src_2ftxui_2component_2resizable__split_8cpp.html#ga9030d0beb64f653603cab382b02750a8", null ], + [ "ResizableSplitTop", "src_2ftxui_2component_2resizable__split_8cpp.html#ga238b4b650aca14716b82b2198695e008", null ], + [ "ResizableSplitBottom", "src_2ftxui_2component_2resizable__split_8cpp.html#gacb75e6e61a021829893f7b57aeb7e3a2", null ] +]; \ No newline at end of file diff --git a/src_2ftxui_2component_2resizable__split_8cpp_source.html b/src_2ftxui_2component_2resizable__split_8cpp_source.html new file mode 100644 index 000000000..914103a07 --- /dev/null +++ b/src_2ftxui_2component_2resizable__split_8cpp_source.html @@ -0,0 +1,586 @@ + + + + + + + + +FTXUI: resizable_split.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    src/ftxui/component/resizable_split.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2021 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <ftxui/component/component_options.hpp> // for ResizableSplitOption
    +
    5#include <ftxui/dom/direction.hpp> // for Direction, Direction::Down, Direction::Left, Direction::Right, Direction::Up
    +
    6#include <ftxui/util/ref.hpp> // for Ref
    +
    7#include <functional> // for function
    +
    8#include <utility> // for move
    +
    9
    +
    10#include "ftxui/component/captured_mouse.hpp" // for CapturedMouse
    +
    11#include "ftxui/component/component.hpp" // for Horizontal, Make, ResizableSplit, ResizableSplitBottom, ResizableSplitLeft, ResizableSplitRight, ResizableSplitTop
    +
    12#include "ftxui/component/component_base.hpp" // for Component, ComponentBase
    +
    13#include "ftxui/component/event.hpp" // for Event
    +
    14#include "ftxui/component/mouse.hpp" // for Mouse, Mouse::Left, Mouse::Pressed, Mouse::Released
    +
    15#include "ftxui/dom/elements.hpp" // for operator|, reflect, Element, size, EQUAL, xflex, yflex, hbox, vbox, HEIGHT, WIDTH, text
    +
    16#include "ftxui/screen/box.hpp" // for Box
    +
    17
    +
    18namespace ftxui {
    +
    19namespace {
    +
    20
    +
    21class ResizableSplitBase : public ComponentBase {
    +
    22 public:
    +
    23 explicit ResizableSplitBase(ResizableSplitOption options)
    +
    24 : options_(std::move(options)) {
    +
    25 switch (options_->direction()) {
    +
    26 case Direction::Left:
    +
    27 Add(Container::Horizontal({
    +
    28 options_->main,
    +
    29 options_->back,
    +
    30 }));
    +
    31 break;
    + + +
    34 options_->back,
    +
    35 options_->main,
    +
    36 }));
    +
    37 break;
    +
    38 case Direction::Up:
    + +
    40 options_->main,
    +
    41 options_->back,
    +
    42 }));
    +
    43 break;
    +
    44 case Direction::Down:
    + +
    46 options_->back,
    +
    47 options_->main,
    +
    48 }));
    +
    49 break;
    +
    50 }
    +
    51 }
    +
    52
    +
    53 bool OnEvent(Event event) final {
    +
    54 if (event.is_mouse()) {
    +
    55 return OnMouseEvent(std::move(event));
    +
    56 }
    +
    57 return ComponentBase::OnEvent(std::move(event));
    +
    58 }
    +
    59
    +
    60 bool OnMouseEvent(Event event) {
    +
    61 if (captured_mouse_ && event.mouse().motion == Mouse::Released) {
    +
    62 captured_mouse_.reset();
    +
    63 return true;
    +
    64 }
    +
    65
    +
    66 if (event.mouse().button == Mouse::Left &&
    +
    67 event.mouse().motion == Mouse::Pressed &&
    +
    68 separator_box_.Contain(event.mouse().x, event.mouse().y) &&
    +
    69 !captured_mouse_) {
    +
    70 captured_mouse_ = CaptureMouse(event);
    +
    71 return true;
    +
    72 }
    +
    73
    +
    74 if (!captured_mouse_) {
    +
    75 return ComponentBase::OnEvent(event);
    +
    76 }
    +
    77
    +
    78 switch (options_->direction()) {
    +
    79 case Direction::Left:
    +
    80 options_->main_size() = std::max(0, event.mouse().x - box_.x_min);
    +
    81 return true;
    + +
    83 options_->main_size() = std::max(0, box_.x_max - event.mouse().x);
    +
    84 return true;
    +
    85 case Direction::Up:
    +
    86 options_->main_size() = std::max(0, event.mouse().y - box_.y_min);
    +
    87 return true;
    +
    88 case Direction::Down:
    +
    89 options_->main_size() = std::max(0, box_.y_max - event.mouse().y);
    +
    90 return true;
    +
    91 }
    +
    92
    +
    93 // NOTREACHED()
    +
    94 return false;
    +
    95 }
    +
    96
    +
    97 Element OnRender() final {
    +
    98 switch (options_->direction()) {
    +
    99 case Direction::Left:
    +
    100 return RenderLeft();
    +
    101 case Direction::Right:
    +
    102 return RenderRight();
    +
    103 case Direction::Up:
    +
    104 return RenderTop();
    +
    105 case Direction::Down:
    +
    106 return RenderBottom();
    +
    107 }
    +
    108 // NOTREACHED()
    +
    109 return text("unreacheable");
    +
    110 }
    +
    111
    +
    112 Element RenderLeft() {
    +
    113 return hbox({
    +
    114 options_->main->Render() |
    +
    115 size(WIDTH, EQUAL, options_->main_size()),
    +
    116 options_->separator_func() | reflect(separator_box_),
    +
    117 options_->back->Render() | xflex,
    +
    118 }) |
    +
    119 reflect(box_);
    +
    120 }
    +
    121
    +
    122 Element RenderRight() {
    +
    123 return hbox({
    +
    124 options_->back->Render() | xflex,
    +
    125 options_->separator_func() | reflect(separator_box_),
    +
    126 options_->main->Render() |
    +
    127 size(WIDTH, EQUAL, options_->main_size()),
    +
    128 }) |
    +
    129 reflect(box_);
    +
    130 }
    +
    131
    +
    132 Element RenderTop() {
    +
    133 return vbox({
    +
    134 options_->main->Render() |
    +
    135 size(HEIGHT, EQUAL, options_->main_size()),
    +
    136 options_->separator_func() | reflect(separator_box_),
    +
    137 options_->back->Render() | yflex,
    +
    138 }) |
    +
    139 reflect(box_);
    +
    140 }
    +
    141
    +
    142 Element RenderBottom() {
    +
    143 return vbox({
    +
    144 options_->back->Render() | yflex,
    +
    145 options_->separator_func() | reflect(separator_box_),
    +
    146 options_->main->Render() |
    +
    147 size(HEIGHT, EQUAL, options_->main_size()),
    +
    148 }) |
    +
    149 reflect(box_);
    +
    150 }
    +
    151
    +
    152 private:
    +
    153 Ref<ResizableSplitOption> options_;
    +
    154 CapturedMouse captured_mouse_;
    +
    155 Box separator_box_;
    +
    156 Box box_;
    +
    157};
    +
    158
    +
    159} // namespace
    +
    160
    +
    161/// @brief A split in between two components.
    +
    162/// @param options all the parameters.
    +
    163///
    +
    164/// ### Example
    +
    165///
    +
    166/// ```cpp
    +
    167/// auto left = Renderer([] { return text("Left") | center;});
    +
    168/// auto right = Renderer([] { return text("right") | center;});
    +
    169/// int left_size = 10;
    +
    170/// auto component = ResizableSplit({
    +
    171/// .main = left,
    +
    172/// .back = right,
    +
    173/// .direction = Direction::Left,
    +
    174/// .main_size = &left_size,
    +
    175/// .separator_func = [] { return separatorDouble(); },
    +
    176/// });
    +
    177/// ```
    +
    178///
    +
    179/// ### Output
    +
    180///
    +
    181/// ```bash
    +
    182/// ║
    +
    183/// left ║ right
    +
    184/// ║
    +
    185/// ```
    +
    +
    186Component ResizableSplit(ResizableSplitOption options) {
    +
    187 return Make<ResizableSplitBase>(std::move(options));
    +
    188}
    +
    +
    189
    +
    190/// @brief An horizontal split in between two components, configurable using the
    +
    191/// mouse.
    +
    192/// @param main The main component of size |main_size|, on the left.
    +
    193/// @param back The back component taking the remaining size, on the right.
    +
    194/// @param main_size The size of the |main| component.
    +
    195/// @ingroup component
    +
    196///
    +
    197/// ### Example
    +
    198///
    +
    199/// ```cpp
    +
    200/// auto screen = ScreenInteractive::Fullscreen();
    +
    201/// int left_size = 10;
    +
    202/// auto left = Renderer([] { return text("Left") | center;});
    +
    203/// auto right = Renderer([] { return text("right") | center;});
    +
    204/// auto split = ResizableSplitLeft(left, right, &left_size);
    +
    205/// screen.Loop(split);
    +
    206/// ```
    +
    207///
    +
    208/// ### Output
    +
    209///
    +
    210/// ```bash
    +
    211/// │
    +
    212/// left │ right
    +
    213/// │
    +
    214/// ```
    +
    +
    215Component ResizableSplitLeft(Component main, Component back, int* main_size) {
    +
    216 return ResizableSplit({
    +
    217 std::move(main),
    +
    218 std::move(back),
    +
    219 Direction::Left,
    +
    220 main_size,
    +
    221 });
    +
    222}
    +
    +
    223
    +
    224/// @brief An horizontal split in between two components, configurable using the
    +
    225/// mouse.
    +
    226/// @param main The main component of size |main_size|, on the right.
    +
    227/// @param back The back component taking the remaining size, on the left.
    +
    228/// @param main_size The size of the |main| component.
    +
    229/// @ingroup component
    +
    230///
    +
    231/// ### Example
    +
    232///
    +
    233/// ```cpp
    +
    234/// auto screen = ScreenInteractive::Fullscreen();
    +
    235/// int right_size = 10;
    +
    236/// auto left = Renderer([] { return text("Left") | center;});
    +
    237/// auto right = Renderer([] { return text("right") | center;});
    +
    238/// auto split = ResizableSplitRight(right, left, &right_size)
    +
    239/// screen.Loop(split);
    +
    240/// ```
    +
    241///
    +
    242/// ### Output
    +
    243///
    +
    244/// ```bash
    +
    245/// │
    +
    246/// left │ right
    +
    247/// │
    +
    248/// ```
    +
    +
    249Component ResizableSplitRight(Component main, Component back, int* main_size) {
    +
    250 return ResizableSplit({
    +
    251 std::move(main),
    +
    252 std::move(back),
    +
    253 Direction::Right,
    +
    254 main_size,
    +
    255 });
    +
    256}
    +
    +
    257
    +
    258/// @brief An vertical split in between two components, configurable using the
    +
    259/// mouse.
    +
    260/// @param main The main component of size |main_size|, on the top.
    +
    261/// @param back The back component taking the remaining size, on the bottom.
    +
    262/// @param main_size The size of the |main| component.
    +
    263/// @ingroup component
    +
    264///
    +
    265/// ### Example
    +
    266///
    +
    267/// ```cpp
    +
    268/// auto screen = ScreenInteractive::Fullscreen();
    +
    269/// int top_size = 1;
    +
    270/// auto top = Renderer([] { return text("Top") | center;});
    +
    271/// auto bottom = Renderer([] { return text("Bottom") | center;});
    +
    272/// auto split = ResizableSplitTop(top, bottom, &top_size)
    +
    273/// screen.Loop(split);
    +
    274/// ```
    +
    275///
    +
    276/// ### Output
    +
    277///
    +
    278/// ```bash
    +
    279/// top
    +
    280/// ────────────
    +
    281/// bottom
    +
    282/// ```
    +
    +
    283Component ResizableSplitTop(Component main, Component back, int* main_size) {
    +
    284 return ResizableSplit({
    +
    285 std::move(main),
    +
    286 std::move(back),
    +
    287 Direction::Up,
    +
    288 main_size,
    +
    289 });
    +
    290}
    +
    +
    291
    +
    292/// @brief An vertical split in between two components, configurable using the
    +
    293/// mouse.
    +
    294/// @param main The main component of size |main_size|, on the bottom.
    +
    295/// @param back The back component taking the remaining size, on the top.
    +
    296/// @param main_size The size of the |main| component.
    +
    297/// @ingroup component
    +
    298///
    +
    299/// ### Example
    +
    300///
    +
    301/// ```cpp
    +
    302/// auto screen = ScreenInteractive::Fullscreen();
    +
    303/// int bottom_size = 1;
    +
    304/// auto top = Renderer([] { return text("Top") | center;});
    +
    305/// auto bottom = Renderer([] { return text("Bottom") | center;});
    +
    306/// auto split = ResizableSplit::Bottom(bottom, top, &bottom_size)
    +
    307/// screen.Loop(split);
    +
    308/// ```
    +
    309///
    +
    310/// ### Output
    +
    311///
    +
    312/// ```bash
    +
    313/// top
    +
    314/// ────────────
    +
    315/// bottom
    +
    316/// ```
    +
    +
    317Component ResizableSplitBottom(Component main, Component back, int* main_size) {
    +
    318 return ResizableSplit({
    +
    319 std::move(main),
    +
    320 std::move(back),
    +
    321 Direction::Down,
    +
    322 main_size,
    +
    323 });
    +
    324}
    +
    +
    325
    +
    326} // namespace ftxui
    + + + + + + + + + + + + +
    virtual bool OnEvent(Event)
    Called in response to an event.
    +
    Component Horizontal(Components children)
    A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow...
    +
    Component Vertical(Components children)
    A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
    +
    Element xflex(Element)
    Expand/Minimize if possible/needed on the X axis.
    Definition flex.cpp:129
    +
    Decorator size(WidthOrHeight, Constraint, int value)
    Apply a constraint on the size of an element.
    +
    Element yflex(Element)
    Expand/Minimize if possible/needed on the Y axis.
    Definition flex.cpp:135
    +
    Element text(std::wstring text)
    Display a piece of unicode text.
    Definition text.cpp:160
    +
    Element vbox(Elements)
    A container displaying elements vertically one by one.
    Definition vbox.cpp:96
    + + + + +
    bool Contain(int x, int y) const
    Definition box.cpp:42
    +
    int x_max
    Definition box.hpp:18
    +
    int y_min
    Definition box.hpp:19
    +
    int y_max
    Definition box.hpp:20
    +
    int x_min
    Definition box.hpp:17
    + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + + +
    std::unique_ptr< CapturedMouseInterface > CapturedMouse
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    Element hbox(Elements)
    A container displaying elements horizontally one by one.
    Definition hbox.cpp:94
    +
    Decorator reflect(Box &box)
    Definition reflect.cpp:43
    + +
    std::shared_ptr< ComponentBase > Component
    + + +
    +
    + + + + + diff --git a/src_2ftxui_2component_2slider_8cpp.html b/src_2ftxui_2component_2slider_8cpp.html new file mode 100644 index 000000000..bca7f6088 --- /dev/null +++ b/src_2ftxui_2component_2slider_8cpp.html @@ -0,0 +1,255 @@ + + + + + + + + +FTXUI: slider.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    slider.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Functions

    Component Slider (ConstStringRef label, Ref< int > value, ConstRef< int > min, ConstRef< int > max, ConstRef< int > increment)
     An horizontal slider.
     
    Component Slider (ConstStringRef label, Ref< float > value, ConstRef< float > min=0.f, ConstRef< float > max=100.f, ConstRef< float > increment=5.f)
     
    Component Slider (ConstStringRef label, Ref< long > value, ConstRef< long > min=0L, ConstRef< long > max=100L, ConstRef< long > increment=5L)
     
    template<typename T >
    Component Slider (SliderOption< T > options)
     A slider in any direction.
     
    template Component Slider (SliderOption< int8_t >)
     
    template Component Slider (SliderOption< int16_t >)
     
    template Component Slider (SliderOption< int32_t >)
     
    template Component Slider (SliderOption< int64_t >)
     
    template Component Slider (SliderOption< uint8_t >)
     
    template Component Slider (SliderOption< uint16_t >)
     
    template Component Slider (SliderOption< uint32_t >)
     
    template Component Slider (SliderOption< uint64_t >)
     
    template Component Slider (SliderOption< float >)
     
    template Component Slider (SliderOption< double >)
     
    +
    +
    + + + + + diff --git a/src_2ftxui_2component_2slider_8cpp.js b/src_2ftxui_2component_2slider_8cpp.js new file mode 100644 index 000000000..c0a29ad96 --- /dev/null +++ b/src_2ftxui_2component_2slider_8cpp.js @@ -0,0 +1,17 @@ +var src_2ftxui_2component_2slider_8cpp = +[ + [ "Slider", "src_2ftxui_2component_2slider_8cpp.html#gafdce74ff1421c2f1bda336c8dacefcbd", null ], + [ "Slider", "src_2ftxui_2component_2slider_8cpp.html#a8bfa2757905a4fb50e0ec263976d1f96", null ], + [ "Slider", "src_2ftxui_2component_2slider_8cpp.html#aba34419b025c881c07808816c81c5230", null ], + [ "Slider", "src_2ftxui_2component_2slider_8cpp.html#aa3558d992a72679e5e9c9c7b67abd727", null ], + [ "Slider", "src_2ftxui_2component_2slider_8cpp.html#a877bf1673c86ac33e24facf81068e693", null ], + [ "Slider", "src_2ftxui_2component_2slider_8cpp.html#a551dff4f473bdb27fde654341d08c618", null ], + [ "Slider", "src_2ftxui_2component_2slider_8cpp.html#a8d1ae475487cb22769f127449380925e", null ], + [ "Slider", "src_2ftxui_2component_2slider_8cpp.html#a217d120bd78c7e5fbe21c60d58f411ba", null ], + [ "Slider", "src_2ftxui_2component_2slider_8cpp.html#a83667b04778e0206c7c9f05652c9110a", null ], + [ "Slider", "src_2ftxui_2component_2slider_8cpp.html#a41e0cb91026c84d8767958a6c3d65d88", null ], + [ "Slider", "src_2ftxui_2component_2slider_8cpp.html#a17babf521947301435a4f7c47835032c", null ], + [ "Slider", "src_2ftxui_2component_2slider_8cpp.html#a69e9803a9d52936adf22dabd14df4289", null ], + [ "Slider", "src_2ftxui_2component_2slider_8cpp.html#a453d7fc2e7bd34b00775062018daf96d", null ], + [ "Slider", "src_2ftxui_2component_2slider_8cpp.html#a9d64c6ad8cbbae0735eac76e4f4f5811", null ] +]; \ No newline at end of file diff --git a/src_2ftxui_2component_2slider_8cpp_source.html b/src_2ftxui_2component_2slider_8cpp_source.html new file mode 100644 index 000000000..8da75f52e --- /dev/null +++ b/src_2ftxui_2component_2slider_8cpp_source.html @@ -0,0 +1,603 @@ + + + + + + + + +FTXUI: slider.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    src/ftxui/component/slider.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <algorithm> // for max, min
    +
    5#include <ftxui/component/component_options.hpp> // for SliderOption
    +
    6#include <ftxui/dom/direction.hpp> // for Direction, Direction::Down, Direction::Left, Direction::Right, Direction::Up
    +
    7#include <string> // for allocator
    +
    8#include <utility> // for move
    +
    9
    +
    10#include "ftxui/component/captured_mouse.hpp" // for CapturedMouse
    +
    11#include "ftxui/component/component.hpp" // for Make, Slider
    +
    12#include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    13#include "ftxui/component/event.hpp" // for Event, Event::ArrowDown, Event::ArrowLeft, Event::ArrowRight, Event::ArrowUp
    +
    14#include "ftxui/component/mouse.hpp" // for Mouse, Mouse::Left, Mouse::Pressed, Mouse::Released
    +
    15#include "ftxui/component/screen_interactive.hpp" // for Component
    +
    16#include "ftxui/dom/elements.hpp" // for operator|, text, Element, xflex, hbox, color, underlined, reflect, Decorator, dim, vcenter, focus, nothing, select, yflex, gaugeDirection
    +
    17#include "ftxui/screen/box.hpp" // for Box
    +
    18#include "ftxui/screen/color.hpp" // for Color, Color::GrayDark, Color::White
    +
    19#include "ftxui/util/ref.hpp" // for ConstRef, Ref, ConstStringRef
    +
    20
    +
    21namespace ftxui {
    +
    22
    +
    23namespace {
    +
    24Decorator flexDirection(Direction direction) {
    +
    25 switch (direction) {
    +
    26 case Direction::Up:
    +
    27 case Direction::Down:
    +
    28 return yflex;
    +
    29 case Direction::Left:
    + +
    31 return xflex;
    +
    32 }
    +
    33 return xflex; // NOT_REACHED()
    +
    34}
    +
    35
    +
    36Direction Opposite(Direction d) {
    +
    37 switch (d) {
    +
    38 case Direction::Up:
    +
    39 return Direction::Down;
    +
    40 case Direction::Down:
    +
    41 return Direction::Up;
    +
    42 case Direction::Left:
    +
    43 return Direction::Right;
    + +
    45 return Direction::Left;
    +
    46 }
    +
    47 return d; // NOT_REACHED()
    +
    48}
    +
    49
    +
    50template <class T>
    +
    51class SliderBase : public SliderOption<T>, public ComponentBase {
    +
    52 public:
    +
    53 explicit SliderBase(SliderOption<T> options) : SliderOption<T>(options) {}
    +
    54
    +
    55 Element OnRender() override {
    +
    56 auto gauge_color =
    +
    57 Focused() ? color(this->color_active) : color(this->color_inactive);
    +
    58 const float percent =
    +
    59 float(this->value() - this->min()) / float(this->max() - this->min());
    +
    60 return gaugeDirection(percent, this->direction) |
    +
    61 flexDirection(this->direction) | reflect(gauge_box_) | gauge_color;
    +
    62 }
    +
    63
    +
    64 void OnDirection(Direction pressed) {
    +
    65 if (pressed == this->direction) {
    +
    66 this->value() += this->increment();
    +
    67 return;
    +
    68 }
    +
    69
    +
    70 if (pressed == Opposite(this->direction)) {
    +
    71 this->value() -= this->increment();
    +
    72 return;
    +
    73 }
    +
    74 }
    +
    75
    +
    76 bool OnEvent(Event event) final {
    +
    77 if (event.is_mouse()) {
    +
    78 return OnMouseEvent(event);
    +
    79 }
    +
    80
    +
    81 T old_value = this->value();
    +
    82 if (event == Event::ArrowLeft || event == Event::Character('h')) {
    +
    83 OnDirection(Direction::Left);
    +
    84 }
    +
    85 if (event == Event::ArrowRight || event == Event::Character('l')) {
    +
    86 OnDirection(Direction::Right);
    +
    87 }
    +
    88 if (event == Event::ArrowUp || event == Event::Character('k')) {
    +
    89 OnDirection(Direction::Up);
    +
    90 }
    +
    91 if (event == Event::ArrowDown || event == Event::Character('j')) {
    +
    92 OnDirection(Direction::Down);
    +
    93 }
    +
    94
    +
    95 this->value() = std::max(this->min(), std::min(this->max(), this->value()));
    +
    96 if (old_value != this->value()) {
    +
    97 if (this->on_change) {
    +
    98 this->on_change();
    +
    99 }
    +
    100 return true;
    +
    101 }
    +
    102
    +
    103 return ComponentBase::OnEvent(event);
    +
    104 }
    +
    105
    +
    106 bool OnCapturedMouseEvent(Event event) {
    +
    107 if (event.mouse().motion == Mouse::Released) {
    +
    108 captured_mouse_ = nullptr;
    +
    109 return true;
    +
    110 }
    +
    111
    +
    112 T old_value = this->value();
    +
    113 switch (this->direction) {
    +
    114 case Direction::Right: {
    +
    115 this->value() = this->min() + (event.mouse().x - gauge_box_.x_min) *
    +
    116 (this->max() - this->min()) /
    +
    117 (gauge_box_.x_max - gauge_box_.x_min);
    +
    118
    +
    119 break;
    +
    120 }
    +
    121 case Direction::Left: {
    +
    122 this->value() = this->max() - (event.mouse().x - gauge_box_.x_min) *
    +
    123 (this->max() - this->min()) /
    +
    124 (gauge_box_.x_max - gauge_box_.x_min);
    +
    125 break;
    +
    126 }
    +
    127 case Direction::Down: {
    +
    128 this->value() = this->min() + (event.mouse().y - gauge_box_.y_min) *
    +
    129 (this->max() - this->min()) /
    +
    130 (gauge_box_.y_max - gauge_box_.y_min);
    +
    131 break;
    +
    132 }
    +
    133 case Direction::Up: {
    +
    134 this->value() = this->max() - (event.mouse().y - gauge_box_.y_min) *
    +
    135 (this->max() - this->min()) /
    +
    136 (gauge_box_.y_max - gauge_box_.y_min);
    +
    137 break;
    +
    138 }
    +
    139 }
    +
    140
    +
    141 this->value() = std::max(this->min(), std::min(this->max(), this->value()));
    +
    142
    +
    143 if (old_value != this->value() && this->on_change) {
    +
    144 this->on_change();
    +
    145 }
    +
    146 return true;
    +
    147 }
    +
    148
    +
    149 bool OnMouseEvent(Event event) {
    +
    150 if (captured_mouse_) {
    +
    151 return OnCapturedMouseEvent(event);
    +
    152 }
    +
    153
    +
    154 if (event.mouse().button != Mouse::Left) {
    +
    155 return false;
    +
    156 }
    +
    157 if (event.mouse().motion != Mouse::Pressed) {
    +
    158 return false;
    +
    159 }
    +
    160
    +
    161 if (!gauge_box_.Contain(event.mouse().x, event.mouse().y)) {
    +
    162 return false;
    +
    163 }
    +
    164
    +
    165 captured_mouse_ = CaptureMouse(event);
    +
    166
    +
    167 if (captured_mouse_) {
    +
    168 TakeFocus();
    +
    169 return OnCapturedMouseEvent(event);
    +
    170 }
    +
    171
    +
    172 return false;
    +
    173 }
    +
    174
    +
    175 bool Focusable() const final { return true; }
    +
    176
    +
    177 private:
    +
    178 Box gauge_box_;
    +
    179 CapturedMouse captured_mouse_;
    +
    180};
    +
    181
    +
    182class SliderWithLabel : public ComponentBase {
    +
    183 public:
    +
    184 SliderWithLabel(ConstStringRef label, Component inner)
    +
    185 : label_(std::move(label)) {
    +
    186 Add(std::move(inner));
    +
    187 SetActiveChild(ChildAt(0));
    +
    188 }
    +
    189
    +
    190 private:
    +
    191 bool OnEvent(Event event) final {
    +
    192 if (ComponentBase::OnEvent(event)) {
    +
    193 return true;
    +
    194 }
    +
    195
    +
    196 if (!event.is_mouse()) {
    +
    197 return false;
    +
    198 }
    +
    199
    +
    200 mouse_hover_ = box_.Contain(event.mouse().x, event.mouse().y);
    +
    201
    +
    202 if (!mouse_hover_) {
    +
    203 return false;
    +
    204 }
    +
    205
    +
    206 if (!CaptureMouse(event)) {
    +
    207 return false;
    +
    208 }
    +
    209
    +
    210 return true;
    +
    211 }
    +
    212
    +
    213 Element OnRender() override {
    +
    214 auto gauge_color = (Focused() || mouse_hover_) ? color(Color::White)
    + +
    216 auto element = hbox({
    +
    217 text(label_()) | dim | vcenter,
    +
    218 hbox({
    +
    219 text("["),
    + +
    221 text("]"),
    +
    222 }) | xflex,
    +
    223 }) |
    +
    224 gauge_color | xflex | reflect(box_);
    +
    225
    +
    226 element |= focus;
    +
    227 return element;
    +
    228 }
    +
    229
    +
    230 ConstStringRef label_;
    +
    231 Box box_;
    +
    232 bool mouse_hover_ = false;
    +
    233};
    +
    234
    +
    235} // namespace
    +
    236
    +
    237/// @brief An horizontal slider.
    +
    238/// @param label The name of the slider.
    +
    239/// @param value The current value of the slider.
    +
    240/// @param min The minimum value.
    +
    241/// @param max The maximum value.
    +
    242/// @param increment The increment when used by the cursor.
    +
    243/// @ingroup component
    +
    244///
    +
    245/// ### Example
    +
    246///
    +
    247/// ```cpp
    +
    248/// auto screen = ScreenInteractive::TerminalOutput();
    +
    249/// int value = 50;
    +
    250/// auto slider = Slider("Value:", &value, 0, 100, 1);
    +
    251/// screen.Loop(slider);
    +
    252/// ```
    +
    253///
    +
    254/// ### Output
    +
    255///
    +
    256/// ```bash
    +
    257/// Value:[██████████████████████████ ]
    +
    258/// ```
    +
    + +
    260 Ref<int> value,
    +
    261 ConstRef<int> min,
    +
    262 ConstRef<int> max,
    +
    263 ConstRef<int> increment) {
    +
    264 SliderOption<int> option;
    +
    265 option.value = value;
    +
    266 option.min = min;
    +
    267 option.max = max;
    +
    268 option.increment = increment;
    +
    269 auto slider = Make<SliderBase<int>>(option);
    +
    270 return Make<SliderWithLabel>(std::move(label), slider);
    +
    271}
    +
    +
    272
    +
    + +
    274 Ref<float> value,
    +
    275 ConstRef<float> min,
    +
    276 ConstRef<float> max,
    +
    277 ConstRef<float> increment) {
    +
    278 SliderOption<float> option;
    +
    279 option.value = value;
    +
    280 option.min = min;
    +
    281 option.max = max;
    +
    282 option.increment = increment;
    +
    283 auto slider = Make<SliderBase<float>>(option);
    +
    284 return Make<SliderWithLabel>(std::move(label), slider);
    +
    285}
    +
    +
    + +
    287 Ref<long> value,
    +
    288 ConstRef<long> min,
    +
    289 ConstRef<long> max,
    +
    290 ConstRef<long> increment) {
    +
    291 SliderOption<long> option;
    +
    292 option.value = value;
    +
    293 option.min = min;
    +
    294 option.max = max;
    +
    295 option.increment = increment;
    +
    296 auto slider = Make<SliderBase<long>>(option);
    +
    297 return Make<SliderWithLabel>(std::move(label), slider);
    +
    298}
    +
    +
    299
    +
    300/// @brief A slider in any direction.
    +
    301/// @param options The options
    +
    302/// ### Example
    +
    303///
    +
    304/// ```cpp
    +
    305/// auto screen = ScreenInteractive::TerminalOutput();
    +
    306/// int value = 50;
    +
    307/// auto slider = Slider({
    +
    308/// .value = &value,
    +
    309/// .min = 0,
    +
    310/// .max = 100,
    +
    311/// .increment= 20,
    +
    312/// });
    +
    313/// screen.Loop(slider);
    +
    314/// ```
    +
    315template <typename T>
    +
    + +
    317 return Make<SliderBase<T>>(options);
    +
    318}
    +
    +
    319
    + + + + +
    324
    + + + + +
    329
    + + +
    332
    +
    333} // namespace ftxui
    + + +
    An adapter. Own or reference an immutable object.
    Definition ref.hpp:17
    +
    An adapter. Own or reference a constant string. For convenience, this class convert multiple immutabl...
    Definition ref.hpp:94
    +
    An adapter. Own or reference an mutable object.
    Definition ref.hpp:46
    + + + + + + + + + + +
    Element Render()
    Draw the component. Build a ftxui::Element to be drawn on the ftxui::Screen representing this ftxui::...
    +
    static const Event ArrowUp
    Definition event.hpp:42
    +
    static const Event ArrowDown
    Definition event.hpp:43
    +
    virtual bool OnEvent(Event)
    Called in response to an event.
    +
    static const Event ArrowLeft
    Definition event.hpp:40
    +
    static const Event ArrowRight
    Definition event.hpp:41
    +
    Element xflex(Element)
    Expand/Minimize if possible/needed on the X axis.
    Definition flex.cpp:129
    +
    Element gaugeDirection(float progress, Direction direction)
    Draw a high definition progress bar progressing in specified direction.
    +
    Direction
    Direction is an enumeration that represents the four cardinal directions.
    Definition direction.hpp:13
    +
    Element yflex(Element)
    Expand/Minimize if possible/needed on the Y axis.
    Definition flex.cpp:135
    +
    Element underlined(Element)
    Underline the given element.
    +
    Element text(std::wstring text)
    Display a piece of unicode text.
    Definition text.cpp:160
    +
    Element focus(Element)
    Set the child to be the one focused among its siblings.
    Definition frame.cpp:101
    +
    Element vcenter(Element)
    Center an element vertically.
    +
    Decorator color(Color)
    Decorate using a foreground color.
    + + + + + + + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::function< Element(Element)> Decorator
    Definition elements.hpp:24
    +
    std::unique_ptr< CapturedMouseInterface > CapturedMouse
    +
    std::shared_ptr< T > Make(Args &&... args)
    Definition component.hpp:27
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    Element hbox(Elements)
    A container displaying elements horizontally one by one.
    Definition hbox.cpp:94
    +
    Component Slider(SliderOption< T > options)
    A slider in any direction.
    +
    Decorator reflect(Box &box)
    Definition reflect.cpp:43
    +
    std::shared_ptr< ComponentBase > Component
    + + + + + + + +
    +
    + + + + + diff --git a/src_2ftxui_2component_2window_8cpp.html b/src_2ftxui_2component_2window_8cpp.html new file mode 100644 index 000000000..419b508d4 --- /dev/null +++ b/src_2ftxui_2component_2window_8cpp.html @@ -0,0 +1,331 @@ + + + + + + + + +FTXUI: window.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    window.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + +

    +Macros

    #define NOMINMAX
     
    + + + + +

    +Functions

    Component Window (WindowOptions option)
     A draggeable / resizeable window. To use multiple of them, they must be stacked using Container::Stacked({...}) component;.
     
    +

    Macro Definition Documentation

    + +

    ◆ NOMINMAX

    + +
    +
    + + + + +
    #define NOMINMAX
    +
    + +

    Definition at line 4 of file src/ftxui/component/window.cpp.

    + +
    +
    +

    Variable Documentation

    + +

    ◆ color_

    + +
    +
    + + + + +
    Color color_
    +
    + +

    Definition at line 87 of file src/ftxui/component/window.cpp.

    + +
    +
    + +

    ◆ resize_left_

    + +
    +
    + + + + +
    bool resize_left_ = false
    +
    + +

    Definition at line 88 of file src/ftxui/component/window.cpp.

    + +
    +
    + +

    ◆ resize_right_

    + +
    +
    + + + + +
    bool resize_right_ = false
    +
    + +

    Definition at line 89 of file src/ftxui/component/window.cpp.

    + +
    +
    + +

    ◆ resize_top_

    + +
    +
    + + + + +
    bool resize_top_ = false
    +
    + +

    Definition at line 90 of file src/ftxui/component/window.cpp.

    + +
    +
    + +

    ◆ resize_down_

    + +
    +
    + + + + +
    bool resize_down_ = false
    +
    + +

    Definition at line 91 of file src/ftxui/component/window.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/src_2ftxui_2component_2window_8cpp.js b/src_2ftxui_2component_2window_8cpp.js new file mode 100644 index 000000000..11b3cf5e4 --- /dev/null +++ b/src_2ftxui_2component_2window_8cpp.js @@ -0,0 +1,10 @@ +var src_2ftxui_2component_2window_8cpp = +[ + [ "NOMINMAX", "src_2ftxui_2component_2window_8cpp.html#a9f918755b601cf4bffca775992e6fb90", null ], + [ "Window", "src_2ftxui_2component_2window_8cpp.html#ga638693abef9289912f5fa39606390b20", null ], + [ "color_", "src_2ftxui_2component_2window_8cpp.html#af75802a6553b2b23639f23d3c4b94217", null ], + [ "resize_left_", "src_2ftxui_2component_2window_8cpp.html#a11cd63ba8957337034d3351d3b416030", null ], + [ "resize_right_", "src_2ftxui_2component_2window_8cpp.html#a435bdeaeaea854a80f574fbfda91032f", null ], + [ "resize_top_", "src_2ftxui_2component_2window_8cpp.html#a12f0c5cd8f00f860d8fb47550f0af746", null ], + [ "resize_down_", "src_2ftxui_2component_2window_8cpp.html#abb5820730ee5ac08f5623d866a8b6777", null ] +]; \ No newline at end of file diff --git a/src_2ftxui_2component_2window_8cpp_source.html b/src_2ftxui_2component_2window_8cpp_source.html new file mode 100644 index 000000000..0f4ca2625 --- /dev/null +++ b/src_2ftxui_2component_2window_8cpp_source.html @@ -0,0 +1,573 @@ + + + + + + + + +FTXUI: window.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    src/ftxui/component/window.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2023 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#define NOMINMAX
    +
    5#include <algorithm>
    + + + +
    9#include <ftxui/component/screen_interactive.hpp> // for ScreenInteractive
    +
    10#include <memory>
    +
    11#include <utility>
    +
    12#include "ftxui/dom/elements.hpp" // for text, window, hbox, vbox, size, clear_under, reflect, emptyElement
    +
    13#include "ftxui/dom/node_decorator.hpp" // for NodeDecorator
    +
    14#include "ftxui/screen/color.hpp" // for Color
    +
    15#include "ftxui/screen/screen.hpp" // for Screen
    +
    16
    +
    17namespace ftxui {
    +
    18
    +
    19namespace {
    +
    20
    +
    21Decorator PositionAndSize(int left, int top, int width, int height) {
    +
    22 return [=](Element element) {
    +
    23 element |= size(WIDTH, EQUAL, width);
    +
    24 element |= size(HEIGHT, EQUAL, height);
    +
    25
    +
    26 auto padding_left = emptyElement() | size(WIDTH, EQUAL, left);
    +
    27 auto padding_top = emptyElement() | size(HEIGHT, EQUAL, top);
    +
    28
    +
    29 return vbox({
    +
    30 padding_top,
    +
    31 hbox({
    +
    32 padding_left,
    +
    33 element,
    +
    34 }),
    +
    35 });
    +
    36 };
    +
    37}
    +
    38
    +
    39class ResizeDecorator : public NodeDecorator {
    +
    40 public:
    +
    41 ResizeDecorator(Element child,
    +
    42 bool resize_left,
    +
    43 bool resize_right,
    +
    44 bool resize_top,
    +
    45 bool resize_down,
    +
    46 Color color)
    +
    47 : NodeDecorator(std::move(child)),
    +
    48 color_(color),
    +
    49 resize_left_(resize_left),
    +
    50 resize_right_(resize_right),
    +
    51 resize_top_(resize_top),
    +
    52 resize_down_(resize_down) {}
    +
    53
    +
    54 void Render(Screen& screen) override {
    + +
    56
    +
    57 if (resize_left_) {
    +
    58 for (int y = box_.y_min; y <= box_.y_max; ++y) {
    +
    59 auto& cell = screen.PixelAt(box_.x_min, y);
    +
    60 cell.foreground_color = color_;
    +
    61 cell.automerge = false;
    +
    62 }
    +
    63 }
    +
    64 if (resize_right_) {
    +
    65 for (int y = box_.y_min; y <= box_.y_max; ++y) {
    +
    66 auto& cell = screen.PixelAt(box_.x_max, y);
    +
    67 cell.foreground_color = color_;
    +
    68 cell.automerge = false;
    +
    69 }
    +
    70 }
    +
    71 if (resize_top_) {
    +
    72 for (int x = box_.x_min; x <= box_.x_max; ++x) {
    +
    73 auto& cell = screen.PixelAt(x, box_.y_min);
    +
    74 cell.foreground_color = color_;
    +
    75 cell.automerge = false;
    +
    76 }
    +
    77 }
    +
    78 if (resize_down_) {
    +
    79 for (int x = box_.x_min; x <= box_.x_max; ++x) {
    +
    80 auto& cell = screen.PixelAt(x, box_.y_max);
    +
    81 cell.foreground_color = color_;
    +
    82 cell.automerge = false;
    +
    83 }
    +
    84 }
    +
    85 }
    +
    86
    +
    87 Color color_;
    +
    88 const bool resize_left_;
    +
    89 const bool resize_right_;
    +
    90 const bool resize_top_;
    +
    91 const bool resize_down_;
    +
    92};
    +
    93
    +
    94Element DefaultRenderState(const WindowRenderState& state) {
    +
    95 Element element = state.inner;
    +
    96 if (!state.active) {
    +
    97 element |= dim;
    +
    98 }
    +
    99
    +
    100 element = window(text(state.title), element);
    +
    101 element |= clear_under;
    +
    102
    +
    103 const Color color = Color::Red;
    +
    104
    +
    105 element = std::make_shared<ResizeDecorator>( //
    +
    106 element, //
    +
    107 state.hover_left, //
    +
    108 state.hover_right, //
    +
    109 state.hover_top, //
    +
    110 state.hover_down, //
    +
    111 color //
    +
    112 );
    +
    113
    +
    114 return element;
    +
    115}
    +
    116
    +
    117class WindowImpl : public ComponentBase, public WindowOptions {
    +
    118 public:
    +
    119 explicit WindowImpl(WindowOptions option) : WindowOptions(std::move(option)) {
    +
    120 if (!inner) {
    +
    121 inner = Make<ComponentBase>();
    +
    122 }
    +
    123 Add(inner);
    +
    124 }
    +
    125
    +
    126 private:
    +
    127 Element OnRender() final {
    +
    128 auto element = ComponentBase::Render();
    +
    129
    +
    130 const bool captureable =
    +
    131 captured_mouse_ || ScreenInteractive::Active()->CaptureMouse();
    +
    132
    +
    133 const WindowRenderState state = {
    +
    134 element,
    +
    135 title(),
    +
    136 Active(),
    +
    137 drag_,
    + +
    139 (resize_left_hover_ || resize_left_) && captureable,
    +
    140 (resize_right_hover_ || resize_right_) && captureable,
    +
    141 (resize_top_hover_ || resize_top_) && captureable,
    +
    142 (resize_down_hover_ || resize_down_) && captureable,
    +
    143 };
    +
    144
    +
    145 element = render ? render(state) : DefaultRenderState(state);
    +
    146
    +
    147 // Position and record the drawn area of the window.
    +
    148 element |= reflect(box_window_);
    +
    149 element |= PositionAndSize(left(), top(), width(), height());
    +
    150 element |= reflect(box_);
    +
    151
    +
    152 return element;
    +
    153 }
    +
    154
    +
    155 bool OnEvent(Event event) final {
    +
    156 if (ComponentBase::OnEvent(event)) {
    +
    157 return true;
    +
    158 }
    +
    159
    +
    160 if (!event.is_mouse()) {
    +
    161 return false;
    +
    162 }
    +
    163
    +
    164 mouse_hover_ = box_window_.Contain(event.mouse().x, event.mouse().y);
    +
    165
    +
    166 resize_down_hover_ = false;
    +
    167 resize_top_hover_ = false;
    +
    168 resize_left_hover_ = false;
    +
    169 resize_right_hover_ = false;
    +
    170
    +
    171 if (mouse_hover_) {
    +
    172 resize_left_hover_ = event.mouse().x == left() + box_.x_min;
    +
    173 resize_right_hover_ =
    +
    174 event.mouse().x == left() + width() - 1 + box_.x_min;
    +
    175 resize_top_hover_ = event.mouse().y == top() + box_.y_min;
    +
    176 resize_down_hover_ = event.mouse().y == top() + height() - 1 + box_.y_min;
    +
    177
    +
    178 // Apply the component options:
    +
    179 resize_top_hover_ &= resize_top();
    +
    180 resize_left_hover_ &= resize_left();
    +
    181 resize_down_hover_ &= resize_down();
    +
    182 resize_right_hover_ &= resize_right();
    +
    183 }
    +
    184
    +
    185 if (captured_mouse_) {
    +
    186 if (event.mouse().motion == Mouse::Released) {
    +
    187 captured_mouse_ = nullptr;
    +
    188 return true;
    +
    189 }
    +
    190
    +
    191 if (resize_left_) {
    +
    192 width() = left() + width() - event.mouse().x + box_.x_min;
    +
    193 left() = event.mouse().x - box_.x_min;
    +
    194 }
    +
    195
    +
    196 if (resize_right_) {
    +
    197 width() = event.mouse().x - resize_start_x - box_.x_min;
    +
    198 }
    +
    199
    +
    200 if (resize_top_) {
    +
    201 height() = top() + height() - event.mouse().y + box_.y_min;
    +
    202 top() = event.mouse().y - box_.y_min;
    +
    203 }
    +
    204
    +
    205 if (resize_down_) {
    +
    206 height() = event.mouse().y - resize_start_y - box_.y_min;
    +
    207 }
    +
    208
    +
    209 if (drag_) {
    +
    210 left() = event.mouse().x - drag_start_x - box_.x_min;
    +
    211 top() = event.mouse().y - drag_start_y - box_.y_min;
    +
    212 }
    +
    213
    +
    214 // Clamp the window size.
    +
    215 width() = std::max<int>(width(), static_cast<int>(title().size() + 2));
    +
    216 height() = std::max<int>(height(), 2);
    +
    217
    +
    218 return true;
    +
    219 }
    +
    220
    +
    221 resize_left_ = false;
    +
    222 resize_right_ = false;
    +
    223 resize_top_ = false;
    +
    224 resize_down_ = false;
    +
    225
    +
    226 if (!mouse_hover_) {
    +
    227 return false;
    +
    228 }
    +
    229
    +
    230 if (!CaptureMouse(event)) {
    +
    231 return true;
    +
    232 }
    +
    233
    +
    234 if (event.mouse().button != Mouse::Left) {
    +
    235 return true;
    +
    236 }
    +
    237 if (event.mouse().motion != Mouse::Pressed) {
    +
    238 return true;
    +
    239 }
    +
    240
    +
    241 TakeFocus();
    +
    242
    +
    243 captured_mouse_ = CaptureMouse(event);
    +
    244 if (!captured_mouse_) {
    +
    245 return true;
    +
    246 }
    +
    247
    +
    248 resize_left_ = resize_left_hover_;
    +
    249 resize_right_ = resize_right_hover_;
    +
    250 resize_top_ = resize_top_hover_;
    +
    251 resize_down_ = resize_down_hover_;
    +
    252
    +
    253 resize_start_x = event.mouse().x - width() - box_.x_min;
    +
    254 resize_start_y = event.mouse().y - height() - box_.y_min;
    +
    255 drag_start_x = event.mouse().x - left() - box_.x_min;
    +
    256 drag_start_y = event.mouse().y - top() - box_.y_min;
    +
    257
    +
    258 // Drag only if we are not resizeing a border yet:
    + +
    260 return true;
    +
    261 }
    +
    262
    +
    263 Box box_;
    +
    264 Box box_window_;
    +
    265
    +
    266 CapturedMouse captured_mouse_;
    +
    267 int drag_start_x = 0;
    +
    268 int drag_start_y = 0;
    +
    269 int resize_start_x = 0;
    +
    270 int resize_start_y = 0;
    +
    271
    +
    272 bool mouse_hover_ = false;
    +
    273 bool drag_ = false;
    +
    274 bool resize_top_ = false;
    +
    275 bool resize_left_ = false;
    +
    276 bool resize_down_ = false;
    +
    277 bool resize_right_ = false;
    +
    278
    +
    279 bool resize_top_hover_ = false;
    +
    280 bool resize_left_hover_ = false;
    +
    281 bool resize_down_hover_ = false;
    +
    282 bool resize_right_hover_ = false;
    +
    283};
    +
    284
    +
    285} // namespace
    +
    286
    +
    287/// @brief A draggeable / resizeable window. To use multiple of them, they must
    +
    288/// be stacked using `Container::Stacked({...})` component;
    +
    289///
    +
    290/// @param option A struct holding every parameters.
    +
    291/// @ingroup component
    +
    292/// @see Window
    +
    293///
    +
    294/// ### Example
    +
    295///
    +
    296/// ```cpp
    +
    297/// auto window_1= Window({
    +
    298/// .inner = DummyWindowContent(),
    +
    299/// .title = "First window",
    +
    300/// });
    +
    301///
    +
    302/// auto window_2= Window({
    +
    303/// .inner = DummyWindowContent(),
    +
    304/// .title = "Second window",
    +
    305/// });
    +
    306///
    +
    307/// auto container = Container::Stacked({
    +
    308/// window_1,
    +
    309/// window_2,
    +
    310/// });
    +
    311/// ```
    +
    + +
    313 return Make<WindowImpl>(std::move(option));
    +
    314}
    +
    +
    315
    +
    316}; // namespace ftxui
    + + + + + + + + +
    Element Render()
    Draw the component. Build a ftxui::Element to be drawn on the ftxui::Screen representing this ftxui::...
    +
    static ScreenInteractive * Active()
    Return the currently active screen, or null if none.
    +
    CapturedMouse CaptureMouse()
    Try to get the unique lock about behing able to capture the mouse.
    +
    virtual bool OnEvent(Event)
    Called in response to an event.
    +
    Component Window(WindowOptions option)
    A draggeable / resizeable window. To use multiple of them, they must be stacked using Container::Stac...
    +
    friend void Render(Screen &screen, Node *node, Selection &selection)
    Definition node.cpp:96
    +
    Element window(Element title, Element content, BorderStyle border=ROUNDED)
    Draw window with a title and a border around the element.
    +
    Element clear_under(Element element)
    Before drawing |child|, clear the pixels below. This is useful in combination with dbox.
    +
    Decorator size(WidthOrHeight, Constraint, int value)
    Apply a constraint on the size of an element.
    +
    Element emptyElement()
    Definition dom/util.cpp:140
    +
    Element text(std::wstring text)
    Display a piece of unicode text.
    Definition text.cpp:160
    +
    Element dim(Element)
    Use a light font, for elements with less emphasis.
    Definition dim.cpp:33
    +
    void Render(Screen &screen, const Element &element)
    Display an element on a ftxui::Screen.
    Definition node.cpp:84
    +
    Element vbox(Elements)
    A container displaying elements vertically one by one.
    Definition vbox.cpp:96
    + +
    Color
    Color is an enumeration that represents the color support of the terminal.
    Definition terminal.hpp:23
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + + +
    std::function< Element(Element)> Decorator
    Definition elements.hpp:24
    +
    std::unique_ptr< CapturedMouseInterface > CapturedMouse
    +
    std::shared_ptr< T > Make(Args &&... args)
    Definition component.hpp:27
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    Element hbox(Elements)
    A container displaying elements horizontally one by one.
    Definition hbox.cpp:94
    +
    Decorator reflect(Box &box)
    Definition reflect.cpp:43
    + +
    std::shared_ptr< ComponentBase > Component
    + +
    std::uint8_t top
    Definition screen.cpp:131
    +
    std::uint8_t left
    Definition screen.cpp:130
    + + +
    const bool resize_left_
    +
    const bool resize_top_
    +
    const bool resize_right_
    +
    const bool resize_down_
    + + +
    +
    + + + + + diff --git a/src_2ftxui_2dom_2border_8cpp.html b/src_2ftxui_2dom_2border_8cpp.html new file mode 100644 index 000000000..a645f60f9 --- /dev/null +++ b/src_2ftxui_2dom_2border_8cpp.html @@ -0,0 +1,293 @@ + + + + + + + + +FTXUI: border.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    border.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Functions

    Element border (Element child)
     Draw a border around the element.
     
    Decorator borderWith (const Pixel &pixel)
     Same as border but with a constant Pixel around the element.
     
    Decorator borderStyled (BorderStyle style)
     Same as border but with different styles.
     
    Decorator borderStyled (Color foreground_color)
     Same as border but with a foreground color.
     
    Decorator borderStyled (BorderStyle style, Color foreground_color)
     Same as border but with a foreground color and a different style.
     
    Element borderDashed (Element child)
     Draw a dashed border around the element.
     
    Element borderLight (Element child)
     Draw a light border around the element.
     
    Element borderHeavy (Element child)
     Draw a heavy border around the element.
     
    Element borderDouble (Element child)
     Draw a double border around the element.
     
    Element borderRounded (Element child)
     Draw a rounded border around the element.
     
    Element borderEmpty (Element child)
     Draw an empty border around the element.
     
    Element window (Element title, Element content, BorderStyle border)
     Draw window with a title and a border around the element.
     
    +

    Variable Documentation

    + +

    ◆ charset_

    + +
    +
    + + + + +
    const Charset& charset_
    +
    + +

    Definition at line 45 of file src/ftxui/dom/border.cpp.

    + +
    +
    + +

    ◆ foreground_color_

    + +
    +
    + + + + +
    std::optional<Color> foreground_color_
    +
    + +

    Definition at line 46 of file src/ftxui/dom/border.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/src_2ftxui_2dom_2border_8cpp.js b/src_2ftxui_2dom_2border_8cpp.js new file mode 100644 index 000000000..d5b087395 --- /dev/null +++ b/src_2ftxui_2dom_2border_8cpp.js @@ -0,0 +1,17 @@ +var src_2ftxui_2dom_2border_8cpp = +[ + [ "border", "src_2ftxui_2dom_2border_8cpp.html#gae8537acd423d47cf07e61bd774fb1098", null ], + [ "borderWith", "src_2ftxui_2dom_2border_8cpp.html#gaa97cfcfbe6df92dac085454395ec7b2f", null ], + [ "borderStyled", "src_2ftxui_2dom_2border_8cpp.html#gabc9db79957d4dd36deb8ca79938e4c41", null ], + [ "borderStyled", "src_2ftxui_2dom_2border_8cpp.html#gad1dbf36194dcb77674085df9e11c1e22", null ], + [ "borderStyled", "src_2ftxui_2dom_2border_8cpp.html#ga5aab98b289d2e7b2ce8ca0eeee51ce78", null ], + [ "borderDashed", "src_2ftxui_2dom_2border_8cpp.html#ga181c80f8ada12d1356f6bfa0ebb7219f", null ], + [ "borderLight", "src_2ftxui_2dom_2border_8cpp.html#gaa074cdab57eeb47b99f1699bcc8addd8", null ], + [ "borderHeavy", "src_2ftxui_2dom_2border_8cpp.html#ga666c31419cc31cdadc9f8178ed63529e", null ], + [ "borderDouble", "src_2ftxui_2dom_2border_8cpp.html#ga052b504344f3bc1ff86b3493cd934215", null ], + [ "borderRounded", "src_2ftxui_2dom_2border_8cpp.html#ga3cf2db223a5efaa370f0ca6bb405b80e", null ], + [ "borderEmpty", "src_2ftxui_2dom_2border_8cpp.html#gaf20f7d6fb275d109f0bdc01a2e4d3f3e", null ], + [ "window", "src_2ftxui_2dom_2border_8cpp.html#ga03049def08fa7a5eaa4d5e897152bc1a", null ], + [ "charset_", "src_2ftxui_2dom_2border_8cpp.html#a108d200440dbd1759a7b025709c2d321", null ], + [ "foreground_color_", "src_2ftxui_2dom_2border_8cpp.html#ab929ed9438df4a818e56490a23d8324e", null ] +]; \ No newline at end of file diff --git a/src_2ftxui_2dom_2border_8cpp_source.html b/src_2ftxui_2dom_2border_8cpp_source.html new file mode 100644 index 000000000..b85b2f502 --- /dev/null +++ b/src_2ftxui_2dom_2border_8cpp_source.html @@ -0,0 +1,779 @@ + + + + + + + + +FTXUI: border.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    src/ftxui/dom/border.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <algorithm> // for max
    +
    5#include <array> // for array
    +
    6#include <ftxui/screen/color.hpp> // for Color
    +
    7#include <memory> // for allocator, make_shared, __shared_ptr_access
    +
    8#include <optional> // for optional, nullopt
    +
    9#include <string> // for basic_string, string
    +
    10#include <utility> // for move
    +
    11
    +
    12#include "ftxui/dom/elements.hpp" // for unpack, Element, Decorator, BorderStyle, ROUNDED, borderStyled, Elements, DASHED, DOUBLE, EMPTY, HEAVY, LIGHT, border, borderDashed, borderDouble, borderEmpty, borderHeavy, borderLight, borderRounded, borderWith, window
    +
    13#include "ftxui/dom/node.hpp" // for Node, Elements
    +
    14#include "ftxui/dom/requirement.hpp" // for Requirement
    +
    15#include "ftxui/screen/box.hpp" // for Box
    +
    16#include "ftxui/screen/pixel.hpp" // for Pixel
    +
    17#include "ftxui/screen/screen.hpp" // for Pixel, Screen
    +
    18
    +
    19namespace ftxui {
    +
    20
    +
    21namespace {
    +
    22using Charset = std::array<std::string, 6>; // NOLINT
    +
    23using Charsets = std::array<Charset, 6>; // NOLINT
    +
    24// NOLINTNEXTLINE
    +
    25static Charsets simple_border_charset = {
    +
    26 Charset{"┌", "┐", "└", "┘", "─", "│"}, // LIGHT
    +
    27 Charset{"┏", "┓", "┗", "┛", "╍", "╏"}, // DASHED
    +
    28 Charset{"┏", "┓", "┗", "┛", "━", "┃"}, // HEAVY
    +
    29 Charset{"╔", "╗", "╚", "╝", "═", "║"}, // DOUBLE
    +
    30 Charset{"╭", "╮", "╰", "╯", "─", "│"}, // ROUNDED
    +
    31 Charset{" ", " ", " ", " ", " ", " "}, // EMPTY
    +
    32};
    +
    33
    +
    34// For reference, here is the charset for normal border:
    +
    35class Border : public Node {
    +
    36 public:
    +
    37 Border(Elements children,
    +
    38 BorderStyle style,
    +
    39 std::optional<Color> foreground_color = std::nullopt)
    +
    40 : Node(std::move(children)),
    +
    41 charset_(simple_border_charset[style]) // NOLINT
    +
    42 ,
    +
    43 foreground_color_(foreground_color) {} // NOLINT
    +
    44
    +
    45 const Charset& charset_; // NOLINT
    +
    46 std::optional<Color> foreground_color_;
    +
    47
    +
    48 void ComputeRequirement() override {
    + +
    50 requirement_ = children_[0]->requirement();
    +
    51 requirement_.min_x += 2;
    +
    52 requirement_.min_y += 2;
    +
    53 if (children_.size() == 2) {
    +
    54 requirement_.min_x =
    +
    55 std::max(requirement_.min_x, children_[1]->requirement().min_x + 2);
    +
    56 }
    +
    57 requirement_.focused.box.x_min++;
    +
    58 requirement_.focused.box.x_max++;
    +
    59 requirement_.focused.box.y_min++;
    +
    60 requirement_.focused.box.y_max++;
    +
    61 }
    +
    62
    +
    63 void SetBox(Box box) override {
    +
    64 Node::SetBox(box);
    +
    65 if (children_.size() == 2) {
    +
    66 Box title_box;
    +
    67 title_box.x_min = box.x_min + 1;
    +
    68 title_box.x_max = std::min(box.x_max - 1,
    +
    69 box.x_min + children_[1]->requirement().min_x);
    +
    70 title_box.y_min = box.y_min;
    +
    71 title_box.y_max = box.y_min;
    +
    72 children_[1]->SetBox(title_box);
    +
    73 }
    +
    74 box.x_min++;
    +
    75 box.x_max--;
    +
    76 box.y_min++;
    +
    77 box.y_max--;
    +
    78 children_[0]->SetBox(box);
    +
    79 }
    +
    80
    +
    81 void Render(Screen& screen) override {
    +
    82 // Draw content.
    +
    83 children_[0]->Render(screen);
    +
    84
    +
    85 // Draw the border.
    +
    86 if (box_.x_min >= box_.x_max || box_.y_min >= box_.y_max) {
    +
    87 return;
    +
    88 }
    +
    89
    +
    90 screen.at(box_.x_min, box_.y_min) = charset_[0]; // NOLINT
    +
    91 screen.at(box_.x_max, box_.y_min) = charset_[1]; // NOLINT
    +
    92 screen.at(box_.x_min, box_.y_max) = charset_[2]; // NOLINT
    +
    93 screen.at(box_.x_max, box_.y_max) = charset_[3]; // NOLINT
    +
    94
    +
    95 for (int x = box_.x_min + 1; x < box_.x_max; ++x) {
    +
    96 Pixel& p1 = screen.PixelAt(x, box_.y_min);
    +
    97 Pixel& p2 = screen.PixelAt(x, box_.y_max);
    +
    98 p1.character = charset_[4]; // NOLINT
    +
    99 p2.character = charset_[4]; // NOLINT
    +
    100 p1.automerge = true;
    +
    101 p2.automerge = true;
    +
    102 }
    +
    103 for (int y = box_.y_min + 1; y < box_.y_max; ++y) {
    +
    104 Pixel& p3 = screen.PixelAt(box_.x_min, y);
    +
    105 Pixel& p4 = screen.PixelAt(box_.x_max, y);
    +
    106 p3.character = charset_[5]; // NOLINT
    +
    107 p4.character = charset_[5]; // NOLINT
    +
    108 p3.automerge = true;
    +
    109 p4.automerge = true;
    +
    110 }
    +
    111
    +
    112 // Draw title.
    +
    113 if (children_.size() == 2) {
    +
    114 children_[1]->Render(screen);
    +
    115 }
    +
    116
    +
    117 // Draw the border color.
    +
    118 if (foreground_color_) {
    +
    119 for (int x = box_.x_min; x <= box_.x_max; ++x) {
    +
    120 screen.PixelAt(x, box_.y_min).foreground_color = *foreground_color_;
    +
    121 screen.PixelAt(x, box_.y_max).foreground_color = *foreground_color_;
    +
    122 }
    +
    123 for (int y = box_.y_min; y <= box_.y_max; ++y) {
    +
    124 screen.PixelAt(box_.x_min, y).foreground_color = *foreground_color_;
    +
    125 screen.PixelAt(box_.x_max, y).foreground_color = *foreground_color_;
    +
    126 }
    +
    127 }
    +
    128 }
    +
    129};
    +
    130
    +
    131// For reference, here is the charset for normal border:
    +
    132class BorderPixel : public Node {
    +
    133 public:
    +
    134 BorderPixel(Elements children, Pixel pixel)
    +
    135 : Node(std::move(children)), pixel_(std::move(pixel)) {}
    +
    136
    +
    137 private:
    +
    138 Pixel pixel_;
    +
    139
    +
    140 void ComputeRequirement() override {
    + +
    142 requirement_ = children_[0]->requirement();
    +
    143 requirement_.min_x += 2;
    +
    144 requirement_.min_y += 2;
    +
    145 if (children_.size() == 2) {
    +
    146 requirement_.min_x =
    +
    147 std::max(requirement_.min_x, children_[1]->requirement().min_x + 2);
    +
    148 }
    +
    149
    +
    150 requirement_.focused.box.Shift(1, 1);
    +
    151 }
    +
    152
    +
    153 void SetBox(Box box) override {
    +
    154 Node::SetBox(box);
    +
    155 if (children_.size() == 2) {
    +
    156 Box title_box;
    +
    157 title_box.x_min = box.x_min + 1;
    +
    158 title_box.x_max = box.x_max - 1;
    +
    159 title_box.y_min = box.y_min;
    +
    160 title_box.y_max = box.y_min;
    +
    161 children_[1]->SetBox(title_box);
    +
    162 }
    +
    163 box.x_min++;
    +
    164 box.x_max--;
    +
    165 box.y_min++;
    +
    166 box.y_max--;
    +
    167 children_[0]->SetBox(box);
    +
    168 }
    +
    169
    +
    170 void Render(Screen& screen) override {
    +
    171 // Draw content.
    +
    172 children_[0]->Render(screen);
    +
    173
    +
    174 // Draw the border.
    +
    175 if (box_.x_min >= box_.x_max || box_.y_min >= box_.y_max) {
    +
    176 return;
    +
    177 }
    +
    178
    +
    179 screen.PixelAt(box_.x_min, box_.y_min) = pixel_;
    +
    180 screen.PixelAt(box_.x_max, box_.y_min) = pixel_;
    +
    181 screen.PixelAt(box_.x_min, box_.y_max) = pixel_;
    +
    182 screen.PixelAt(box_.x_max, box_.y_max) = pixel_;
    +
    183
    +
    184 for (int x = box_.x_min + 1; x < box_.x_max; ++x) {
    +
    185 screen.PixelAt(x, box_.y_min) = pixel_;
    +
    186 screen.PixelAt(x, box_.y_max) = pixel_;
    +
    187 }
    +
    188 for (int y = box_.y_min + 1; y < box_.y_max; ++y) {
    +
    189 screen.PixelAt(box_.x_min, y) = pixel_;
    +
    190 screen.PixelAt(box_.x_max, y) = pixel_;
    +
    191 }
    +
    192 }
    +
    193};
    +
    194} // namespace
    +
    195
    +
    196/// @brief Draw a border around the element.
    +
    197/// @ingroup dom
    +
    198/// @see border
    +
    199/// @see borderLight
    +
    200/// @see borderDashed
    +
    201/// @see borderDouble
    +
    202/// @see borderHeavy
    +
    203/// @see borderEmpty
    +
    204/// @see borderRounded
    +
    205/// @see borderStyled
    +
    206/// @see borderWith
    +
    207///
    +
    208/// Add a border around an element
    +
    209///
    +
    210/// ### Example
    +
    211///
    +
    212/// ```cpp
    +
    213/// // Use 'border' as a function...
    +
    214/// Element document = border(text("The element"));
    +
    215///
    +
    216/// // ...Or as a 'pipe'.
    +
    217/// Element document = text("The element") | border;
    +
    218/// ```
    +
    219///
    +
    220/// ### Output
    +
    221///
    +
    222/// ```bash
    +
    223/// ┌───────────┐
    +
    224/// │The element│
    +
    225/// └───────────┘
    +
    226/// ```
    +
    + +
    228 return std::make_shared<Border>(unpack(std::move(child)), ROUNDED);
    +
    229}
    +
    +
    230
    +
    231/// @brief Same as border but with a constant Pixel around the element.
    +
    232/// @ingroup dom
    +
    233/// @see border
    +
    + +
    235 return [pixel](Element child) {
    +
    236 return std::make_shared<BorderPixel>(unpack(std::move(child)), pixel);
    +
    237 };
    +
    238}
    +
    +
    239
    +
    240/// @brief Same as border but with different styles.
    +
    241/// @ingroup dom
    +
    242/// @see border
    +
    + +
    244 return [style](Element child) {
    +
    245 return std::make_shared<Border>(unpack(std::move(child)), style);
    +
    246 };
    +
    247}
    +
    +
    248
    +
    249/// @brief Same as border but with a foreground color.
    +
    250/// @ingroup dom
    +
    251/// @see border
    +
    +
    252Decorator borderStyled(Color foreground_color) {
    +
    253 return [foreground_color](Element child) {
    +
    254 return std::make_shared<Border>(unpack(std::move(child)), ROUNDED,
    +
    255 foreground_color);
    +
    256 };
    +
    257}
    +
    +
    258
    +
    259/// @brief Same as border but with a foreground color and a different style
    +
    260/// @ingroup dom
    +
    261/// @see border
    +
    +
    262Decorator borderStyled(BorderStyle style, Color foreground_color) {
    +
    263 return [style, foreground_color](Element child) {
    +
    264 return std::make_shared<Border>(unpack(std::move(child)), style,
    +
    265 foreground_color);
    +
    266 };
    +
    267}
    +
    +
    268
    +
    269/// @brief Draw a dashed border around the element.
    +
    270/// @ingroup dom
    +
    271/// @see border
    +
    272/// @see borderLight
    +
    273/// @see borderDashed
    +
    274/// @see borderDouble
    +
    275/// @see borderHeavy
    +
    276/// @see borderRounded
    +
    277/// @see borderEmpty
    +
    278/// @see borderStyled
    +
    279/// @see borderWith
    +
    280///
    +
    281/// Add a border around an element
    +
    282///
    +
    283/// ### Example
    +
    284///
    +
    285/// ```cpp
    +
    286/// // Use 'borderDash' as a function...
    +
    287/// Element document = borderDash(text("The element"));
    +
    288///
    +
    289/// // ...Or as a 'pipe'.
    +
    290/// Element document = text("The element") | borderDAsh;
    +
    291/// ```
    +
    292///
    +
    293/// ### Output
    +
    294///
    +
    295/// ```bash
    +
    296/// ┏╍╍╍╍╍╍╍╍╍╍╍╍╍╍┓
    +
    297/// ╏The element ╏
    +
    298/// ┗╍╍╍╍╍╍╍╍╍╍╍╍╍╍┛
    +
    299/// ```
    +
    + +
    301 return std::make_shared<Border>(unpack(std::move(child)), DASHED);
    +
    302}
    +
    +
    303
    +
    304/// @brief Draw a light border around the element.
    +
    305/// @ingroup dom
    +
    306/// @see border
    +
    307/// @see borderLight
    +
    308/// @see borderDashed
    +
    309/// @see borderDouble
    +
    310/// @see borderHeavy
    +
    311/// @see borderRounded
    +
    312/// @see borderEmpty
    +
    313/// @see borderStyled
    +
    314/// @see borderWith
    +
    315///
    +
    316/// Add a border around an element
    +
    317///
    +
    318/// ### Example
    +
    319///
    +
    320/// ```cpp
    +
    321/// // Use 'borderLight' as a function...
    +
    322/// Element document = borderLight(text("The element"));
    +
    323///
    +
    324/// // ...Or as a 'pipe'.
    +
    325/// Element document = text("The element") | borderLight;
    +
    326/// ```
    +
    327///
    +
    328/// ### Output
    +
    329///
    +
    330/// ```bash
    +
    331/// ┌──────────────┐
    +
    332/// │The element │
    +
    333/// └──────────────┘
    +
    334/// ```
    +
    + +
    336 return std::make_shared<Border>(unpack(std::move(child)), LIGHT);
    +
    337}
    +
    +
    338
    +
    339/// @brief Draw a heavy border around the element.
    +
    340/// @ingroup dom
    +
    341/// @see border
    +
    342/// @see borderLight
    +
    343/// @see borderDashed
    +
    344/// @see borderDouble
    +
    345/// @see borderHeavy
    +
    346/// @see borderRounded
    +
    347/// @see borderEmpty
    +
    348/// @see borderStyled
    +
    349/// @see borderWith
    +
    350///
    +
    351/// Add a border around an element
    +
    352///
    +
    353/// ### Example
    +
    354///
    +
    355/// ```cpp
    +
    356/// // Use 'borderHeavy' as a function...
    +
    357/// Element document = borderHeavy(text("The element"));
    +
    358///
    +
    359/// // ...Or as a 'pipe'.
    +
    360/// Element document = text("The element") | borderHeavy;
    +
    361/// ```
    +
    362///
    +
    363/// ### Output
    +
    364///
    +
    365/// ```bash
    +
    366/// ┏━━━━━━━━━━━━━━┓
    +
    367/// ┃The element ┃
    +
    368/// ┗━━━━━━━━━━━━━━┛
    +
    369/// ```
    +
    + +
    371 return std::make_shared<Border>(unpack(std::move(child)), HEAVY);
    +
    372}
    +
    +
    373
    +
    374/// @brief Draw a double border around the element.
    +
    375/// @ingroup dom
    +
    376/// @see border
    +
    377/// @see borderLight
    +
    378/// @see borderDashed
    +
    379/// @see borderDouble
    +
    380/// @see borderHeavy
    +
    381/// @see borderRounded
    +
    382/// @see borderEmpty
    +
    383/// @see borderStyled
    +
    384/// @see borderWith
    +
    385///
    +
    386/// Add a border around an element
    +
    387///
    +
    388/// ### Example
    +
    389///
    +
    390/// ```cpp
    +
    391/// // Use 'borderDouble' as a function...
    +
    392/// Element document = borderDouble(text("The element"));
    +
    393///
    +
    394/// // ...Or as a 'pipe'.
    +
    395/// Element document = text("The element") | borderDouble;
    +
    396/// ```
    +
    397///
    +
    398/// ### Output
    +
    399///
    +
    400/// ```bash
    +
    401/// ╔══════════════╗
    +
    402/// ║The element ║
    +
    403/// ╚══════════════╝
    +
    404/// ```
    +
    + +
    406 return std::make_shared<Border>(unpack(std::move(child)), DOUBLE);
    +
    407}
    +
    +
    408
    +
    409/// @brief Draw a rounded border around the element.
    +
    410/// @ingroup dom
    +
    411/// @see border
    +
    412/// @see borderLight
    +
    413/// @see borderDashed
    +
    414/// @see borderDouble
    +
    415/// @see borderHeavy
    +
    416/// @see borderRounded
    +
    417/// @see borderEmpty
    +
    418/// @see borderStyled
    +
    419/// @see borderWith
    +
    420///
    +
    421/// Add a border around an element
    +
    422///
    +
    423/// ### Example
    +
    424///
    +
    425/// ```cpp
    +
    426/// // Use 'borderRounded' as a function...
    +
    427/// Element document = borderRounded(text("The element"));
    +
    428///
    +
    429/// // ...Or as a 'pipe'.
    +
    430/// Element document = text("The element") | borderRounded;
    +
    431/// ```
    +
    432///
    +
    433/// ### Output
    +
    434///
    +
    435/// ```bash
    +
    436/// ╭──────────────╮
    +
    437/// │The element │
    +
    438/// ╰──────────────╯
    +
    439/// ```
    +
    + +
    441 return std::make_shared<Border>(unpack(std::move(child)), ROUNDED);
    +
    442}
    +
    +
    443
    +
    444/// @brief Draw an empty border around the element.
    +
    445/// @ingroup dom
    +
    446/// @see border
    +
    447/// @see borderLight
    +
    448/// @see borderDashed
    +
    449/// @see borderDouble
    +
    450/// @see borderHeavy
    +
    451/// @see borderRounded
    +
    452/// @see borderEmpty
    +
    453/// @see borderStyled
    +
    454/// @see borderWith
    +
    455///
    +
    456/// Add a border around an element
    +
    457///
    +
    458/// ### Example
    +
    459///
    +
    460/// ```cpp
    +
    461/// // Use 'borderRounded' as a function...
    +
    462/// Element document = borderRounded(text("The element"));
    +
    463///
    +
    464/// // ...Or as a 'pipe'.
    +
    465/// Element document = text("The element") | borderRounded;
    +
    466/// ```
    +
    467///
    +
    468/// ### Output
    +
    469///
    +
    470/// ```bash
    +
    471///
    +
    472/// The element
    +
    473///
    +
    474/// ```
    +
    + +
    476 return std::make_shared<Border>(unpack(std::move(child)), EMPTY);
    +
    477}
    +
    +
    478
    +
    479/// @brief Draw window with a title and a border around the element.
    +
    480/// @param title The title of the window.
    +
    481/// @param content The element to be wrapped.
    +
    482/// @param border The style of the border. Default is ROUNDED.
    +
    483/// @ingroup dom
    +
    484/// @see border
    +
    485///
    +
    486/// ### Example
    +
    487///
    +
    488/// ```cpp
    +
    489/// Element document = window(text("Title"),
    +
    490/// text("content")
    +
    491/// );
    +
    492///
    +
    493/// // With specifying border
    +
    494/// Element document = window(text("Title"),
    +
    495/// text("content"),
    +
    496/// ROUNDED
    +
    497/// );
    +
    498/// ```
    +
    499///
    +
    500/// ### Output
    +
    501///
    +
    502/// ```bash
    +
    503/// ┌Title──┐
    +
    504/// │content│
    +
    505/// └───────┘
    +
    506/// ```
    +
    +
    507Element window(Element title, Element content, BorderStyle border) {
    +
    508 return std::make_shared<Border>(unpack(std::move(content), std::move(title)),
    +
    509 border);
    +
    510}
    +
    +
    511} // namespace ftxui
    + + + +
    virtual void SetBox(Box box)
    Assign a position and a dimension to an element for drawing.
    Definition node.cpp:41
    +
    virtual void ComputeRequirement()
    Compute how much space an element needs.
    Definition node.cpp:20
    +
    Element window(Element title, Element content, BorderStyle border=ROUNDED)
    Draw window with a title and a border around the element.
    +
    Element borderDouble(Element)
    Draw a double border around the element.
    +
    Element borderDashed(Element)
    Draw a dashed border around the element.
    +
    Element borderRounded(Element)
    Draw a rounded border around the element.
    +
    Element borderHeavy(Element)
    Draw a heavy border around the element.
    +
    Element borderLight(Element)
    Draw a light border around the element.
    +
    Decorator borderWith(const Pixel &)
    Same as border but with a constant Pixel around the element.
    +
    Decorator borderStyled(BorderStyle)
    Same as border but with different styles.
    +
    void Render(Screen &screen, const Element &element)
    Display an element on a ftxui::Screen.
    Definition node.cpp:84
    +
    Element border(Element)
    Draw a border around the element.
    +
    Element borderEmpty(Element)
    Draw an empty border around the element.
    +
    BorderStyle
    BorderStyle is an enumeration that represents the different styles of borders that can be applied to ...
    Definition elements.hpp:35
    +
    @ EMPTY
    Definition elements.hpp:41
    +
    @ DOUBLE
    Definition elements.hpp:39
    +
    @ HEAVY
    Definition elements.hpp:38
    +
    @ ROUNDED
    Definition elements.hpp:40
    +
    @ DASHED
    Definition elements.hpp:37
    +
    @ LIGHT
    Definition elements.hpp:36
    +
    Color is a class that represents a color in the terminal user interface.
    Definition color.hpp:22
    +
    A Unicode character and its associated style.
    Definition pixel.hpp:15
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::function< Element(Element)> Decorator
    Definition elements.hpp:24
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    std::vector< Element > Elements
    Definition elements.hpp:23
    + + + + +
    const Charset & charset_
    +
    std::optional< Color > foreground_color_
    +
    +
    + + + + + diff --git a/src_2ftxui_2dom_2canvas_8cpp.html b/src_2ftxui_2dom_2canvas_8cpp.html new file mode 100644 index 000000000..39fd32e9f --- /dev/null +++ b/src_2ftxui_2dom_2canvas_8cpp.html @@ -0,0 +1,233 @@ + + + + + + + + +FTXUI: canvas.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    canvas.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + + + + + + + +

    +Functions

    Element canvas (ConstRef< Canvas > canvas)
     Produce an element from a Canvas, or a reference to a Canvas.
     
    Element canvas (int width, int height, std::function< void(Canvas &)> fn)
     Produce an element drawing a canvas of requested size.
     
    Element canvas (std::function< void(Canvas &)> fn)
     Produce an element drawing a canvas.
     
    +
    +
    + + + + + diff --git a/src_2ftxui_2dom_2canvas_8cpp.js b/src_2ftxui_2dom_2canvas_8cpp.js new file mode 100644 index 000000000..f9c06b5bc --- /dev/null +++ b/src_2ftxui_2dom_2canvas_8cpp.js @@ -0,0 +1,6 @@ +var src_2ftxui_2dom_2canvas_8cpp = +[ + [ "canvas", "src_2ftxui_2dom_2canvas_8cpp.html#a57d7bdf155e190de514a689abb4e9a35", null ], + [ "canvas", "src_2ftxui_2dom_2canvas_8cpp.html#ac781c6530fb74b861af7d52c03ffb2b9", null ], + [ "canvas", "src_2ftxui_2dom_2canvas_8cpp.html#a8bef154e558868d259c52380e1e5ead9", null ] +]; \ No newline at end of file diff --git a/src_2ftxui_2dom_2canvas_8cpp_source.html b/src_2ftxui_2dom_2canvas_8cpp_source.html new file mode 100644 index 000000000..0a8312b15 --- /dev/null +++ b/src_2ftxui_2dom_2canvas_8cpp_source.html @@ -0,0 +1,1315 @@ + + + + + + + + +FTXUI: canvas.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    src/ftxui/dom/canvas.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2021 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    + +
    5
    +
    6#include <algorithm> // for max, min
    +
    7#include <cmath> // for abs
    +
    8#include <cstdint> // for uint8_t
    +
    9#include <cstdlib> // for abs
    +
    10#include <ftxui/screen/color.hpp> // for Color
    +
    11#include <functional> // for function
    +
    12#include <map> // for map
    +
    13#include <memory> // for make_shared
    +
    14#include <utility> // for move, pair
    +
    15#include <vector> // for vector
    +
    16
    +
    17#include "ftxui/dom/elements.hpp" // for Element, canvas
    +
    18#include "ftxui/dom/node.hpp" // for Node
    +
    19#include "ftxui/dom/requirement.hpp" // for Requirement
    +
    20#include "ftxui/screen/box.hpp" // for Box
    +
    21#include "ftxui/screen/image.hpp" // for Image
    +
    22#include "ftxui/screen/pixel.hpp" // for Pixel
    +
    23#include "ftxui/screen/screen.hpp" // for Pixel, Screen
    +
    24#include "ftxui/screen/string.hpp" // for Utf8ToGlyphs
    +
    25#include "ftxui/util/ref.hpp" // for ConstRef
    +
    26
    +
    27namespace ftxui {
    +
    28
    +
    29namespace {
    +
    30
    +
    31// Base UTF8 pattern:
    +
    32// 11100010 10100000 10000000 // empty
    +
    33
    +
    34// Pattern for the individual dots:
    +
    35// ┌──────┬───────┐
    +
    36// │dot1 │ dot4 │
    +
    37// ├──────┼───────┤
    +
    38// │dot2 │ dot5 │
    +
    39// ├──────┼───────┤
    +
    40// │dot3 │ dot6 │
    +
    41// ├──────┼───────┤
    +
    42// │dot0-1│ dot0-2│
    +
    43// └──────┴───────┘
    +
    44// 11100010 10100000 10000001 // dot1
    +
    45// 11100010 10100000 10000010 // dot2
    +
    46// 11100010 10100000 10000100 // dot3
    +
    47// 11100010 10100001 10000000 // dot0-1
    +
    48// 11100010 10100000 10001000 // dot4
    +
    49// 11100010 10100000 10010000 // dot5
    +
    50// 11100010 10100000 10100000 // dot6
    +
    51// 11100010 10100010 10000000 // dot0-2
    +
    52
    +
    53// NOLINTNEXTLINE
    +
    54uint8_t g_map_braille[2][4][2] = {
    +
    55 {
    +
    56 {0b00000000, 0b00000001}, // NOLINT | dot1
    +
    57 {0b00000000, 0b00000010}, // NOLINT | dot2
    +
    58 {0b00000000, 0b00000100}, // NOLINT | dot3
    +
    59 {0b00000001, 0b00000000}, // NOLINT | dot0-1
    +
    60 },
    +
    61 {
    +
    62 {0b00000000, 0b00001000}, // NOLINT | dot4
    +
    63 {0b00000000, 0b00010000}, // NOLINT | dot5
    +
    64 {0b00000000, 0b00100000}, // NOLINT | dot6
    +
    65 {0b00000010, 0b00000000}, // NOLINT | dot0-2
    +
    66 },
    +
    67};
    +
    68
    +
    69// NOLINTNEXTLINE
    +
    70std::vector<std::string> g_map_block = {
    +
    71 " ", "▘", "▖", "▌", "▝", "▀", "▞", "▛",
    +
    72 "▗", "▚", "▄", "▙", "▐", "▜", "▟", "█",
    +
    73};
    +
    74
    +
    75// NOLINTNEXTLINE
    +
    76const std::map<std::string, uint8_t> g_map_block_inversed = {
    +
    77 {" ", 0b0000}, {"▘", 0b0001}, {"▖", 0b0010}, {"▌", 0b0011},
    +
    78 {"▝", 0b0100}, {"▀", 0b0101}, {"▞", 0b0110}, {"▛", 0b0111},
    +
    79 {"▗", 0b1000}, {"▚", 0b1001}, {"▄", 0b1010}, {"▙", 0b1011},
    +
    80 {"▐", 0b1100}, {"▜", 0b1101}, {"▟", 0b1110}, {"█", 0b1111},
    +
    81};
    +
    82
    +
    83constexpr auto nostyle = [](Pixel& /*pixel*/) {};
    +
    84
    +
    85} // namespace
    +
    86
    +
    87/// @brief Constructor.
    +
    88/// @param width the width of the canvas. A cell is a 2x4 braille dot.
    +
    89/// @param height the height of the canvas. A cell is a 2x4 braille dot.
    +
    +
    90Canvas::Canvas(int width, int height)
    +
    91 : width_(width),
    +
    92 height_(height),
    +
    93 storage_(width_ * height_ / 8 /* NOLINT */) {}
    +
    +
    94
    +
    95/// @brief Get the content of a cell.
    +
    96/// @param x the x coordinate of the cell.
    +
    97/// @param y the y coordinate of the cell.
    +
    +
    98Pixel Canvas::GetPixel(int x, int y) const {
    +
    99 auto it = storage_.find(XY{x, y});
    +
    100 return (it == storage_.end()) ? Pixel() : it->second.content;
    +
    101}
    +
    +
    102
    +
    103/// @brief Draw a braille dot.
    +
    104/// @param x the x coordinate of the dot.
    +
    105/// @param y the y coordinate of the dot.
    +
    106/// @param value whether the dot is filled or not.
    +
    +
    107void Canvas::DrawPoint(int x, int y, bool value) {
    +
    108 DrawPoint(x, y, value, [](Pixel& /*pixel*/) {});
    +
    109}
    +
    +
    110
    +
    111/// @brief Draw a braille dot.
    +
    112/// @param x the x coordinate of the dot.
    +
    113/// @param y the y coordinate of the dot.
    +
    114/// @param value whether the dot is filled or not.
    +
    115/// @param color the color of the dot.
    +
    +
    116void Canvas::DrawPoint(int x, int y, bool value, const Color& color) {
    +
    117 DrawPoint(x, y, value, [color](Pixel& p) { p.foreground_color = color; });
    +
    118}
    +
    +
    119
    +
    120/// @brief Draw a braille dot.
    +
    121/// @param x the x coordinate of the dot.
    +
    122/// @param y the y coordinate of the dot.
    +
    123/// @param value whether the dot is filled or not.
    +
    124/// @param style the style of the cell.
    +
    +
    125void Canvas::DrawPoint(int x, int y, bool value, const Stylizer& style) {
    +
    126 Style(x, y, style);
    +
    127 if (value) {
    +
    128 DrawPointOn(x, y);
    +
    129 } else {
    +
    130 DrawPointOff(x, y);
    +
    131 }
    +
    132}
    +
    +
    133
    +
    134/// @brief Draw a braille dot.
    +
    135/// @param x the x coordinate of the dot.
    +
    136/// @param y the y coordinate of the dot.
    +
    +
    137void Canvas::DrawPointOn(int x, int y) {
    +
    138 if (!IsIn(x, y)) {
    +
    139 return;
    +
    140 }
    +
    141 Cell& cell = storage_[XY{x / 2, y / 4}];
    +
    142 if (cell.type != CellType::kBraille) {
    +
    143 cell.content.character = "⠀"; // 3 bytes.
    +
    144 cell.type = CellType::kBraille;
    +
    145 }
    +
    146
    +
    147 cell.content.character[1] |= g_map_braille[x % 2][y % 4][0]; // NOLINT
    +
    148 cell.content.character[2] |= g_map_braille[x % 2][y % 4][1]; // NOLINT
    +
    149}
    +
    +
    150
    +
    151/// @brief Erase a braille dot.
    +
    152/// @param x the x coordinate of the dot.
    +
    153/// @param y the y coordinate of the dot.
    +
    +
    154void Canvas::DrawPointOff(int x, int y) {
    +
    155 if (!IsIn(x, y)) {
    +
    156 return;
    +
    157 }
    +
    158 Cell& cell = storage_[XY{x / 2, y / 4}];
    +
    159 if (cell.type != CellType::kBraille) {
    +
    160 cell.content.character = "⠀"; // 3 byt
    +
    161 cell.type = CellType::kBraille;
    +
    162 }
    +
    163
    +
    164 cell.content.character[1] &= ~(g_map_braille[x % 2][y % 4][0]); // NOLINT
    +
    165 cell.content.character[2] &= ~(g_map_braille[x % 2][y % 4][1]); // NOLINT
    +
    166}
    +
    +
    167
    +
    168/// @brief Toggle a braille dot. A filled one will be erased, and the other will
    +
    169/// be drawn.
    +
    170/// @param x the x coordinate of the dot.
    +
    171/// @param y the y coordinate of the dot.
    +
    +
    172void Canvas::DrawPointToggle(int x, int y) {
    +
    173 if (!IsIn(x, y)) {
    +
    174 return;
    +
    175 }
    +
    176 Cell& cell = storage_[XY{x / 2, y / 4}];
    +
    177 if (cell.type != CellType::kBraille) {
    +
    178 cell.content.character = "⠀"; // 3 byt
    +
    179 cell.type = CellType::kBraille;
    +
    180 }
    +
    181
    +
    182 cell.content.character[1] ^= g_map_braille[x % 2][y % 4][0]; // NOLINT
    +
    183 cell.content.character[2] ^= g_map_braille[x % 2][y % 4][1]; // NOLINT
    +
    184}
    +
    +
    185
    +
    186/// @brief Draw a line made of braille dots.
    +
    187/// @param x1 the x coordinate of the first dot.
    +
    188/// @param y1 the y coordinate of the first dot.
    +
    189/// @param x2 the x coordinate of the second dot.
    +
    190/// @param y2 the y coordinate of the second dot.
    +
    +
    191void Canvas::DrawPointLine(int x1, int y1, int x2, int y2) {
    +
    192 DrawPointLine(x1, y1, x2, y2, [](Pixel& /*pixel*/) {});
    +
    193}
    +
    +
    194
    +
    195/// @brief Draw a line made of braille dots.
    +
    196/// @param x1 the x coordinate of the first dot.
    +
    197/// @param y1 the y coordinate of the first dot.
    +
    198/// @param x2 the x coordinate of the second dot.
    +
    199/// @param y2 the y coordinate of the second dot.
    +
    200/// @param color the color of the line.
    +
    +
    201void Canvas::DrawPointLine(int x1, int y1, int x2, int y2, const Color& color) {
    +
    202 DrawPointLine(x1, y1, x2, y2,
    +
    203 [color](Pixel& p) { p.foreground_color = color; });
    +
    204}
    +
    +
    205
    +
    206/// @brief Draw a line made of braille dots.
    +
    207/// @param x1 the x coordinate of the first dot.
    +
    208/// @param y1 the y coordinate of the first dot.o
    +
    209/// @param x2 the x coordinate of the second dot.
    +
    210/// @param y2 the y coordinate of the second dot.
    +
    211/// @param style the style of the line.
    +
    + +
    213 int y1,
    +
    214 int x2,
    +
    215 int y2,
    +
    216 const Stylizer& style) {
    +
    217 const int dx = std::abs(x2 - x1);
    +
    218 const int dy = std::abs(y2 - y1);
    +
    219 const int sx = x1 < x2 ? 1 : -1;
    +
    220 const int sy = y1 < y2 ? 1 : -1;
    +
    221 const int length = std::max(dx, dy);
    +
    222
    +
    223 if (!IsIn(x1, y1) && !IsIn(x2, y2)) {
    +
    224 return;
    +
    225 }
    +
    226 if (dx + dx > width_ * height_) {
    +
    227 return;
    +
    228 }
    +
    229
    +
    230 int error = dx - dy;
    +
    231 for (int i = 0; i < length; ++i) {
    +
    232 DrawPoint(x1, y1, true, style);
    +
    233 if (2 * error >= -dy) {
    +
    234 error -= dy;
    +
    235 x1 += sx;
    +
    236 }
    +
    237 if (2 * error <= dx) {
    +
    238 error += dx;
    +
    239 y1 += sy;
    +
    240 }
    +
    241 }
    +
    242 DrawPoint(x2, y2, true, style);
    +
    243}
    +
    +
    244
    +
    245/// @brief Draw a circle made of braille dots.
    +
    246/// @param x the x coordinate of the center of the circle.
    +
    247/// @param y the y coordinate of the center of the circle.
    +
    248/// @param radius the radius of the circle.
    +
    +
    249void Canvas::DrawPointCircle(int x, int y, int radius) {
    +
    250 DrawPointCircle(x, y, radius, [](Pixel& /*pixel*/) {});
    +
    251}
    +
    +
    252
    +
    253/// @brief Draw a circle made of braille dots.
    +
    254/// @param x the x coordinate of the center of the circle.
    +
    255/// @param y the y coordinate of the center of the circle.
    +
    256/// @param radius the radius of the circle.
    +
    257/// @param color the color of the circle.
    +
    +
    258void Canvas::DrawPointCircle(int x, int y, int radius, const Color& color) {
    +
    259 DrawPointCircle(x, y, radius,
    +
    260 [color](Pixel& p) { p.foreground_color = color; });
    +
    261}
    +
    +
    262
    +
    263/// @brief Draw a circle made of braille dots.
    +
    264/// @param x the x coordinate of the center of the circle.
    +
    265/// @param y the y coordinate of the center of the circle.
    +
    266/// @param radius the radius of the circle.
    +
    267/// @param style the style of the circle.
    +
    +
    268void Canvas::DrawPointCircle(int x, int y, int radius, const Stylizer& style) {
    +
    269 DrawPointEllipse(x, y, radius, radius, style);
    +
    270}
    +
    +
    271
    +
    272/// @brief Draw a filled circle made of braille dots.
    +
    273/// @param x the x coordinate of the center of the circle.
    +
    274/// @param y the y coordinate of the center of the circle.
    +
    275/// @param radius the radius of the circle.
    +
    +
    276void Canvas::DrawPointCircleFilled(int x, int y, int radius) {
    +
    277 DrawPointCircleFilled(x, y, radius, [](Pixel& /*pixel*/) {});
    +
    278}
    +
    +
    279
    +
    280/// @brief Draw a filled circle made of braille dots.
    +
    281/// @param x the x coordinate of the center of the circle.
    +
    282/// @param y the y coordinate of the center of the circle.
    +
    283/// @param radius the radius of the circle.
    +
    284/// @param color the color of the circle.
    +
    + +
    286 int y,
    +
    287 int radius,
    +
    288 const Color& color) {
    +
    289 DrawPointCircleFilled(x, y, radius,
    +
    290 [color](Pixel& p) { p.foreground_color = color; });
    +
    291}
    +
    +
    292
    +
    293/// @brief Draw a filled circle made of braille dots.
    +
    294/// @param x the x coordinate of the center of the circle.
    +
    295/// @param y the y coordinate of the center of the circle.
    +
    296/// @param radius the radius of the circle.
    +
    297/// @param style the style of the circle.
    +
    + +
    299 int y,
    +
    300 int radius,
    +
    301 const Stylizer& style) {
    +
    302 DrawPointEllipseFilled(x, y, radius, radius, style);
    +
    303}
    +
    +
    304
    +
    305/// @brief Draw an ellipse made of braille dots.
    +
    306/// @param x the x coordinate of the center of the ellipse.
    +
    307/// @param y the y coordinate of the center of the ellipse.
    +
    308/// @param r1 the radius of the ellipse along the x axis.
    +
    309/// @param r2 the radius of the ellipse along the y axis.
    +
    +
    310void Canvas::DrawPointEllipse(int x, int y, int r1, int r2) {
    +
    311 DrawPointEllipse(x, y, r1, r2, [](Pixel& /*pixel*/) {});
    +
    312}
    +
    +
    313
    +
    314/// @brief Draw an ellipse made of braille dots.
    +
    315/// @param x the x coordinate of the center of the ellipse.
    +
    316/// @param y the y coordinate of the center of the ellipse.
    +
    317/// @param r1 the radius of the ellipse along the x axis.
    +
    318/// @param r2 the radius of the ellipse along the y axis.
    +
    319/// @param color the color of the ellipse.
    +
    + +
    321 int y,
    +
    322 int r1,
    +
    323 int r2,
    +
    324 const Color& color) {
    +
    325 DrawPointEllipse(x, y, r1, r2,
    +
    326 [color](Pixel& p) { p.foreground_color = color; });
    +
    327}
    +
    +
    328
    +
    329/// @brief Draw an ellipse made of braille dots.
    +
    330/// @param x1 the x coordinate of the center of the ellipse.
    +
    331/// @param y1 the y coordinate of the center of the ellipse.
    +
    332/// @param r1 the radius of the ellipse along the x axis.
    +
    333/// @param r2 the radius of the ellipse along the y axis.
    +
    334/// @param s the style of the ellipse.
    +
    + +
    336 int y1,
    +
    337 int r1,
    +
    338 int r2,
    +
    339 const Stylizer& s) {
    +
    340 int x = -r1;
    +
    341 int y = 0;
    +
    342 int e2 = r2;
    +
    343 int dx = (1 + 2 * x) * e2 * e2;
    +
    344 int dy = x * x;
    +
    345 int err = dx + dy;
    +
    346
    +
    347 do { // NOLINT
    +
    348 DrawPoint(x1 - x, y1 + y, true, s);
    +
    349 DrawPoint(x1 + x, y1 + y, true, s);
    +
    350 DrawPoint(x1 + x, y1 - y, true, s);
    +
    351 DrawPoint(x1 - x, y1 - y, true, s);
    +
    352 e2 = 2 * err;
    +
    353 if (e2 >= dx) {
    +
    354 x++;
    +
    355 err += dx += 2 * r2 * r2;
    +
    356 }
    +
    357 if (e2 <= dy) {
    +
    358 y++;
    +
    359 err += dy += 2 * r1 * r1;
    +
    360 }
    +
    361 } while (x <= 0);
    +
    362
    +
    363 while (y++ < r2) {
    +
    364 DrawPoint(x1, y1 + y, true, s);
    +
    365 DrawPoint(x1, y1 - y, true, s);
    +
    366 }
    +
    367}
    +
    +
    368
    +
    369/// @brief Draw a filled ellipse made of braille dots.
    +
    370/// @param x1 the x coordinate of the center of the ellipse.
    +
    371/// @param y1 the y coordinate of the center of the ellipse.
    +
    372/// @param r1 the radius of the ellipse along the x axis.
    +
    373/// @param r2 the radius of the ellipse along the y axis.
    +
    +
    374void Canvas::DrawPointEllipseFilled(int x1, int y1, int r1, int r2) {
    +
    375 DrawPointEllipseFilled(x1, y1, r1, r2, [](Pixel& /*pixel*/) {});
    +
    376}
    +
    +
    377
    +
    378/// @brief Draw a filled ellipse made of braille dots.
    +
    379/// @param x1 the x coordinate of the center of the ellipse.
    +
    380/// @param y1 the y coordinate of the center of the ellipse.
    +
    381/// @param r1 the radius of the ellipse along the x axis.
    +
    382/// @param r2 the radius of the ellipse along the y axis.
    +
    383/// @param color the color of the ellipse.
    +
    + +
    385 int y1,
    +
    386 int r1,
    +
    387 int r2,
    +
    388 const Color& color) {
    +
    389 DrawPointEllipseFilled(x1, y1, r1, r2,
    +
    390 [color](Pixel& p) { p.foreground_color = color; });
    +
    391}
    +
    +
    392
    +
    393/// @brief Draw a filled ellipse made of braille dots.
    +
    394/// @param x1 the x coordinate of the center of the ellipse.
    +
    395/// @param y1 the y coordinate of the center of the ellipse.
    +
    396/// @param r1 the radius of the ellipse along the x axis.
    +
    397/// @param r2 the radius of the ellipse along the y axis.
    +
    398/// @param s the style of the ellipse.
    +
    + +
    400 int y1,
    +
    401 int r1,
    +
    402 int r2,
    +
    403 const Stylizer& s) {
    +
    404 int x = -r1;
    +
    405 int y = 0;
    +
    406 int e2 = r2;
    +
    407 int dx = (1 + 2 * x) * e2 * e2;
    +
    408 int dy = x * x;
    +
    409 int err = dx + dy;
    +
    410
    +
    411 do { // NOLINT
    +
    412 for (int xx = x1 + x; xx <= x1 - x; ++xx) {
    +
    413 DrawPoint(xx, y1 + y, true, s);
    +
    414 DrawPoint(xx, y1 - y, true, s);
    +
    415 }
    +
    416 e2 = 2 * err;
    +
    417 if (e2 >= dx) {
    +
    418 x++;
    +
    419 err += dx += 2 * r2 * r2;
    +
    420 }
    +
    421 if (e2 <= dy) {
    +
    422 y++;
    +
    423 err += dy += 2 * r1 * r1;
    +
    424 }
    +
    425 } while (x <= 0);
    +
    426
    +
    427 while (y++ < r2) {
    +
    428 for (int yy = y1 - y; yy <= y1 + y; ++yy) {
    +
    429 DrawPoint(x1, yy, true, s);
    +
    430 }
    +
    431 }
    +
    432}
    +
    +
    433
    +
    434/// @brief Draw a block.
    +
    435/// @param x the x coordinate of the block.
    +
    436/// @param y the y coordinate of the block.
    +
    437/// @param value whether the block is filled or not.
    +
    +
    438void Canvas::DrawBlock(int x, int y, bool value) {
    +
    439 DrawBlock(x, y, value, [](Pixel& /*pixel*/) {});
    +
    440}
    +
    +
    441
    +
    442/// @brief Draw a block.
    +
    443/// @param x the x coordinate of the block.
    +
    444/// @param y the y coordinate of the block.
    +
    445/// @param value whether the block is filled or not.
    +
    446/// @param color the color of the block.
    +
    +
    447void Canvas::DrawBlock(int x, int y, bool value, const Color& color) {
    +
    448 DrawBlock(x, y, value, [color](Pixel& p) { p.foreground_color = color; });
    +
    449}
    +
    +
    450
    +
    451/// @brief Draw a block.
    +
    452/// @param x the x coordinate of the block.
    +
    453/// @param y the y coordinate of the block.
    +
    454/// @param value whether the block is filled or not.
    +
    455/// @param style the style of the block.
    +
    +
    456void Canvas::DrawBlock(int x, int y, bool value, const Stylizer& style) {
    +
    457 Style(x, y, style);
    +
    458 if (value) {
    +
    459 DrawBlockOn(x, y);
    +
    460 } else {
    +
    461 DrawBlockOff(x, y);
    +
    462 }
    +
    463}
    +
    +
    464
    +
    465/// @brief Draw a block.
    +
    466/// @param x the x coordinate of the block.
    +
    467/// @param y the y coordinate of the block.
    +
    +
    468void Canvas::DrawBlockOn(int x, int y) {
    +
    469 if (!IsIn(x, y)) {
    +
    470 return;
    +
    471 }
    +
    472 y /= 2;
    +
    473 Cell& cell = storage_[XY{x / 2, y / 2}];
    +
    474 if (cell.type != CellType::kBlock) {
    +
    475 cell.content.character = " ";
    +
    476 cell.type = CellType::kBlock;
    +
    477 }
    +
    478
    +
    479 const uint8_t bit = (x % 2) * 2 + y % 2;
    +
    480 uint8_t value = g_map_block_inversed.at(cell.content.character);
    +
    481 value |= 1U << bit;
    +
    482 cell.content.character = g_map_block[value];
    +
    483}
    +
    +
    484
    +
    485/// @brief Erase a block.
    +
    486/// @param x the x coordinate of the block.
    +
    487/// @param y the y coordinate of the block.
    +
    +
    488void Canvas::DrawBlockOff(int x, int y) {
    +
    489 if (!IsIn(x, y)) {
    +
    490 return;
    +
    491 }
    +
    492 Cell& cell = storage_[XY{x / 2, y / 4}];
    +
    493 if (cell.type != CellType::kBlock) {
    +
    494 cell.content.character = " ";
    +
    495 cell.type = CellType::kBlock;
    +
    496 }
    +
    497 y /= 2;
    +
    498
    +
    499 const uint8_t bit = (y % 2) * 2 + x % 2;
    +
    500 uint8_t value = g_map_block_inversed.at(cell.content.character);
    +
    501 value &= ~(1U << bit);
    +
    502 cell.content.character = g_map_block[value];
    +
    503}
    +
    +
    504
    +
    505/// @brief Toggle a block. If it is filled, it will be erased. If it is empty,
    +
    506/// it will be filled.
    +
    507/// @param x the x coordinate of the block.
    +
    508/// @param y the y coordinate of the block.
    +
    +
    509void Canvas::DrawBlockToggle(int x, int y) {
    +
    510 if (!IsIn(x, y)) {
    +
    511 return;
    +
    512 }
    +
    513 Cell& cell = storage_[XY{x / 2, y / 4}];
    +
    514 if (cell.type != CellType::kBlock) {
    +
    515 cell.content.character = " ";
    +
    516 cell.type = CellType::kBlock;
    +
    517 }
    +
    518 y /= 2;
    +
    519
    +
    520 const uint8_t bit = (y % 2) * 2 + x % 2;
    +
    521 uint8_t value = g_map_block_inversed.at(cell.content.character);
    +
    522 value ^= 1U << bit;
    +
    523 cell.content.character = g_map_block[value];
    +
    524}
    +
    +
    525
    +
    526/// @brief Draw a line made of block characters.
    +
    527/// @param x1 the x coordinate of the first point of the line.
    +
    528/// @param y1 the y coordinate of the first point of the line.
    +
    529/// @param x2 the x coordinate of the second point of the line.
    +
    530/// @param y2 the y coordinate of the second point of the line.
    +
    +
    531void Canvas::DrawBlockLine(int x1, int y1, int x2, int y2) {
    +
    532 DrawBlockLine(x1, y1, x2, y2, [](Pixel& /*pixel*/) {});
    +
    533}
    +
    +
    534
    +
    535/// @brief Draw a line made of block characters.
    +
    536/// @param x1 the x coordinate of the first point of the line.
    +
    537/// @param y1 the y coordinate of the first point of the line.
    +
    538/// @param x2 the x coordinate of the second point of the line.
    +
    539/// @param y2 the y coordinate of the second point of the line.
    +
    540/// @param color the color of the line.
    +
    +
    541void Canvas::DrawBlockLine(int x1, int y1, int x2, int y2, const Color& color) {
    +
    542 DrawBlockLine(x1, y1, x2, y2,
    +
    543 [color](Pixel& p) { p.foreground_color = color; });
    +
    544}
    +
    +
    545
    +
    546/// @brief Draw a line made of block characters.
    +
    547/// @param x1 the x coordinate of the first point of the line.
    +
    548/// @param y1 the y coordinate of the first point of the line.
    +
    549/// @param x2 the x coordinate of the second point of the line.
    +
    550/// @param y2 the y coordinate of the second point of the line.
    +
    551/// @param style the style of the line.
    +
    + +
    553 int y1,
    +
    554 int x2,
    +
    555 int y2,
    +
    556 const Stylizer& style) {
    +
    557 y1 /= 2;
    +
    558 y2 /= 2;
    +
    559
    +
    560 const int dx = std::abs(x2 - x1);
    +
    561 const int dy = std::abs(y2 - y1);
    +
    562 const int sx = x1 < x2 ? 1 : -1;
    +
    563 const int sy = y1 < y2 ? 1 : -1;
    +
    564 const int length = std::max(dx, dy);
    +
    565
    +
    566 if (!IsIn(x1, y1) && !IsIn(x2, y2)) {
    +
    567 return;
    +
    568 }
    +
    569 if (dx + dx > width_ * height_) {
    +
    570 return;
    +
    571 }
    +
    572
    +
    573 int error = dx - dy;
    +
    574 for (int i = 0; i < length; ++i) {
    +
    575 DrawBlock(x1, y1 * 2, true, style);
    +
    576 if (2 * error >= -dy) {
    +
    577 error -= dy;
    +
    578 x1 += sx;
    +
    579 }
    +
    580 if (2 * error <= dx) {
    +
    581 error += dx;
    +
    582 y1 += sy;
    +
    583 }
    +
    584 }
    +
    585 DrawBlock(x2, y2 * 2, true, style);
    +
    586}
    +
    +
    587
    +
    588/// @brief Draw a circle made of block characters.
    +
    589/// @param x the x coordinate of the center of the circle.
    +
    590/// @param y the y coordinate of the center of the circle.
    +
    591/// @param radius the radius of the circle.
    +
    +
    592void Canvas::DrawBlockCircle(int x, int y, int radius) {
    +
    593 DrawBlockCircle(x, y, radius, nostyle);
    +
    594}
    +
    +
    595
    +
    596/// @brief Draw a circle made of block characters.
    +
    597/// @param x the x coordinate of the center of the circle.
    +
    598/// @param y the y coordinate of the center of the circle.
    +
    599/// @param radius the radius of the circle.
    +
    600/// @param color the color of the circle.
    +
    +
    601void Canvas::DrawBlockCircle(int x, int y, int radius, const Color& color) {
    +
    602 DrawBlockCircle(x, y, radius,
    +
    603 [color](Pixel& p) { p.foreground_color = color; });
    +
    604}
    +
    +
    605
    +
    606/// @brief Draw a circle made of block characters.
    +
    607/// @param x the x coordinate of the center of the circle.
    +
    608/// @param y the y coordinate of the center of the circle.
    +
    609/// @param radius the radius of the circle.
    +
    610/// @param style the style of the circle.
    +
    +
    611void Canvas::DrawBlockCircle(int x, int y, int radius, const Stylizer& style) {
    +
    612 DrawBlockEllipse(x, y, radius, radius, style);
    +
    613}
    +
    +
    614
    +
    615/// @brief Draw a filled circle made of block characters.
    +
    616/// @param x the x coordinate of the center of the circle.
    +
    617/// @param y the y coordinate of the center of the circle.
    +
    618/// @param radius the radius of the circle.
    +
    +
    619void Canvas::DrawBlockCircleFilled(int x, int y, int radius) {
    +
    620 DrawBlockCircleFilled(x, y, radius, nostyle);
    +
    621}
    +
    +
    622
    +
    623/// @brief Draw a filled circle made of block characters.
    +
    624/// @param x the x coordinate of the center of the circle.
    +
    625/// @param y the y coordinate of the center of the circle.
    +
    626/// @param radius the radius of the circle.
    +
    627/// @param color the color of the circle.
    +
    + +
    629 int y,
    +
    630 int radius,
    +
    631 const Color& color) {
    +
    632 DrawBlockCircleFilled(x, y, radius,
    +
    633 [color](Pixel& p) { p.foreground_color = color; });
    +
    634}
    +
    +
    635
    +
    636/// @brief Draw a filled circle made of block characters.
    +
    637/// @param x the x coordinate of the center of the circle.
    +
    638/// @param y the y coordinate of the center of the circle.
    +
    639/// @param radius the radius of the circle.
    +
    640/// @param s the style of the circle.
    +
    + +
    642 int y,
    +
    643 int radius,
    +
    644 const Stylizer& s) {
    +
    645 DrawBlockEllipseFilled(x, y, radius, radius, s);
    +
    646}
    +
    +
    647
    +
    648/// @brief Draw an ellipse made of block characters.
    +
    649/// @param x the x coordinate of the center of the ellipse.
    +
    650/// @param y the y coordinate of the center of the ellipse.
    +
    651/// @param r1 the radius of the ellipse along the x axis.
    +
    652/// @param r2 the radius of the ellipse along the y axis.
    +
    +
    653void Canvas::DrawBlockEllipse(int x, int y, int r1, int r2) {
    +
    654 DrawBlockEllipse(x, y, r1, r2, nostyle);
    +
    655}
    +
    +
    656
    +
    657/// @brief Draw an ellipse made of block characters.
    +
    658/// @param x the x coordinate of the center of the ellipse.
    +
    659/// @param y the y coordinate of the center of the ellipse.
    +
    660/// @param r1 the radius of the ellipse along the x axis.
    +
    661/// @param r2 the radius of the ellipse along the y axis.
    +
    662/// @param color the color of the ellipse.
    +
    + +
    664 int y,
    +
    665 int r1,
    +
    666 int r2,
    +
    667 const Color& color) {
    +
    668 DrawBlockEllipse(x, y, r1, r2,
    +
    669 [color](Pixel& p) { p.foreground_color = color; });
    +
    670}
    +
    +
    671
    +
    672/// @brief Draw an ellipse made of block characters.
    +
    673/// @param x1 the x coordinate of the center of the ellipse.
    +
    674/// @param y1 the y coordinate of the center of the ellipse.
    +
    675/// @param r1 the radius of the ellipse along the x axis.
    +
    676/// @param r2 the radius of the ellipse along the y axis.
    +
    677/// @param s the style of the ellipse.
    +
    + +
    679 int y1,
    +
    680 int r1,
    +
    681 int r2,
    +
    682 const Stylizer& s) {
    +
    683 y1 /= 2;
    +
    684 r2 /= 2;
    +
    685 int x = -r1;
    +
    686 int y = 0;
    +
    687 int e2 = r2;
    +
    688 int dx = (1 + 2 * x) * e2 * e2;
    +
    689 int dy = x * x;
    +
    690 int err = dx + dy;
    +
    691
    +
    692 do { // NOLINT
    +
    693 DrawBlock(x1 - x, 2 * (y1 + y), true, s);
    +
    694 DrawBlock(x1 + x, 2 * (y1 + y), true, s);
    +
    695 DrawBlock(x1 + x, 2 * (y1 - y), true, s);
    +
    696 DrawBlock(x1 - x, 2 * (y1 - y), true, s);
    +
    697 e2 = 2 * err;
    +
    698 if (e2 >= dx) {
    +
    699 x++;
    +
    700 err += dx += 2 * r2 * r2;
    +
    701 }
    +
    702 if (e2 <= dy) {
    +
    703 y++;
    +
    704 err += dy += 2 * r1 * r1;
    +
    705 }
    +
    706 } while (x <= 0);
    +
    707
    +
    708 while (y++ < r2) {
    +
    709 DrawBlock(x1, 2 * (y1 + y), true, s);
    +
    710 DrawBlock(x1, 2 * (y1 - y), true, s);
    +
    711 }
    +
    712}
    +
    +
    713
    +
    714/// @brief Draw a filled ellipse made of block characters.
    +
    715/// @param x the x coordinate of the center of the ellipse.
    +
    716/// @param y the y coordinate of the center of the ellipse.
    +
    717/// @param r1 the radius of the ellipse along the x axis.
    +
    718/// @param r2 the radius of the ellipse along the y axis.
    +
    +
    719void Canvas::DrawBlockEllipseFilled(int x, int y, int r1, int r2) {
    +
    720 DrawBlockEllipseFilled(x, y, r1, r2, nostyle);
    +
    721}
    +
    +
    722
    +
    723/// @brief Draw a filled ellipse made of block characters.
    +
    724/// @param x the x coordinate of the center of the ellipse.
    +
    725/// @param y the y coordinate of the center of the ellipse.
    +
    726/// @param r1 the radius of the ellipse along the x axis.
    +
    727/// @param r2 the radius of the ellipse along the y axis.
    +
    728/// @param color the color of the ellipse.
    +
    + +
    730 int y,
    +
    731 int r1,
    +
    732 int r2,
    +
    733 const Color& color) {
    +
    734 DrawBlockEllipseFilled(x, y, r1, r2,
    +
    735 [color](Pixel& p) { p.foreground_color = color; });
    +
    736}
    +
    +
    737
    +
    738/// @brief Draw a filled ellipse made of block characters.
    +
    739/// @param x1 the x coordinate of the center of the ellipse.
    +
    740/// @param y1 the y coordinate of the center of the ellipse.
    +
    741/// @param r1 the radius of the ellipse along the x axis.
    +
    742/// @param r2 the radius of the ellipse along the y axis.
    +
    743/// @param s the style of the ellipse.
    +
    + +
    745 int y1,
    +
    746 int r1,
    +
    747 int r2,
    +
    748 const Stylizer& s) {
    +
    749 y1 /= 2;
    +
    750 r2 /= 2;
    +
    751 int x = -r1;
    +
    752 int y = 0;
    +
    753 int e2 = r2;
    +
    754 int dx = (1 + 2 * x) * e2 * e2;
    +
    755 int dy = x * x;
    +
    756 int err = dx + dy;
    +
    757
    +
    758 do { // NOLINT
    +
    759 for (int xx = x1 + x; xx <= x1 - x; ++xx) {
    +
    760 DrawBlock(xx, 2 * (y1 + y), true, s);
    +
    761 DrawBlock(xx, 2 * (y1 - y), true, s);
    +
    762 }
    +
    763 e2 = 2 * err;
    +
    764 if (e2 >= dx) {
    +
    765 x++;
    +
    766 err += dx += 2 * r2 * r2;
    +
    767 }
    +
    768 if (e2 <= dy) {
    +
    769 y++;
    +
    770 err += dy += 2 * r1 * r1;
    +
    771 }
    +
    772 } while (x <= 0);
    +
    773
    +
    774 while (y++ < r2) {
    +
    775 for (int yy = y1 + y; yy <= y1 - y; ++yy) {
    +
    776 DrawBlock(x1, 2 * yy, true, s);
    +
    777 }
    +
    778 }
    +
    779}
    +
    +
    780
    +
    781/// @brief Draw a piece of text.
    +
    782/// @param x the x coordinate of the text.
    +
    783/// @param y the y coordinate of the text.
    +
    784/// @param value the text to draw.
    +
    +
    785void Canvas::DrawText(int x, int y, const std::string& value) {
    +
    786 DrawText(x, y, value, nostyle);
    +
    787}
    +
    +
    788
    +
    789/// @brief Draw a piece of text.
    +
    790/// @param x the x coordinate of the text.
    +
    791/// @param y the y coordinate of the text.
    +
    792/// @param value the text to draw.
    +
    793/// @param color the color of the text.
    +
    + +
    795 int y,
    +
    796 const std::string& value,
    +
    797 const Color& color) {
    +
    798 DrawText(x, y, value, [color](Pixel& p) { p.foreground_color = color; });
    +
    799}
    +
    +
    800
    +
    801/// @brief Draw a piece of text.
    +
    802/// @param x the x coordinate of the text.
    +
    803/// @param y the y coordinate of the text.
    +
    804/// @param value the text to draw.
    +
    805/// @param style the style of the text.
    +
    + +
    807 int y,
    +
    808 const std::string& value,
    +
    809 const Stylizer& style) {
    +
    810 for (const auto& it : Utf8ToGlyphs(value)) {
    +
    811 if (!IsIn(x, y)) {
    +
    812 x += 2;
    +
    813 continue;
    +
    814 }
    +
    815 Cell& cell = storage_[XY{x / 2, y / 4}];
    +
    816 cell.type = CellType::kCell;
    +
    817 cell.content.character = it;
    +
    818 style(cell.content);
    +
    819 x += 2;
    +
    820 }
    +
    821}
    +
    +
    822
    +
    823/// @brief Directly draw a predefined pixel at the given coordinate
    +
    824/// @param x the x coordinate of the pixel.
    +
    825/// @param y the y coordinate of the pixel.
    +
    826/// @param p the pixel to draw.
    +
    +
    827void Canvas::DrawPixel(int x, int y, const Pixel& p) {
    +
    828 Cell& cell = storage_[XY{x / 2, y / 4}];
    +
    829 cell.type = CellType::kCell;
    +
    830 cell.content = p;
    +
    831}
    +
    +
    832
    +
    833/// @brief Draw a predefined image, with top-left corner at the given coordinate
    +
    834/// You can supply negative coordinates to align the image however you like -
    +
    835/// only the 'visible' portion will be drawn
    +
    836/// @param x the x coordinate corresponding to the top-left corner of the image.
    +
    837/// @param y the y coordinate corresponding to the top-left corner of the image.
    +
    838/// @param image the image to draw.
    +
    +
    839void Canvas::DrawImage(int x, int y, const Image& image) {
    +
    840 x /= 2;
    +
    841 y /= 4;
    +
    842 const int dx_begin = std::max(0, -x);
    +
    843 const int dy_begin = std::max(0, -y);
    +
    844 const int dx_end = std::min(image.dimx(), width_ - x);
    +
    845 const int dy_end = std::min(image.dimy(), height_ - y);
    +
    846
    +
    847 for (int dy = dy_begin; dy < dy_end; ++dy) {
    +
    848 for (int dx = dx_begin; dx < dx_end; ++dx) {
    +
    849 Cell& cell = storage_[XY{
    +
    850 x + dx,
    +
    851 y + dy,
    +
    852 }];
    +
    853 cell.type = CellType::kCell;
    +
    854 cell.content = image.PixelAt(dx, dy);
    +
    855 }
    +
    856 }
    +
    857}
    +
    +
    858
    +
    859/// @brief Modify a pixel at a given location.
    +
    860/// @param style a function that modifies the pixel.
    +
    +
    861void Canvas::Style(int x, int y, const Stylizer& style) {
    +
    862 if (IsIn(x, y)) {
    +
    863 style(storage_[XY{x / 2, y / 4}].content);
    +
    864 }
    +
    865}
    +
    +
    866
    +
    867namespace {
    +
    868
    +
    869class CanvasNodeBase : public Node {
    +
    870 public:
    +
    871 CanvasNodeBase() = default;
    +
    872
    +
    873 void Render(Screen& screen) override {
    +
    874 const Canvas& c = canvas();
    +
    875 const int y_max = std::min(c.height() / 4, box_.y_max - box_.y_min + 1);
    +
    876 const int x_max = std::min(c.width() / 2, box_.x_max - box_.x_min + 1);
    +
    877 for (int y = 0; y < y_max; ++y) {
    +
    878 for (int x = 0; x < x_max; ++x) {
    +
    879 screen.PixelAt(box_.x_min + x, box_.y_min + y) = c.GetPixel(x, y);
    +
    880 }
    +
    881 }
    +
    882 }
    +
    883
    +
    884 virtual const Canvas& canvas() = 0;
    +
    885};
    +
    886
    +
    887} // namespace
    +
    888
    +
    889/// @brief Produce an element from a Canvas, or a reference to a Canvas.
    +
    890// NOLINTNEXTLINE
    +
    + +
    892 class Impl : public CanvasNodeBase {
    +
    893 public:
    +
    894 explicit Impl(ConstRef<Canvas> canvas) : canvas_(std::move(canvas)) {
    +
    895 requirement_.min_x = (canvas_->width() + 1) / 2;
    +
    896 requirement_.min_y = (canvas_->height() + 3) / 4;
    +
    897 }
    +
    898 const Canvas& canvas() final { return *canvas_; }
    +
    899 ConstRef<Canvas> canvas_;
    +
    900 };
    +
    901 return std::make_shared<Impl>(canvas);
    +
    902}
    +
    +
    903
    +
    904/// @brief Produce an element drawing a canvas of requested size.
    +
    905/// @param width the width of the canvas.
    +
    906/// @param height the height of the canvas.
    +
    907/// @param fn a function drawing the canvas.
    +
    +
    908Element canvas(int width, int height, std::function<void(Canvas&)> fn) {
    +
    909 class Impl : public CanvasNodeBase {
    +
    910 public:
    +
    911 Impl(int width, int height, std::function<void(Canvas&)> fn)
    +
    912 : width_(width), height_(height), fn_(std::move(fn)) {}
    +
    913
    +
    914 void ComputeRequirement() final {
    +
    915 requirement_.min_x = (width_ + 1) / 2;
    +
    916 requirement_.min_y = (height_ + 3) / 4;
    +
    917 }
    +
    918
    +
    919 void Render(Screen& screen) final {
    +
    920 const int width = (box_.x_max - box_.x_min + 1) * 2;
    +
    921 const int height = (box_.y_max - box_.y_min + 1) * 4;
    +
    922 canvas_ = Canvas(width, height);
    +
    923 fn_(canvas_);
    +
    924 CanvasNodeBase::Render(screen);
    +
    925 }
    +
    926
    +
    927 const Canvas& canvas() final { return canvas_; }
    +
    928 Canvas canvas_;
    +
    929 int width_;
    +
    930 int height_;
    +
    931 std::function<void(Canvas&)> fn_;
    +
    932 };
    +
    933 return std::make_shared<Impl>(width, height, std::move(fn));
    +
    934}
    +
    +
    935
    +
    936/// @brief Produce an element drawing a canvas.
    +
    937/// @param fn a function drawing the canvas.
    +
    +
    938Element canvas(std::function<void(Canvas&)> fn) {
    +
    939 const int default_dim = 12;
    +
    940 return canvas(default_dim, default_dim, std::move(fn));
    +
    941}
    +
    +
    942
    +
    943} // namespace ftxui
    + + +
    An adapter. Own or reference an immutable object.
    Definition ref.hpp:17
    + + +
    ButtonOption Style()
    +
    void DrawImage(int x, int y, const Image &)
    Draw a predefined image, with top-left corner at the given coordinate You can supply negative coordin...
    +
    void DrawBlockLine(int x1, int y1, int x2, int y2)
    Draw a line made of block characters.
    +
    void DrawPointEllipseFilled(int x, int y, int r1, int r2)
    Draw a filled ellipse made of braille dots.
    +
    void DrawPointLine(int x1, int y1, int x2, int y2)
    Draw a line made of braille dots.
    +
    void DrawText(int x, int y, const std::string &value)
    Draw a piece of text.
    +
    Canvas()=default
    +
    std::function< void(Pixel &)> Stylizer
    Definition canvas.hpp:48
    +
    void DrawBlockOn(int x, int y)
    Draw a block.
    +
    void DrawPointCircleFilled(int x, int y, int radius)
    Draw a filled circle made of braille dots.
    +
    void DrawPointOn(int x, int y)
    Draw a braille dot.
    +
    void DrawPointOff(int x, int y)
    Erase a braille dot.
    +
    Pixel GetPixel(int x, int y) const
    Get the content of a cell.
    +
    void DrawBlockEllipseFilled(int x1, int y1, int r1, int r2)
    Draw a filled ellipse made of block characters.
    +
    void DrawPointEllipse(int x, int y, int r1, int r2)
    Draw an ellipse made of braille dots.
    +
    void DrawPoint(int x, int y, bool value)
    Draw a braille dot.
    +
    void DrawBlockEllipse(int x1, int y1, int r1, int r2)
    Draw an ellipse made of block characters.
    +
    void DrawBlockToggle(int x, int y)
    Toggle a block. If it is filled, it will be erased. If it is empty, it will be filled.
    +
    void DrawBlockCircle(int x1, int y1, int radius)
    Draw a circle made of block characters.
    +
    void DrawBlockCircleFilled(int x1, int y1, int radius)
    Draw a filled circle made of block characters.
    +
    void DrawPointCircle(int x, int y, int radius)
    Draw a circle made of braille dots.
    +
    int height() const
    Definition canvas.hpp:45
    +
    void DrawBlockOff(int x, int y)
    Erase a block.
    +
    int width() const
    Definition canvas.hpp:44
    +
    void DrawBlock(int x, int y, bool value)
    Draw a block.
    +
    void Style(int x, int y, const Stylizer &style)
    Modify a pixel at a given location.
    +
    void DrawPointToggle(int x, int y)
    Toggle a braille dot. A filled one will be erased, and the other will be drawn.
    +
    void DrawPixel(int x, int y, const Pixel &)
    Directly draw a predefined pixel at the given coordinate.
    +
    Node is the base class for all elements in the DOM tree.
    Definition node.hpp:37
    +
    void Render(Screen &screen, const Element &element)
    Display an element on a ftxui::Screen.
    Definition node.cpp:84
    +
    Decorator color(Color)
    Decorate using a foreground color.
    +
    Canvas is a drawable buffer associated with drawing operations.
    Definition canvas.hpp:38
    +
    int dimy() const
    Definition image.hpp:36
    +
    Color foreground_color
    Definition pixel.hpp:49
    +
    std::string character
    Definition pixel.hpp:45
    +
    Pixel & PixelAt(int x, int y)
    Access a cell (Pixel) at a given position.
    Definition image.cpp:43
    +
    int dimx() const
    Definition image.hpp:35
    +
    Color is a class that represents a color in the terminal user interface.
    Definition color.hpp:22
    +
    A rectangular grid of Pixel.
    Definition image.hpp:17
    +
    A rectangular grid of Pixel.
    Definition screen.hpp:26
    +
    A Unicode character and its associated style.
    Definition pixel.hpp:15
    + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    std::vector< std::string > Utf8ToGlyphs(const std::string &input)
    Definition string.cpp:1358
    +
    Element canvas(ConstRef< Canvas >)
    Produce an element from a Canvas, or a reference to a Canvas.
    + + + + + + +
    +
    + + + + + diff --git a/src_2ftxui_2dom_2dbox_8cpp.html b/src_2ftxui_2dom_2dbox_8cpp.html new file mode 100644 index 000000000..b15a372f8 --- /dev/null +++ b/src_2ftxui_2dom_2dbox_8cpp.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: dbox.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    dbox.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + +

    +Functions

    Element dbox (Elements children_)
     Stack several element on top of each other.
     
    +
    +
    + + + + + diff --git a/src_2ftxui_2dom_2dbox_8cpp.js b/src_2ftxui_2dom_2dbox_8cpp.js new file mode 100644 index 000000000..f2ee8644d --- /dev/null +++ b/src_2ftxui_2dom_2dbox_8cpp.js @@ -0,0 +1,4 @@ +var src_2ftxui_2dom_2dbox_8cpp = +[ + [ "dbox", "src_2ftxui_2dom_2dbox_8cpp.html#ga901ab1b6b2e0e8c295552168ab206441", null ] +]; \ No newline at end of file diff --git a/src_2ftxui_2dom_2dbox_8cpp_source.html b/src_2ftxui_2dom_2dbox_8cpp_source.html new file mode 100644 index 000000000..febfd3024 --- /dev/null +++ b/src_2ftxui_2dom_2dbox_8cpp_source.html @@ -0,0 +1,280 @@ + + + + + + + + +FTXUI: dbox.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    src/ftxui/dom/dbox.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <algorithm> // for max
    +
    5#include <cstddef> // for size_t
    +
    6#include <memory> // for __shared_ptr_access, shared_ptr, make_shared
    +
    7#include <utility> // for move
    +
    8#include <vector>
    +
    9
    +
    10#include "ftxui/dom/elements.hpp" // for Element, Elements, dbox
    +
    11#include "ftxui/dom/node.hpp" // for Node, Elements
    +
    12#include "ftxui/dom/requirement.hpp" // for Requirement
    +
    13#include "ftxui/screen/box.hpp" // for Box
    +
    14#include "ftxui/screen/pixel.hpp" // for Pixel
    +
    15
    +
    16namespace ftxui {
    +
    17
    +
    18namespace {
    +
    19class DBox : public Node {
    +
    20 public:
    +
    21 explicit DBox(Elements children) : Node(std::move(children)) {}
    +
    22
    +
    23 void ComputeRequirement() override {
    +
    24 requirement_ = Requirement{};
    +
    25 for (auto& child : children_) {
    +
    26 child->ComputeRequirement();
    +
    27
    +
    28 // Propagate the focused requirement.
    +
    29 if (requirement_.focused.Prefer(child->requirement().focused)) {
    +
    30 requirement_.focused = child->requirement().focused;
    +
    31 }
    +
    32
    +
    33 // Extend the min_x and min_y to contain all the children
    +
    34 requirement_.min_x =
    +
    35 std::max(requirement_.min_x, child->requirement().min_x);
    +
    36 requirement_.min_y =
    +
    37 std::max(requirement_.min_y, child->requirement().min_y);
    +
    38 }
    +
    39 }
    +
    40
    +
    41 void SetBox(Box box) override {
    +
    42 Node::SetBox(box);
    +
    43
    +
    44 for (auto& child : children_) {
    +
    45 child->SetBox(box);
    +
    46 }
    +
    47 }
    +
    48};
    +
    49} // namespace
    +
    50
    +
    51/// @brief Stack several element on top of each other.
    +
    52/// @param children_ The input element.
    +
    53/// @return The right aligned element.
    +
    54/// @ingroup dom
    +
    +
    55Element dbox(Elements children_) {
    +
    56 return std::make_shared<DBox>(std::move(children_));
    +
    57}
    +
    +
    58
    +
    59} // namespace ftxui
    + + +
    virtual void SetBox(Box box)
    Assign a position and a dimension to an element for drawing.
    Definition node.cpp:41
    +
    Element dbox(Elements)
    Stack several element on top of each other.
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    std::vector< Element > Elements
    Definition elements.hpp:23
    + + + +
    +
    + + + + + diff --git a/src_2ftxui_2dom_2focus_8cpp.html b/src_2ftxui_2dom_2focus_8cpp.html new file mode 100644 index 000000000..eb17771b6 --- /dev/null +++ b/src_2ftxui_2dom_2focus_8cpp.html @@ -0,0 +1,230 @@ + + + + + + + + +FTXUI: focus.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    focus.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + + + + +

    +Functions

    Decorator focusPositionRelative (float x, float y)
     Used inside a frame, this force the view to be scrolled toward a a given position. The position is expressed in proportion of the requested size.
     
    Decorator focusPosition (int x, int y)
     Used inside a frame, this force the view to be scrolled toward a a given position. The position is expressed in the numbers of cells.
     
    +
    +
    + + + + + diff --git a/src_2ftxui_2dom_2focus_8cpp.js b/src_2ftxui_2dom_2focus_8cpp.js new file mode 100644 index 000000000..88c5d8df1 --- /dev/null +++ b/src_2ftxui_2dom_2focus_8cpp.js @@ -0,0 +1,5 @@ +var src_2ftxui_2dom_2focus_8cpp = +[ + [ "focusPositionRelative", "src_2ftxui_2dom_2focus_8cpp.html#ga13befad33cb4125e2143f2af3eddcc71", null ], + [ "focusPosition", "src_2ftxui_2dom_2focus_8cpp.html#ga78447ba1ccb792963ad6d306f4ed1256", null ] +]; \ No newline at end of file diff --git a/src_2ftxui_2dom_2focus_8cpp_source.html b/src_2ftxui_2dom_2focus_8cpp_source.html new file mode 100644 index 000000000..e24deac92 --- /dev/null +++ b/src_2ftxui_2dom_2focus_8cpp_source.html @@ -0,0 +1,324 @@ + + + + + + + + +FTXUI: focus.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    src/ftxui/dom/focus.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <memory> // for make_shared
    +
    5#include <utility> // for move
    +
    6
    +
    7#include "ftxui/dom/elements.hpp" // for Decorator, Element, focusPosition, focusPositionRelative
    +
    8#include "ftxui/dom/node_decorator.hpp" // for NodeDecorator
    +
    9#include "ftxui/dom/requirement.hpp" // for Requirement, Requirement::NORMAL, Requirement::Selection
    +
    10#include "ftxui/screen/box.hpp" // for Box
    +
    11
    +
    12namespace ftxui {
    +
    13
    +
    14/// @brief Used inside a `frame`, this force the view to be scrolled toward a
    +
    15/// a given position. The position is expressed in proportion of the requested
    +
    16/// size.
    +
    17///
    +
    18/// For instance:
    +
    19/// - (0, 0) means that the view is scrolled toward the upper left.
    +
    20/// - (1, 0) means that the view is scrolled toward the upper right.
    +
    21/// - (0, 1) means that the view is scrolled toward the bottom left.
    +
    22/// @ingroup dom
    +
    23///
    +
    24/// ### Example
    +
    25///
    +
    26/// ```cpp
    +
    27/// Element document = huge_document()
    +
    28/// | focusPositionRelative(0.f, 1.f)
    +
    29/// | frame;
    +
    30/// ```
    +
    + +
    32 class Impl : public NodeDecorator {
    +
    33 public:
    +
    34 Impl(Element child, float x, float y)
    +
    35 : NodeDecorator(std::move(child)), x_(x), y_(y) {}
    +
    36
    +
    37 void ComputeRequirement() override {
    +
    38 NodeDecorator::ComputeRequirement();
    +
    39 requirement_.focused.enabled = true;
    +
    40 requirement_.focused.node = this;
    +
    41 requirement_.focused.box.x_min = int(float(requirement_.min_x) * x_);
    +
    42 requirement_.focused.box.y_min = int(float(requirement_.min_y) * y_);
    +
    43 requirement_.focused.box.x_max = int(float(requirement_.min_x) * x_);
    +
    44 requirement_.focused.box.y_max = int(float(requirement_.min_y) * y_);
    +
    45 }
    +
    46
    +
    47 private:
    +
    48 const float x_;
    +
    49 const float y_;
    +
    50 };
    +
    51
    +
    52 return [x, y](Element child) {
    +
    53 return std::make_shared<Impl>(std::move(child), x, y);
    +
    54 };
    +
    55}
    +
    +
    56
    +
    57/// @brief Used inside a `frame`, this force the view to be scrolled toward a
    +
    58/// a given position. The position is expressed in the numbers of cells.
    +
    59///
    +
    60/// @ingroup dom
    +
    61///
    +
    62/// ### Example
    +
    63///
    +
    64/// ```cpp
    +
    65/// Element document = huge_document()
    +
    66/// | focusPosition(10, 10)
    +
    67/// | frame;
    +
    68/// ```
    +
    +
    69Decorator focusPosition(int x, int y) {
    +
    70 class Impl : public NodeDecorator {
    +
    71 public:
    +
    72 Impl(Element child, int x, int y)
    +
    73 : NodeDecorator(std::move(child)), x_(x), y_(y) {}
    +
    74
    +
    75 void ComputeRequirement() override {
    +
    76 NodeDecorator::ComputeRequirement();
    +
    77 requirement_.focused.enabled = false;
    +
    78
    +
    79 Box& box = requirement_.focused.box;
    +
    80 box.x_min = x_;
    +
    81 box.y_min = y_;
    +
    82 box.x_max = x_;
    +
    83 box.y_max = y_;
    +
    84 }
    +
    85
    +
    86 private:
    +
    87 const int x_;
    +
    88 const int y_;
    +
    89 };
    +
    90
    +
    91 return [x, y](Element child) {
    +
    92 return std::make_shared<Impl>(std::move(child), x, y);
    +
    93 };
    +
    94}
    +
    +
    95
    +
    96} // namespace ftxui
    + + + +
    Decorator focusPositionRelative(float x, float y)
    Used inside a frame, this force the view to be scrolled toward a a given position....
    +
    Decorator focusPosition(int x, int y)
    Used inside a frame, this force the view to be scrolled toward a a given position....
    +
    int x_max
    Definition box.hpp:18
    +
    int y_min
    Definition box.hpp:19
    +
    int y_max
    Definition box.hpp:20
    +
    int x_min
    Definition box.hpp:17
    +
    Box is a structure that represents a rectangular area in a 2D space.
    Definition box.hpp:16
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::function< Element(Element)> Decorator
    Definition elements.hpp:24
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    + + +
    +
    + + + + + diff --git a/src_2ftxui_2dom_2gauge_8cpp.html b/src_2ftxui_2dom_2gauge_8cpp.html new file mode 100644 index 000000000..064289898 --- /dev/null +++ b/src_2ftxui_2dom_2gauge_8cpp.html @@ -0,0 +1,242 @@ + + + + + + + + +FTXUI: gauge.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    gauge.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + + + + + + + + + + + + + + + + +

    +Functions

    Element gaugeDirection (float progress, Direction direction)
     Draw a high definition progress bar progressing in specified direction.
     
    Element gaugeRight (float progress)
     Draw a high definition progress bar progressing from left to right.
     
    Element gaugeLeft (float progress)
     Draw a high definition progress bar progressing from right to left.
     
    Element gaugeUp (float progress)
     Draw a high definition progress bar progressing from bottom to top.
     
    Element gaugeDown (float progress)
     Draw a high definition progress bar progressing from top to bottom.
     
    Element gauge (float progress)
     Draw a high definition progress bar.
     
    +
    +
    + + + + + diff --git a/src_2ftxui_2dom_2gauge_8cpp.js b/src_2ftxui_2dom_2gauge_8cpp.js new file mode 100644 index 000000000..4cfc165ea --- /dev/null +++ b/src_2ftxui_2dom_2gauge_8cpp.js @@ -0,0 +1,9 @@ +var src_2ftxui_2dom_2gauge_8cpp = +[ + [ "gaugeDirection", "src_2ftxui_2dom_2gauge_8cpp.html#ga1265cc8a52448e1b98d7abe84a04681e", null ], + [ "gaugeRight", "src_2ftxui_2dom_2gauge_8cpp.html#ga333d781a44885ed4b5ea8444015b86f7", null ], + [ "gaugeLeft", "src_2ftxui_2dom_2gauge_8cpp.html#ga97898b9f77b3edd330eaef22fce7cf2b", null ], + [ "gaugeUp", "src_2ftxui_2dom_2gauge_8cpp.html#ga6e9a97b66c14404a2b3f95f4dae414c2", null ], + [ "gaugeDown", "src_2ftxui_2dom_2gauge_8cpp.html#gafe537f915cac5613261580bae3a8fe33", null ], + [ "gauge", "src_2ftxui_2dom_2gauge_8cpp.html#gae0b8041a60629fd790716038738c93ce", null ] +]; \ No newline at end of file diff --git a/src_2ftxui_2dom_2gauge_8cpp_source.html b/src_2ftxui_2dom_2gauge_8cpp_source.html new file mode 100644 index 000000000..9daee8219 --- /dev/null +++ b/src_2ftxui_2dom_2gauge_8cpp_source.html @@ -0,0 +1,538 @@ + + + + + + + + +FTXUI: gauge.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    src/ftxui/dom/gauge.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <ftxui/dom/direction.hpp> // for Direction, Direction::Down, Direction::Left, Direction::Right, Direction::Up
    +
    5#include <memory> // for allocator, make_shared
    +
    6#include <string> // for string
    +
    7
    +
    8#include "ftxui/dom/elements.hpp" // for Element, gauge, gaugeDirection, gaugeDown, gaugeLeft, gaugeRight, gaugeUp
    +
    9#include "ftxui/dom/node.hpp" // for Node
    +
    10#include "ftxui/dom/requirement.hpp" // for Requirement
    +
    11#include "ftxui/screen/box.hpp" // for Box
    +
    12#include "ftxui/screen/screen.hpp" // for Screen, Pixel
    +
    13
    +
    14namespace ftxui {
    +
    15
    +
    16namespace {
    +
    17// NOLINTNEXTLINE
    +
    18static const std::string charset_horizontal[11] = {
    +
    19#if defined(FTXUI_MICROSOFT_TERMINAL_FALLBACK)
    +
    20 // Microsoft's terminals often use fonts not handling the 8 unicode
    +
    21 // characters for representing the whole gauge. Fallback with less.
    +
    22 " ", " ", " ", " ", "▌", "▌", "▌", "█", "█", "█",
    +
    23#else
    +
    24 " ", " ", "▏", "▎", "▍", "▌", "▋", "▊", "▉", "█",
    +
    25#endif
    +
    26 // An extra character in case when the fuzzer manage to have:
    +
    27 // int(9 * (limit - limit_int) = 9
    +
    28 "█"};
    +
    29
    +
    30// NOLINTNEXTLINE
    +
    31static const std::string charset_vertical[10] = {
    +
    32 "█",
    +
    33 "▇",
    +
    34 "▆",
    +
    35 "▅",
    +
    36 "▄",
    +
    37 "▃",
    +
    38 "▂",
    +
    39 "▁",
    +
    40 " ",
    +
    41 // An extra character in case when the fuzzer manage to have:
    +
    42 // int(8 * (limit - limit_int) = 8
    +
    43 " ",
    +
    44};
    +
    45
    +
    46class Gauge : public Node {
    +
    47 public:
    +
    48 Gauge(float progress, Direction direction)
    +
    49 : progress_(progress), direction_(direction) {
    +
    50 // This handle NAN correctly:
    +
    51 if (!(progress_ > 0.F)) {
    +
    52 progress_ = 0.F;
    +
    53 }
    +
    54 if (!(progress_ < 1.F)) {
    +
    55 progress_ = 1.F;
    +
    56 }
    +
    57 }
    +
    58
    +
    59 void ComputeRequirement() override {
    +
    60 switch (direction_) {
    + +
    62 case Direction::Left:
    +
    63 requirement_.flex_grow_x = 1;
    +
    64 requirement_.flex_grow_y = 0;
    +
    65 requirement_.flex_shrink_x = 1;
    +
    66 requirement_.flex_shrink_y = 0;
    +
    67 break;
    +
    68 case Direction::Up:
    +
    69 case Direction::Down:
    +
    70 requirement_.flex_grow_x = 0;
    +
    71 requirement_.flex_grow_y = 1;
    +
    72 requirement_.flex_shrink_x = 0;
    +
    73 requirement_.flex_shrink_y = 1;
    +
    74 break;
    +
    75 }
    +
    76 requirement_.min_x = 1;
    +
    77 requirement_.min_y = 1;
    +
    78 }
    +
    79
    +
    80 void Render(Screen& screen) override {
    +
    81 switch (direction_) {
    + +
    83 RenderHorizontal(screen, /*invert=*/false);
    +
    84 break;
    +
    85 case Direction::Up:
    +
    86 RenderVertical(screen, /*invert=*/false);
    +
    87 break;
    +
    88 case Direction::Left:
    +
    89 RenderHorizontal(screen, /*invert=*/true);
    +
    90 break;
    +
    91 case Direction::Down:
    +
    92 RenderVertical(screen, /*invert=*/true);
    +
    93 break;
    +
    94 }
    +
    95 }
    +
    96
    +
    97 void RenderHorizontal(Screen& screen, bool invert) {
    +
    98 const int y = box_.y_min;
    +
    99 if (y > box_.y_max) {
    +
    100 return;
    +
    101 }
    +
    102
    +
    103 // Draw the progress bar horizontally.
    +
    104 {
    +
    105 const float progress = invert ? 1.F - progress_ : progress_;
    +
    106 const auto limit =
    +
    107 float(box_.x_min) + progress * float(box_.x_max - box_.x_min + 1);
    +
    108 const int limit_int = static_cast<int>(limit);
    +
    109 int x = box_.x_min;
    +
    110 while (x < limit_int) {
    +
    111 screen.at(x++, y) = charset_horizontal[9]; // NOLINT
    +
    112 }
    +
    113 // NOLINTNEXTLINE
    +
    114 screen.at(x++, y) = charset_horizontal[int(9 * (limit - limit_int))];
    +
    115 while (x <= box_.x_max) {
    +
    116 screen.at(x++, y) = charset_horizontal[0];
    +
    117 }
    +
    118 }
    +
    119
    +
    120 if (invert) {
    +
    121 for (int x = box_.x_min; x <= box_.x_max; x++) {
    +
    122 screen.PixelAt(x, y).inverted ^= true;
    +
    123 }
    +
    124 }
    +
    125 }
    +
    126
    +
    127 void RenderVertical(Screen& screen, bool invert) {
    +
    128 const int x = box_.x_min;
    +
    129 if (x > box_.x_max) {
    +
    130 return;
    +
    131 }
    +
    132
    +
    133 // Draw the progress bar vertically:
    +
    134 {
    +
    135 const float progress = invert ? progress_ : 1.F - progress_;
    +
    136 const float limit =
    +
    137 float(box_.y_min) + progress * float(box_.y_max - box_.y_min + 1);
    +
    138 const int limit_int = static_cast<int>(limit);
    +
    139 int y = box_.y_min;
    +
    140 while (y < limit_int) {
    +
    141 screen.at(x, y++) = charset_vertical[8]; // NOLINT
    +
    142 }
    +
    143 // NOLINTNEXTLINE
    +
    144 screen.at(x, y++) = charset_vertical[int(8 * (limit - limit_int))];
    +
    145 while (y <= box_.y_max) {
    +
    146 screen.at(x, y++) = charset_vertical[0];
    +
    147 }
    +
    148 }
    +
    149
    +
    150 if (invert) {
    +
    151 for (int y = box_.y_min; y <= box_.y_max; y++) {
    +
    152 screen.PixelAt(x, y).inverted ^= true;
    +
    153 }
    +
    154 }
    +
    155 }
    +
    156
    +
    157 private:
    +
    158 float progress_;
    +
    159 Direction direction_;
    +
    160};
    +
    161
    +
    162} // namespace
    +
    163
    +
    164/// @brief Draw a high definition progress bar progressing in specified
    +
    165/// direction.
    +
    166/// @param progress The proportion of the area to be filled. Belong to [0,1].
    +
    167/// @param direction Direction of progress bars progression.
    +
    168/// @ingroup dom
    +
    +
    169Element gaugeDirection(float progress, Direction direction) {
    +
    170 return std::make_shared<Gauge>(progress, direction);
    +
    171}
    +
    +
    172
    +
    173/// @brief Draw a high definition progress bar progressing from left to right.
    +
    174/// @param progress The proportion of the area to be filled. Belong to [0,1].
    +
    175/// @ingroup dom
    +
    176///
    +
    177/// ### Example
    +
    178///
    +
    179/// A gauge. It can be used to represent a progress bar.
    +
    180/// ~~~cpp
    +
    181/// border(gaugeRight(0.5))
    +
    182/// ~~~
    +
    183///
    +
    184/// #### Output
    +
    185///
    +
    186/// ~~~bash
    +
    187/// ┌──────────────────────────────────────────────────────────────────────────┐
    +
    188/// │█████████████████████████████████████ │
    +
    189/// └──────────────────────────────────────────────────────────────────────────┘
    +
    190/// ~~~
    +
    +
    191Element gaugeRight(float progress) {
    +
    192 return gaugeDirection(progress, Direction::Right);
    +
    193}
    +
    +
    194
    +
    195/// @brief Draw a high definition progress bar progressing from right to left.
    +
    196/// @param progress The proportion of the area to be filled. Belong to [0,1].
    +
    197/// @ingroup dom
    +
    198///
    +
    199/// ### Example
    +
    200///
    +
    201/// A gauge. It can be used to represent a progress bar.
    +
    202/// ~~~cpp
    +
    203/// border(gaugeLeft(0.5))
    +
    204/// ~~~
    +
    205///
    +
    206/// #### Output
    +
    207///
    +
    208/// ~~~bash
    +
    209/// ┌──────────────────────────────────────────────────────────────────────────┐
    +
    210/// │ █████████████████████████████████████│
    +
    211/// └──────────────────────────────────────────────────────────────────────────┘
    +
    212/// ~~~
    +
    +
    213Element gaugeLeft(float progress) {
    +
    214 return gaugeDirection(progress, Direction::Left);
    +
    215}
    +
    +
    216
    +
    217/// @brief Draw a high definition progress bar progressing from bottom to top.
    +
    218/// @param progress The proportion of the area to be filled. Belong to [0,1].
    +
    219/// @ingroup dom
    +
    220///
    +
    221/// ### Example
    +
    222///
    +
    223/// A gauge. It can be used to represent a progress bar.
    +
    224/// ~~~cpp
    +
    225/// border(gaugeUp(0.5))
    +
    226/// ~~~
    +
    227///
    +
    228/// #### Output
    +
    229///
    +
    230/// ~~~bash
    +
    231/// ┌─┐
    +
    232/// │ │
    +
    233/// │ │
    +
    234/// │ │
    +
    235/// │ │
    +
    236/// │█│
    +
    237/// │█│
    +
    238/// │█│
    +
    239/// │█│
    +
    240/// └─┘
    +
    241/// ~~~
    +
    +
    242Element gaugeUp(float progress) {
    +
    243 return gaugeDirection(progress, Direction::Up);
    +
    244}
    +
    +
    245
    +
    246/// @brief Draw a high definition progress bar progressing from top to bottom.
    +
    247/// @param progress The proportion of the area to be filled. Belong to [0,1].
    +
    248/// @ingroup dom
    +
    249///
    +
    250/// ### Example
    +
    251///
    +
    252/// A gauge. It can be used to represent a progress bar.
    +
    253/// ~~~cpp
    +
    254/// border(gaugeDown(0.5))
    +
    255/// ~~~
    +
    256///
    +
    257/// #### Output
    +
    258///
    +
    259/// ~~~bash
    +
    260/// ┌─┐
    +
    261/// │█│
    +
    262/// │█│
    +
    263/// │█│
    +
    264/// │█│
    +
    265/// │ │
    +
    266/// │ │
    +
    267/// │ │
    +
    268/// │ │
    +
    269/// └─┘
    +
    270/// ~~~
    +
    +
    271Element gaugeDown(float progress) {
    +
    272 return gaugeDirection(progress, Direction::Down);
    +
    273}
    +
    +
    274
    +
    275/// @brief Draw a high definition progress bar.
    +
    276/// @param progress The proportion of the area to be filled. Belong to [0,1].
    +
    277/// @ingroup dom
    +
    278///
    +
    279/// ### Example
    +
    280///
    +
    281/// A gauge. It can be used to represent a progress bar.
    +
    282/// ~~~cpp
    +
    283/// border(gauge(0.5))
    +
    284/// ~~~
    +
    285///
    +
    286/// #### Output
    +
    287///
    +
    288/// ~~~bash
    +
    289/// ┌──────────────────────────────────────────────────────────────────────────┐
    +
    290/// │█████████████████████████████████████ │
    +
    291/// └──────────────────────────────────────────────────────────────────────────┘
    +
    292/// ~~~
    +
    +
    293Element gauge(float progress) {
    +
    294 return gaugeRight(progress);
    +
    295}
    +
    +
    296
    +
    297} // namespace ftxui
    + + + +
    Element gaugeDirection(float progress, Direction direction)
    Draw a high definition progress bar progressing in specified direction.
    +
    Direction
    Direction is an enumeration that represents the four cardinal directions.
    Definition direction.hpp:13
    +
    Element gaugeRight(float progress)
    Draw a high definition progress bar progressing from left to right.
    +
    Element gaugeUp(float progress)
    Draw a high definition progress bar progressing from bottom to top.
    +
    Element gaugeLeft(float progress)
    Draw a high definition progress bar progressing from right to left.
    +
    void Render(Screen &screen, const Element &element)
    Display an element on a ftxui::Screen.
    Definition node.cpp:84
    +
    Element gauge(float progress)
    Draw a high definition progress bar.
    +
    Element gaugeDown(float progress)
    Draw a high definition progress bar progressing from top to bottom.
    + + + + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    + + + +
    +
    + + + + + diff --git a/src_2ftxui_2dom_2graph_8cpp.html b/src_2ftxui_2dom_2graph_8cpp.html new file mode 100644 index 000000000..bf6f3f8ad --- /dev/null +++ b/src_2ftxui_2dom_2graph_8cpp.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: graph.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    graph.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + +

    +Functions

    Element graph (GraphFunction graph_function)
     Draw a graph using a GraphFunction.
     
    +
    +
    + + + + + diff --git a/src_2ftxui_2dom_2graph_8cpp.js b/src_2ftxui_2dom_2graph_8cpp.js new file mode 100644 index 000000000..ab64dcf4c --- /dev/null +++ b/src_2ftxui_2dom_2graph_8cpp.js @@ -0,0 +1,4 @@ +var src_2ftxui_2dom_2graph_8cpp = +[ + [ "graph", "src_2ftxui_2dom_2graph_8cpp.html#ae78c2b2b147e65701493465f8e3f4d89", null ] +]; \ No newline at end of file diff --git a/src_2ftxui_2dom_2graph_8cpp_source.html b/src_2ftxui_2dom_2graph_8cpp_source.html new file mode 100644 index 000000000..3fd506475 --- /dev/null +++ b/src_2ftxui_2dom_2graph_8cpp_source.html @@ -0,0 +1,296 @@ + + + + + + + + +FTXUI: graph.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    src/ftxui/dom/graph.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <functional> // for function
    +
    5#include <memory> // for allocator, make_shared
    +
    6#include <string> // for string
    +
    7#include <utility> // for move
    +
    8#include <vector> // for vector
    +
    9
    +
    10#include "ftxui/dom/elements.hpp" // for GraphFunction, Element, graph
    +
    11#include "ftxui/dom/node.hpp" // for Node
    +
    12#include "ftxui/dom/requirement.hpp" // for Requirement
    +
    13#include "ftxui/screen/box.hpp" // for Box
    +
    14#include "ftxui/screen/screen.hpp" // for Screen
    +
    15
    +
    16namespace ftxui {
    +
    17
    +
    18namespace {
    +
    19// NOLINTNEXTLINE
    +
    20static std::string charset[] =
    +
    21#if defined(FTXUI_MICROSOFT_TERMINAL_FALLBACK)
    +
    22 // Microsoft's terminals often use fonts not handling the 8 unicode
    +
    23 // characters for representing the whole graph. Fallback with less.
    +
    24 {" ", " ", "█", " ", "█", "█", "█", "█", "█"};
    +
    25#else
    +
    26 {" ", "▗", "▐", "▖", "▄", "▟", "▌", "▙", "█"};
    +
    27#endif
    +
    28
    +
    29class Graph : public Node {
    +
    30 public:
    +
    31 explicit Graph(GraphFunction graph_function)
    +
    32 : graph_function_(std::move(graph_function)) {}
    +
    33
    +
    34 void ComputeRequirement() override {
    +
    35 requirement_.flex_grow_x = 1;
    +
    36 requirement_.flex_grow_y = 1;
    +
    37 requirement_.flex_shrink_x = 1;
    +
    38 requirement_.flex_shrink_y = 1;
    +
    39 requirement_.min_x = 3;
    +
    40 requirement_.min_y = 3;
    +
    41 }
    +
    42
    +
    43 void Render(Screen& screen) override {
    +
    44 const int width = (box_.x_max - box_.x_min + 1) * 2;
    +
    45 const int height = (box_.y_max - box_.y_min + 1) * 2;
    +
    46 if (width <= 0 || height <= 0) {
    +
    47 return;
    +
    48 }
    +
    49 auto data = graph_function_(width, height);
    +
    50 int i = 0;
    +
    51 for (int x = box_.x_min; x <= box_.x_max; ++x) {
    +
    52 const int height_1 = 2 * box_.y_max - data[i++];
    +
    53 const int height_2 = 2 * box_.y_max - data[i++];
    +
    54 for (int y = box_.y_min; y <= box_.y_max; ++y) {
    +
    55 const int yy = 2 * y;
    +
    56 int i_1 = yy < height_1 ? 0 : yy == height_1 ? 3 : 6; // NOLINT
    +
    57 int i_2 = yy < height_2 ? 0 : yy == height_2 ? 1 : 2; // NOLINT
    +
    58 screen.at(x, y) = charset[i_1 + i_2]; // NOLINT
    +
    59 }
    +
    60 }
    +
    61 }
    +
    62
    +
    63 private:
    +
    64 GraphFunction graph_function_;
    +
    65};
    +
    66
    +
    67} // namespace
    +
    68
    +
    69/// @brief Draw a graph using a GraphFunction.
    +
    70/// @param graph_function the function to be called to get the data.
    +
    +
    71Element graph(GraphFunction graph_function) {
    +
    72 return std::make_shared<Graph>(std::move(graph_function));
    +
    73}
    +
    +
    74
    +
    75} // namespace ftxui
    + + +
    void Render(Screen &screen, const Element &element)
    Display an element on a ftxui::Screen.
    Definition node.cpp:84
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    std::function< std::vector< int >(int, int)> GraphFunction
    Definition elements.hpp:25
    +
    Element graph(GraphFunction)
    Draw a graph using a GraphFunction.
    + + + +
    +
    + + + + + diff --git a/src_2ftxui_2dom_2gridbox_8cpp.html b/src_2ftxui_2dom_2gridbox_8cpp.html new file mode 100644 index 000000000..254a84d0a --- /dev/null +++ b/src_2ftxui_2dom_2gridbox_8cpp.html @@ -0,0 +1,276 @@ + + + + + + + + +FTXUI: gridbox.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    gridbox.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + +

    +Functions

    Element gridbox (std::vector< Elements > lines)
     A container displaying a grid of elements.
     
    +

    Variable Documentation

    + +

    ◆ x_size

    + +
    +
    + + + + +
    int x_size = 0
    +
    + +

    Definition at line 141 of file src/ftxui/dom/gridbox.cpp.

    + +
    +
    + +

    ◆ y_size

    + +
    +
    + + + + +
    int y_size = 0
    +
    + +

    Definition at line 142 of file src/ftxui/dom/gridbox.cpp.

    + +
    +
    + +

    ◆ lines_

    + +
    +
    + + + + +
    std::vector<Elements> lines_
    +
    + +

    Definition at line 143 of file src/ftxui/dom/gridbox.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/src_2ftxui_2dom_2gridbox_8cpp.js b/src_2ftxui_2dom_2gridbox_8cpp.js new file mode 100644 index 000000000..9623c705a --- /dev/null +++ b/src_2ftxui_2dom_2gridbox_8cpp.js @@ -0,0 +1,7 @@ +var src_2ftxui_2dom_2gridbox_8cpp = +[ + [ "gridbox", "src_2ftxui_2dom_2gridbox_8cpp.html#abcdf409d605edafd3191cd7ba47bcbd1", null ], + [ "x_size", "src_2ftxui_2dom_2gridbox_8cpp.html#aa84601b56e801ce086fd86309a13e695", null ], + [ "y_size", "src_2ftxui_2dom_2gridbox_8cpp.html#a99e442a053babaa64367447a56138823", null ], + [ "lines_", "src_2ftxui_2dom_2gridbox_8cpp.html#a14d0ca68485bdef40e820b3bd755deb7", null ] +]; \ No newline at end of file diff --git a/src_2ftxui_2dom_2gridbox_8cpp_source.html b/src_2ftxui_2dom_2gridbox_8cpp_source.html new file mode 100644 index 000000000..75d990fb4 --- /dev/null +++ b/src_2ftxui_2dom_2gridbox_8cpp_source.html @@ -0,0 +1,399 @@ + + + + + + + + +FTXUI: gridbox.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    src/ftxui/dom/gridbox.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <algorithm> // for max, min
    +
    5#include <cstddef> // for size_t
    +
    6#include <memory> // for __shared_ptr_access, shared_ptr, make_shared, allocator_traits<>::value_type
    +
    7#include <utility> // for move
    +
    8#include <vector> // for vector, __alloc_traits<>::value_type
    +
    9
    +
    10#include "ftxui/dom/box_helper.hpp" // for Element, Compute
    +
    11#include "ftxui/dom/elements.hpp" // for Elements, filler, Element, gridbox
    +
    12#include "ftxui/dom/node.hpp" // for Node
    +
    13#include "ftxui/dom/requirement.hpp" // for Requirement
    +
    14#include "ftxui/screen/box.hpp" // for Box
    +
    15
    +
    16namespace ftxui {
    +
    17class Screen;
    +
    18
    +
    19namespace {
    +
    20
    +
    21// Accumulate the values of a list U[n] into v[n]. So that:
    +
    22// V[0] = 0;
    +
    23// V[n+1] = v[n] + U[n]
    +
    24// return the sum of U[n].
    +
    25int Integrate(std::vector<int>& elements) {
    +
    26 int accu = 0;
    +
    27 for (auto& i : elements) {
    +
    28 const int old_accu = accu;
    +
    29 accu += i;
    +
    30 i = old_accu;
    +
    31 }
    +
    32 return accu;
    +
    33}
    +
    34
    +
    35class GridBox : public Node {
    +
    36 public:
    +
    37 explicit GridBox(std::vector<Elements> lines) : lines_(std::move(lines)) {
    +
    38 y_size = static_cast<int>(lines_.size());
    +
    39 for (const auto& line : lines_) {
    +
    40 x_size = std::max(x_size, int(line.size()));
    +
    41 }
    +
    42
    +
    43 // Fill in empty cells, in case the user did not used the API correctly:
    +
    44 for (auto& line : lines_) {
    +
    45 while (line.size() < size_t(x_size)) {
    +
    46 line.push_back(filler());
    +
    47 }
    +
    48 }
    +
    49 }
    +
    50
    +
    51 void ComputeRequirement() override {
    +
    52 requirement_ = Requirement{};
    +
    53 for (auto& line : lines_) {
    +
    54 for (auto& cell : line) {
    +
    55 cell->ComputeRequirement();
    +
    56 }
    +
    57 }
    +
    58
    +
    59 // Compute the size of each columns/row.
    +
    60 std::vector<int> size_x(x_size, 0);
    +
    61 std::vector<int> size_y(y_size, 0);
    +
    62 for (int x = 0; x < x_size; ++x) {
    +
    63 for (int y = 0; y < y_size; ++y) {
    +
    64 size_x[x] = std::max(size_x[x], lines_[y][x]->requirement().min_x);
    +
    65 size_y[y] = std::max(size_y[y], lines_[y][x]->requirement().min_y);
    +
    66 }
    +
    67 }
    +
    68
    +
    69 requirement_.min_x = Integrate(size_x);
    +
    70 requirement_.min_y = Integrate(size_y);
    +
    71
    +
    72 // Forward the focused/focused child state:
    +
    73 for (int x = 0; x < x_size; ++x) {
    +
    74 for (int y = 0; y < y_size; ++y) {
    +
    75 if (requirement_.focused.enabled ||
    +
    76 !lines_[y][x]->requirement().focused.enabled) {
    +
    77 continue;
    +
    78 }
    +
    79 requirement_.focused = lines_[y][x]->requirement().focused;
    +
    80 requirement_.focused.box.Shift(size_x[x], size_y[y]);
    +
    81 }
    +
    82 }
    +
    83 }
    +
    84
    +
    85 void SetBox(Box box) override {
    +
    86 Node::SetBox(box);
    +
    87
    +
    88 box_helper::Element init;
    +
    89 init.min_size = 0;
    +
    90 init.flex_grow = 1024; // NOLINT
    +
    91 init.flex_shrink = 1024; // NOLINT
    +
    92 std::vector<box_helper::Element> elements_x(x_size, init);
    +
    93 std::vector<box_helper::Element> elements_y(y_size, init);
    +
    94
    +
    95 for (int y = 0; y < y_size; ++y) {
    +
    96 for (int x = 0; x < x_size; ++x) {
    +
    97 const auto& cell = lines_[y][x];
    +
    98 const auto& requirement = cell->requirement();
    +
    99 auto& e_x = elements_x[x];
    +
    100 auto& e_y = elements_y[y];
    +
    101 e_x.min_size = std::max(e_x.min_size, requirement.min_x);
    +
    102 e_y.min_size = std::max(e_y.min_size, requirement.min_y);
    +
    103 e_x.flex_grow = std::min(e_x.flex_grow, requirement.flex_grow_x);
    +
    104 e_y.flex_grow = std::min(e_y.flex_grow, requirement.flex_grow_y);
    +
    105 e_x.flex_shrink = std::min(e_x.flex_shrink, requirement.flex_shrink_x);
    +
    106 e_y.flex_shrink = std::min(e_y.flex_shrink, requirement.flex_shrink_y);
    +
    107 }
    +
    108 }
    +
    109
    +
    110 const int target_size_x = box.x_max - box.x_min + 1;
    +
    111 const int target_size_y = box.y_max - box.y_min + 1;
    +
    112 box_helper::Compute(&elements_x, target_size_x);
    +
    113 box_helper::Compute(&elements_y, target_size_y);
    +
    114
    +
    115 Box box_y = box;
    +
    116 int y = box_y.y_min;
    +
    117 for (int iy = 0; iy < y_size; ++iy) {
    +
    118 box_y.y_min = y;
    +
    119 y += elements_y[iy].size;
    +
    120 box_y.y_max = y - 1;
    +
    121
    +
    122 Box box_x = box_y;
    +
    123 int x = box_x.x_min;
    +
    124 for (int ix = 0; ix < x_size; ++ix) {
    +
    125 box_x.x_min = x;
    +
    126 x += elements_x[ix].size;
    +
    127 box_x.x_max = x - 1;
    +
    128 lines_[iy][ix]->SetBox(box_x);
    +
    129 }
    +
    130 }
    +
    131 }
    +
    132
    +
    133 void Render(Screen& screen) override {
    +
    134 for (auto& line : lines_) {
    +
    135 for (auto& cell : line) {
    +
    136 cell->Render(screen);
    +
    137 }
    +
    138 }
    +
    139 }
    +
    140
    +
    141 int x_size = 0;
    +
    142 int y_size = 0;
    +
    143 std::vector<Elements> lines_;
    +
    144};
    +
    145} // namespace
    +
    146 //
    +
    147/// @brief A container displaying a grid of elements.
    +
    148/// @param lines A list of lines, each line being a list of elements.
    +
    149/// @return The container.
    +
    150///
    +
    151/// #### Example
    +
    152///
    +
    153/// ```cpp
    +
    154/// auto cell = [](const char* t) { return text(t) | border; };
    +
    155/// auto document = gridbox({
    +
    156/// {cell("north-west") , cell("north") , cell("north-east")} ,
    +
    157/// {cell("west") , cell("center") , cell("east")} ,
    +
    158/// {cell("south-west") , cell("south") , cell("south-east")} ,
    +
    159/// });
    +
    160/// ```
    +
    161/// Output:
    +
    162/// ```
    +
    163/// ╭──────────╮╭──────╮╭──────────╮
    +
    164/// │north-west││north ││north-east│
    +
    165/// ╰──────────╯╰──────╯╰──────────╯
    +
    166/// ╭──────────╮╭──────╮╭──────────╮
    +
    167/// │west ││center││east │
    +
    168/// ╰──────────╯╰──────╯╰──────────╯
    +
    169/// ╭──────────╮╭──────╮╭──────────╮
    +
    170/// │south-west││south ││south-east│
    +
    171/// ╰──────────╯╰──────╯╰──────────╯
    +
    172/// ```
    +
    +
    173Element gridbox(std::vector<Elements> lines) {
    +
    174 return std::make_shared<GridBox>(std::move(lines));
    +
    175}
    +
    +
    176
    +
    177} // namespace ftxui
    + + + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    Element gridbox(std::vector< Elements > lines)
    A container displaying a grid of elements.
    + + +
    std::vector< Elements > lines_
    + + +
    +
    + + + + + diff --git a/src_2ftxui_2dom_2linear__gradient_8cpp.html b/src_2ftxui_2dom_2linear__gradient_8cpp.html new file mode 100644 index 000000000..7f2aa41a3 --- /dev/null +++ b/src_2ftxui_2dom_2linear__gradient_8cpp.html @@ -0,0 +1,287 @@ + + + + + + + + +FTXUI: linear_gradient.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    linear_gradient.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + + + + + + + + + + +

    +Functions

    Element color (const LinearGradient &gradient, Element child)
     Set the foreground color of an element with linear-gradient effect.
     
    Element bgcolor (const LinearGradient &gradient, Element child)
     Set the background color of an element with linear-gradient effect.
     
    Decorator color (const LinearGradient &gradient)
     Decorate using a linear-gradient effect on the foreground color.
     
    Decorator bgcolor (const LinearGradient &gradient)
     Decorate using a linear-gradient effect on the background color.
     
    +

    Variable Documentation

    + +

    ◆ angle

    + +
    +
    + + + + +
    float angle = 0.F
    +
    +
    + +

    ◆ colors

    + +
    +
    + + + + +
    std::vector<Color> colors
    +
    + +

    Definition at line 24 of file src/ftxui/dom/linear_gradient.cpp.

    + +
    +
    + +

    ◆ positions

    + +
    +
    + + + + +
    std::vector<float> positions
    +
    + +

    Definition at line 25 of file src/ftxui/dom/linear_gradient.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/src_2ftxui_2dom_2linear__gradient_8cpp.js b/src_2ftxui_2dom_2linear__gradient_8cpp.js new file mode 100644 index 000000000..d3a6de535 --- /dev/null +++ b/src_2ftxui_2dom_2linear__gradient_8cpp.js @@ -0,0 +1,10 @@ +var src_2ftxui_2dom_2linear__gradient_8cpp = +[ + [ "color", "src_2ftxui_2dom_2linear__gradient_8cpp.html#ga050df9c8ed04eec13309d6c0542c636d", null ], + [ "bgcolor", "src_2ftxui_2dom_2linear__gradient_8cpp.html#gaaac1622d43662a6a02113d9230a4fdd4", null ], + [ "color", "src_2ftxui_2dom_2linear__gradient_8cpp.html#ga8af6b5a06b03fd53bf30a6b050b96968", null ], + [ "bgcolor", "src_2ftxui_2dom_2linear__gradient_8cpp.html#gaee41f3eaff28a123214e81231f8f4593", null ], + [ "angle", "src_2ftxui_2dom_2linear__gradient_8cpp.html#ab8ef1bf8a70cc07c6d55823c390a7e76", null ], + [ "colors", "src_2ftxui_2dom_2linear__gradient_8cpp.html#ac3290ba0758760ac0d6df01f7707dd94", null ], + [ "positions", "src_2ftxui_2dom_2linear__gradient_8cpp.html#af3fd42b7427cb742f96e7ec3244fb7cf", null ] +]; \ No newline at end of file diff --git a/src_2ftxui_2dom_2linear__gradient_8cpp_source.html b/src_2ftxui_2dom_2linear__gradient_8cpp_source.html new file mode 100644 index 000000000..d1a7a1f7a --- /dev/null +++ b/src_2ftxui_2dom_2linear__gradient_8cpp_source.html @@ -0,0 +1,549 @@ + + + + + + + + +FTXUI: linear_gradient.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    src/ftxui/dom/linear_gradient.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2023 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <algorithm> // for max, min, sort, copy
    +
    5#include <cmath> // for fmod, cos, sin
    +
    6#include <cstddef> // for size_t
    +
    7#include <ftxui/dom/linear_gradient.hpp> // for LinearGradient::Stop, LinearGradient
    +
    8#include <memory> // for allocator_traits<>::value_type, make_shared
    +
    9#include <optional> // for optional, operator!=, operator<
    +
    10#include <utility> // for move
    +
    11#include <vector> // for vector
    +
    12
    +
    13#include "ftxui/dom/elements.hpp" // for Element, Decorator, bgcolor, color
    +
    14#include "ftxui/dom/node_decorator.hpp" // for NodeDecorator
    +
    15#include "ftxui/screen/box.hpp" // for Box
    +
    16#include "ftxui/screen/color.hpp" // for Color, Color::Default, Color::Blue
    +
    17#include "ftxui/screen/screen.hpp" // for Pixel, Screen
    +
    18
    +
    19namespace ftxui {
    +
    20namespace {
    +
    21
    +
    22struct LinearGradientNormalized {
    +
    23 float angle = 0.F;
    +
    24 std::vector<Color> colors;
    +
    25 std::vector<float> positions; // Sorted.
    +
    26};
    +
    27
    +
    28// Convert a LinearGradient to a normalized version.
    +
    29LinearGradientNormalized Normalize(LinearGradient gradient) {
    +
    30 // Handle gradient of size 0.
    +
    31 if (gradient.stops.empty()) {
    +
    32 return LinearGradientNormalized{
    +
    33 0.F,
    + +
    35 {0.F, 1.F},
    +
    36 };
    +
    37 }
    +
    38
    +
    39 // Fill in the two extent, if not provided.
    +
    40 if (!gradient.stops.front().position) {
    +
    41 gradient.stops.front().position = 0.F;
    +
    42 }
    +
    43 if (!gradient.stops.back().position) {
    +
    44 gradient.stops.back().position = 1.F;
    +
    45 }
    +
    46
    +
    47 // Fill in the blank, by interpolating positions.
    +
    48 size_t last_checkpoint = 0;
    +
    49 for (size_t i = 1; i < gradient.stops.size(); ++i) {
    +
    50 if (!gradient.stops[i].position) {
    +
    51 continue;
    +
    52 }
    +
    53
    +
    54 if (i - last_checkpoint >= 2) {
    +
    55 const float min = gradient.stops[i].position.value(); // NOLINT
    +
    56 const float max =
    +
    57 gradient.stops[last_checkpoint].position.value(); // NOLINT
    +
    58 for (size_t j = last_checkpoint + 1; j < i; ++j) {
    +
    59 gradient.stops[j].position = min + (max - min) *
    +
    60 float(j - last_checkpoint) /
    +
    61 float(i - last_checkpoint);
    +
    62 }
    +
    63 }
    +
    64
    +
    65 last_checkpoint = i;
    +
    66 }
    +
    67
    +
    68 // Sort the stops by position.
    +
    69 std::sort(
    +
    70 gradient.stops.begin(), gradient.stops.end(),
    +
    71 [](const auto& a, const auto& b) { return a.position < b.position; });
    +
    72
    +
    73 // If we don't being with zero, add a stop at zero.
    +
    74 if (gradient.stops.front().position != 0) {
    +
    75 gradient.stops.insert(gradient.stops.begin(),
    +
    76 {gradient.stops.front().color, 0.F});
    +
    77 }
    +
    78 // If we don't end with one, add a stop at one.
    +
    79 if (gradient.stops.back().position != 1) {
    +
    80 gradient.stops.push_back({gradient.stops.back().color, 1.F});
    +
    81 }
    +
    82
    +
    83 // Normalize the angle.
    +
    84 LinearGradientNormalized normalized;
    +
    85 const float modulo = 360.F;
    +
    86 normalized.angle =
    +
    87 std::fmod(std::fmod(gradient.angle, modulo) + modulo, modulo);
    +
    88 for (auto& stop : gradient.stops) {
    +
    89 normalized.colors.push_back(stop.color);
    +
    90 // NOLINTNEXTLINE
    +
    91 normalized.positions.push_back(stop.position.value());
    +
    92 }
    +
    93 return normalized;
    +
    94}
    +
    95
    +
    96Color Interpolate(const LinearGradientNormalized& gradient, float t) {
    +
    97 // Find the right color in the gradient's stops.
    +
    98 size_t i = 1;
    +
    99 while (true) {
    +
    100 // Note that `t` might be slightly greater than 1.0 due to floating point
    +
    101 // precision. This is why we need to handle the case where `t` is greater
    +
    102 // than the last stop's position.
    +
    103 // See https://github.com/ArthurSonzogni/FTXUI/issues/998
    +
    104 if (i >= gradient.positions.size()) {
    +
    105 const float half = 0.5F;
    +
    106 return Color::Interpolate(half, gradient.colors.back(),
    +
    107 gradient.colors.back());
    +
    108 }
    +
    109 if (t <= gradient.positions[i]) {
    +
    110 break;
    +
    111 }
    +
    112 ++i;
    +
    113 }
    +
    114
    +
    115 const float t0 = gradient.positions[i - 1];
    +
    116 const float t1 = gradient.positions[i - 0];
    +
    117 const float tt = (t - t0) / (t1 - t0);
    +
    118
    +
    119 const Color& c0 = gradient.colors[i - 1];
    +
    120 const Color& c1 = gradient.colors[i - 0];
    +
    121 const Color& cc = Color::Interpolate(tt, c0, c1);
    +
    122
    +
    123 return cc;
    +
    124}
    +
    125
    +
    126class LinearGradientColor : public NodeDecorator {
    +
    127 public:
    +
    128 explicit LinearGradientColor(Element child,
    +
    129 const LinearGradient& gradient,
    +
    130 bool background_color)
    +
    131 : NodeDecorator(std::move(child)),
    +
    132 gradient_(Normalize(gradient)),
    +
    133 background_color_{background_color} {}
    +
    134
    +
    135 private:
    +
    136 void Render(Screen& screen) override {
    +
    137 const float degtorad = 0.01745329251F;
    +
    138 const float dx = std::cos(gradient_.angle * degtorad);
    +
    139 const float dy = std::sin(gradient_.angle * degtorad);
    +
    140
    +
    141 // Project every corner to get the extent of the gradient.
    +
    142 const float p1 = float(box_.x_min) * dx + float(box_.y_min) * dy;
    +
    143 const float p2 = float(box_.x_min) * dx + float(box_.y_max) * dy;
    +
    144 const float p3 = float(box_.x_max) * dx + float(box_.y_min) * dy;
    +
    145 const float p4 = float(box_.x_max) * dx + float(box_.y_max) * dy;
    +
    146 const float min = std::min({p1, p2, p3, p4});
    +
    147 const float max = std::max({p1, p2, p3, p4});
    +
    148
    +
    149 // Renormalize the projection to [0, 1] using the extent and projective
    +
    150 // geometry.
    +
    151 const float dX = dx / (max - min);
    +
    152 const float dY = dy / (max - min);
    +
    153 const float dZ = -min / (max - min);
    +
    154
    +
    155 // Project every pixel to get the color.
    +
    156 if (background_color_) {
    +
    157 for (int y = box_.y_min; y <= box_.y_max; ++y) {
    +
    158 for (int x = box_.x_min; x <= box_.x_max; ++x) {
    +
    159 const float t = float(x) * dX + float(y) * dY + dZ;
    +
    160 screen.PixelAt(x, y).background_color = Interpolate(gradient_, t);
    +
    161 }
    +
    162 }
    +
    163 } else {
    +
    164 for (int y = box_.y_min; y <= box_.y_max; ++y) {
    +
    165 for (int x = box_.x_min; x <= box_.x_max; ++x) {
    +
    166 const float t = float(x) * dX + float(y) * dY + dZ;
    +
    167 screen.PixelAt(x, y).foreground_color = Interpolate(gradient_, t);
    +
    168 }
    +
    169 }
    +
    170 }
    +
    171
    +
    172 NodeDecorator::Render(screen);
    +
    173 }
    +
    174
    +
    175 LinearGradientNormalized gradient_;
    +
    176 bool background_color_;
    +
    177};
    +
    178
    +
    179} // namespace
    +
    180
    +
    181/// @brief Build the "empty" gradient. This is often followed by calls to
    +
    182/// LinearGradient::Angle() and LinearGradient::Stop().
    +
    183/// Example:
    +
    184/// ```cpp
    +
    185/// auto gradient =
    +
    186/// LinearGradient()
    +
    187/// .Angle(45)
    +
    188/// .Stop(Color::Red, 0.0)
    +
    189/// .Stop(Color::Green, 0.5)
    +
    190/// .Stop(Color::Blue, 1.0);;
    +
    191/// ```
    + +
    193
    +
    194/// @brief Build a gradient with two colors.
    +
    195/// @param begin The color at the beginning of the gradient.
    +
    196/// @param end The color at the end of the gradient.
    +
    + +
    198 : LinearGradient(0, begin, end) {}
    +
    +
    199
    +
    200/// @brief Build a gradient with two colors and an angle.
    +
    201/// @param a The angle of the gradient.
    +
    202/// @param begin The color at the beginning of the gradient.
    +
    203/// @param end The color at the end of the gradient.
    +
    + +
    205 stops.push_back({begin, {}});
    +
    206 stops.push_back({end, {}});
    +
    207}
    +
    +
    208
    +
    209/// @brief Set the angle of the gradient.
    +
    210/// @param a The angle of the gradient.
    +
    211/// @return The gradient.
    +
    + +
    213 angle = a;
    +
    214 return *this;
    +
    215}
    +
    +
    216
    +
    217/// @brief Add a color stop to the gradient.
    +
    218/// @param c The color of the stop.
    +
    219/// @param p The position of the stop.
    +
    + +
    221 stops.push_back({c, p});
    +
    222 return *this;
    +
    223}
    +
    +
    224
    +
    225/// @brief Add a color stop to the gradient.
    +
    226/// @param c The color of the stop.
    +
    227/// @return The gradient.
    +
    228/// @note The position of the stop is interpolated from nearby stops.
    +
    + +
    230 stops.push_back({c, {}});
    +
    231 return *this;
    +
    232}
    +
    +
    233
    +
    234/// @brief Set the foreground color of an element with linear-gradient effect.
    +
    235/// @param gradient The gradient effect to be applied on the output element.
    +
    236/// @param child The input element.
    +
    237/// @return The output element colored.
    +
    238/// @ingroup dom
    +
    239///
    +
    240/// ### Example
    +
    241///
    +
    242/// ```cpp
    +
    243/// color(LinearGradient{0, {Color::Red, Color::Blue}}, text("Hello"))
    +
    244/// ```
    +
    +
    245Element color(const LinearGradient& gradient, Element child) {
    +
    246 return std::make_shared<LinearGradientColor>(std::move(child), gradient,
    +
    247 /*background_color*/ false);
    +
    248}
    +
    +
    249
    +
    250/// @brief Set the background color of an element with linear-gradient effect.
    +
    251/// @param gradient The gradient effect to be applied on the output element.
    +
    252/// @param child The input element.
    +
    253/// @return The output element colored.
    +
    254/// @ingroup dom
    +
    255///
    +
    256/// ### Example
    +
    257///
    +
    258/// ```cpp
    +
    259/// bgcolor(LinearGradient{0, {Color::Red, Color::Blue}}, text("Hello"))
    +
    260/// ```
    +
    +
    261Element bgcolor(const LinearGradient& gradient, Element child) {
    +
    262 return std::make_shared<LinearGradientColor>(std::move(child), gradient,
    +
    263 /*background_color*/ true);
    +
    264}
    +
    +
    265
    +
    266/// @brief Decorate using a linear-gradient effect on the foreground color.
    +
    267/// @param gradient The gradient effect to be applied on the output element.
    +
    268/// @return The Decorator applying the color.
    +
    269/// @ingroup dom
    +
    270///
    +
    271/// ### Example
    +
    272///
    +
    273/// ```cpp
    +
    274/// text("Hello") | color(LinearGradient{0, {Color::Red, Color::Blue}})
    +
    275/// ```
    +
    + +
    277 return
    +
    278 [gradient](Element child) { return color(gradient, std::move(child)); };
    +
    279}
    +
    +
    280
    +
    281/// @brief Decorate using a linear-gradient effect on the background color.
    +
    282/// @param gradient The gradient effect to be applied on the output element.
    +
    283/// @return The Decorator applying the color.
    +
    284/// @ingroup dom
    +
    285///
    +
    286/// ### Example
    +
    287///
    +
    288/// ```cpp
    +
    289/// text("Hello") | color(LinearGradient{0, {Color::Red, Color::Blue}})
    +
    290/// ```
    +
    + +
    292 return
    +
    293 [gradient](Element child) { return bgcolor(gradient, std::move(child)); };
    +
    294}
    +
    +
    295
    +
    296} // namespace ftxui
    + + + +
    LinearGradient & Stop(Color color, float position)
    Add a color stop to the gradient.
    +
    LinearGradient & Angle(float angle)
    Set the angle of the gradient.
    +
    LinearGradient()
    Build the "empty" gradient. This is often followed by calls to LinearGradient::Angle() and LinearGrad...
    +
    std::vector< Stop > stops
    +
    friend void Render(Screen &screen, Node *node, Selection &selection)
    Definition node.cpp:96
    + +
    Decorator bgcolor(Color)
    Decorate using a background color.
    +
    void Render(Screen &screen, const Element &element)
    Display an element on a ftxui::Screen.
    Definition node.cpp:84
    +
    Decorator color(Color)
    Decorate using a foreground color.
    +
    A class representing the settings for linear-gradient color effect.
    + +
    static Color Interpolate(float t, const Color &a, const Color &b)
    +
    Color is a class that represents a color in the terminal user interface.
    Definition color.hpp:22
    +
    Color
    Color is an enumeration that represents the color support of the terminal.
    Definition terminal.hpp:23
    + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::function< Element(Element)> Decorator
    Definition elements.hpp:24
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    + + + +
    std::vector< Color > colors
    +
    std::vector< float > positions
    +
    +
    + + + + + diff --git a/src_2ftxui_2dom_2paragraph_8cpp.html b/src_2ftxui_2dom_2paragraph_8cpp.html new file mode 100644 index 000000000..d4ca3f681 --- /dev/null +++ b/src_2ftxui_2dom_2paragraph_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: paragraph.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    paragraph.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + + + + + + + + + + + + + +

    +Functions

    Element paragraph (const std::string &the_text)
     Return an element drawing the paragraph on multiple lines.
     
    Element paragraphAlignLeft (const std::string &the_text)
     Return an element drawing the paragraph on multiple lines, aligned on the left.
     
    Element paragraphAlignRight (const std::string &the_text)
     Return an element drawing the paragraph on multiple lines, aligned on the right.
     
    Element paragraphAlignCenter (const std::string &the_text)
     Return an element drawing the paragraph on multiple lines, aligned on the center.
     
    Element paragraphAlignJustify (const std::string &the_text)
     Return an element drawing the paragraph on multiple lines, aligned using a justified alignment. the center.
     
    +
    +
    + + + + + diff --git a/src_2ftxui_2dom_2paragraph_8cpp.js b/src_2ftxui_2dom_2paragraph_8cpp.js new file mode 100644 index 000000000..89aa911a9 --- /dev/null +++ b/src_2ftxui_2dom_2paragraph_8cpp.js @@ -0,0 +1,8 @@ +var src_2ftxui_2dom_2paragraph_8cpp = +[ + [ "paragraph", "src_2ftxui_2dom_2paragraph_8cpp.html#ga3f9093ae1a2790d396fc2cff9990fbbd", null ], + [ "paragraphAlignLeft", "src_2ftxui_2dom_2paragraph_8cpp.html#gaa334a836eccc573e1137a1ba29d07d8a", null ], + [ "paragraphAlignRight", "src_2ftxui_2dom_2paragraph_8cpp.html#ga28a69f06a88c89fe7a507e33ab486411", null ], + [ "paragraphAlignCenter", "src_2ftxui_2dom_2paragraph_8cpp.html#ga6a105f6b0d07d7933379ff1ae9282fb8", null ], + [ "paragraphAlignJustify", "src_2ftxui_2dom_2paragraph_8cpp.html#gae4de548aa67ab77cb345e4ddec6b248b", null ] +]; \ No newline at end of file diff --git a/src_2ftxui_2dom_2paragraph_8cpp_source.html b/src_2ftxui_2dom_2paragraph_8cpp_source.html new file mode 100644 index 000000000..91df0b39c --- /dev/null +++ b/src_2ftxui_2dom_2paragraph_8cpp_source.html @@ -0,0 +1,333 @@ + + + + + + + + +FTXUI: paragraph.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    src/ftxui/dom/paragraph.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <functional> // for function
    +
    5#include <sstream> // for basic_istream, stringstream
    +
    6#include <string> // for string, allocator, getline
    +
    7#include <utility> // for move
    +
    8
    +
    9#include "ftxui/dom/elements.hpp" // for flexbox, Element, text, Elements, operator|, xflex, paragraph, paragraphAlignCenter, paragraphAlignJustify, paragraphAlignLeft, paragraphAlignRight
    +
    10#include "ftxui/dom/flexbox_config.hpp" // for FlexboxConfig, FlexboxConfig::JustifyContent, FlexboxConfig::JustifyContent::Center, FlexboxConfig::JustifyContent::FlexEnd, FlexboxConfig::JustifyContent::SpaceBetween
    +
    11
    +
    12namespace ftxui {
    +
    13
    +
    14namespace {
    +
    15Elements Split(const std::string& the_text) {
    +
    16 Elements output;
    +
    17 std::stringstream ss(the_text);
    +
    18 std::string word;
    +
    19 while (std::getline(ss, word, ' ')) {
    +
    20 output.push_back(text(word));
    +
    21 }
    +
    22 return output;
    +
    23}
    +
    24
    +
    25Element Split(const std::string& paragraph,
    +
    26 const std::function<Element(std::string)>& f) {
    +
    27 Elements output;
    +
    28 std::stringstream ss(paragraph);
    +
    29 std::string line;
    +
    30 while (std::getline(ss, line, '\n')) {
    +
    31 output.push_back(f(line));
    +
    32 }
    +
    33 return vbox(std::move(output));
    +
    34}
    +
    35
    +
    36} // namespace
    +
    37
    +
    38/// @brief Return an element drawing the paragraph on multiple lines.
    +
    39/// @ingroup dom
    +
    40/// @see flexbox.
    +
    +
    41Element paragraph(const std::string& the_text) {
    +
    42 return paragraphAlignLeft(the_text);
    +
    43}
    +
    +
    44
    +
    45/// @brief Return an element drawing the paragraph on multiple lines, aligned on
    +
    46/// the left.
    +
    47/// @ingroup dom
    +
    48/// @see flexbox.
    +
    +
    49Element paragraphAlignLeft(const std::string& the_text) {
    +
    50 return Split(the_text, [](const std::string& line) {
    +
    51 static const auto config = FlexboxConfig().SetGap(1, 0);
    +
    52 return flexbox(Split(line), config);
    +
    53 });
    +
    54};
    +
    +
    55
    +
    56/// @brief Return an element drawing the paragraph on multiple lines, aligned on
    +
    57/// the right.
    +
    58/// @ingroup dom
    +
    59/// @see flexbox.
    +
    +
    60Element paragraphAlignRight(const std::string& the_text) {
    +
    61 return Split(the_text, [](const std::string& line) {
    +
    62 static const auto config = FlexboxConfig().SetGap(1, 0).Set(
    + +
    64 return flexbox(Split(line), config);
    +
    65 });
    +
    66}
    +
    +
    67
    +
    68/// @brief Return an element drawing the paragraph on multiple lines, aligned on
    +
    69/// the center.
    +
    70/// @ingroup dom
    +
    71/// @see flexbox.
    +
    +
    72Element paragraphAlignCenter(const std::string& the_text) {
    +
    73 return Split(the_text, [](const std::string& line) {
    +
    74 static const auto config =
    + +
    76 return flexbox(Split(line), config);
    +
    77 });
    +
    78}
    +
    +
    79
    +
    80/// @brief Return an element drawing the paragraph on multiple lines, aligned
    +
    81/// using a justified alignment.
    +
    82/// the center.
    +
    83/// @ingroup dom
    +
    84/// @see flexbox.
    +
    +
    85Element paragraphAlignJustify(const std::string& the_text) {
    +
    86 return Split(the_text, [](const std::string& line) {
    +
    87 static const auto config = FlexboxConfig().SetGap(1, 0).Set(
    + +
    89 Elements words = Split(line);
    +
    90 words.push_back(text("") | xflex);
    +
    91 return flexbox(std::move(words), config);
    +
    92 });
    +
    93}
    +
    +
    94
    +
    95} // namespace ftxui
    + + +
    FlexboxConfig & SetGap(int gap_x, int gap_y)
    Set the flexbox flex direction.
    +
    @ Center
    Items are centered along the line.
    +
    @ FlexEnd
    Items are aligned to the end of flexbox's direction.
    +
    @ SpaceBetween
    Items are evenly distributed in the line; first item is on the start.
    +
    FlexboxConfig & Set(FlexboxConfig::Direction)
    Set the flexbox direction.
    +
    Element paragraphAlignRight(const std::string &text)
    Return an element drawing the paragraph on multiple lines, aligned on the right.
    +
    Element paragraphAlignCenter(const std::string &text)
    Return an element drawing the paragraph on multiple lines, aligned on the center.
    +
    Element text(std::wstring text)
    Display a piece of unicode text.
    Definition text.cpp:160
    +
    Element paragraphAlignLeft(const std::string &text)
    Return an element drawing the paragraph on multiple lines, aligned on the left.
    +
    Element paragraphAlignJustify(const std::string &text)
    Return an element drawing the paragraph on multiple lines, aligned using a justified alignment....
    +
    Element vbox(Elements)
    A container displaying elements vertically one by one.
    Definition vbox.cpp:96
    +
    FlexboxConfig is a configuration structure that defines the layout properties for a flexbox container...
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    Element flexbox(Elements, FlexboxConfig config=FlexboxConfig())
    A container displaying elements on row/columns and capable of wrapping on the next column/row when fu...
    Definition flexbox.cpp:251
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    std::vector< Element > Elements
    Definition elements.hpp:23
    +
    Elements paragraph(std::wstring text)
    +
    +
    + + + + + diff --git a/src_2ftxui_2dom_2selection_8cpp.html b/src_2ftxui_2dom_2selection_8cpp.html new file mode 100644 index 000000000..b621aa18a --- /dev/null +++ b/src_2ftxui_2dom_2selection_8cpp.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: selection.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    selection.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    +
    +
    + + + + + diff --git a/src_2ftxui_2dom_2selection_8cpp_source.html b/src_2ftxui_2dom_2selection_8cpp_source.html new file mode 100644 index 000000000..1e3854b84 --- /dev/null +++ b/src_2ftxui_2dom_2selection_8cpp_source.html @@ -0,0 +1,410 @@ + + + + + + + + +FTXUI: selection.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    src/ftxui/dom/selection.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2024 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4
    +
    5#include "ftxui/dom/selection.hpp" // for Selection
    +
    6#include <algorithm> // for max, min
    +
    7#include <string> // for string
    +
    8#include <tuple> // for ignore
    +
    9
    +
    10#include "ftxui/dom/node_decorator.hpp" // for NodeDecorator
    +
    11
    +
    12namespace ftxui {
    +
    13
    +
    14namespace {
    +
    15class Unselectable : public NodeDecorator {
    +
    16 public:
    + +
    18
    +
    19 void Select(Selection& ignored) override {
    +
    20 std::ignore = ignored;
    +
    21 // Overwrite the select method to do nothing.
    +
    22 }
    +
    23};
    +
    24} // namespace
    +
    25
    +
    26/// @brief Create an empty selection.
    +
    27Selection::Selection() = default;
    +
    28
    +
    29/// @brief Create a selection.
    +
    30/// @param start_x The x coordinate of the start of the selection.
    +
    31/// @param start_y The y coordinate of the start of the selection.
    +
    32/// @param end_x The x coordinate of the end of the selection.
    +
    33/// @param end_y The y coordinate of the end of the selection.
    +
    +
    34Selection::Selection(int start_x, int start_y, int end_x, int end_y)
    +
    35 : start_x_(start_x),
    +
    36 start_y_(start_y),
    +
    37 end_x_(end_x),
    +
    38 end_y_(end_y),
    +
    39 box_{
    +
    40 std::min(start_x, end_x),
    +
    41 std::max(start_x, end_x),
    +
    42 std::min(start_y, end_y),
    +
    43 std::max(start_y, end_y),
    +
    44 },
    +
    45 empty_(false) {}
    +
    +
    46
    +
    47Selection::Selection(int start_x,
    +
    48 int start_y,
    +
    49 int end_x,
    +
    50 int end_y,
    +
    51 Selection* parent)
    +
    52 : start_x_(start_x),
    +
    53 start_y_(start_y),
    +
    54 end_x_(end_x),
    +
    55 end_y_(end_y),
    +
    56 box_{
    +
    57 std::min(start_x, end_x),
    +
    58 std::max(start_x, end_x),
    +
    59 std::min(start_y, end_y),
    +
    60 std::max(start_y, end_y),
    +
    61 },
    +
    62 parent_(parent),
    +
    63 empty_(false) {}
    +
    64
    +
    65/// @brief Get the box of the selection.
    +
    66/// @return The box of the selection.
    +
    +
    67const Box& Selection::GetBox() const {
    +
    68 return box_;
    +
    69}
    +
    +
    70
    +
    71/// @brief Saturate the selection to be inside the box.
    +
    72/// This is called by `hbox` to propagate the selection to its children.
    +
    73/// @param box The box to saturate the selection in.
    +
    74/// @return The saturated selection.
    +
    + +
    76 int start_x = start_x_;
    +
    77 int start_y = start_y_;
    +
    78 int end_x = end_x_;
    +
    79 int end_y = end_y_;
    +
    80
    +
    81 const bool start_outside = !box.Contain(start_x, start_y);
    +
    82 const bool end_outside = !box.Contain(end_x, end_y);
    +
    83 const bool properly_ordered =
    +
    84 start_y < end_y || (start_y == end_y && start_x <= end_x);
    +
    85 if (properly_ordered) {
    +
    86 if (start_outside) {
    +
    87 start_x = box.x_min;
    +
    88 start_y = box.y_min;
    +
    89 }
    +
    90 if (end_outside) {
    +
    91 end_x = box.x_max;
    +
    92 end_y = box.y_max;
    +
    93 }
    +
    94 } else {
    +
    95 if (start_outside) {
    +
    96 start_x = box.x_max;
    +
    97 start_y = box.y_max;
    +
    98 }
    +
    99 if (end_outside) {
    +
    100 end_x = box.x_min;
    +
    101 end_y = box.y_min;
    +
    102 }
    +
    103 }
    +
    104 return {
    +
    105 start_x, start_y, end_x, end_y, parent_,
    +
    106 };
    +
    107}
    +
    +
    108
    +
    109/// @brief Saturate the selection to be inside the box.
    +
    110/// This is called by `vbox` to propagate the selection to its children.
    +
    111/// @param box The box to saturate the selection in.
    +
    112/// @return The saturated selection.
    +
    + +
    114 int start_x = start_x_;
    +
    115 int start_y = start_y_;
    +
    116 int end_x = end_x_;
    +
    117 int end_y = end_y_;
    +
    118
    +
    119 const bool start_outside = !box.Contain(start_x, start_y);
    +
    120 const bool end_outside = !box.Contain(end_x, end_y);
    +
    121 const bool properly_ordered =
    +
    122 start_y < end_y || (start_y == end_y && start_x <= end_x);
    +
    123
    +
    124 if (properly_ordered) {
    +
    125 if (start_outside) {
    +
    126 start_x = box.x_min;
    +
    127 start_y = box.y_min;
    +
    128 }
    +
    129 if (end_outside) {
    +
    130 end_x = box.x_max;
    +
    131 end_y = box.y_max;
    +
    132 }
    +
    133 } else {
    +
    134 if (start_outside) {
    +
    135 start_x = box.x_max;
    +
    136 start_y = box.y_max;
    +
    137 }
    +
    138 if (end_outside) {
    +
    139 end_x = box.x_min;
    +
    140 end_y = box.y_min;
    +
    141 }
    +
    142 }
    +
    143 return {start_x, start_y, end_x, end_y, parent_};
    +
    144}
    +
    +
    145
    +
    +
    146void Selection::AddPart(const std::string& part, int y, int left, int right) {
    +
    147 if (parent_ != this) {
    +
    148 parent_->AddPart(part, y, left, right);
    +
    149 return;
    +
    150 }
    +
    151 [&] {
    +
    152 if (parts_.str().empty()) {
    +
    153 parts_ << part;
    +
    154 return;
    +
    155 }
    +
    156
    +
    157 if (y_ != y) {
    +
    158 parts_ << '\n' << part;
    +
    159 return;
    +
    160 }
    +
    161
    +
    162 if (x_ == left + 1) {
    +
    163 parts_ << part;
    +
    164 return;
    +
    165 }
    +
    166
    +
    167 parts_ << part;
    +
    168 }();
    +
    169 y_ = y;
    +
    170 x_ = right;
    +
    171}
    +
    +
    172
    +
    173} // namespace ftxui
    +
    NodeDecorator(Element child)
    +
    const Box & GetBox() const
    Get the box of the selection.
    +
    void AddPart(const std::string &part, int y, int left, int right)
    +
    Selection SaturateVertical(Box box)
    Saturate the selection to be inside the box. This is called by vbox to propagate the selection to its...
    +
    Selection()
    Create an empty selection.
    +
    Selection SaturateHorizontal(Box box)
    Saturate the selection to be inside the box. This is called by hbox to propagate the selection to its...
    +
    Represents a selection in a terminal user interface.
    Definition selection.hpp:22
    +
    bool Contain(int x, int y) const
    Definition box.cpp:42
    +
    int x_max
    Definition box.hpp:18
    +
    int y_min
    Definition box.hpp:19
    +
    int y_max
    Definition box.hpp:20
    +
    int x_min
    Definition box.hpp:17
    +
    Box is a structure that represents a rectangular area in a 2D space.
    Definition box.hpp:16
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + +
    std::uint8_t left
    Definition screen.cpp:130
    +
    std::uint8_t right
    Definition screen.cpp:132
    + +
    +
    + + + + + diff --git a/src_2ftxui_2dom_2separator_8cpp.html b/src_2ftxui_2dom_2separator_8cpp.html new file mode 100644 index 000000000..2b5d6d2ea --- /dev/null +++ b/src_2ftxui_2dom_2separator_8cpp.html @@ -0,0 +1,290 @@ + + + + + + + + +FTXUI: separator.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    separator.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Functions

    Element separator ()
     Draw a vertical or horizontal separation in between two other elements.
     
    Element separatorStyled (BorderStyle style)
     Draw a vertical or horizontal separation in between two other elements.
     
    Element separatorLight ()
     Draw a vertical or horizontal separation in between two other elements, using the LIGHT style.
     
    Element separatorDashed ()
     Draw a vertical or horizontal separation in between two other elements, using the DASHED style.
     
    Element separatorHeavy ()
     Draw a vertical or horizontal separation in between two other elements, using the HEAVY style.
     
    Element separatorDouble ()
     Draw a vertical or horizontal separation in between two other elements, using the DOUBLE style.
     
    Element separatorEmpty ()
     Draw a vertical or horizontal separation in between two other elements, using the EMPTY style.
     
    Element separatorCharacter (std::string value)
     Draw a vertical or horizontal separation in between two other elements.
     
    Element separator (Pixel pixel)
     Draw a separator in between two element filled with a given pixel.
     
    Element separatorHSelector (float left, float right, Color unselected_color, Color selected_color)
     Draw a horizontal bar, with the area in between left/right colored differently.
     
    Element separatorVSelector (float up, float down, Color unselected_color, Color selected_color)
     Draw an vertical bar, with the area in between up/downcolored differently.
     
    +

    Variable Documentation

    + +

    ◆ value_

    + +
    +
    + + + + +
    std::string value_
    +
    + +

    Definition at line 51 of file src/ftxui/dom/separator.cpp.

    + +
    +
    + +

    ◆ style_

    + +
    +
    + + + + +
    BorderStyle style_
    +
    + +

    Definition at line 79 of file src/ftxui/dom/separator.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/src_2ftxui_2dom_2separator_8cpp.js b/src_2ftxui_2dom_2separator_8cpp.js new file mode 100644 index 000000000..46705741b --- /dev/null +++ b/src_2ftxui_2dom_2separator_8cpp.js @@ -0,0 +1,16 @@ +var src_2ftxui_2dom_2separator_8cpp = +[ + [ "separator", "src_2ftxui_2dom_2separator_8cpp.html#gac1ef1cf6bf7cd0759ffa195071edb2a0", null ], + [ "separatorStyled", "src_2ftxui_2dom_2separator_8cpp.html#ga13cb559cfc7e409b3f211f0bb35ea7fa", null ], + [ "separatorLight", "src_2ftxui_2dom_2separator_8cpp.html#ga37c2b93daf557f68064bc9fbf93ebde0", null ], + [ "separatorDashed", "src_2ftxui_2dom_2separator_8cpp.html#ga81f2d3256c0cfbc70f820129286f08c6", null ], + [ "separatorHeavy", "src_2ftxui_2dom_2separator_8cpp.html#gaf0649e89a9960f1c2703e48c1817645b", null ], + [ "separatorDouble", "src_2ftxui_2dom_2separator_8cpp.html#gadd376830fdb51b0bf52672ef17515989", null ], + [ "separatorEmpty", "src_2ftxui_2dom_2separator_8cpp.html#ga1934703e56ab66f6f259b9f8da331f1b", null ], + [ "separatorCharacter", "src_2ftxui_2dom_2separator_8cpp.html#ga97a10482d591aade2958da0f2f19b371", null ], + [ "separator", "src_2ftxui_2dom_2separator_8cpp.html#ga71d9a6a32f65b6d172f9696b3b9579b4", null ], + [ "separatorHSelector", "src_2ftxui_2dom_2separator_8cpp.html#a50413065cee4757447b35c3a500667d3", null ], + [ "separatorVSelector", "src_2ftxui_2dom_2separator_8cpp.html#a1a0211233bacd4eb4d31a8e3d58b5f48", null ], + [ "value_", "src_2ftxui_2dom_2separator_8cpp.html#ad84db3d1db4de4af9935d2d361626bdb", null ], + [ "style_", "src_2ftxui_2dom_2separator_8cpp.html#ac30a0a0ed81dc58d609a872c58242761", null ] +]; \ No newline at end of file diff --git a/src_2ftxui_2dom_2separator_8cpp_source.html b/src_2ftxui_2dom_2separator_8cpp_source.html new file mode 100644 index 000000000..1f5b663b3 --- /dev/null +++ b/src_2ftxui_2dom_2separator_8cpp_source.html @@ -0,0 +1,840 @@ + + + + + + + + +FTXUI: separator.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    src/ftxui/dom/separator.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <array> // for array, array<>::value_type
    +
    5#include <memory> // for make_shared, allocator
    +
    6#include <string> // for basic_string, string
    +
    7#include <utility> // for move
    +
    8
    +
    9#include "ftxui/dom/elements.hpp" // for Element, BorderStyle, LIGHT, separator, DOUBLE, EMPTY, HEAVY, separatorCharacter, separatorDouble, separatorEmpty, separatorHSelector, separatorHeavy, separatorLight, separatorStyled, separatorVSelector
    +
    10#include "ftxui/dom/node.hpp" // for Node
    +
    11#include "ftxui/dom/requirement.hpp" // for Requirement
    +
    12#include "ftxui/screen/box.hpp" // for Box
    +
    13#include "ftxui/screen/color.hpp" // for Color
    +
    14#include "ftxui/screen/pixel.hpp" // for Pixel
    +
    15#include "ftxui/screen/screen.hpp" // for Pixel, Screen
    +
    16
    +
    17namespace ftxui {
    +
    18
    +
    19namespace {
    +
    20using Charset = std::array<std::string, 2>; // NOLINT
    +
    21using Charsets = std::array<Charset, 6>; // NOLINT
    +
    22// NOLINTNEXTLINE
    +
    23const Charsets charsets = {
    +
    24 Charset{"│", "─"}, // LIGHT
    +
    25 Charset{"╏", "╍"}, // DASHED
    +
    26 Charset{"┃", "━"}, // HEAVY
    +
    27 Charset{"║", "═"}, // DOUBLE
    +
    28 Charset{"│", "─"}, // ROUNDED
    +
    29 Charset{" ", " "}, // EMPTY
    +
    30};
    +
    31
    +
    32class Separator : public Node {
    +
    33 public:
    +
    34 explicit Separator(std::string value) : value_(std::move(value)) {}
    +
    35
    +
    36 void ComputeRequirement() override {
    +
    37 requirement_.min_x = 1;
    +
    38 requirement_.min_y = 1;
    +
    39 }
    +
    40
    +
    41 void Render(Screen& screen) override {
    +
    42 for (int y = box_.y_min; y <= box_.y_max; ++y) {
    +
    43 for (int x = box_.x_min; x <= box_.x_max; ++x) {
    +
    44 Pixel& pixel = screen.PixelAt(x, y);
    +
    45 pixel.character = value_;
    +
    46 pixel.automerge = true;
    +
    47 }
    +
    48 }
    +
    49 }
    +
    50
    +
    51 std::string value_;
    +
    52};
    +
    53
    +
    54class SeparatorAuto : public Node {
    +
    55 public:
    +
    56 explicit SeparatorAuto(BorderStyle style) : style_(style) {}
    +
    57
    +
    58 void ComputeRequirement() override {
    +
    59 requirement_.min_x = 1;
    +
    60 requirement_.min_y = 1;
    +
    61 }
    +
    62
    +
    63 void Render(Screen& screen) override {
    +
    64 const bool is_column = (box_.x_max == box_.x_min);
    +
    65 const bool is_line = (box_.y_min == box_.y_max);
    +
    66
    +
    67 const std::string c =
    +
    68 charsets[style_][int(is_line && !is_column)]; // NOLINT
    +
    69
    +
    70 for (int y = box_.y_min; y <= box_.y_max; ++y) {
    +
    71 for (int x = box_.x_min; x <= box_.x_max; ++x) {
    +
    72 Pixel& pixel = screen.PixelAt(x, y);
    +
    73 pixel.character = c;
    +
    74 pixel.automerge = true;
    +
    75 }
    +
    76 }
    +
    77 }
    +
    78
    + +
    80};
    +
    81
    +
    82class SeparatorWithPixel : public SeparatorAuto {
    +
    83 public:
    +
    84 explicit SeparatorWithPixel(Pixel pixel)
    +
    85 : SeparatorAuto(LIGHT), pixel_(std::move(pixel)) {
    +
    86 pixel_.automerge = true;
    +
    87 }
    +
    88 void Render(Screen& screen) override {
    +
    89 for (int y = box_.y_min; y <= box_.y_max; ++y) {
    +
    90 for (int x = box_.x_min; x <= box_.x_max; ++x) {
    +
    91 screen.PixelAt(x, y) = pixel_;
    +
    92 }
    +
    93 }
    +
    94 }
    +
    95
    +
    96 private:
    +
    97 Pixel pixel_;
    +
    98};
    +
    99} // namespace
    +
    100
    +
    101/// @brief Draw a vertical or horizontal separation in between two other
    +
    102/// elements.
    +
    103/// @ingroup dom
    +
    104/// @see separator
    +
    105/// @see separatorLight
    +
    106/// @see separatorDashed
    +
    107/// @see separatorDouble
    +
    108/// @see separatorHeavy
    +
    109/// @see separatorEmpty
    +
    110/// @see separatorRounded
    +
    111/// @see separatorStyled
    +
    112/// @see separatorCharacter
    +
    113///
    +
    114/// Add a visual separation in between two elements.
    +
    115///
    +
    116/// ### Example
    +
    117///
    +
    118/// ```cpp
    +
    119/// // Use 'border' as a function...
    +
    120/// Element document = vbox({
    +
    121/// text("up"),
    +
    122/// separator(),
    +
    123/// text("down"),
    +
    124/// });
    +
    125/// ```
    +
    126///
    +
    127/// ### Output
    +
    128///
    +
    129/// ```bash
    +
    130/// up
    +
    131/// ────
    +
    132/// down
    +
    133/// ```
    +
    + +
    135 return std::make_shared<SeparatorAuto>(LIGHT);
    +
    136}
    +
    +
    137
    +
    138/// @brief Draw a vertical or horizontal separation in between two other
    +
    139/// elements.
    +
    140/// @param style the style of the separator.
    +
    141/// @ingroup dom
    +
    142/// @see separator
    +
    143/// @see separatorLight
    +
    144/// @see separatorDashed
    +
    145/// @see separatorDouble
    +
    146/// @see separatorHeavy
    +
    147/// @see separatorEmpty
    +
    148/// @see separatorRounded
    +
    149/// @see separatorStyled
    +
    150/// @see separatorCharacter
    +
    151///
    +
    152/// Add a visual separation in between two elements.
    +
    153///
    +
    154/// ### Example
    +
    155///
    +
    156/// ```cpp
    +
    157/// // Use 'border' as a function...
    +
    158/// Element document = vbox({
    +
    159/// text("up"),
    +
    160/// separatorStyled(DOUBLE),
    +
    161/// text("down"),
    +
    162/// });
    +
    163/// ```
    +
    164///
    +
    165/// ### Output
    +
    166///
    +
    167/// ```bash
    +
    168/// up
    +
    169/// ════
    +
    170/// down
    +
    171/// ```
    +
    + +
    173 return std::make_shared<SeparatorAuto>(style);
    +
    174}
    +
    +
    175
    +
    176/// @brief Draw a vertical or horizontal separation in between two other
    +
    177/// elements, using the LIGHT style.
    +
    178/// @ingroup dom
    +
    179/// @see separator
    +
    180/// @see separatorLight
    +
    181/// @see separatorDashed
    +
    182/// @see separatorDouble
    +
    183/// @see separatorHeavy
    +
    184/// @see separatorEmpty
    +
    185/// @see separatorRounded
    +
    186/// @see separatorStyled
    +
    187/// @see separatorCharacter
    +
    188///
    +
    189/// Add a visual separation in between two elements.
    +
    190///
    +
    191/// ### Example
    +
    192///
    +
    193/// ```cpp
    +
    194/// // Use 'border' as a function...
    +
    195/// Element document = vbox({
    +
    196/// text("up"),
    +
    197/// separatorLight(),
    +
    198/// text("down"),
    +
    199/// });
    +
    200/// ```
    +
    201///
    +
    202/// ### Output
    +
    203///
    +
    204/// ```bash
    +
    205/// up
    +
    206/// ────
    +
    207/// down
    +
    208/// ```
    +
    + +
    210 return std::make_shared<SeparatorAuto>(LIGHT);
    +
    211}
    +
    +
    212
    +
    213/// @brief Draw a vertical or horizontal separation in between two other
    +
    214/// elements, using the DASHED style.
    +
    215/// @ingroup dom
    +
    216/// @see separator
    +
    217/// @see separatorLight
    +
    218/// @see separatorDashed
    +
    219/// @see separatorDouble
    +
    220/// @see separatorHeavy
    +
    221/// @see separatorEmpty
    +
    222/// @see separatorRounded
    +
    223/// @see separatorStyled
    +
    224/// @see separatorCharacter
    +
    225///
    +
    226/// Add a visual separation in between two elements.
    +
    227///
    +
    228/// ### Example
    +
    229///
    +
    230/// ```cpp
    +
    231/// // Use 'border' as a function...
    +
    232/// Element document = vbox({
    +
    233/// text("up"),
    +
    234/// separatorLight(),
    +
    235/// text("down"),
    +
    236/// });
    +
    237/// ```
    +
    238///
    +
    239/// ### Output
    +
    240///
    +
    241/// ```bash
    +
    242/// up
    +
    243/// ╍╍╍╍
    +
    244/// down
    +
    245/// ```
    +
    + +
    247 return std::make_shared<SeparatorAuto>(DASHED);
    +
    248}
    +
    +
    249
    +
    250/// @brief Draw a vertical or horizontal separation in between two other
    +
    251/// elements, using the HEAVY style.
    +
    252/// @ingroup dom
    +
    253/// @see separator
    +
    254/// @see separatorLight
    +
    255/// @see separatorDashed
    +
    256/// @see separatorDouble
    +
    257/// @see separatorHeavy
    +
    258/// @see separatorEmpty
    +
    259/// @see separatorRounded
    +
    260/// @see separatorStyled
    +
    261/// @see separatorCharacter
    +
    262///
    +
    263/// Add a visual separation in between two elements.
    +
    264///
    +
    265/// ### Example
    +
    266///
    +
    267/// ```cpp
    +
    268/// // Use 'border' as a function...
    +
    269/// Element document = vbox({
    +
    270/// text("up"),
    +
    271/// separatorHeavy(),
    +
    272/// text("down"),
    +
    273/// });
    +
    274/// ```
    +
    275///
    +
    276/// ### Output
    +
    277///
    +
    278/// ```bash
    +
    279/// up
    +
    280/// ━━━━
    +
    281/// down
    +
    282/// ```
    +
    + +
    284 return std::make_shared<SeparatorAuto>(HEAVY);
    +
    285}
    +
    +
    286
    +
    287/// @brief Draw a vertical or horizontal separation in between two other
    +
    288/// elements, using the DOUBLE style.
    +
    289/// @ingroup dom
    +
    290/// @see separator
    +
    291/// @see separatorLight
    +
    292/// @see separatorDashed
    +
    293/// @see separatorDouble
    +
    294/// @see separatorHeavy
    +
    295/// @see separatorEmpty
    +
    296/// @see separatorRounded
    +
    297/// @see separatorStyled
    +
    298/// @see separatorCharacter
    +
    299///
    +
    300/// Add a visual separation in between two elements.
    +
    301///
    +
    302/// ### Example
    +
    303///
    +
    304/// ```cpp
    +
    305/// // Use 'border' as a function...
    +
    306/// Element document = vbox({
    +
    307/// text("up"),
    +
    308/// separatorDouble(),
    +
    309/// text("down"),
    +
    310/// });
    +
    311/// ```
    +
    312///
    +
    313/// ### Output
    +
    314///
    +
    315/// ```bash
    +
    316/// up
    +
    317/// ════
    +
    318/// down
    +
    319/// ```
    +
    + +
    321 return std::make_shared<SeparatorAuto>(DOUBLE);
    +
    322}
    +
    +
    323
    +
    324/// @brief Draw a vertical or horizontal separation in between two other
    +
    325/// elements, using the EMPTY style.
    +
    326/// @ingroup dom
    +
    327/// @see separator
    +
    328/// @see separatorLight
    +
    329/// @see separatorDashed
    +
    330/// @see separatorDouble
    +
    331/// @see separatorHeavy
    +
    332/// @see separatorEmpty
    +
    333/// @see separatorRounded
    +
    334/// @see separatorStyled
    +
    335/// @see separatorCharacter
    +
    336///
    +
    337/// Add a visual separation in between two elements.
    +
    338///
    +
    339/// ### Example
    +
    340///
    +
    341/// ```cpp
    +
    342/// // Use 'border' as a function...
    +
    343/// Element document = vbox({
    +
    344/// text("up"),
    +
    345/// separator(),
    +
    346/// text("down"),
    +
    347/// });
    +
    348/// ```
    +
    349///
    +
    350/// ### Output
    +
    351///
    +
    352/// ```bash
    +
    353/// up
    +
    354///
    +
    355/// down
    +
    356/// ```
    +
    + +
    358 return std::make_shared<SeparatorAuto>(EMPTY);
    +
    359}
    +
    +
    360
    +
    361/// @brief Draw a vertical or horizontal separation in between two other
    +
    362/// elements.
    +
    363/// @param value the character to fill the separator area.
    +
    364/// @ingroup dom
    +
    365/// @see separator
    +
    366/// @see separatorLight
    +
    367/// @see separatorDashed
    +
    368/// @see separatorDouble
    +
    369/// @see separatorHeavy
    +
    370/// @see separatorEmpty
    +
    371/// @see separatorRounded
    +
    372/// @see separatorStyled
    +
    373/// @see separatorCharacter
    +
    374///
    +
    375/// Add a visual separation in between two elements.
    +
    376///
    +
    377/// ### Example
    +
    378///
    +
    379/// ```cpp
    +
    380/// // Use 'border' as a function...
    +
    381/// Element document = vbox({
    +
    382/// text("up"),
    +
    383/// separator(),
    +
    384/// text("down"),
    +
    385/// });
    +
    386/// ```
    +
    387///
    +
    388/// ### Output
    +
    389///
    +
    390/// ```bash
    +
    391/// up
    +
    392/// ────
    +
    393/// down
    +
    394/// ```
    +
    +
    395Element separatorCharacter(std::string value) {
    +
    396 return std::make_shared<Separator>(std::move(value));
    +
    397}
    +
    +
    398
    +
    399/// @brief Draw a separator in between two element filled with a given pixel.
    +
    400/// @ingroup dom
    +
    401/// @see separator
    +
    402/// @see separatorLight
    +
    403/// @see separatorDashed
    +
    404/// @see separatorHeavy
    +
    405/// @see separatorDouble
    +
    406/// @see separatorStyled
    +
    407///
    +
    408/// ### Example
    +
    409///
    +
    410/// ```cpp
    +
    411/// Pixel empty;
    +
    412/// Element document = vbox({
    +
    413/// text("Up"),
    +
    414/// separator(empty),
    +
    415/// text("Down"),
    +
    416/// })
    +
    417/// ```
    +
    418///
    +
    419/// ### Output
    +
    420///
    +
    421/// ```bash
    +
    422/// Up
    +
    423///
    +
    424/// Down
    +
    425/// ```
    +
    + +
    427 return std::make_shared<SeparatorWithPixel>(std::move(pixel));
    +
    428}
    +
    +
    429
    +
    430/// @brief Draw a horizontal bar, with the area in between left/right colored
    +
    431/// differently.
    +
    432/// @param left the left limit of the active area.
    +
    433/// @param right the right limit of the active area.
    +
    434/// @param selected_color the color of the selected area.
    +
    435/// @param unselected_color the color of the unselected area.
    +
    436///
    +
    437/// ### Example
    +
    438///
    +
    439/// ```cpp
    +
    440/// Element document = separatorHSelector(2,5, Color::White, Color::Blue);
    +
    441/// ```
    +
    + +
    443 float right,
    +
    444 Color unselected_color,
    +
    445 Color selected_color) {
    +
    446 class Impl : public Node {
    +
    447 public:
    +
    448 Impl(float left, float right, Color selected_color, Color unselected_color)
    +
    449 : left_(left),
    +
    450 right_(right),
    +
    451 unselected_color_(unselected_color),
    +
    452 selected_color_(selected_color) {}
    +
    453 void ComputeRequirement() override {
    +
    454 requirement_.min_x = 1;
    +
    455 requirement_.min_y = 1;
    +
    456 }
    +
    457
    +
    458 void Render(Screen& screen) override {
    +
    459 if (box_.y_max < box_.y_min) {
    +
    460 return;
    +
    461 }
    +
    462
    +
    463 // This are the two location with an empty demi-cell.
    +
    464 int demi_cell_left = int(left_ * 2.F - 1.F); // NOLINT
    +
    465 int demi_cell_right = int(right_ * 2.F + 2.F); // NOLINT
    +
    466
    +
    467 const int y = box_.y_min;
    +
    468 for (int x = box_.x_min; x <= box_.x_max; ++x) {
    +
    469 Pixel& pixel = screen.PixelAt(x, y);
    +
    470
    +
    471 const int a = (x - box_.x_min) * 2;
    +
    472 const int b = a + 1;
    +
    473 const bool a_empty = demi_cell_left == a || demi_cell_right == a;
    +
    474 const bool b_empty = demi_cell_left == b || demi_cell_right == b;
    +
    475
    +
    476 if (!a_empty && !b_empty) {
    +
    477 pixel.character = "─";
    +
    478 pixel.automerge = true;
    +
    479 } else {
    +
    480 pixel.character = a_empty ? "╶" : "╴"; // NOLINT
    +
    481 pixel.automerge = false;
    +
    482 }
    +
    483
    +
    484 if (demi_cell_left <= a && b <= demi_cell_right) {
    +
    485 pixel.foreground_color = selected_color_;
    +
    486 } else {
    +
    487 pixel.foreground_color = unselected_color_;
    +
    488 }
    +
    489 }
    +
    490 }
    +
    491
    +
    492 float left_;
    +
    493 float right_;
    +
    494 Color unselected_color_;
    +
    495 Color selected_color_;
    +
    496 };
    +
    497 return std::make_shared<Impl>(left, right, unselected_color, selected_color);
    +
    498}
    +
    +
    499
    +
    500/// @brief Draw an vertical bar, with the area in between up/downcolored
    +
    501/// differently.
    +
    502/// @param up the left limit of the active area.
    +
    503/// @param down the right limit of the active area.
    +
    504/// @param selected_color the color of the selected area.
    +
    505/// @param unselected_color the color of the unselected area.
    +
    506///
    +
    507/// ### Example
    +
    508///
    +
    509/// ```cpp
    +
    510/// Element document = separatorHSelector(2,5, Color::White, Color::Blue);
    +
    511/// ```
    +
    + +
    513 float down,
    +
    514 Color unselected_color,
    +
    515 Color selected_color) {
    +
    516 class Impl : public Node {
    +
    517 public:
    +
    518 Impl(float up, float down, Color unselected_color, Color selected_color)
    +
    519 : up_(up),
    +
    520 down_(down),
    +
    521 unselected_color_(unselected_color),
    +
    522 selected_color_(selected_color) {}
    +
    523 void ComputeRequirement() override {
    +
    524 requirement_.min_x = 1;
    +
    525 requirement_.min_y = 1;
    +
    526 }
    +
    527
    +
    528 void Render(Screen& screen) override {
    +
    529 if (box_.x_max < box_.x_min) {
    +
    530 return;
    +
    531 }
    +
    532
    +
    533 // This are the two location with an empty demi-cell.
    +
    534 const int demi_cell_up = int(up_ * 2 - 1);
    +
    535 const int demi_cell_down = int(down_ * 2 + 2);
    +
    536
    +
    537 const int x = box_.x_min;
    +
    538 for (int y = box_.y_min; y <= box_.y_max; ++y) {
    +
    539 Pixel& pixel = screen.PixelAt(x, y);
    +
    540
    +
    541 const int a = (y - box_.y_min) * 2;
    +
    542 const int b = a + 1;
    +
    543 const bool a_empty = demi_cell_up == a || demi_cell_down == a;
    +
    544 const bool b_empty = demi_cell_up == b || demi_cell_down == b;
    +
    545
    +
    546 if (!a_empty && !b_empty) {
    +
    547 pixel.character = "│";
    +
    548 pixel.automerge = true;
    +
    549 } else {
    +
    550 pixel.character = a_empty ? "╷" : "╵"; // NOLINT
    +
    551 pixel.automerge = false;
    +
    552 }
    +
    553
    +
    554 if (demi_cell_up <= a && b <= demi_cell_down) {
    +
    555 pixel.foreground_color = selected_color_;
    +
    556 } else {
    +
    557 pixel.foreground_color = unselected_color_;
    +
    558 }
    +
    559 }
    +
    560 }
    +
    561
    +
    562 float up_;
    +
    563 float down_;
    +
    564 Color unselected_color_;
    +
    565 Color selected_color_;
    +
    566 };
    +
    567 return std::make_shared<Impl>(up, down, unselected_color, selected_color);
    +
    568}
    +
    +
    569
    +
    570} // namespace ftxui
    + + + +
    Node is the base class for all elements in the DOM tree.
    Definition node.hpp:37
    +
    Element separatorStyled(BorderStyle)
    Draw a vertical or horizontal separation in between two other elements.
    +
    Element separatorEmpty()
    Draw a vertical or horizontal separation in between two other elements, using the EMPTY style.
    +
    Element separatorLight()
    Draw a vertical or horizontal separation in between two other elements, using the LIGHT style.
    +
    Element separatorDashed()
    Draw a vertical or horizontal separation in between two other elements, using the DASHED style.
    +
    Element separatorCharacter(std::string)
    Draw a vertical or horizontal separation in between two other elements.
    +
    Element separator()
    Draw a vertical or horizontal separation in between two other elements.
    +
    void Render(Screen &screen, const Element &element)
    Display an element on a ftxui::Screen.
    Definition node.cpp:84
    +
    Element separatorDouble()
    Draw a vertical or horizontal separation in between two other elements, using the DOUBLE style.
    +
    Element separatorHeavy()
    Draw a vertical or horizontal separation in between two other elements, using the HEAVY style.
    +
    BorderStyle
    BorderStyle is an enumeration that represents the different styles of borders that can be applied to ...
    Definition elements.hpp:35
    +
    @ EMPTY
    Definition elements.hpp:41
    +
    @ DOUBLE
    Definition elements.hpp:39
    +
    @ HEAVY
    Definition elements.hpp:38
    +
    @ DASHED
    Definition elements.hpp:37
    +
    @ LIGHT
    Definition elements.hpp:36
    +
    Color foreground_color
    Definition pixel.hpp:49
    +
    std::string character
    Definition pixel.hpp:45
    +
    Pixel & PixelAt(int x, int y)
    Access a cell (Pixel) at a given position.
    Definition image.cpp:43
    +
    bool automerge
    Definition pixel.hpp:36
    +
    Color is a class that represents a color in the terminal user interface.
    Definition color.hpp:22
    +
    A rectangular grid of Pixel.
    Definition screen.hpp:26
    +
    A Unicode character and its associated style.
    Definition pixel.hpp:15
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    Element separatorVSelector(float up, float down, Color unselected_color, Color selected_color)
    Draw an vertical bar, with the area in between up/downcolored differently.
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    Element separatorHSelector(float left, float right, Color unselected_color, Color selected_color)
    Draw a horizontal bar, with the area in between left/right colored differently.
    + + + +
    std::uint8_t left
    Definition screen.cpp:130
    +
    std::uint8_t down
    Definition screen.cpp:133
    +
    std::uint8_t right
    Definition screen.cpp:132
    + +
    std::function< void(Pixel &)> style_
    +
    std::string value_
    +
    +
    + + + + + diff --git a/src_2ftxui_2dom_2size_8cpp.html b/src_2ftxui_2dom_2size_8cpp.html new file mode 100644 index 000000000..6f7be4041 --- /dev/null +++ b/src_2ftxui_2dom_2size_8cpp.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: size.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    size.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + +

    +Functions

    Decorator size (WidthOrHeight direction, Constraint constraint, int value)
     Apply a constraint on the size of an element.
     
    +
    +
    + + + + + diff --git a/src_2ftxui_2dom_2size_8cpp.js b/src_2ftxui_2dom_2size_8cpp.js new file mode 100644 index 000000000..2dfd43b5b --- /dev/null +++ b/src_2ftxui_2dom_2size_8cpp.js @@ -0,0 +1,4 @@ +var src_2ftxui_2dom_2size_8cpp = +[ + [ "size", "src_2ftxui_2dom_2size_8cpp.html#ga201220986fbdc539e42efe067985cbdb", null ] +]; \ No newline at end of file diff --git a/src_2ftxui_2dom_2size_8cpp_source.html b/src_2ftxui_2dom_2size_8cpp_source.html new file mode 100644 index 000000000..334c5c330 --- /dev/null +++ b/src_2ftxui_2dom_2size_8cpp_source.html @@ -0,0 +1,323 @@ + + + + + + + + +FTXUI: size.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    src/ftxui/dom/size.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <algorithm> // for min, max
    +
    5#include <memory> // for make_shared, __shared_ptr_access
    +
    6#include <utility> // for move
    +
    7
    +
    8#include "ftxui/dom/elements.hpp" // for Constraint, WidthOrHeight, EQUAL, GREATER_THAN, LESS_THAN, WIDTH, unpack, Decorator, Element, size
    +
    9#include "ftxui/dom/node.hpp" // for Node, Elements
    +
    10#include "ftxui/dom/requirement.hpp" // for Requirement
    +
    11#include "ftxui/screen/box.hpp" // for Box
    +
    12
    +
    13namespace ftxui {
    +
    14
    +
    15namespace {
    +
    16class Size : public Node {
    +
    17 public:
    +
    18 Size(Element child, WidthOrHeight direction, Constraint constraint, int value)
    +
    19 : Node(unpack(std::move(child))),
    +
    20 direction_(direction),
    +
    21 constraint_(constraint),
    +
    22 value_(std::max(0, value)) {}
    +
    23
    +
    24 void ComputeRequirement() override {
    + +
    26 requirement_ = children_[0]->requirement();
    +
    27
    +
    28 auto& value = direction_ == WIDTH ? requirement_.min_x : requirement_.min_y;
    +
    29
    +
    30 switch (constraint_) {
    +
    31 case LESS_THAN:
    +
    32 value = std::min(value, value_);
    +
    33 break;
    +
    34 case EQUAL:
    +
    35 value = value_;
    +
    36 break;
    +
    37 case GREATER_THAN:
    +
    38 value = std::max(value, value_);
    +
    39 break;
    +
    40 }
    +
    41
    +
    42 if (direction_ == WIDTH) {
    +
    43 requirement_.flex_grow_x = 0;
    +
    44 requirement_.flex_shrink_x = 0;
    +
    45 } else {
    +
    46 requirement_.flex_grow_y = 0;
    +
    47 requirement_.flex_shrink_y = 0;
    +
    48 }
    +
    49 }
    +
    50
    +
    51 void SetBox(Box box) override {
    +
    52 Node::SetBox(box);
    +
    53
    +
    54 if (direction_ == WIDTH) {
    +
    55 switch (constraint_) {
    +
    56 case LESS_THAN:
    +
    57 case EQUAL:
    +
    58 box.x_max = std::min(box.x_min + value_ + 1, box.x_max);
    +
    59 break;
    +
    60 case GREATER_THAN:
    +
    61 break;
    +
    62 }
    +
    63 } else {
    +
    64 switch (constraint_) {
    +
    65 case LESS_THAN:
    +
    66 case EQUAL:
    +
    67 box.y_max = std::min(box.y_min + value_ + 1, box.y_max);
    +
    68 break;
    +
    69 case GREATER_THAN:
    +
    70 break;
    +
    71 }
    +
    72 }
    +
    73 children_[0]->SetBox(box);
    +
    74 }
    +
    75
    +
    76 private:
    +
    77 WidthOrHeight direction_;
    +
    78 Constraint constraint_;
    +
    79 int value_;
    +
    80};
    +
    81} // namespace
    +
    82
    +
    83/// @brief Apply a constraint on the size of an element.
    +
    84/// @param direction Whether the WIDTH of the HEIGHT of the element must be
    +
    85/// constrained.
    +
    86/// @param constraint The type of constaint.
    +
    87/// @param value The value.
    +
    88/// @ingroup dom
    +
    +
    89Decorator size(WidthOrHeight direction, Constraint constraint, int value) {
    +
    90 return [=](Element e) {
    +
    91 return std::make_shared<Size>(std::move(e), direction, constraint, value);
    +
    92 };
    +
    93}
    +
    +
    94
    +
    95} // namespace ftxui
    + + +
    virtual void SetBox(Box box)
    Assign a position and a dimension to an element for drawing.
    Definition node.cpp:41
    +
    virtual void ComputeRequirement()
    Compute how much space an element needs.
    Definition node.cpp:20
    +
    Decorator size(WidthOrHeight, Constraint, int value)
    Apply a constraint on the size of an element.
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    WidthOrHeight
    Definition elements.hpp:161
    + +
    std::function< Element(Element)> Decorator
    Definition elements.hpp:24
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    + +
    @ LESS_THAN
    Definition elements.hpp:162
    + +
    @ GREATER_THAN
    Definition elements.hpp:162
    + + +
    std::string value_
    +
    +
    + + + + + diff --git a/src_2ftxui_2dom_2spinner_8cpp.html b/src_2ftxui_2dom_2spinner_8cpp.html new file mode 100644 index 000000000..cbcf7249a --- /dev/null +++ b/src_2ftxui_2dom_2spinner_8cpp.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: spinner.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    spinner.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + +

    +Functions

    Element spinner (int charset_index, size_t image_index)
     Useful to represent the effect of time and/or events. This displays an ASCII art "video".
     
    +
    +
    + + + + + diff --git a/src_2ftxui_2dom_2spinner_8cpp.js b/src_2ftxui_2dom_2spinner_8cpp.js new file mode 100644 index 000000000..4d4968ba9 --- /dev/null +++ b/src_2ftxui_2dom_2spinner_8cpp.js @@ -0,0 +1,4 @@ +var src_2ftxui_2dom_2spinner_8cpp = +[ + [ "spinner", "src_2ftxui_2dom_2spinner_8cpp.html#ga3b08e0030a0831d3ec3e2a505908273b", null ] +]; \ No newline at end of file diff --git a/src_2ftxui_2dom_2spinner_8cpp_source.html b/src_2ftxui_2dom_2spinner_8cpp_source.html new file mode 100644 index 000000000..318e7f6cf --- /dev/null +++ b/src_2ftxui_2dom_2spinner_8cpp_source.html @@ -0,0 +1,519 @@ + + + + + + + + +FTXUI: spinner.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    src/ftxui/dom/spinner.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <cstddef> // for size_t
    +
    5#include <string> // for basic_string, string
    +
    6#include <utility> // for move
    +
    7#include <vector> // for vector, __alloc_traits<>::value_type
    +
    8
    +
    9#include "ftxui/dom/elements.hpp" // for Element, gauge, text, vbox, spinner
    +
    10
    +
    11namespace ftxui {
    +
    12
    +
    13namespace {
    +
    14// NOLINTNEXTLINE
    +
    15const std::vector<std::vector<std::vector<std::string>>> elements = {
    +
    16 {
    +
    17 {"Replaced by the gauge"},
    +
    18 },
    +
    19 {
    +
    20 {". "},
    +
    21 {".. "},
    +
    22 {"..."},
    +
    23 },
    +
    24 {
    +
    25 {"|"},
    +
    26 {"/"},
    +
    27 {"-"},
    +
    28 {"\\"},
    +
    29 },
    +
    30 {
    +
    31 {"+"},
    +
    32 {"x"},
    +
    33 },
    +
    34 {
    +
    35 {"| "},
    +
    36 {"|| "},
    +
    37 {"|||"},
    +
    38 },
    +
    39 {
    +
    40 {"←"},
    +
    41 {"↖"},
    +
    42 {"↑"},
    +
    43 {"↗"},
    +
    44 {"→"},
    +
    45 {"↘"},
    +
    46 {"↓"},
    +
    47 {"↙"},
    +
    48 },
    +
    49 {
    +
    50 {"▁"},
    +
    51 {"▂"},
    +
    52 {"▃"},
    +
    53 {"▄"},
    +
    54 {"▅"},
    +
    55 {"▆"},
    +
    56 {"▇"},
    +
    57 {"█"},
    +
    58 {"▇"},
    +
    59 {"▆"},
    +
    60 {"▅"},
    +
    61 {"▄"},
    +
    62 {"▃"},
    +
    63 {"▁"},
    +
    64 },
    +
    65 {
    +
    66 {"▉"},
    +
    67 {"▊"},
    +
    68 {"▋"},
    +
    69 {"▌"},
    +
    70 {"▍"},
    +
    71 {"▎"},
    +
    72 {"▏"},
    +
    73 {"▎"},
    +
    74 {"▍"},
    +
    75 {"▌"},
    +
    76 {"▋"},
    +
    77 {"▊"},
    +
    78 },
    +
    79 {
    +
    80 {"▖"},
    +
    81 {"▘"},
    +
    82 {"▝"},
    +
    83 {"▗"},
    +
    84 },
    +
    85 {
    +
    86 {"◢"},
    +
    87 {"◣"},
    +
    88 {"◤"},
    +
    89 {"◥"},
    +
    90 },
    +
    91 {
    +
    92 {"◰"},
    +
    93 {"◳"},
    +
    94 {"◲"},
    +
    95 {"◱"},
    +
    96 },
    +
    97 {
    +
    98 {"◴"},
    +
    99 {"◷"},
    +
    100 {"◶"},
    +
    101 {"◵"},
    +
    102 },
    +
    103 {
    +
    104 {"◐"},
    +
    105 {"◓"},
    +
    106 {"◑"},
    +
    107 {"◒"},
    +
    108 },
    +
    109 {
    +
    110 {"◡"},
    +
    111 {"⊙"},
    +
    112 {"◠"},
    +
    113 },
    +
    114 {
    +
    115 {"⠁"},
    +
    116 {"⠂"},
    +
    117 {"⠄"},
    +
    118 {"⡀"},
    +
    119 {"⢀"},
    +
    120 {"⠠"},
    +
    121 {"⠐"},
    +
    122 {"⠈"},
    +
    123 },
    +
    124 {
    +
    125 {"⠋"},
    +
    126 {"⠙"},
    +
    127 {"⠹"},
    +
    128 {"⠸"},
    +
    129 {"⠼"},
    +
    130 {"⠴"},
    +
    131 {"⠦"},
    +
    132 {"⠧"},
    +
    133 {"⠇"},
    +
    134 {"⠏"},
    +
    135 },
    +
    136 {
    +
    137 {"(*----------)"}, {"(-*---------)"}, {"(--*--------)"},
    +
    138 {"(---*-------)"}, {"(----*------)"}, {"(-----*-----)"},
    +
    139 {"(------*----)"}, {"(-------*---)"}, {"(--------*--)"},
    +
    140 {"(---------*-)"}, {"(----------*)"}, {"(---------*-)"},
    +
    141 {"(--------*--)"}, {"(-------*---)"}, {"(------*----)"},
    +
    142 {"(-----*-----)"}, {"(----*------)"}, {"(---*-------)"},
    +
    143 {"(--*--------)"}, {"(-*---------)"},
    +
    144 },
    +
    145 {
    +
    146 {"[ ]"},
    +
    147 {"[= ]"},
    +
    148 {"[== ]"},
    +
    149 {"[=== ]"},
    +
    150 {"[==== ]"},
    +
    151 {"[===== ]"},
    +
    152 {"[======]"},
    +
    153 {"[===== ]"},
    +
    154 {"[==== ]"},
    +
    155 {"[=== ]"},
    +
    156 {"[== ]"},
    +
    157 {"[= ]"},
    +
    158 },
    +
    159 {
    +
    160 {"[ ]"},
    +
    161 {"[= ]"},
    +
    162 {"[== ]"},
    +
    163 {"[=== ]"},
    +
    164 {"[==== ]"},
    +
    165 {"[===== ]"},
    +
    166 {"[======]"},
    +
    167 {"[ =====]"},
    +
    168 {"[ ====]"},
    +
    169 {"[ ===]"},
    +
    170 {"[ ==]"},
    +
    171 {"[ =]"},
    +
    172 },
    +
    173 {
    +
    174 {"[== ]"},
    +
    175 {"[== ]"},
    +
    176 {"[== ]"},
    +
    177 {"[== ]"},
    +
    178 {"[== ]"},
    +
    179 {" [== ]"},
    +
    180 {"[ == ]"},
    +
    181 {"[ == ]"},
    +
    182 {"[ ==]"},
    +
    183 {"[ ==]"},
    +
    184 {"[ ==]"},
    +
    185 {"[ ==]"},
    +
    186 {"[ ==]"},
    +
    187 {"[ ==] "},
    +
    188 {"[ == ]"},
    +
    189 {"[ == ]"},
    +
    190 },
    +
    191 {
    +
    192 {
    +
    193 " ─╮",
    +
    194 " │",
    +
    195 " ",
    +
    196 },
    +
    197 {
    +
    198 " ╮",
    +
    199 " │",
    +
    200 " ╯",
    +
    201 },
    +
    202 {
    +
    203 " ",
    +
    204 " │",
    +
    205 " ─╯",
    +
    206 },
    +
    207 {
    +
    208 " ",
    +
    209 " ",
    +
    210 "╰─╯",
    +
    211 },
    +
    212 {
    +
    213 " ",
    +
    214 "│ ",
    +
    215 "╰─ ",
    +
    216 },
    +
    217 {
    +
    218 "╭ ",
    +
    219 "│ ",
    +
    220 "╰ ",
    +
    221 },
    +
    222 {
    +
    223 "╭─ ",
    +
    224 "│ ",
    +
    225 " ",
    +
    226 },
    +
    227 {
    +
    228 "╭─╮",
    +
    229 " ",
    +
    230 " ",
    +
    231 },
    +
    232 },
    +
    233 {
    +
    234 {
    +
    235 " /\\O ",
    +
    236 " /\\/",
    +
    237 " /\\ ",
    +
    238 " / \\ ",
    +
    239 "LOL LOL",
    +
    240 },
    +
    241 {
    +
    242 " _O ",
    +
    243 " //|_ ",
    +
    244 " | ",
    +
    245 " /| ",
    +
    246 " LLOL ",
    +
    247 },
    +
    248 {
    +
    249 " O ",
    +
    250 " /_ ",
    +
    251 " |\\ ",
    +
    252 " / | ",
    +
    253 " LOLLOL ",
    +
    254 },
    +
    255 },
    +
    256 {
    +
    257 {" ", "_______", " "},
    +
    258 {" ", "______/", " "},
    +
    259 {" _", "_____/ ", " "},
    +
    260 {" _ ", "____/ \\", " "},
    +
    261 {" _ ", "___/ \\ ", " \\"},
    +
    262 {" _ ", "__/ \\ ", " \\_"},
    +
    263 {" _ ", "_/ \\ ", " \\_/"},
    +
    264 {" _ ", "/ \\ _", " \\_/ "},
    +
    265 {"_ ", " \\ __", " \\_/ "},
    +
    266 {" ", "\\ ___", " \\_/ "},
    +
    267 {" ", " ___", "\\_/ "},
    +
    268 {" ", " _____", "_/ "},
    +
    269 {" ", " ______", "/ "},
    +
    270 {" ", "_______", " "},
    +
    271 },
    +
    272};
    +
    273
    +
    274} // namespace
    +
    275
    +
    276/// @brief Useful to represent the effect of time and/or events. This displays
    +
    277/// an ASCII art "video".
    +
    278/// @param charset_index The type of "video".
    +
    279/// @param image_index The "frame" of the video. You need to increase this for
    +
    280/// every "step".
    +
    281/// @ingroup dom
    +
    +
    282Element spinner(int charset_index, size_t image_index) {
    +
    283 if (charset_index <= 0) {
    +
    284 const int progress_size = 40;
    +
    285 image_index %= progress_size;
    +
    286 if (image_index > progress_size / 2) {
    +
    287 image_index = progress_size - image_index;
    +
    288 }
    +
    289 return gauge(float(image_index) * 0.05F); // NOLINT
    +
    290 }
    +
    291 charset_index %= int(elements.size());
    +
    292 image_index %= int(elements[charset_index].size());
    +
    293 std::vector<Element> lines;
    +
    294 for (const auto& it : elements[charset_index][image_index]) {
    +
    295 lines.push_back(text(it));
    +
    296 }
    +
    297 return vbox(std::move(lines));
    +
    298}
    +
    +
    299
    +
    300} // namespace ftxui
    + +
    Decorator size(WidthOrHeight, Constraint, int value)
    Apply a constraint on the size of an element.
    +
    Element spinner(int charset_index, size_t image_index)
    Useful to represent the effect of time and/or events. This displays an ASCII art "video".
    +
    Element text(std::wstring text)
    Display a piece of unicode text.
    Definition text.cpp:160
    +
    Element gauge(float progress)
    Draw a high definition progress bar.
    +
    Element vbox(Elements)
    A container displaying elements vertically one by one.
    Definition vbox.cpp:96
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    +
    + + + + + diff --git a/src_2ftxui_2dom_2table_8cpp.html b/src_2ftxui_2dom_2table_8cpp.html new file mode 100644 index 000000000..c625ed272 --- /dev/null +++ b/src_2ftxui_2dom_2table_8cpp.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: table.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    table.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    +
    +
    + + + + + diff --git a/src_2ftxui_2dom_2table_8cpp_source.html b/src_2ftxui_2dom_2table_8cpp_source.html new file mode 100644 index 000000000..38842d80d --- /dev/null +++ b/src_2ftxui_2dom_2table_8cpp_source.html @@ -0,0 +1,740 @@ + + + + + + + + +FTXUI: table.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    src/ftxui/dom/table.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2021 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include "ftxui/dom/table.hpp"
    +
    5
    +
    6#include <algorithm> // for max
    +
    7#include <initializer_list> // for initializer_list
    +
    8#include <memory> // for allocator, shared_ptr, allocator_traits<>::value_type
    +
    9#include <utility> // for move, swap
    +
    10#include <vector> // for vector
    +
    11
    +
    12#include "ftxui/dom/elements.hpp" // for Element, operator|, text, separatorCharacter, Elements, BorderStyle, Decorator, emptyElement, size, gridbox, EQUAL, flex, flex_shrink, HEIGHT, WIDTH
    +
    13
    +
    14namespace ftxui {
    +
    15namespace {
    +
    16
    +
    17bool IsCell(int x, int y) {
    +
    18 return x % 2 == 1 && y % 2 == 1;
    +
    19}
    +
    20
    +
    21// NOLINTNEXTLINE
    +
    22static std::string charset[6][6] = {
    +
    23 {"┌", "┐", "└", "┘", "─", "│"}, // LIGHT
    +
    24 {"┏", "┓", "┗", "┛", "╍", "╏"}, // DASHED
    +
    25 {"┏", "┓", "┗", "┛", "━", "┃"}, // HEAVY
    +
    26 {"╔", "╗", "╚", "╝", "═", "║"}, // DOUBLE
    +
    27 {"╭", "╮", "╰", "╯", "─", "│"}, // ROUNDED
    +
    28 {" ", " ", " ", " ", " ", " "}, // EMPTY
    +
    29};
    +
    30
    +
    31int Wrap(int input, int modulo) {
    +
    32 input %= modulo;
    +
    33 input += modulo;
    +
    34 input %= modulo;
    +
    35 return input;
    +
    36}
    +
    37
    +
    38void Order(int& a, int& b) {
    +
    39 if (a >= b) {
    +
    40 std::swap(a, b);
    +
    41 }
    +
    42}
    +
    43
    +
    44} // namespace
    +
    45
    +
    46/// @brief Create an empty table.
    +
    + +
    48 Initialize({});
    +
    49}
    +
    +
    50
    +
    51/// @brief Create a table from a vector of vector of string.
    +
    52/// @param input The input data.
    +
    +
    53Table::Table(std::vector<std::vector<std::string>> input) {
    +
    54 std::vector<std::vector<Element>> output;
    +
    55 output.reserve(input.size());
    +
    56 for (auto& row : input) {
    +
    57 output.emplace_back();
    +
    58 auto& output_row = output.back();
    +
    59 output_row.reserve(row.size());
    +
    60 for (auto& cell : row) {
    +
    61 output_row.push_back(text(std::move(cell)));
    +
    62 }
    +
    63 }
    +
    64 Initialize(std::move(output));
    +
    65}
    +
    +
    66
    +
    67/// @brief Create a table from a vector of vector of Element
    +
    68/// @param input The input elements.
    +
    +
    69Table::Table(std::vector<std::vector<Element>> input) {
    +
    70 Initialize(std::move(input));
    +
    71}
    +
    +
    72
    +
    73// @brief Create a table from a list of list of string.
    +
    74// @param init The input data.
    +
    +
    75Table::Table(std::initializer_list<std::vector<std::string>> init) {
    +
    76 std::vector<std::vector<Element>> input;
    +
    77 for (const auto& row : init) {
    +
    78 std::vector<Element> output_row;
    +
    79 output_row.reserve(row.size());
    +
    80 for (const auto& cell : row) {
    +
    81 output_row.push_back(text(cell));
    +
    82 }
    +
    83 input.push_back(std::move(output_row));
    +
    84 }
    +
    85 Initialize(std::move(input));
    +
    86}
    +
    +
    87
    +
    88// private
    +
    89void Table::Initialize(std::vector<std::vector<Element>> input) {
    +
    90 input_dim_y_ = static_cast<int>(input.size());
    +
    91 input_dim_x_ = 0;
    +
    92 for (auto& row : input) {
    +
    93 input_dim_x_ = std::max(input_dim_x_, int(row.size()));
    +
    94 }
    +
    95
    +
    96 dim_y_ = 2 * input_dim_y_ + 1;
    +
    97 dim_x_ = 2 * input_dim_x_ + 1;
    +
    98
    +
    99 // Reserve space.
    +
    100 elements_.resize(dim_y_);
    +
    101 for (int y = 0; y < dim_y_; ++y) {
    +
    102 elements_[y].resize(dim_x_);
    +
    103 }
    +
    104
    +
    105 // Transfert elements_ from |input| toward |elements_|.
    +
    106 {
    +
    107 int y = 1;
    +
    108 for (auto& row : input) {
    +
    109 int x = 1;
    +
    110 for (auto& cell : row) {
    +
    111 elements_[y][x] = std::move(cell);
    +
    112 x += 2;
    +
    113 }
    +
    114 y += 2;
    +
    115 }
    +
    116 }
    +
    117
    +
    118 // Add empty element for the border.
    +
    119 for (int y = 0; y < dim_y_; ++y) {
    +
    120 for (int x = 0; x < dim_x_; ++x) {
    +
    121 auto& element = elements_[y][x];
    +
    122
    +
    123 if (IsCell(x, y)) {
    +
    124 if (!element) {
    +
    125 element = emptyElement();
    +
    126 }
    +
    127 continue;
    +
    128 }
    +
    129
    +
    130 element = emptyElement();
    +
    131 }
    +
    132 }
    +
    133}
    +
    134
    +
    135/// @brief Select a row of the table.
    +
    136/// @param index The index of the row to select.
    +
    137/// @note You can use negative index to select from the end.
    +
    + +
    139 return SelectRectangle(0, -1, index, index);
    +
    140}
    +
    +
    141
    +
    142/// @brief Select a range of rows of the table.
    +
    143/// @param row_min The first row to select.
    +
    144/// @param row_max The last row to select.
    +
    145/// @note You can use negative index to select from the end.
    +
    +
    146TableSelection Table::SelectRows(int row_min, int row_max) {
    +
    147 return SelectRectangle(0, -1, row_min, row_max);
    +
    148}
    +
    +
    149
    +
    150/// @brief Select a column of the table.
    +
    151/// @param index The index of the column to select.
    +
    152/// @note You can use negative index to select from the end.
    +
    + +
    154 return SelectRectangle(index, index, 0, -1);
    +
    155}
    +
    +
    156
    +
    157/// @brief Select a range of columns of the table.
    +
    158/// @param column_min The first column to select.
    +
    159/// @param column_max The last column to select.
    +
    160/// @note You can use negative index to select from the end.
    +
    +
    161TableSelection Table::SelectColumns(int column_min, int column_max) {
    +
    162 return SelectRectangle(column_min, column_max, 0, -1);
    +
    163}
    +
    +
    164
    +
    165/// @brief Select a cell of the table.
    +
    166/// @param column The column of the cell to select.
    +
    167/// @param row The row of the cell to select.
    +
    168/// @note You can use negative index to select from the end.
    +
    +
    169TableSelection Table::SelectCell(int column, int row) {
    +
    170 return SelectRectangle(column, column, row, row);
    +
    171}
    +
    +
    172
    +
    173/// @brief Select a rectangle of the table.
    +
    174/// @param column_min The first column to select.
    +
    175/// @param column_max The last column to select.
    +
    176/// @param row_min The first row to select.
    +
    177/// @param row_max The last row to select.
    +
    178/// @note You can use negative index to select from the end.
    +
    + +
    180 int column_max,
    +
    181 int row_min,
    +
    182 int row_max) {
    +
    183 column_min = Wrap(column_min, input_dim_x_);
    +
    184 column_max = Wrap(column_max, input_dim_x_);
    +
    185 Order(column_min, column_max);
    +
    186 row_min = Wrap(row_min, input_dim_y_);
    +
    187 row_max = Wrap(row_max, input_dim_y_);
    +
    188 Order(row_min, row_max);
    +
    189
    +
    190 TableSelection output; // NOLINT
    +
    191 output.table_ = this;
    +
    192 output.x_min_ = 2 * column_min;
    +
    193 output.x_max_ = 2 * column_max + 2;
    +
    194 output.y_min_ = 2 * row_min;
    +
    195 output.y_max_ = 2 * row_max + 2;
    +
    196 return output;
    +
    197}
    +
    +
    198
    +
    199/// @brief Select all the table.
    +
    + +
    201 TableSelection output; // NOLINT
    +
    202 output.table_ = this;
    +
    203 output.x_min_ = 0;
    +
    204 output.x_max_ = dim_x_ - 1;
    +
    205 output.y_min_ = 0;
    +
    206 output.y_max_ = dim_y_ - 1;
    +
    207 return output;
    +
    208}
    +
    +
    209
    +
    210/// @brief Render the table.
    +
    211/// @return The rendered table. This is an element you can draw.
    +
    + +
    213 for (int y = 0; y < dim_y_; ++y) {
    +
    214 for (int x = 0; x < dim_x_; ++x) {
    +
    215 auto& it = elements_[y][x];
    +
    216
    +
    217 // Line
    +
    218 if ((x + y) % 2 == 1) {
    +
    219 it = std::move(it) | flex;
    +
    220 continue;
    +
    221 }
    +
    222
    +
    223 // Cells
    +
    224 if ((x % 2) == 1 && (y % 2) == 1) {
    +
    225 it = std::move(it) | flex_shrink;
    +
    226 continue;
    +
    227 }
    +
    228
    +
    229 // Corners
    +
    230 it = std::move(it) | size(WIDTH, EQUAL, 0) | size(HEIGHT, EQUAL, 0);
    +
    231 }
    +
    232 }
    +
    233 dim_x_ = 0;
    +
    234 dim_y_ = 0;
    +
    235 return gridbox(std::move(elements_));
    +
    236}
    +
    +
    237
    +
    238/// @brief Apply the `decorator` to the selection.
    +
    239/// This decorate both the cells, the lines and the corners.
    +
    240/// @param decorator The decorator to apply.
    +
    241// NOLINTNEXTLINE
    +
    + +
    243 for (int y = y_min_; y <= y_max_; ++y) {
    +
    244 for (int x = x_min_; x <= x_max_; ++x) {
    +
    245 Element& e = table_->elements_[y][x];
    +
    246 e = std::move(e) | decorator;
    +
    247 }
    +
    248 }
    +
    249}
    +
    +
    250
    +
    251/// @brief Apply the `decorator` to the selection.
    +
    252/// @param decorator The decorator to apply.
    +
    253/// This decorate only the cells.
    +
    254// NOLINTNEXTLINE
    +
    + +
    256 for (int y = y_min_; y <= y_max_; ++y) {
    +
    257 for (int x = x_min_; x <= x_max_; ++x) {
    +
    258 if (y % 2 == 1 && x % 2 == 1) {
    +
    259 Element& e = table_->elements_[y][x];
    +
    260 e = std::move(e) | decorator;
    +
    261 }
    +
    262 }
    +
    263 }
    +
    264}
    +
    +
    265
    +
    266/// @brief Apply the `decorator` to the selection.
    +
    267/// This decorate only the lines modulo `modulo` with a shift of `shift`.
    +
    268/// @param decorator The decorator to apply.
    +
    269/// @param modulo The modulo of the lines to decorate.
    +
    270/// @param shift The shift of the lines to decorate.
    +
    271// NOLINTNEXTLINE
    +
    + +
    273 int modulo,
    +
    274 int shift) {
    +
    275 for (int y = y_min_; y <= y_max_; ++y) {
    +
    276 for (int x = x_min_; x <= x_max_; ++x) {
    +
    277 if (y % 2 == 1 && (x / 2) % modulo == shift) {
    +
    278 Element& e = table_->elements_[y][x];
    +
    279 e = std::move(e) | decorator;
    +
    280 }
    +
    281 }
    +
    282 }
    +
    283}
    +
    +
    284
    +
    285/// @brief Apply the `decorator` to the selection.
    +
    286/// This decorate only the lines modulo `modulo` with a shift of `shift`.
    +
    287/// @param decorator The decorator to apply.
    +
    288/// @param modulo The modulo of the lines to decorate.
    +
    289/// @param shift The shift of the lines to decorate.
    +
    290// NOLINTNEXTLINE
    +
    + +
    292 int modulo,
    +
    293 int shift) {
    +
    294 for (int y = y_min_ + 1; y <= y_max_ - 1; ++y) {
    +
    295 for (int x = x_min_; x <= x_max_; ++x) {
    +
    296 if (y % 2 == 1 && (y / 2) % modulo == shift) {
    +
    297 Element& e = table_->elements_[y][x];
    +
    298 e = std::move(e) | decorator;
    +
    299 }
    +
    300 }
    +
    301 }
    +
    302}
    +
    +
    303
    +
    304/// @brief Apply the `decorator` to the selection.
    +
    305/// This decorate only the corners modulo `modulo` with a shift of `shift`.
    +
    306/// @param decorator The decorator to apply.
    +
    307/// @param modulo The modulo of the corners to decorate.
    +
    308/// @param shift The shift of the corners to decorate.
    +
    309// NOLINTNEXTLINE
    +
    + +
    311 int modulo,
    +
    312 int shift) {
    +
    313 for (int y = y_min_; y <= y_max_; ++y) {
    +
    314 for (int x = x_min_; x <= x_max_; ++x) {
    +
    315 if (y % 2 == 1 && x % 2 == 1 && ((x / 2) % modulo == shift)) {
    +
    316 Element& e = table_->elements_[y][x];
    +
    317 e = std::move(e) | decorator;
    +
    318 }
    +
    319 }
    +
    320 }
    +
    321}
    +
    +
    322
    +
    323/// @brief Apply the `decorator` to the selection.
    +
    324/// This decorate only the corners modulo `modulo` with a shift of `shift`.
    +
    325/// @param decorator The decorator to apply.
    +
    326/// @param modulo The modulo of the corners to decorate.
    +
    327/// @param shift The shift of the corners to decorate.
    +
    328// NOLINTNEXTLINE
    +
    + +
    330 int modulo,
    +
    331 int shift) {
    +
    332 for (int y = y_min_; y <= y_max_; ++y) {
    +
    333 for (int x = x_min_; x <= x_max_; ++x) {
    +
    334 if (y % 2 == 1 && x % 2 == 1 && ((y / 2) % modulo == shift)) {
    +
    335 Element& e = table_->elements_[y][x];
    +
    336 e = std::move(e) | decorator;
    +
    337 }
    +
    338 }
    +
    339 }
    +
    340}
    +
    +
    341
    +
    342/// @brief Apply a `border` around the selection.
    +
    343/// @param border The border style to apply.
    +
    + +
    345 BorderLeft(border);
    +
    346 BorderRight(border);
    +
    347 BorderTop(border);
    +
    348 BorderBottom(border);
    +
    349
    +
    350 // NOLINTNEXTLINE
    +
    351 table_->elements_[y_min_][x_min_] = text(charset[border][0]) | automerge;
    +
    352 // NOLINTNEXTLINE
    +
    353 table_->elements_[y_min_][x_max_] = text(charset[border][1]) | automerge;
    +
    354 // NOLINTNEXTLINE
    +
    355 table_->elements_[y_max_][x_min_] = text(charset[border][2]) | automerge;
    +
    356 // NOLINTNEXTLINE
    +
    357 table_->elements_[y_max_][x_max_] = text(charset[border][3]) | automerge;
    +
    358}
    +
    +
    359
    +
    360/// @brief Draw some separator lines in the selection.
    +
    361/// @param border The border style to apply.
    +
    + +
    363 for (int y = y_min_ + 1; y <= y_max_ - 1; ++y) {
    +
    364 for (int x = x_min_ + 1; x <= x_max_ - 1; ++x) {
    +
    365 if (y % 2 == 0 || x % 2 == 0) {
    +
    366 Element& e = table_->elements_[y][x];
    +
    367 e = (y % 2 == 1)
    +
    368 ? separatorCharacter(charset[border][5]) | automerge // NOLINT
    +
    369 : separatorCharacter(charset[border][4]) | automerge; // NOLINT
    +
    370 }
    +
    371 }
    +
    372 }
    +
    373}
    +
    +
    374
    +
    375/// @brief Draw some vertical separator lines in the selection.
    +
    376/// @param border The border style to apply.
    +
    + +
    378 for (int y = y_min_ + 1; y <= y_max_ - 1; ++y) {
    +
    379 for (int x = x_min_ + 1; x <= x_max_ - 1; ++x) {
    +
    380 if (x % 2 == 0) {
    +
    381 table_->elements_[y][x] =
    +
    382 separatorCharacter(charset[border][5]) | automerge; // NOLINT
    +
    383 }
    +
    384 }
    +
    385 }
    +
    386}
    +
    +
    387
    +
    388/// @brief Draw some horizontal separator lines in the selection.
    +
    389/// @param border The border style to apply.
    +
    + +
    391 for (int y = y_min_ + 1; y <= y_max_ - 1; ++y) {
    +
    392 for (int x = x_min_ + 1; x <= x_max_ - 1; ++x) {
    +
    393 if (y % 2 == 0) {
    +
    394 table_->elements_[y][x] =
    +
    395 separatorCharacter(charset[border][4]) | automerge; // NOLINT
    +
    396 }
    +
    397 }
    +
    398 }
    +
    399}
    +
    +
    400
    +
    401/// @brief Draw some separator lines to the left side of the selection.
    +
    402/// @param border The border style to apply.
    +
    + +
    404 for (int y = y_min_; y <= y_max_; y++) {
    +
    405 table_->elements_[y][x_min_] =
    +
    406 separatorCharacter(charset[border][5]) | automerge; // NOLINT
    +
    407 }
    +
    408}
    +
    +
    409
    +
    410/// @brief Draw some separator lines to the right side of the selection.
    +
    411/// @param border The border style to apply.
    +
    + +
    413 for (int y = y_min_; y <= y_max_; y++) {
    +
    414 table_->elements_[y][x_max_] =
    +
    415 separatorCharacter(charset[border][5]) | automerge; // NOLINT
    +
    416 }
    +
    417}
    +
    +
    418
    +
    419/// @brief Draw some separator lines to the top side of the selection.
    +
    420/// @param border The border style to apply.
    +
    + +
    422 for (int x = x_min_; x <= x_max_; x++) {
    +
    423 table_->elements_[y_min_][x] =
    +
    424 separatorCharacter(charset[border][4]) | automerge; // NOLINT
    +
    425 }
    +
    426}
    +
    +
    427
    +
    428/// @brief Draw some separator lines to the bottom side of the selection.
    +
    429/// @param border The border style to apply.
    +
    + +
    431 for (int x = x_min_; x <= x_max_; x++) {
    +
    432 table_->elements_[y_max_][x] =
    +
    433 separatorCharacter(charset[border][4]) | automerge; // NOLINT
    +
    434 }
    +
    435}
    +
    +
    436
    +
    437} // namespace ftxui
    + +
    void DecorateAlternateColumn(Decorator, int modulo=2, int shift=0)
    Apply the decorator to the selection. This decorate only the lines modulo modulo with a shift of shif...
    +
    void SeparatorVertical(BorderStyle border=LIGHT)
    Draw some vertical separator lines in the selection.
    +
    void DecorateCells(Decorator)
    Apply the decorator to the selection.
    +
    void BorderLeft(BorderStyle border=LIGHT)
    Draw some separator lines to the left side of the selection.
    +
    void DecorateCellsAlternateColumn(Decorator, int modulo=2, int shift=0)
    Apply the decorator to the selection. This decorate only the corners modulo modulo with a shift of sh...
    +
    void Decorate(Decorator)
    Apply the decorator to the selection. This decorate both the cells, the lines and the corners.
    +
    void DecorateAlternateRow(Decorator, int modulo=2, int shift=0)
    Apply the decorator to the selection. This decorate only the lines modulo modulo with a shift of shif...
    +
    void BorderTop(BorderStyle border=LIGHT)
    Draw some separator lines to the top side of the selection.
    +
    void Separator(BorderStyle border=LIGHT)
    Draw some separator lines in the selection.
    +
    void BorderBottom(BorderStyle border=LIGHT)
    Draw some separator lines to the bottom side of the selection.
    +
    void DecorateCellsAlternateRow(Decorator, int modulo=2, int shift=0)
    Apply the decorator to the selection. This decorate only the corners modulo modulo with a shift of sh...
    +
    void BorderRight(BorderStyle border=LIGHT)
    Draw some separator lines to the right side of the selection.
    +
    void Border(BorderStyle border=LIGHT)
    Apply a border around the selection.
    +
    void SeparatorHorizontal(BorderStyle border=LIGHT)
    Draw some horizontal separator lines in the selection.
    + +
    Component Wrap(std::string name, Component component)
    Definition gallery.cpp:18
    +
    Element Render()
    Render the table.
    +
    Table()
    Create an empty table.
    +
    TableSelection SelectCell(int column, int row)
    Select a cell of the table.
    +
    TableSelection SelectColumn(int column_index)
    Select a column of the table.
    +
    TableSelection SelectRow(int row_index)
    Select a row of the table.
    +
    TableSelection SelectColumns(int column_min, int column_max)
    Select a range of columns of the table.
    +
    TableSelection SelectRows(int row_min, int row_max)
    Select a range of rows of the table.
    +
    TableSelection SelectAll()
    Select all the table.
    +
    TableSelection SelectRectangle(int column_min, int column_max, int row_min, int row_max)
    Select a rectangle of the table.
    +
    Decorator size(WidthOrHeight, Constraint, int value)
    Apply a constraint on the size of an element.
    +
    Element flex(Element)
    Make a child element to expand proportionally to the space left in a container.
    Definition flex.cpp:123
    +
    Element emptyElement()
    Definition dom/util.cpp:140
    +
    Element flex_shrink(Element)
    Minimize if needed.
    Definition flex.cpp:159
    +
    Element text(std::wstring text)
    Display a piece of unicode text.
    Definition text.cpp:160
    +
    Element separatorCharacter(std::string)
    Draw a vertical or horizontal separation in between two other elements.
    +
    Element automerge(Element child)
    Enable character to be automatically merged with others nearby.
    Definition automerge.cpp:17
    +
    BorderStyle
    BorderStyle is an enumeration that represents the different styles of borders that can be applied to ...
    Definition elements.hpp:35
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + + +
    std::function< Element(Element)> Decorator
    Definition elements.hpp:24
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    Element gridbox(std::vector< Elements > lines)
    A container displaying a grid of elements.
    + + +
    +
    + + + + + diff --git a/strikethrough_8cpp.html b/strikethrough_8cpp.html new file mode 100644 index 000000000..6a38b881b --- /dev/null +++ b/strikethrough_8cpp.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: strikethrough.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    strikethrough.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + +

    +Functions

    Element strikethrough (Element child)
     Apply a strikethrough to text.
     
    +
    +
    + + + + + diff --git a/strikethrough_8cpp.js b/strikethrough_8cpp.js new file mode 100644 index 000000000..96dc78e6e --- /dev/null +++ b/strikethrough_8cpp.js @@ -0,0 +1,4 @@ +var strikethrough_8cpp = +[ + [ "strikethrough", "strikethrough_8cpp.html#ga8594d70f0491def903370e86132fbf01", null ] +]; \ No newline at end of file diff --git a/strikethrough_8cpp_source.html b/strikethrough_8cpp_source.html new file mode 100644 index 000000000..223d05f94 --- /dev/null +++ b/strikethrough_8cpp_source.html @@ -0,0 +1,258 @@ + + + + + + + + +FTXUI: strikethrough.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    strikethrough.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2023 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <memory> // for make_shared
    +
    5#include <utility> // for move
    +
    6
    +
    7#include "ftxui/dom/elements.hpp" // for Element, strikethrough
    +
    8#include "ftxui/dom/node.hpp" // for Node
    +
    9#include "ftxui/dom/node_decorator.hpp" // for NodeDecorator
    +
    10#include "ftxui/screen/box.hpp" // for Box
    +
    11#include "ftxui/screen/screen.hpp" // for Pixel, Screen
    +
    12
    +
    13namespace ftxui {
    +
    14
    +
    15/// @brief Apply a strikethrough to text.
    +
    16/// @ingroup dom
    +
    + +
    18 class Impl : public NodeDecorator {
    +
    19 public:
    +
    20 using NodeDecorator::NodeDecorator;
    +
    21
    +
    22 void Render(Screen& screen) override {
    +
    23 for (int y = box_.y_min; y <= box_.y_max; ++y) {
    +
    24 for (int x = box_.x_min; x <= box_.x_max; ++x) {
    +
    25 screen.PixelAt(x, y).strikethrough = true;
    +
    26 }
    +
    27 }
    +
    28 Node::Render(screen);
    +
    29 }
    +
    30 };
    +
    31
    +
    32 return std::make_shared<Impl>(std::move(child));
    +
    33}
    +
    +
    34
    +
    35} // namespace ftxui
    + + + +
    Element strikethrough(Element)
    Apply a strikethrough to text.
    +
    bool strikethrough
    Definition pixel.hpp:35
    +
    Pixel & PixelAt(int x, int y)
    Access a cell (Pixel) at a given position.
    Definition image.cpp:43
    +
    A rectangular grid of Pixel.
    Definition screen.hpp:26
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    + + + +
    +
    + + + + + diff --git a/string_8cpp.html b/string_8cpp.html new file mode 100644 index 000000000..809efd4aa --- /dev/null +++ b/string_8cpp.html @@ -0,0 +1,262 @@ + + + + + + + + +FTXUI: string.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    string.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Functions

    bool EatCodePoint (const std::string &input, size_t start, size_t *end, uint32_t *ucs)
     
    bool EatCodePoint (const std::wstring &input, size_t start, size_t *end, uint32_t *ucs)
     
    bool IsCombining (uint32_t ucs)
     
    bool IsFullWidth (uint32_t ucs)
     
    bool IsControl (uint32_t ucs)
     
    WordBreakProperty CodepointToWordBreakProperty (uint32_t codepoint)
     
    int wchar_width (wchar_t)
     
    int wstring_width (const std::wstring &)
     
    int string_width (const std::string &)
     
    std::vector< std::string > Utf8ToGlyphs (const std::string &input)
     
    size_t GlyphPrevious (const std::string &input, size_t start)
     
    size_t GlyphNext (const std::string &input, size_t start)
     
    size_t GlyphIterate (const std::string &input, int glyph_offset, size_t start)
     
    std::vector< int > CellToGlyphIndex (const std::string &input)
     
    int GlyphCount (const std::string &input)
     
    std::vector< WordBreakPropertyUtf8ToWordBreakProperty (const std::string &input)
     
    std::string to_string (const std::wstring &s)
     Convert a std::wstring into a UTF8 std::string.
     
    std::wstring to_wstring (const std::string &s)
     Convert a UTF8 std::string into a std::wstring.
     
    +
    +
    + + + + + diff --git a/string_8cpp.js b/string_8cpp.js new file mode 100644 index 000000000..1de05baaf --- /dev/null +++ b/string_8cpp.js @@ -0,0 +1,21 @@ +var string_8cpp = +[ + [ "EatCodePoint", "string_8cpp.html#a903cd2e24b3b7cf8d7d4daa680e0a8d5", null ], + [ "EatCodePoint", "string_8cpp.html#a88b8b2f726acaf2aca140a403989d8d0", null ], + [ "IsCombining", "string_8cpp.html#a506e6b467ddd8d11646942fd101d8e9e", null ], + [ "IsFullWidth", "string_8cpp.html#abd13f584efddd3a7e5749c9c5e841a11", null ], + [ "IsControl", "string_8cpp.html#a037df033cc26c960faa54b52bdbea900", null ], + [ "CodepointToWordBreakProperty", "string_8cpp.html#a191b3278846ceb6ac35d2e4eb26db759", null ], + [ "wchar_width", "string_8cpp.html#a1bb4947f62228380f5c415f69b34021f", null ], + [ "wstring_width", "string_8cpp.html#adedb4aa528ad2aef48177dea69ca7a9d", null ], + [ "string_width", "string_8cpp.html#a517b35c7721e632812d8b3a7697c4099", null ], + [ "Utf8ToGlyphs", "string_8cpp.html#a389c58d385e861cd2ef109b53fc6ef96", null ], + [ "GlyphPrevious", "string_8cpp.html#ae2ef74edc55750554e97ea71c5887650", null ], + [ "GlyphNext", "string_8cpp.html#a02453c4504a5cfbc83b38abd4ec6d8ba", null ], + [ "GlyphIterate", "string_8cpp.html#ad74a7d623ff7a09787469021d30c9461", null ], + [ "CellToGlyphIndex", "string_8cpp.html#a9769a28baa6a84d5de6a8bd624a29294", null ], + [ "GlyphCount", "string_8cpp.html#a9b4f3faecfbeb6b2c0fdf9c30e3f1553", null ], + [ "Utf8ToWordBreakProperty", "string_8cpp.html#ad15724e497f0001e146da530183ca552", null ], + [ "to_string", "string_8cpp.html#a757b345f73bb6cde5165a4d7f0c0a298", null ], + [ "to_wstring", "string_8cpp.html#a57429a83a46c643a81dee81e49384439", null ] +]; \ No newline at end of file diff --git a/string_8cpp_source.html b/string_8cpp_source.html new file mode 100644 index 000000000..180dffdbe --- /dev/null +++ b/string_8cpp_source.html @@ -0,0 +1,1938 @@ + + + + + + + + +FTXUI: string.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    string.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4//
    +
    5// Content of this file was created thanks to:
    +
    6// -
    +
    7// https://www.unicode.org/Public/UCD/latest/ucd/auxiliary/WordBreakProperty.txt
    +
    8// - Markus Kuhn -- 2007-05-26 (Unicode 5.0)
    +
    9// http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
    +
    10// Thanks you!
    +
    11
    + +
    13
    +
    14#include <array> // for array
    +
    15#include <cstddef> // for size_t
    +
    16#include <cstdint> // for uint32_t, uint8_t, uint16_t, int32_t
    +
    17#include <string> // for string, basic_string, wstring
    +
    18#include <tuple> // for _Swallow_assign, ignore
    +
    19#include <vector>
    +
    20
    +
    21#include "ftxui/screen/deprecated.hpp" // for wchar_width, wstring_width
    +
    22#include "ftxui/screen/string_internal.hpp" // for WordBreakProperty, EatCodePoint, CodepointToWordBreakProperty, GlyphCount, GlyphIterate, GlyphNext, GlyphPrevious, IsCombining, IsControl, IsFullWidth, Utf8ToWordBreakProperty
    +
    23
    +
    24namespace {
    +
    25
    +
    26struct Interval {
    +
    27 uint32_t first;
    +
    28 uint32_t last;
    +
    29};
    +
    30
    +
    31// As of Unicode 13.0.0
    +
    32constexpr std::array<Interval, 116> g_full_width_characters = {{
    +
    33 {0x01100, 0x0115f}, {0x0231a, 0x0231b}, {0x02329, 0x0232a},
    +
    34 {0x023e9, 0x023ec}, {0x023f0, 0x023f0}, {0x023f3, 0x023f3},
    +
    35 {0x025fd, 0x025fe}, {0x02614, 0x02615}, {0x02648, 0x02653},
    +
    36 {0x0267f, 0x0267f}, {0x02693, 0x02693}, {0x026a1, 0x026a1},
    +
    37 {0x026aa, 0x026ab}, {0x026bd, 0x026be}, {0x026c4, 0x026c5},
    +
    38 {0x026ce, 0x026ce}, {0x026d4, 0x026d4}, {0x026ea, 0x026ea},
    +
    39 {0x026f2, 0x026f3}, {0x026f5, 0x026f5}, {0x026fa, 0x026fa},
    +
    40 {0x026fd, 0x026fd}, {0x02705, 0x02705}, {0x0270a, 0x0270b},
    +
    41 {0x02728, 0x02728}, {0x0274c, 0x0274c}, {0x0274e, 0x0274e},
    +
    42 {0x02753, 0x02755}, {0x02757, 0x02757}, {0x02795, 0x02797},
    +
    43 {0x027b0, 0x027b0}, {0x027bf, 0x027bf}, {0x02b1b, 0x02b1c},
    +
    44 {0x02b50, 0x02b50}, {0x02b55, 0x02b55}, {0x02e80, 0x02e99},
    +
    45 {0x02e9b, 0x02ef3}, {0x02f00, 0x02fd5}, {0x02ff0, 0x02ffb},
    +
    46 {0x03000, 0x0303e}, {0x03041, 0x03096}, {0x03099, 0x030ff},
    +
    47 {0x03105, 0x0312f}, {0x03131, 0x0318e}, {0x03190, 0x031e3},
    +
    48 {0x031f0, 0x0321e}, {0x03220, 0x03247}, {0x03250, 0x04dbf},
    +
    49 {0x04e00, 0x0a48c}, {0x0a490, 0x0a4c6}, {0x0a960, 0x0a97c},
    +
    50 {0x0ac00, 0x0d7a3}, {0x0f900, 0x0faff}, {0x0fe10, 0x0fe19},
    +
    51 {0x0fe30, 0x0fe52}, {0x0fe54, 0x0fe66}, {0x0fe68, 0x0fe6b},
    +
    52 {0x0ff01, 0x0ff60}, {0x0ffe0, 0x0ffe6}, {0x16fe0, 0x16fe4},
    +
    53 {0x16ff0, 0x16ff1}, {0x17000, 0x187f7}, {0x18800, 0x18cd5},
    +
    54 {0x18d00, 0x18d08}, {0x1b000, 0x1b11e}, {0x1b150, 0x1b152},
    +
    55 {0x1b164, 0x1b167}, {0x1b170, 0x1b2fb}, {0x1f004, 0x1f004},
    +
    56 {0x1f0cf, 0x1f0cf}, {0x1f18e, 0x1f18e}, {0x1f191, 0x1f19a},
    +
    57 {0x1f200, 0x1f202}, {0x1f210, 0x1f23b}, {0x1f240, 0x1f248},
    +
    58 {0x1f250, 0x1f251}, {0x1f260, 0x1f265}, {0x1f300, 0x1f320},
    +
    59 {0x1f32d, 0x1f335}, {0x1f337, 0x1f37c}, {0x1f37e, 0x1f393},
    +
    60 {0x1f3a0, 0x1f3ca}, {0x1f3cf, 0x1f3d3}, {0x1f3e0, 0x1f3f0},
    +
    61 {0x1f3f4, 0x1f3f4}, {0x1f3f8, 0x1f43e}, {0x1f440, 0x1f440},
    +
    62 {0x1f442, 0x1f4fc}, {0x1f4ff, 0x1f53d}, {0x1f54b, 0x1f54e},
    +
    63 {0x1f550, 0x1f567}, {0x1f57a, 0x1f57a}, {0x1f595, 0x1f596},
    +
    64 {0x1f5a4, 0x1f5a4}, {0x1f5fb, 0x1f64f}, {0x1f680, 0x1f6c5},
    +
    65 {0x1f6cc, 0x1f6cc}, {0x1f6d0, 0x1f6d2}, {0x1f6d5, 0x1f6d7},
    +
    66 {0x1f6eb, 0x1f6ec}, {0x1f6f4, 0x1f6fc}, {0x1f7e0, 0x1f7eb},
    +
    67 {0x1f90c, 0x1f93a}, {0x1f93c, 0x1f945}, {0x1f947, 0x1f978},
    +
    68 {0x1f97a, 0x1f9cb}, {0x1f9cd, 0x1f9ff}, {0x1fa70, 0x1fa74},
    +
    69 {0x1fa78, 0x1fa7a}, {0x1fa80, 0x1fa86}, {0x1fa90, 0x1faa8},
    +
    70 {0x1fab0, 0x1fab6}, {0x1fac0, 0x1fac2}, {0x1fad0, 0x1fad6},
    +
    71 {0x20000, 0x2fffd}, {0x30000, 0x3fffd},
    +
    72}};
    +
    73
    +
    74using WBP = ftxui::WordBreakProperty;
    +
    75struct WordBreakPropertyInterval {
    +
    76 uint32_t first;
    +
    77 uint32_t last;
    +
    78 WBP property;
    +
    79};
    +
    80
    +
    81// Properties from:
    +
    82// https://www.unicode.org/Public/UCD/latest/ucd/auxiliary/WordBreakProperty.txt
    +
    83constexpr std::array<WordBreakPropertyInterval, 993> g_word_break_intervals = {{
    +
    84 {0x0000A, 0x0000A, WBP::LF},
    +
    85 {0x0000B, 0x0000C, WBP::Newline},
    +
    86 {0x0000D, 0x0000D, WBP::CR},
    +
    87 {0x00020, 0x00020, WBP::WSegSpace},
    +
    88 {0x00022, 0x00022, WBP::Double_Quote},
    +
    89 {0x00027, 0x00027, WBP::Single_Quote},
    +
    90 {0x0002C, 0x0002C, WBP::MidNum},
    +
    91 {0x0002E, 0x0002E, WBP::MidNumLet},
    +
    92 {0x00030, 0x00039, WBP::Numeric},
    +
    93 {0x0003A, 0x0003A, WBP::MidLetter},
    +
    94 {0x0003B, 0x0003B, WBP::MidNum},
    +
    95 {0x00041, 0x0005A, WBP::ALetter},
    +
    96 {0x0005F, 0x0005F, WBP::ExtendNumLet},
    +
    97 {0x00061, 0x0007A, WBP::ALetter},
    +
    98 {0x00085, 0x00085, WBP::Newline},
    +
    99 {0x000AA, 0x000AA, WBP::ALetter},
    +
    100 {0x000AD, 0x000AD, WBP::Format},
    +
    101 {0x000B5, 0x000B5, WBP::ALetter},
    +
    102 {0x000B7, 0x000B7, WBP::MidLetter},
    +
    103 {0x000BA, 0x000BA, WBP::ALetter},
    +
    104 {0x000C0, 0x000D6, WBP::ALetter},
    +
    105 {0x000D8, 0x000F6, WBP::ALetter},
    +
    106 {0x000F8, 0x002D7, WBP::ALetter},
    +
    107 {0x002DE, 0x002FF, WBP::ALetter},
    +
    108 {0x00300, 0x0036F, WBP::Extend},
    +
    109 {0x00370, 0x00374, WBP::ALetter},
    +
    110 {0x00376, 0x00377, WBP::ALetter},
    +
    111 {0x0037A, 0x0037D, WBP::ALetter},
    +
    112 {0x0037E, 0x0037E, WBP::MidNum},
    +
    113 {0x0037F, 0x0037F, WBP::ALetter},
    +
    114 {0x00386, 0x00386, WBP::ALetter},
    +
    115 {0x00387, 0x00387, WBP::MidLetter},
    +
    116 {0x00388, 0x0038A, WBP::ALetter},
    +
    117 {0x0038C, 0x0038C, WBP::ALetter},
    +
    118 {0x0038E, 0x003A1, WBP::ALetter},
    +
    119 {0x003A3, 0x003F5, WBP::ALetter},
    +
    120 {0x003F7, 0x00481, WBP::ALetter},
    +
    121 {0x00483, 0x00489, WBP::Extend},
    +
    122 {0x0048A, 0x0052F, WBP::ALetter},
    +
    123 {0x00531, 0x00556, WBP::ALetter},
    +
    124 {0x00559, 0x0055C, WBP::ALetter},
    +
    125 {0x0055E, 0x0055E, WBP::ALetter},
    +
    126 {0x0055F, 0x0055F, WBP::MidLetter},
    +
    127 {0x00560, 0x00588, WBP::ALetter},
    +
    128 {0x00589, 0x00589, WBP::MidNum},
    +
    129 {0x0058A, 0x0058A, WBP::ALetter},
    +
    130 {0x00591, 0x005BD, WBP::Extend},
    +
    131 {0x005BF, 0x005BF, WBP::Extend},
    +
    132 {0x005C1, 0x005C2, WBP::Extend},
    +
    133 {0x005C4, 0x005C5, WBP::Extend},
    +
    134 {0x005C7, 0x005C7, WBP::Extend},
    +
    135 {0x005D0, 0x005EA, WBP::Hebrew_Letter},
    +
    136 {0x005EF, 0x005F2, WBP::Hebrew_Letter},
    +
    137 {0x005F3, 0x005F3, WBP::ALetter},
    +
    138 {0x005F4, 0x005F4, WBP::MidLetter},
    +
    139 {0x00600, 0x00605, WBP::Format},
    +
    140 {0x0060C, 0x0060D, WBP::MidNum},
    +
    141 {0x00610, 0x0061A, WBP::Extend},
    +
    142 {0x0061C, 0x0061C, WBP::Format},
    +
    143 {0x00620, 0x0064A, WBP::ALetter},
    +
    144 {0x0064B, 0x0065F, WBP::Extend},
    +
    145 {0x00660, 0x00669, WBP::Numeric},
    +
    146 {0x0066B, 0x0066B, WBP::Numeric},
    +
    147 {0x0066C, 0x0066C, WBP::MidNum},
    +
    148 {0x0066E, 0x0066F, WBP::ALetter},
    +
    149 {0x00670, 0x00670, WBP::Extend},
    +
    150 {0x00671, 0x006D3, WBP::ALetter},
    +
    151 {0x006D5, 0x006D5, WBP::ALetter},
    +
    152 {0x006D6, 0x006DC, WBP::Extend},
    +
    153 {0x006DD, 0x006DD, WBP::Format},
    +
    154 {0x006DF, 0x006E4, WBP::Extend},
    +
    155 {0x006E5, 0x006E6, WBP::ALetter},
    +
    156 {0x006E7, 0x006E8, WBP::Extend},
    +
    157 {0x006EA, 0x006ED, WBP::Extend},
    +
    158 {0x006EE, 0x006EF, WBP::ALetter},
    +
    159 {0x006F0, 0x006F9, WBP::Numeric},
    +
    160 {0x006FA, 0x006FC, WBP::ALetter},
    +
    161 {0x006FF, 0x006FF, WBP::ALetter},
    +
    162 {0x0070F, 0x0070F, WBP::Format},
    +
    163 {0x00710, 0x00710, WBP::ALetter},
    +
    164 {0x00711, 0x00711, WBP::Extend},
    +
    165 {0x00712, 0x0072F, WBP::ALetter},
    +
    166 {0x00730, 0x0074A, WBP::Extend},
    +
    167 {0x0074D, 0x007A5, WBP::ALetter},
    +
    168 {0x007A6, 0x007B0, WBP::Extend},
    +
    169 {0x007B1, 0x007B1, WBP::ALetter},
    +
    170 {0x007C0, 0x007C9, WBP::Numeric},
    +
    171 {0x007CA, 0x007EA, WBP::ALetter},
    +
    172 {0x007EB, 0x007F3, WBP::Extend},
    +
    173 {0x007F4, 0x007F5, WBP::ALetter},
    +
    174 {0x007F8, 0x007F8, WBP::MidNum},
    +
    175 {0x007FA, 0x007FA, WBP::ALetter},
    +
    176 {0x007FD, 0x007FD, WBP::Extend},
    +
    177 {0x00800, 0x00815, WBP::ALetter},
    +
    178 {0x00816, 0x00819, WBP::Extend},
    +
    179 {0x0081A, 0x0081A, WBP::ALetter},
    +
    180 {0x0081B, 0x00823, WBP::Extend},
    +
    181 {0x00824, 0x00824, WBP::ALetter},
    +
    182 {0x00825, 0x00827, WBP::Extend},
    +
    183 {0x00828, 0x00828, WBP::ALetter},
    +
    184 {0x00829, 0x0082D, WBP::Extend},
    +
    185 {0x00840, 0x00858, WBP::ALetter},
    +
    186 {0x00859, 0x0085B, WBP::Extend},
    +
    187 {0x00860, 0x0086A, WBP::ALetter},
    +
    188 {0x008A0, 0x008B4, WBP::ALetter},
    +
    189 {0x008B6, 0x008C7, WBP::ALetter},
    +
    190 {0x008D3, 0x008E1, WBP::Extend},
    +
    191 {0x008E2, 0x008E2, WBP::Format},
    +
    192 {0x008E3, 0x00903, WBP::Extend},
    +
    193 {0x00904, 0x00939, WBP::ALetter},
    +
    194 {0x0093A, 0x0093C, WBP::Extend},
    +
    195 {0x0093D, 0x0093D, WBP::ALetter},
    +
    196 {0x0093E, 0x0094F, WBP::Extend},
    +
    197 {0x00950, 0x00950, WBP::ALetter},
    +
    198 {0x00951, 0x00957, WBP::Extend},
    +
    199 {0x00958, 0x00961, WBP::ALetter},
    +
    200 {0x00962, 0x00963, WBP::Extend},
    +
    201 {0x00966, 0x0096F, WBP::Numeric},
    +
    202 {0x00971, 0x00980, WBP::ALetter},
    +
    203 {0x00981, 0x00983, WBP::Extend},
    +
    204 {0x00985, 0x0098C, WBP::ALetter},
    +
    205 {0x0098F, 0x00990, WBP::ALetter},
    +
    206 {0x00993, 0x009A8, WBP::ALetter},
    +
    207 {0x009AA, 0x009B0, WBP::ALetter},
    +
    208 {0x009B2, 0x009B2, WBP::ALetter},
    +
    209 {0x009B6, 0x009B9, WBP::ALetter},
    +
    210 {0x009BC, 0x009BC, WBP::Extend},
    +
    211 {0x009BD, 0x009BD, WBP::ALetter},
    +
    212 {0x009BE, 0x009C4, WBP::Extend},
    +
    213 {0x009C7, 0x009C8, WBP::Extend},
    +
    214 {0x009CB, 0x009CD, WBP::Extend},
    +
    215 {0x009CE, 0x009CE, WBP::ALetter},
    +
    216 {0x009D7, 0x009D7, WBP::Extend},
    +
    217 {0x009DC, 0x009DD, WBP::ALetter},
    +
    218 {0x009DF, 0x009E1, WBP::ALetter},
    +
    219 {0x009E2, 0x009E3, WBP::Extend},
    +
    220 {0x009E6, 0x009EF, WBP::Numeric},
    +
    221 {0x009F0, 0x009F1, WBP::ALetter},
    +
    222 {0x009FC, 0x009FC, WBP::ALetter},
    +
    223 {0x009FE, 0x009FE, WBP::Extend},
    +
    224 {0x00A01, 0x00A03, WBP::Extend},
    +
    225 {0x00A05, 0x00A0A, WBP::ALetter},
    +
    226 {0x00A0F, 0x00A10, WBP::ALetter},
    +
    227 {0x00A13, 0x00A28, WBP::ALetter},
    +
    228 {0x00A2A, 0x00A30, WBP::ALetter},
    +
    229 {0x00A32, 0x00A33, WBP::ALetter},
    +
    230 {0x00A35, 0x00A36, WBP::ALetter},
    +
    231 {0x00A38, 0x00A39, WBP::ALetter},
    +
    232 {0x00A3C, 0x00A3C, WBP::Extend},
    +
    233 {0x00A3E, 0x00A42, WBP::Extend},
    +
    234 {0x00A47, 0x00A48, WBP::Extend},
    +
    235 {0x00A4B, 0x00A4D, WBP::Extend},
    +
    236 {0x00A51, 0x00A51, WBP::Extend},
    +
    237 {0x00A59, 0x00A5C, WBP::ALetter},
    +
    238 {0x00A5E, 0x00A5E, WBP::ALetter},
    +
    239 {0x00A66, 0x00A6F, WBP::Numeric},
    +
    240 {0x00A70, 0x00A71, WBP::Extend},
    +
    241 {0x00A72, 0x00A74, WBP::ALetter},
    +
    242 {0x00A75, 0x00A75, WBP::Extend},
    +
    243 {0x00A81, 0x00A83, WBP::Extend},
    +
    244 {0x00A85, 0x00A8D, WBP::ALetter},
    +
    245 {0x00A8F, 0x00A91, WBP::ALetter},
    +
    246 {0x00A93, 0x00AA8, WBP::ALetter},
    +
    247 {0x00AAA, 0x00AB0, WBP::ALetter},
    +
    248 {0x00AB2, 0x00AB3, WBP::ALetter},
    +
    249 {0x00AB5, 0x00AB9, WBP::ALetter},
    +
    250 {0x00ABC, 0x00ABC, WBP::Extend},
    +
    251 {0x00ABD, 0x00ABD, WBP::ALetter},
    +
    252 {0x00ABE, 0x00AC5, WBP::Extend},
    +
    253 {0x00AC7, 0x00AC9, WBP::Extend},
    +
    254 {0x00ACB, 0x00ACD, WBP::Extend},
    +
    255 {0x00AD0, 0x00AD0, WBP::ALetter},
    +
    256 {0x00AE0, 0x00AE1, WBP::ALetter},
    +
    257 {0x00AE2, 0x00AE3, WBP::Extend},
    +
    258 {0x00AE6, 0x00AEF, WBP::Numeric},
    +
    259 {0x00AF9, 0x00AF9, WBP::ALetter},
    +
    260 {0x00AFA, 0x00AFF, WBP::Extend},
    +
    261 {0x00B01, 0x00B03, WBP::Extend},
    +
    262 {0x00B05, 0x00B0C, WBP::ALetter},
    +
    263 {0x00B0F, 0x00B10, WBP::ALetter},
    +
    264 {0x00B13, 0x00B28, WBP::ALetter},
    +
    265 {0x00B2A, 0x00B30, WBP::ALetter},
    +
    266 {0x00B32, 0x00B33, WBP::ALetter},
    +
    267 {0x00B35, 0x00B39, WBP::ALetter},
    +
    268 {0x00B3C, 0x00B3C, WBP::Extend},
    +
    269 {0x00B3D, 0x00B3D, WBP::ALetter},
    +
    270 {0x00B3E, 0x00B44, WBP::Extend},
    +
    271 {0x00B47, 0x00B48, WBP::Extend},
    +
    272 {0x00B4B, 0x00B4D, WBP::Extend},
    +
    273 {0x00B55, 0x00B57, WBP::Extend},
    +
    274 {0x00B5C, 0x00B5D, WBP::ALetter},
    +
    275 {0x00B5F, 0x00B61, WBP::ALetter},
    +
    276 {0x00B62, 0x00B63, WBP::Extend},
    +
    277 {0x00B66, 0x00B6F, WBP::Numeric},
    +
    278 {0x00B71, 0x00B71, WBP::ALetter},
    +
    279 {0x00B82, 0x00B82, WBP::Extend},
    +
    280 {0x00B83, 0x00B83, WBP::ALetter},
    +
    281 {0x00B85, 0x00B8A, WBP::ALetter},
    +
    282 {0x00B8E, 0x00B90, WBP::ALetter},
    +
    283 {0x00B92, 0x00B95, WBP::ALetter},
    +
    284 {0x00B99, 0x00B9A, WBP::ALetter},
    +
    285 {0x00B9C, 0x00B9C, WBP::ALetter},
    +
    286 {0x00B9E, 0x00B9F, WBP::ALetter},
    +
    287 {0x00BA3, 0x00BA4, WBP::ALetter},
    +
    288 {0x00BA8, 0x00BAA, WBP::ALetter},
    +
    289 {0x00BAE, 0x00BB9, WBP::ALetter},
    +
    290 {0x00BBE, 0x00BC2, WBP::Extend},
    +
    291 {0x00BC6, 0x00BC8, WBP::Extend},
    +
    292 {0x00BCA, 0x00BCD, WBP::Extend},
    +
    293 {0x00BD0, 0x00BD0, WBP::ALetter},
    +
    294 {0x00BD7, 0x00BD7, WBP::Extend},
    +
    295 {0x00BE6, 0x00BEF, WBP::Numeric},
    +
    296 {0x00C00, 0x00C04, WBP::Extend},
    +
    297 {0x00C05, 0x00C0C, WBP::ALetter},
    +
    298 {0x00C0E, 0x00C10, WBP::ALetter},
    +
    299 {0x00C12, 0x00C28, WBP::ALetter},
    +
    300 {0x00C2A, 0x00C39, WBP::ALetter},
    +
    301 {0x00C3D, 0x00C3D, WBP::ALetter},
    +
    302 {0x00C3E, 0x00C44, WBP::Extend},
    +
    303 {0x00C46, 0x00C48, WBP::Extend},
    +
    304 {0x00C4A, 0x00C4D, WBP::Extend},
    +
    305 {0x00C55, 0x00C56, WBP::Extend},
    +
    306 {0x00C58, 0x00C5A, WBP::ALetter},
    +
    307 {0x00C60, 0x00C61, WBP::ALetter},
    +
    308 {0x00C62, 0x00C63, WBP::Extend},
    +
    309 {0x00C66, 0x00C6F, WBP::Numeric},
    +
    310 {0x00C80, 0x00C80, WBP::ALetter},
    +
    311 {0x00C81, 0x00C83, WBP::Extend},
    +
    312 {0x00C85, 0x00C8C, WBP::ALetter},
    +
    313 {0x00C8E, 0x00C90, WBP::ALetter},
    +
    314 {0x00C92, 0x00CA8, WBP::ALetter},
    +
    315 {0x00CAA, 0x00CB3, WBP::ALetter},
    +
    316 {0x00CB5, 0x00CB9, WBP::ALetter},
    +
    317 {0x00CBC, 0x00CBC, WBP::Extend},
    +
    318 {0x00CBD, 0x00CBD, WBP::ALetter},
    +
    319 {0x00CBE, 0x00CC4, WBP::Extend},
    +
    320 {0x00CC6, 0x00CC8, WBP::Extend},
    +
    321 {0x00CCA, 0x00CCD, WBP::Extend},
    +
    322 {0x00CD5, 0x00CD6, WBP::Extend},
    +
    323 {0x00CDE, 0x00CDE, WBP::ALetter},
    +
    324 {0x00CE0, 0x00CE1, WBP::ALetter},
    +
    325 {0x00CE2, 0x00CE3, WBP::Extend},
    +
    326 {0x00CE6, 0x00CEF, WBP::Numeric},
    +
    327 {0x00CF1, 0x00CF2, WBP::ALetter},
    +
    328 {0x00D00, 0x00D03, WBP::Extend},
    +
    329 {0x00D04, 0x00D0C, WBP::ALetter},
    +
    330 {0x00D0E, 0x00D10, WBP::ALetter},
    +
    331 {0x00D12, 0x00D3A, WBP::ALetter},
    +
    332 {0x00D3B, 0x00D3C, WBP::Extend},
    +
    333 {0x00D3D, 0x00D3D, WBP::ALetter},
    +
    334 {0x00D3E, 0x00D44, WBP::Extend},
    +
    335 {0x00D46, 0x00D48, WBP::Extend},
    +
    336 {0x00D4A, 0x00D4D, WBP::Extend},
    +
    337 {0x00D4E, 0x00D4E, WBP::ALetter},
    +
    338 {0x00D54, 0x00D56, WBP::ALetter},
    +
    339 {0x00D57, 0x00D57, WBP::Extend},
    +
    340 {0x00D5F, 0x00D61, WBP::ALetter},
    +
    341 {0x00D62, 0x00D63, WBP::Extend},
    +
    342 {0x00D66, 0x00D6F, WBP::Numeric},
    +
    343 {0x00D7A, 0x00D7F, WBP::ALetter},
    +
    344 {0x00D81, 0x00D83, WBP::Extend},
    +
    345 {0x00D85, 0x00D96, WBP::ALetter},
    +
    346 {0x00D9A, 0x00DB1, WBP::ALetter},
    +
    347 {0x00DB3, 0x00DBB, WBP::ALetter},
    +
    348 {0x00DBD, 0x00DBD, WBP::ALetter},
    +
    349 {0x00DC0, 0x00DC6, WBP::ALetter},
    +
    350 {0x00DCA, 0x00DCA, WBP::Extend},
    +
    351 {0x00DCF, 0x00DD4, WBP::Extend},
    +
    352 {0x00DD6, 0x00DD6, WBP::Extend},
    +
    353 {0x00DD8, 0x00DDF, WBP::Extend},
    +
    354 {0x00DE6, 0x00DEF, WBP::Numeric},
    +
    355 {0x00DF2, 0x00DF3, WBP::Extend},
    +
    356 {0x00E31, 0x00E31, WBP::Extend},
    +
    357 {0x00E34, 0x00E3A, WBP::Extend},
    +
    358 {0x00E47, 0x00E4E, WBP::Extend},
    +
    359 {0x00E50, 0x00E59, WBP::Numeric},
    +
    360 {0x00EB1, 0x00EB1, WBP::Extend},
    +
    361 {0x00EB4, 0x00EBC, WBP::Extend},
    +
    362 {0x00EC8, 0x00ECD, WBP::Extend},
    +
    363 {0x00ED0, 0x00ED9, WBP::Numeric},
    +
    364 {0x00F00, 0x00F00, WBP::ALetter},
    +
    365 {0x00F18, 0x00F19, WBP::Extend},
    +
    366 {0x00F20, 0x00F29, WBP::Numeric},
    +
    367 {0x00F35, 0x00F35, WBP::Extend},
    +
    368 {0x00F37, 0x00F37, WBP::Extend},
    +
    369 {0x00F39, 0x00F39, WBP::Extend},
    +
    370 {0x00F3E, 0x00F3F, WBP::Extend},
    +
    371 {0x00F40, 0x00F47, WBP::ALetter},
    +
    372 {0x00F49, 0x00F6C, WBP::ALetter},
    +
    373 {0x00F71, 0x00F84, WBP::Extend},
    +
    374 {0x00F86, 0x00F87, WBP::Extend},
    +
    375 {0x00F88, 0x00F8C, WBP::ALetter},
    +
    376 {0x00F8D, 0x00F97, WBP::Extend},
    +
    377 {0x00F99, 0x00FBC, WBP::Extend},
    +
    378 {0x00FC6, 0x00FC6, WBP::Extend},
    +
    379 {0x0102B, 0x0103E, WBP::Extend},
    +
    380 {0x01040, 0x01049, WBP::Numeric},
    +
    381 {0x01056, 0x01059, WBP::Extend},
    +
    382 {0x0105E, 0x01060, WBP::Extend},
    +
    383 {0x01062, 0x01064, WBP::Extend},
    +
    384 {0x01067, 0x0106D, WBP::Extend},
    +
    385 {0x01071, 0x01074, WBP::Extend},
    +
    386 {0x01082, 0x0108D, WBP::Extend},
    +
    387 {0x0108F, 0x0108F, WBP::Extend},
    +
    388 {0x01090, 0x01099, WBP::Numeric},
    +
    389 {0x0109A, 0x0109D, WBP::Extend},
    +
    390 {0x010A0, 0x010C5, WBP::ALetter},
    +
    391 {0x010C7, 0x010C7, WBP::ALetter},
    +
    392 {0x010CD, 0x010CD, WBP::ALetter},
    +
    393 {0x010D0, 0x010FA, WBP::ALetter},
    +
    394 {0x010FC, 0x01248, WBP::ALetter},
    +
    395 {0x0124A, 0x0124D, WBP::ALetter},
    +
    396 {0x01250, 0x01256, WBP::ALetter},
    +
    397 {0x01258, 0x01258, WBP::ALetter},
    +
    398 {0x0125A, 0x0125D, WBP::ALetter},
    +
    399 {0x01260, 0x01288, WBP::ALetter},
    +
    400 {0x0128A, 0x0128D, WBP::ALetter},
    +
    401 {0x01290, 0x012B0, WBP::ALetter},
    +
    402 {0x012B2, 0x012B5, WBP::ALetter},
    +
    403 {0x012B8, 0x012BE, WBP::ALetter},
    +
    404 {0x012C0, 0x012C0, WBP::ALetter},
    +
    405 {0x012C2, 0x012C5, WBP::ALetter},
    +
    406 {0x012C8, 0x012D6, WBP::ALetter},
    +
    407 {0x012D8, 0x01310, WBP::ALetter},
    +
    408 {0x01312, 0x01315, WBP::ALetter},
    +
    409 {0x01318, 0x0135A, WBP::ALetter},
    +
    410 {0x0135D, 0x0135F, WBP::Extend},
    +
    411 {0x01380, 0x0138F, WBP::ALetter},
    +
    412 {0x013A0, 0x013F5, WBP::ALetter},
    +
    413 {0x013F8, 0x013FD, WBP::ALetter},
    +
    414 {0x01401, 0x0166C, WBP::ALetter},
    +
    415 {0x0166F, 0x0167F, WBP::ALetter},
    +
    416 {0x01680, 0x01680, WBP::WSegSpace},
    +
    417 {0x01681, 0x0169A, WBP::ALetter},
    +
    418 {0x016A0, 0x016EA, WBP::ALetter},
    +
    419 {0x016EE, 0x016F8, WBP::ALetter},
    +
    420 {0x01700, 0x0170C, WBP::ALetter},
    +
    421 {0x0170E, 0x01711, WBP::ALetter},
    +
    422 {0x01712, 0x01714, WBP::Extend},
    +
    423 {0x01720, 0x01731, WBP::ALetter},
    +
    424 {0x01732, 0x01734, WBP::Extend},
    +
    425 {0x01740, 0x01751, WBP::ALetter},
    +
    426 {0x01752, 0x01753, WBP::Extend},
    +
    427 {0x01760, 0x0176C, WBP::ALetter},
    +
    428 {0x0176E, 0x01770, WBP::ALetter},
    +
    429 {0x01772, 0x01773, WBP::Extend},
    +
    430 {0x017B4, 0x017D3, WBP::Extend},
    +
    431 {0x017DD, 0x017DD, WBP::Extend},
    +
    432 {0x017E0, 0x017E9, WBP::Numeric},
    +
    433 {0x0180B, 0x0180D, WBP::Extend},
    +
    434 {0x0180E, 0x0180E, WBP::Format},
    +
    435 {0x01810, 0x01819, WBP::Numeric},
    +
    436 {0x01820, 0x01878, WBP::ALetter},
    +
    437 {0x01880, 0x01884, WBP::ALetter},
    +
    438 {0x01885, 0x01886, WBP::Extend},
    +
    439 {0x01887, 0x018A8, WBP::ALetter},
    +
    440 {0x018A9, 0x018A9, WBP::Extend},
    +
    441 {0x018AA, 0x018AA, WBP::ALetter},
    +
    442 {0x018B0, 0x018F5, WBP::ALetter},
    +
    443 {0x01900, 0x0191E, WBP::ALetter},
    +
    444 {0x01920, 0x0192B, WBP::Extend},
    +
    445 {0x01930, 0x0193B, WBP::Extend},
    +
    446 {0x01946, 0x0194F, WBP::Numeric},
    +
    447 {0x019D0, 0x019D9, WBP::Numeric},
    +
    448 {0x01A00, 0x01A16, WBP::ALetter},
    +
    449 {0x01A17, 0x01A1B, WBP::Extend},
    +
    450 {0x01A55, 0x01A5E, WBP::Extend},
    +
    451 {0x01A60, 0x01A7C, WBP::Extend},
    +
    452 {0x01A7F, 0x01A7F, WBP::Extend},
    +
    453 {0x01A80, 0x01A89, WBP::Numeric},
    +
    454 {0x01A90, 0x01A99, WBP::Numeric},
    +
    455 {0x01AB0, 0x01AC0, WBP::Extend},
    +
    456 {0x01B00, 0x01B04, WBP::Extend},
    +
    457 {0x01B05, 0x01B33, WBP::ALetter},
    +
    458 {0x01B34, 0x01B44, WBP::Extend},
    +
    459 {0x01B45, 0x01B4B, WBP::ALetter},
    +
    460 {0x01B50, 0x01B59, WBP::Numeric},
    +
    461 {0x01B6B, 0x01B73, WBP::Extend},
    +
    462 {0x01B80, 0x01B82, WBP::Extend},
    +
    463 {0x01B83, 0x01BA0, WBP::ALetter},
    +
    464 {0x01BA1, 0x01BAD, WBP::Extend},
    +
    465 {0x01BAE, 0x01BAF, WBP::ALetter},
    +
    466 {0x01BB0, 0x01BB9, WBP::Numeric},
    +
    467 {0x01BBA, 0x01BE5, WBP::ALetter},
    +
    468 {0x01BE6, 0x01BF3, WBP::Extend},
    +
    469 {0x01C00, 0x01C23, WBP::ALetter},
    +
    470 {0x01C24, 0x01C37, WBP::Extend},
    +
    471 {0x01C40, 0x01C49, WBP::Numeric},
    +
    472 {0x01C4D, 0x01C4F, WBP::ALetter},
    +
    473 {0x01C50, 0x01C59, WBP::Numeric},
    +
    474 {0x01C5A, 0x01C7D, WBP::ALetter},
    +
    475 {0x01C80, 0x01C88, WBP::ALetter},
    +
    476 {0x01C90, 0x01CBA, WBP::ALetter},
    +
    477 {0x01CBD, 0x01CBF, WBP::ALetter},
    +
    478 {0x01CD0, 0x01CD2, WBP::Extend},
    +
    479 {0x01CD4, 0x01CE8, WBP::Extend},
    +
    480 {0x01CE9, 0x01CEC, WBP::ALetter},
    +
    481 {0x01CED, 0x01CED, WBP::Extend},
    +
    482 {0x01CEE, 0x01CF3, WBP::ALetter},
    +
    483 {0x01CF4, 0x01CF4, WBP::Extend},
    +
    484 {0x01CF5, 0x01CF6, WBP::ALetter},
    +
    485 {0x01CF7, 0x01CF9, WBP::Extend},
    +
    486 {0x01CFA, 0x01CFA, WBP::ALetter},
    +
    487 {0x01D00, 0x01DBF, WBP::ALetter},
    +
    488 {0x01DC0, 0x01DF9, WBP::Extend},
    +
    489 {0x01DFB, 0x01DFF, WBP::Extend},
    +
    490 {0x01E00, 0x01F15, WBP::ALetter},
    +
    491 {0x01F18, 0x01F1D, WBP::ALetter},
    +
    492 {0x01F20, 0x01F45, WBP::ALetter},
    +
    493 {0x01F48, 0x01F4D, WBP::ALetter},
    +
    494 {0x01F50, 0x01F57, WBP::ALetter},
    +
    495 {0x01F59, 0x01F59, WBP::ALetter},
    +
    496 {0x01F5B, 0x01F5B, WBP::ALetter},
    +
    497 {0x01F5D, 0x01F5D, WBP::ALetter},
    +
    498 {0x01F5F, 0x01F7D, WBP::ALetter},
    +
    499 {0x01F80, 0x01FB4, WBP::ALetter},
    +
    500 {0x01FB6, 0x01FBC, WBP::ALetter},
    +
    501 {0x01FBE, 0x01FBE, WBP::ALetter},
    +
    502 {0x01FC2, 0x01FC4, WBP::ALetter},
    +
    503 {0x01FC6, 0x01FCC, WBP::ALetter},
    +
    504 {0x01FD0, 0x01FD3, WBP::ALetter},
    +
    505 {0x01FD6, 0x01FDB, WBP::ALetter},
    +
    506 {0x01FE0, 0x01FEC, WBP::ALetter},
    +
    507 {0x01FF2, 0x01FF4, WBP::ALetter},
    +
    508 {0x01FF6, 0x01FFC, WBP::ALetter},
    +
    509 {0x02000, 0x02006, WBP::WSegSpace},
    +
    510 {0x02008, 0x0200A, WBP::WSegSpace},
    +
    511 {0x0200C, 0x0200C, WBP::Extend},
    +
    512 {0x0200D, 0x0200D, WBP::ZWJ},
    +
    513 {0x0200E, 0x0200F, WBP::Format},
    +
    514 {0x02018, 0x02019, WBP::MidNumLet},
    +
    515 {0x02024, 0x02024, WBP::MidNumLet},
    +
    516 {0x02027, 0x02027, WBP::MidLetter},
    +
    517 {0x02028, 0x02029, WBP::Newline},
    +
    518 {0x0202A, 0x0202E, WBP::Format},
    +
    519 {0x0202F, 0x0202F, WBP::ExtendNumLet},
    +
    520 {0x0203F, 0x02040, WBP::ExtendNumLet},
    +
    521 {0x02044, 0x02044, WBP::MidNum},
    +
    522 {0x02054, 0x02054, WBP::ExtendNumLet},
    +
    523 {0x0205F, 0x0205F, WBP::WSegSpace},
    +
    524 {0x02060, 0x02064, WBP::Format},
    +
    525 {0x02066, 0x0206F, WBP::Format},
    +
    526 {0x02071, 0x02071, WBP::ALetter},
    +
    527 {0x0207F, 0x0207F, WBP::ALetter},
    +
    528 {0x02090, 0x0209C, WBP::ALetter},
    +
    529 {0x020D0, 0x020F0, WBP::Extend},
    +
    530 {0x02102, 0x02102, WBP::ALetter},
    +
    531 {0x02107, 0x02107, WBP::ALetter},
    +
    532 {0x0210A, 0x02113, WBP::ALetter},
    +
    533 {0x02115, 0x02115, WBP::ALetter},
    +
    534 {0x02119, 0x0211D, WBP::ALetter},
    +
    535 {0x02124, 0x02124, WBP::ALetter},
    +
    536 {0x02126, 0x02126, WBP::ALetter},
    +
    537 {0x02128, 0x02128, WBP::ALetter},
    +
    538 {0x0212A, 0x0212D, WBP::ALetter},
    +
    539 {0x0212F, 0x02139, WBP::ALetter},
    +
    540 {0x0213C, 0x0213F, WBP::ALetter},
    +
    541 {0x02145, 0x02149, WBP::ALetter},
    +
    542 {0x0214E, 0x0214E, WBP::ALetter},
    +
    543 {0x02160, 0x02188, WBP::ALetter},
    +
    544 {0x024B6, 0x024E9, WBP::ALetter},
    +
    545 {0x02C00, 0x02C2E, WBP::ALetter},
    +
    546 {0x02C30, 0x02C5E, WBP::ALetter},
    +
    547 {0x02C60, 0x02CE4, WBP::ALetter},
    +
    548 {0x02CEB, 0x02CEE, WBP::ALetter},
    +
    549 {0x02CEF, 0x02CF1, WBP::Extend},
    +
    550 {0x02CF2, 0x02CF3, WBP::ALetter},
    +
    551 {0x02D00, 0x02D25, WBP::ALetter},
    +
    552 {0x02D27, 0x02D27, WBP::ALetter},
    +
    553 {0x02D2D, 0x02D2D, WBP::ALetter},
    +
    554 {0x02D30, 0x02D67, WBP::ALetter},
    +
    555 {0x02D6F, 0x02D6F, WBP::ALetter},
    +
    556 {0x02D7F, 0x02D7F, WBP::Extend},
    +
    557 {0x02D80, 0x02D96, WBP::ALetter},
    +
    558 {0x02DA0, 0x02DA6, WBP::ALetter},
    +
    559 {0x02DA8, 0x02DAE, WBP::ALetter},
    +
    560 {0x02DB0, 0x02DB6, WBP::ALetter},
    +
    561 {0x02DB8, 0x02DBE, WBP::ALetter},
    +
    562 {0x02DC0, 0x02DC6, WBP::ALetter},
    +
    563 {0x02DC8, 0x02DCE, WBP::ALetter},
    +
    564 {0x02DD0, 0x02DD6, WBP::ALetter},
    +
    565 {0x02DD8, 0x02DDE, WBP::ALetter},
    +
    566 {0x02DE0, 0x02DFF, WBP::Extend},
    +
    567 {0x02E2F, 0x02E2F, WBP::ALetter},
    +
    568 {0x03000, 0x03000, WBP::WSegSpace},
    +
    569 {0x03005, 0x03005, WBP::ALetter},
    +
    570 {0x0302A, 0x0302F, WBP::Extend},
    +
    571 {0x03031, 0x03035, WBP::Katakana},
    +
    572 {0x0303B, 0x0303C, WBP::ALetter},
    +
    573 {0x03099, 0x0309A, WBP::Extend},
    +
    574 {0x0309B, 0x0309C, WBP::Katakana},
    +
    575 {0x030A0, 0x030FA, WBP::Katakana},
    +
    576 {0x030FC, 0x030FF, WBP::Katakana},
    +
    577 {0x03105, 0x0312F, WBP::ALetter},
    +
    578 {0x03131, 0x0318E, WBP::ALetter},
    +
    579 {0x031A0, 0x031BF, WBP::ALetter},
    +
    580 {0x031F0, 0x031FF, WBP::Katakana},
    +
    581 {0x032D0, 0x032FE, WBP::Katakana},
    +
    582 {0x03300, 0x03357, WBP::Katakana},
    +
    583 {0x0A000, 0x0A48C, WBP::ALetter},
    +
    584 {0x0A4D0, 0x0A4FD, WBP::ALetter},
    +
    585 {0x0A500, 0x0A60C, WBP::ALetter},
    +
    586 {0x0A610, 0x0A61F, WBP::ALetter},
    +
    587 {0x0A620, 0x0A629, WBP::Numeric},
    +
    588 {0x0A62A, 0x0A62B, WBP::ALetter},
    +
    589 {0x0A640, 0x0A66E, WBP::ALetter},
    +
    590 {0x0A66F, 0x0A672, WBP::Extend},
    +
    591 {0x0A674, 0x0A67D, WBP::Extend},
    +
    592 {0x0A67F, 0x0A69D, WBP::ALetter},
    +
    593 {0x0A69E, 0x0A69F, WBP::Extend},
    +
    594 {0x0A6A0, 0x0A6EF, WBP::ALetter},
    +
    595 {0x0A6F0, 0x0A6F1, WBP::Extend},
    +
    596 {0x0A708, 0x0A7BF, WBP::ALetter},
    +
    597 {0x0A7C2, 0x0A7CA, WBP::ALetter},
    +
    598 {0x0A7F5, 0x0A801, WBP::ALetter},
    +
    599 {0x0A802, 0x0A802, WBP::Extend},
    +
    600 {0x0A803, 0x0A805, WBP::ALetter},
    +
    601 {0x0A806, 0x0A806, WBP::Extend},
    +
    602 {0x0A807, 0x0A80A, WBP::ALetter},
    +
    603 {0x0A80B, 0x0A80B, WBP::Extend},
    +
    604 {0x0A80C, 0x0A822, WBP::ALetter},
    +
    605 {0x0A823, 0x0A827, WBP::Extend},
    +
    606 {0x0A82C, 0x0A82C, WBP::Extend},
    +
    607 {0x0A840, 0x0A873, WBP::ALetter},
    +
    608 {0x0A880, 0x0A881, WBP::Extend},
    +
    609 {0x0A882, 0x0A8B3, WBP::ALetter},
    +
    610 {0x0A8B4, 0x0A8C5, WBP::Extend},
    +
    611 {0x0A8D0, 0x0A8D9, WBP::Numeric},
    +
    612 {0x0A8E0, 0x0A8F1, WBP::Extend},
    +
    613 {0x0A8F2, 0x0A8F7, WBP::ALetter},
    +
    614 {0x0A8FB, 0x0A8FB, WBP::ALetter},
    +
    615 {0x0A8FD, 0x0A8FE, WBP::ALetter},
    +
    616 {0x0A8FF, 0x0A8FF, WBP::Extend},
    +
    617 {0x0A900, 0x0A909, WBP::Numeric},
    +
    618 {0x0A90A, 0x0A925, WBP::ALetter},
    +
    619 {0x0A926, 0x0A92D, WBP::Extend},
    +
    620 {0x0A930, 0x0A946, WBP::ALetter},
    +
    621 {0x0A947, 0x0A953, WBP::Extend},
    +
    622 {0x0A960, 0x0A97C, WBP::ALetter},
    +
    623 {0x0A980, 0x0A983, WBP::Extend},
    +
    624 {0x0A984, 0x0A9B2, WBP::ALetter},
    +
    625 {0x0A9B3, 0x0A9C0, WBP::Extend},
    +
    626 {0x0A9CF, 0x0A9CF, WBP::ALetter},
    +
    627 {0x0A9D0, 0x0A9D9, WBP::Numeric},
    +
    628 {0x0A9E5, 0x0A9E5, WBP::Extend},
    +
    629 {0x0A9F0, 0x0A9F9, WBP::Numeric},
    +
    630 {0x0AA00, 0x0AA28, WBP::ALetter},
    +
    631 {0x0AA29, 0x0AA36, WBP::Extend},
    +
    632 {0x0AA40, 0x0AA42, WBP::ALetter},
    +
    633 {0x0AA43, 0x0AA43, WBP::Extend},
    +
    634 {0x0AA44, 0x0AA4B, WBP::ALetter},
    +
    635 {0x0AA4C, 0x0AA4D, WBP::Extend},
    +
    636 {0x0AA50, 0x0AA59, WBP::Numeric},
    +
    637 {0x0AA7B, 0x0AA7D, WBP::Extend},
    +
    638 {0x0AAB0, 0x0AAB0, WBP::Extend},
    +
    639 {0x0AAB2, 0x0AAB4, WBP::Extend},
    +
    640 {0x0AAB7, 0x0AAB8, WBP::Extend},
    +
    641 {0x0AABE, 0x0AABF, WBP::Extend},
    +
    642 {0x0AAC1, 0x0AAC1, WBP::Extend},
    +
    643 {0x0AAE0, 0x0AAEA, WBP::ALetter},
    +
    644 {0x0AAEB, 0x0AAEF, WBP::Extend},
    +
    645 {0x0AAF2, 0x0AAF4, WBP::ALetter},
    +
    646 {0x0AAF5, 0x0AAF6, WBP::Extend},
    +
    647 {0x0AB01, 0x0AB06, WBP::ALetter},
    +
    648 {0x0AB09, 0x0AB0E, WBP::ALetter},
    +
    649 {0x0AB11, 0x0AB16, WBP::ALetter},
    +
    650 {0x0AB20, 0x0AB26, WBP::ALetter},
    +
    651 {0x0AB28, 0x0AB2E, WBP::ALetter},
    +
    652 {0x0AB30, 0x0AB69, WBP::ALetter},
    +
    653 {0x0AB70, 0x0ABE2, WBP::ALetter},
    +
    654 {0x0ABE3, 0x0ABEA, WBP::Extend},
    +
    655 {0x0ABEC, 0x0ABED, WBP::Extend},
    +
    656 {0x0ABF0, 0x0ABF9, WBP::Numeric},
    +
    657 {0x0AC00, 0x0D7A3, WBP::ALetter},
    +
    658 {0x0D7B0, 0x0D7C6, WBP::ALetter},
    +
    659 {0x0D7CB, 0x0D7FB, WBP::ALetter},
    +
    660 {0x0FB00, 0x0FB06, WBP::ALetter},
    +
    661 {0x0FB13, 0x0FB17, WBP::ALetter},
    +
    662 {0x0FB1D, 0x0FB1D, WBP::Hebrew_Letter},
    +
    663 {0x0FB1E, 0x0FB1E, WBP::Extend},
    +
    664 {0x0FB1F, 0x0FB28, WBP::Hebrew_Letter},
    +
    665 {0x0FB2A, 0x0FB36, WBP::Hebrew_Letter},
    +
    666 {0x0FB38, 0x0FB3C, WBP::Hebrew_Letter},
    +
    667 {0x0FB3E, 0x0FB3E, WBP::Hebrew_Letter},
    +
    668 {0x0FB40, 0x0FB41, WBP::Hebrew_Letter},
    +
    669 {0x0FB43, 0x0FB44, WBP::Hebrew_Letter},
    +
    670 {0x0FB46, 0x0FB4F, WBP::Hebrew_Letter},
    +
    671 {0x0FB50, 0x0FBB1, WBP::ALetter},
    +
    672 {0x0FBD3, 0x0FD3D, WBP::ALetter},
    +
    673 {0x0FD50, 0x0FD8F, WBP::ALetter},
    +
    674 {0x0FD92, 0x0FDC7, WBP::ALetter},
    +
    675 {0x0FDF0, 0x0FDFB, WBP::ALetter},
    +
    676 {0x0FE00, 0x0FE0F, WBP::Extend},
    +
    677 {0x0FE10, 0x0FE10, WBP::MidNum},
    +
    678 {0x0FE13, 0x0FE13, WBP::MidLetter},
    +
    679 {0x0FE14, 0x0FE14, WBP::MidNum},
    +
    680 {0x0FE20, 0x0FE2F, WBP::Extend},
    +
    681 {0x0FE33, 0x0FE34, WBP::ExtendNumLet},
    +
    682 {0x0FE4D, 0x0FE4F, WBP::ExtendNumLet},
    +
    683 {0x0FE50, 0x0FE50, WBP::MidNum},
    +
    684 {0x0FE52, 0x0FE52, WBP::MidNumLet},
    +
    685 {0x0FE54, 0x0FE54, WBP::MidNum},
    +
    686 {0x0FE55, 0x0FE55, WBP::MidLetter},
    +
    687 {0x0FE70, 0x0FE74, WBP::ALetter},
    +
    688 {0x0FE76, 0x0FEFC, WBP::ALetter},
    +
    689 {0x0FEFF, 0x0FEFF, WBP::Format},
    +
    690 {0x0FF07, 0x0FF07, WBP::MidNumLet},
    +
    691 {0x0FF0C, 0x0FF0C, WBP::MidNum},
    +
    692 {0x0FF0E, 0x0FF0E, WBP::MidNumLet},
    +
    693 {0x0FF10, 0x0FF19, WBP::Numeric},
    +
    694 {0x0FF1A, 0x0FF1A, WBP::MidLetter},
    +
    695 {0x0FF1B, 0x0FF1B, WBP::MidNum},
    +
    696 {0x0FF21, 0x0FF3A, WBP::ALetter},
    +
    697 {0x0FF3F, 0x0FF3F, WBP::ExtendNumLet},
    +
    698 {0x0FF41, 0x0FF5A, WBP::ALetter},
    +
    699 {0x0FF66, 0x0FF9D, WBP::Katakana},
    +
    700 {0x0FF9E, 0x0FF9F, WBP::Extend},
    +
    701 {0x0FFA0, 0x0FFBE, WBP::ALetter},
    +
    702 {0x0FFC2, 0x0FFC7, WBP::ALetter},
    +
    703 {0x0FFCA, 0x0FFCF, WBP::ALetter},
    +
    704 {0x0FFD2, 0x0FFD7, WBP::ALetter},
    +
    705 {0x0FFDA, 0x0FFDC, WBP::ALetter},
    +
    706 {0x0FFF9, 0x0FFFB, WBP::Format},
    +
    707 {0x10000, 0x1000B, WBP::ALetter},
    +
    708 {0x1000D, 0x10026, WBP::ALetter},
    +
    709 {0x10028, 0x1003A, WBP::ALetter},
    +
    710 {0x1003C, 0x1003D, WBP::ALetter},
    +
    711 {0x1003F, 0x1004D, WBP::ALetter},
    +
    712 {0x10050, 0x1005D, WBP::ALetter},
    +
    713 {0x10080, 0x100FA, WBP::ALetter},
    +
    714 {0x10140, 0x10174, WBP::ALetter},
    +
    715 {0x101FD, 0x101FD, WBP::Extend},
    +
    716 {0x10280, 0x1029C, WBP::ALetter},
    +
    717 {0x102A0, 0x102D0, WBP::ALetter},
    +
    718 {0x102E0, 0x102E0, WBP::Extend},
    +
    719 {0x10300, 0x1031F, WBP::ALetter},
    +
    720 {0x1032D, 0x1034A, WBP::ALetter},
    +
    721 {0x10350, 0x10375, WBP::ALetter},
    +
    722 {0x10376, 0x1037A, WBP::Extend},
    +
    723 {0x10380, 0x1039D, WBP::ALetter},
    +
    724 {0x103A0, 0x103C3, WBP::ALetter},
    +
    725 {0x103C8, 0x103CF, WBP::ALetter},
    +
    726 {0x103D1, 0x103D5, WBP::ALetter},
    +
    727 {0x10400, 0x1049D, WBP::ALetter},
    +
    728 {0x104A0, 0x104A9, WBP::Numeric},
    +
    729 {0x104B0, 0x104D3, WBP::ALetter},
    +
    730 {0x104D8, 0x104FB, WBP::ALetter},
    +
    731 {0x10500, 0x10527, WBP::ALetter},
    +
    732 {0x10530, 0x10563, WBP::ALetter},
    +
    733 {0x10600, 0x10736, WBP::ALetter},
    +
    734 {0x10740, 0x10755, WBP::ALetter},
    +
    735 {0x10760, 0x10767, WBP::ALetter},
    +
    736 {0x10800, 0x10805, WBP::ALetter},
    +
    737 {0x10808, 0x10808, WBP::ALetter},
    +
    738 {0x1080A, 0x10835, WBP::ALetter},
    +
    739 {0x10837, 0x10838, WBP::ALetter},
    +
    740 {0x1083C, 0x1083C, WBP::ALetter},
    +
    741 {0x1083F, 0x10855, WBP::ALetter},
    +
    742 {0x10860, 0x10876, WBP::ALetter},
    +
    743 {0x10880, 0x1089E, WBP::ALetter},
    +
    744 {0x108E0, 0x108F2, WBP::ALetter},
    +
    745 {0x108F4, 0x108F5, WBP::ALetter},
    +
    746 {0x10900, 0x10915, WBP::ALetter},
    +
    747 {0x10920, 0x10939, WBP::ALetter},
    +
    748 {0x10980, 0x109B7, WBP::ALetter},
    +
    749 {0x109BE, 0x109BF, WBP::ALetter},
    +
    750 {0x10A00, 0x10A00, WBP::ALetter},
    +
    751 {0x10A01, 0x10A03, WBP::Extend},
    +
    752 {0x10A05, 0x10A06, WBP::Extend},
    +
    753 {0x10A0C, 0x10A0F, WBP::Extend},
    +
    754 {0x10A10, 0x10A13, WBP::ALetter},
    +
    755 {0x10A15, 0x10A17, WBP::ALetter},
    +
    756 {0x10A19, 0x10A35, WBP::ALetter},
    +
    757 {0x10A38, 0x10A3A, WBP::Extend},
    +
    758 {0x10A3F, 0x10A3F, WBP::Extend},
    +
    759 {0x10A60, 0x10A7C, WBP::ALetter},
    +
    760 {0x10A80, 0x10A9C, WBP::ALetter},
    +
    761 {0x10AC0, 0x10AC7, WBP::ALetter},
    +
    762 {0x10AC9, 0x10AE4, WBP::ALetter},
    +
    763 {0x10AE5, 0x10AE6, WBP::Extend},
    +
    764 {0x10B00, 0x10B35, WBP::ALetter},
    +
    765 {0x10B40, 0x10B55, WBP::ALetter},
    +
    766 {0x10B60, 0x10B72, WBP::ALetter},
    +
    767 {0x10B80, 0x10B91, WBP::ALetter},
    +
    768 {0x10C00, 0x10C48, WBP::ALetter},
    +
    769 {0x10C80, 0x10CB2, WBP::ALetter},
    +
    770 {0x10CC0, 0x10CF2, WBP::ALetter},
    +
    771 {0x10D00, 0x10D23, WBP::ALetter},
    +
    772 {0x10D24, 0x10D27, WBP::Extend},
    +
    773 {0x10D30, 0x10D39, WBP::Numeric},
    +
    774 {0x10E80, 0x10EA9, WBP::ALetter},
    +
    775 {0x10EAB, 0x10EAC, WBP::Extend},
    +
    776 {0x10EB0, 0x10EB1, WBP::ALetter},
    +
    777 {0x10F00, 0x10F1C, WBP::ALetter},
    +
    778 {0x10F27, 0x10F27, WBP::ALetter},
    +
    779 {0x10F30, 0x10F45, WBP::ALetter},
    +
    780 {0x10F46, 0x10F50, WBP::Extend},
    +
    781 {0x10FB0, 0x10FC4, WBP::ALetter},
    +
    782 {0x10FE0, 0x10FF6, WBP::ALetter},
    +
    783 {0x11000, 0x11002, WBP::Extend},
    +
    784 {0x11003, 0x11037, WBP::ALetter},
    +
    785 {0x11038, 0x11046, WBP::Extend},
    +
    786 {0x11066, 0x1106F, WBP::Numeric},
    +
    787 {0x1107F, 0x11082, WBP::Extend},
    +
    788 {0x11083, 0x110AF, WBP::ALetter},
    +
    789 {0x110B0, 0x110BA, WBP::Extend},
    +
    790 {0x110BD, 0x110BD, WBP::Format},
    +
    791 {0x110CD, 0x110CD, WBP::Format},
    +
    792 {0x110D0, 0x110E8, WBP::ALetter},
    +
    793 {0x110F0, 0x110F9, WBP::Numeric},
    +
    794 {0x11100, 0x11102, WBP::Extend},
    +
    795 {0x11103, 0x11126, WBP::ALetter},
    +
    796 {0x11127, 0x11134, WBP::Extend},
    +
    797 {0x11136, 0x1113F, WBP::Numeric},
    +
    798 {0x11144, 0x11144, WBP::ALetter},
    +
    799 {0x11145, 0x11146, WBP::Extend},
    +
    800 {0x11147, 0x11147, WBP::ALetter},
    +
    801 {0x11150, 0x11172, WBP::ALetter},
    +
    802 {0x11173, 0x11173, WBP::Extend},
    +
    803 {0x11176, 0x11176, WBP::ALetter},
    +
    804 {0x11180, 0x11182, WBP::Extend},
    +
    805 {0x11183, 0x111B2, WBP::ALetter},
    +
    806 {0x111B3, 0x111C0, WBP::Extend},
    +
    807 {0x111C1, 0x111C4, WBP::ALetter},
    +
    808 {0x111C9, 0x111CC, WBP::Extend},
    +
    809 {0x111CE, 0x111CF, WBP::Extend},
    +
    810 {0x111D0, 0x111D9, WBP::Numeric},
    +
    811 {0x111DA, 0x111DA, WBP::ALetter},
    +
    812 {0x111DC, 0x111DC, WBP::ALetter},
    +
    813 {0x11200, 0x11211, WBP::ALetter},
    +
    814 {0x11213, 0x1122B, WBP::ALetter},
    +
    815 {0x1122C, 0x11237, WBP::Extend},
    +
    816 {0x1123E, 0x1123E, WBP::Extend},
    +
    817 {0x11280, 0x11286, WBP::ALetter},
    +
    818 {0x11288, 0x11288, WBP::ALetter},
    +
    819 {0x1128A, 0x1128D, WBP::ALetter},
    +
    820 {0x1128F, 0x1129D, WBP::ALetter},
    +
    821 {0x1129F, 0x112A8, WBP::ALetter},
    +
    822 {0x112B0, 0x112DE, WBP::ALetter},
    +
    823 {0x112DF, 0x112EA, WBP::Extend},
    +
    824 {0x112F0, 0x112F9, WBP::Numeric},
    +
    825 {0x11300, 0x11303, WBP::Extend},
    +
    826 {0x11305, 0x1130C, WBP::ALetter},
    +
    827 {0x1130F, 0x11310, WBP::ALetter},
    +
    828 {0x11313, 0x11328, WBP::ALetter},
    +
    829 {0x1132A, 0x11330, WBP::ALetter},
    +
    830 {0x11332, 0x11333, WBP::ALetter},
    +
    831 {0x11335, 0x11339, WBP::ALetter},
    +
    832 {0x1133B, 0x1133C, WBP::Extend},
    +
    833 {0x1133D, 0x1133D, WBP::ALetter},
    +
    834 {0x1133E, 0x11344, WBP::Extend},
    +
    835 {0x11347, 0x11348, WBP::Extend},
    +
    836 {0x1134B, 0x1134D, WBP::Extend},
    +
    837 {0x11350, 0x11350, WBP::ALetter},
    +
    838 {0x11357, 0x11357, WBP::Extend},
    +
    839 {0x1135D, 0x11361, WBP::ALetter},
    +
    840 {0x11362, 0x11363, WBP::Extend},
    +
    841 {0x11366, 0x1136C, WBP::Extend},
    +
    842 {0x11370, 0x11374, WBP::Extend},
    +
    843 {0x11400, 0x11434, WBP::ALetter},
    +
    844 {0x11435, 0x11446, WBP::Extend},
    +
    845 {0x11447, 0x1144A, WBP::ALetter},
    +
    846 {0x11450, 0x11459, WBP::Numeric},
    +
    847 {0x1145E, 0x1145E, WBP::Extend},
    +
    848 {0x1145F, 0x11461, WBP::ALetter},
    +
    849 {0x11480, 0x114AF, WBP::ALetter},
    +
    850 {0x114B0, 0x114C3, WBP::Extend},
    +
    851 {0x114C4, 0x114C5, WBP::ALetter},
    +
    852 {0x114C7, 0x114C7, WBP::ALetter},
    +
    853 {0x114D0, 0x114D9, WBP::Numeric},
    +
    854 {0x11580, 0x115AE, WBP::ALetter},
    +
    855 {0x115AF, 0x115B5, WBP::Extend},
    +
    856 {0x115B8, 0x115C0, WBP::Extend},
    +
    857 {0x115D8, 0x115DB, WBP::ALetter},
    +
    858 {0x115DC, 0x115DD, WBP::Extend},
    +
    859 {0x11600, 0x1162F, WBP::ALetter},
    +
    860 {0x11630, 0x11640, WBP::Extend},
    +
    861 {0x11644, 0x11644, WBP::ALetter},
    +
    862 {0x11650, 0x11659, WBP::Numeric},
    +
    863 {0x11680, 0x116AA, WBP::ALetter},
    +
    864 {0x116AB, 0x116B7, WBP::Extend},
    +
    865 {0x116B8, 0x116B8, WBP::ALetter},
    +
    866 {0x116C0, 0x116C9, WBP::Numeric},
    +
    867 {0x1171D, 0x1172B, WBP::Extend},
    +
    868 {0x11730, 0x11739, WBP::Numeric},
    +
    869 {0x11800, 0x1182B, WBP::ALetter},
    +
    870 {0x1182C, 0x1183A, WBP::Extend},
    +
    871 {0x118A0, 0x118DF, WBP::ALetter},
    +
    872 {0x118E0, 0x118E9, WBP::Numeric},
    +
    873 {0x118FF, 0x11906, WBP::ALetter},
    +
    874 {0x11909, 0x11909, WBP::ALetter},
    +
    875 {0x1190C, 0x11913, WBP::ALetter},
    +
    876 {0x11915, 0x11916, WBP::ALetter},
    +
    877 {0x11918, 0x1192F, WBP::ALetter},
    +
    878 {0x11930, 0x11935, WBP::Extend},
    +
    879 {0x11937, 0x11938, WBP::Extend},
    +
    880 {0x1193B, 0x1193E, WBP::Extend},
    +
    881 {0x1193F, 0x1193F, WBP::ALetter},
    +
    882 {0x11940, 0x11940, WBP::Extend},
    +
    883 {0x11941, 0x11941, WBP::ALetter},
    +
    884 {0x11942, 0x11943, WBP::Extend},
    +
    885 {0x11950, 0x11959, WBP::Numeric},
    +
    886 {0x119A0, 0x119A7, WBP::ALetter},
    +
    887 {0x119AA, 0x119D0, WBP::ALetter},
    +
    888 {0x119D1, 0x119D7, WBP::Extend},
    +
    889 {0x119DA, 0x119E0, WBP::Extend},
    +
    890 {0x119E1, 0x119E1, WBP::ALetter},
    +
    891 {0x119E3, 0x119E3, WBP::ALetter},
    +
    892 {0x119E4, 0x119E4, WBP::Extend},
    +
    893 {0x11A00, 0x11A00, WBP::ALetter},
    +
    894 {0x11A01, 0x11A0A, WBP::Extend},
    +
    895 {0x11A0B, 0x11A32, WBP::ALetter},
    +
    896 {0x11A33, 0x11A39, WBP::Extend},
    +
    897 {0x11A3A, 0x11A3A, WBP::ALetter},
    +
    898 {0x11A3B, 0x11A3E, WBP::Extend},
    +
    899 {0x11A47, 0x11A47, WBP::Extend},
    +
    900 {0x11A50, 0x11A50, WBP::ALetter},
    +
    901 {0x11A51, 0x11A5B, WBP::Extend},
    +
    902 {0x11A5C, 0x11A89, WBP::ALetter},
    +
    903 {0x11A8A, 0x11A99, WBP::Extend},
    +
    904 {0x11A9D, 0x11A9D, WBP::ALetter},
    +
    905 {0x11AC0, 0x11AF8, WBP::ALetter},
    +
    906 {0x11C00, 0x11C08, WBP::ALetter},
    +
    907 {0x11C0A, 0x11C2E, WBP::ALetter},
    +
    908 {0x11C2F, 0x11C36, WBP::Extend},
    +
    909 {0x11C38, 0x11C3F, WBP::Extend},
    +
    910 {0x11C40, 0x11C40, WBP::ALetter},
    +
    911 {0x11C50, 0x11C59, WBP::Numeric},
    +
    912 {0x11C72, 0x11C8F, WBP::ALetter},
    +
    913 {0x11C92, 0x11CA7, WBP::Extend},
    +
    914 {0x11CA9, 0x11CB6, WBP::Extend},
    +
    915 {0x11D00, 0x11D06, WBP::ALetter},
    +
    916 {0x11D08, 0x11D09, WBP::ALetter},
    +
    917 {0x11D0B, 0x11D30, WBP::ALetter},
    +
    918 {0x11D31, 0x11D36, WBP::Extend},
    +
    919 {0x11D3A, 0x11D3A, WBP::Extend},
    +
    920 {0x11D3C, 0x11D3D, WBP::Extend},
    +
    921 {0x11D3F, 0x11D45, WBP::Extend},
    +
    922 {0x11D46, 0x11D46, WBP::ALetter},
    +
    923 {0x11D47, 0x11D47, WBP::Extend},
    +
    924 {0x11D50, 0x11D59, WBP::Numeric},
    +
    925 {0x11D60, 0x11D65, WBP::ALetter},
    +
    926 {0x11D67, 0x11D68, WBP::ALetter},
    +
    927 {0x11D6A, 0x11D89, WBP::ALetter},
    +
    928 {0x11D8A, 0x11D8E, WBP::Extend},
    +
    929 {0x11D90, 0x11D91, WBP::Extend},
    +
    930 {0x11D93, 0x11D97, WBP::Extend},
    +
    931 {0x11D98, 0x11D98, WBP::ALetter},
    +
    932 {0x11DA0, 0x11DA9, WBP::Numeric},
    +
    933 {0x11EE0, 0x11EF2, WBP::ALetter},
    +
    934 {0x11EF3, 0x11EF6, WBP::Extend},
    +
    935 {0x11FB0, 0x11FB0, WBP::ALetter},
    +
    936 {0x12000, 0x12399, WBP::ALetter},
    +
    937 {0x12400, 0x1246E, WBP::ALetter},
    +
    938 {0x12480, 0x12543, WBP::ALetter},
    +
    939 {0x13000, 0x1342E, WBP::ALetter},
    +
    940 {0x13430, 0x13438, WBP::Format},
    +
    941 {0x14400, 0x14646, WBP::ALetter},
    +
    942 {0x16800, 0x16A38, WBP::ALetter},
    +
    943 {0x16A40, 0x16A5E, WBP::ALetter},
    +
    944 {0x16A60, 0x16A69, WBP::Numeric},
    +
    945 {0x16AD0, 0x16AED, WBP::ALetter},
    +
    946 {0x16AF0, 0x16AF4, WBP::Extend},
    +
    947 {0x16B00, 0x16B2F, WBP::ALetter},
    +
    948 {0x16B30, 0x16B36, WBP::Extend},
    +
    949 {0x16B40, 0x16B43, WBP::ALetter},
    +
    950 {0x16B50, 0x16B59, WBP::Numeric},
    +
    951 {0x16B63, 0x16B77, WBP::ALetter},
    +
    952 {0x16B7D, 0x16B8F, WBP::ALetter},
    +
    953 {0x16E40, 0x16E7F, WBP::ALetter},
    +
    954 {0x16F00, 0x16F4A, WBP::ALetter},
    +
    955 {0x16F4F, 0x16F4F, WBP::Extend},
    +
    956 {0x16F50, 0x16F50, WBP::ALetter},
    +
    957 {0x16F51, 0x16F87, WBP::Extend},
    +
    958 {0x16F8F, 0x16F92, WBP::Extend},
    +
    959 {0x16F93, 0x16F9F, WBP::ALetter},
    +
    960 {0x16FE0, 0x16FE1, WBP::ALetter},
    +
    961 {0x16FE3, 0x16FE3, WBP::ALetter},
    +
    962 {0x16FE4, 0x16FE4, WBP::Extend},
    +
    963 {0x16FF0, 0x16FF1, WBP::Extend},
    +
    964 {0x1B000, 0x1B000, WBP::Katakana},
    +
    965 {0x1B164, 0x1B167, WBP::Katakana},
    +
    966 {0x1BC00, 0x1BC6A, WBP::ALetter},
    +
    967 {0x1BC70, 0x1BC7C, WBP::ALetter},
    +
    968 {0x1BC80, 0x1BC88, WBP::ALetter},
    +
    969 {0x1BC90, 0x1BC99, WBP::ALetter},
    +
    970 {0x1BC9D, 0x1BC9E, WBP::Extend},
    +
    971 {0x1BCA0, 0x1BCA3, WBP::Format},
    +
    972 {0x1D165, 0x1D169, WBP::Extend},
    +
    973 {0x1D16D, 0x1D172, WBP::Extend},
    +
    974 {0x1D173, 0x1D17A, WBP::Format},
    +
    975 {0x1D17B, 0x1D182, WBP::Extend},
    +
    976 {0x1D185, 0x1D18B, WBP::Extend},
    +
    977 {0x1D1AA, 0x1D1AD, WBP::Extend},
    +
    978 {0x1D242, 0x1D244, WBP::Extend},
    +
    979 {0x1D400, 0x1D454, WBP::ALetter},
    +
    980 {0x1D456, 0x1D49C, WBP::ALetter},
    +
    981 {0x1D49E, 0x1D49F, WBP::ALetter},
    +
    982 {0x1D4A2, 0x1D4A2, WBP::ALetter},
    +
    983 {0x1D4A5, 0x1D4A6, WBP::ALetter},
    +
    984 {0x1D4A9, 0x1D4AC, WBP::ALetter},
    +
    985 {0x1D4AE, 0x1D4B9, WBP::ALetter},
    +
    986 {0x1D4BB, 0x1D4BB, WBP::ALetter},
    +
    987 {0x1D4BD, 0x1D4C3, WBP::ALetter},
    +
    988 {0x1D4C5, 0x1D505, WBP::ALetter},
    +
    989 {0x1D507, 0x1D50A, WBP::ALetter},
    +
    990 {0x1D50D, 0x1D514, WBP::ALetter},
    +
    991 {0x1D516, 0x1D51C, WBP::ALetter},
    +
    992 {0x1D51E, 0x1D539, WBP::ALetter},
    +
    993 {0x1D53B, 0x1D53E, WBP::ALetter},
    +
    994 {0x1D540, 0x1D544, WBP::ALetter},
    +
    995 {0x1D546, 0x1D546, WBP::ALetter},
    +
    996 {0x1D54A, 0x1D550, WBP::ALetter},
    +
    997 {0x1D552, 0x1D6A5, WBP::ALetter},
    +
    998 {0x1D6A8, 0x1D6C0, WBP::ALetter},
    +
    999 {0x1D6C2, 0x1D6DA, WBP::ALetter},
    +
    1000 {0x1D6DC, 0x1D6FA, WBP::ALetter},
    +
    1001 {0x1D6FC, 0x1D714, WBP::ALetter},
    +
    1002 {0x1D716, 0x1D734, WBP::ALetter},
    +
    1003 {0x1D736, 0x1D74E, WBP::ALetter},
    +
    1004 {0x1D750, 0x1D76E, WBP::ALetter},
    +
    1005 {0x1D770, 0x1D788, WBP::ALetter},
    +
    1006 {0x1D78A, 0x1D7A8, WBP::ALetter},
    +
    1007 {0x1D7AA, 0x1D7C2, WBP::ALetter},
    +
    1008 {0x1D7C4, 0x1D7CB, WBP::ALetter},
    +
    1009 {0x1D7CE, 0x1D7FF, WBP::Numeric},
    +
    1010 {0x1DA00, 0x1DA36, WBP::Extend},
    +
    1011 {0x1DA3B, 0x1DA6C, WBP::Extend},
    +
    1012 {0x1DA75, 0x1DA75, WBP::Extend},
    +
    1013 {0x1DA84, 0x1DA84, WBP::Extend},
    +
    1014 {0x1DA9B, 0x1DA9F, WBP::Extend},
    +
    1015 {0x1DAA1, 0x1DAAF, WBP::Extend},
    +
    1016 {0x1E000, 0x1E006, WBP::Extend},
    +
    1017 {0x1E008, 0x1E018, WBP::Extend},
    +
    1018 {0x1E01B, 0x1E021, WBP::Extend},
    +
    1019 {0x1E023, 0x1E024, WBP::Extend},
    +
    1020 {0x1E026, 0x1E02A, WBP::Extend},
    +
    1021 {0x1E100, 0x1E12C, WBP::ALetter},
    +
    1022 {0x1E130, 0x1E136, WBP::Extend},
    +
    1023 {0x1E137, 0x1E13D, WBP::ALetter},
    +
    1024 {0x1E140, 0x1E149, WBP::Numeric},
    +
    1025 {0x1E14E, 0x1E14E, WBP::ALetter},
    +
    1026 {0x1E2C0, 0x1E2EB, WBP::ALetter},
    +
    1027 {0x1E2EC, 0x1E2EF, WBP::Extend},
    +
    1028 {0x1E2F0, 0x1E2F9, WBP::Numeric},
    +
    1029 {0x1E800, 0x1E8C4, WBP::ALetter},
    +
    1030 {0x1E8D0, 0x1E8D6, WBP::Extend},
    +
    1031 {0x1E900, 0x1E943, WBP::ALetter},
    +
    1032 {0x1E944, 0x1E94A, WBP::Extend},
    +
    1033 {0x1E94B, 0x1E94B, WBP::ALetter},
    +
    1034 {0x1E950, 0x1E959, WBP::Numeric},
    +
    1035 {0x1EE00, 0x1EE03, WBP::ALetter},
    +
    1036 {0x1EE05, 0x1EE1F, WBP::ALetter},
    +
    1037 {0x1EE21, 0x1EE22, WBP::ALetter},
    +
    1038 {0x1EE24, 0x1EE24, WBP::ALetter},
    +
    1039 {0x1EE27, 0x1EE27, WBP::ALetter},
    +
    1040 {0x1EE29, 0x1EE32, WBP::ALetter},
    +
    1041 {0x1EE34, 0x1EE37, WBP::ALetter},
    +
    1042 {0x1EE39, 0x1EE39, WBP::ALetter},
    +
    1043 {0x1EE3B, 0x1EE3B, WBP::ALetter},
    +
    1044 {0x1EE42, 0x1EE42, WBP::ALetter},
    +
    1045 {0x1EE47, 0x1EE47, WBP::ALetter},
    +
    1046 {0x1EE49, 0x1EE49, WBP::ALetter},
    +
    1047 {0x1EE4B, 0x1EE4B, WBP::ALetter},
    +
    1048 {0x1EE4D, 0x1EE4F, WBP::ALetter},
    +
    1049 {0x1EE51, 0x1EE52, WBP::ALetter},
    +
    1050 {0x1EE54, 0x1EE54, WBP::ALetter},
    +
    1051 {0x1EE57, 0x1EE57, WBP::ALetter},
    +
    1052 {0x1EE59, 0x1EE59, WBP::ALetter},
    +
    1053 {0x1EE5B, 0x1EE5B, WBP::ALetter},
    +
    1054 {0x1EE5D, 0x1EE5D, WBP::ALetter},
    +
    1055 {0x1EE5F, 0x1EE5F, WBP::ALetter},
    +
    1056 {0x1EE61, 0x1EE62, WBP::ALetter},
    +
    1057 {0x1EE64, 0x1EE64, WBP::ALetter},
    +
    1058 {0x1EE67, 0x1EE6A, WBP::ALetter},
    +
    1059 {0x1EE6C, 0x1EE72, WBP::ALetter},
    +
    1060 {0x1EE74, 0x1EE77, WBP::ALetter},
    +
    1061 {0x1EE79, 0x1EE7C, WBP::ALetter},
    +
    1062 {0x1EE7E, 0x1EE7E, WBP::ALetter},
    +
    1063 {0x1EE80, 0x1EE89, WBP::ALetter},
    +
    1064 {0x1EE8B, 0x1EE9B, WBP::ALetter},
    +
    1065 {0x1EEA1, 0x1EEA3, WBP::ALetter},
    +
    1066 {0x1EEA5, 0x1EEA9, WBP::ALetter},
    +
    1067 {0x1EEAB, 0x1EEBB, WBP::ALetter},
    +
    1068 {0x1F130, 0x1F149, WBP::ALetter},
    +
    1069 {0x1F150, 0x1F169, WBP::ALetter},
    +
    1070 {0x1F170, 0x1F189, WBP::ALetter},
    +
    1071 {0x1F1E6, 0x1F1FF, WBP::Regional_Indicator},
    +
    1072 {0x1F3FB, 0x1F3FF, WBP::Extend},
    +
    1073 {0x1FBF0, 0x1FBF9, WBP::Numeric},
    +
    1074 {0xE0001, 0xE0001, WBP::Format},
    +
    1075 {0xE0020, 0xE007F, WBP::Extend},
    +
    1076 {0xE0100, 0xE01EF, WBP::Extend},
    +
    1077}};
    +
    1078
    +
    1079// Construct table of just WBP::Extend character intervals
    +
    1080constexpr auto g_extend_characters{[]() constexpr {
    +
    1081 // Compute number of extend character intervals
    +
    1082 constexpr size_t size = []() constexpr {
    +
    1083 size_t count = 0;
    +
    1084 for (auto interval : g_word_break_intervals) {
    +
    1085 if (interval.property == WBP::Extend) {
    +
    1086 count++;
    +
    1087 }
    +
    1088 }
    +
    1089 return count;
    +
    1090 }();
    +
    1091
    +
    1092 // Create array of extend character intervals
    +
    1093 std::array<Interval, size> result{};
    +
    1094 size_t index = 0;
    +
    1095 for (auto interval : g_word_break_intervals) {
    +
    1096 if (interval.property == WBP::Extend) {
    +
    1097 result[index++] = {interval.first, interval.last}; // NOLINT
    +
    1098 }
    +
    1099 }
    +
    1100 return result;
    +
    1101}()};
    +
    1102
    +
    1103// Find a codepoint inside a sorted list of Interval.
    +
    1104template <size_t N>
    +
    1105bool Bisearch(uint32_t ucs, const std::array<Interval, N>& table) {
    +
    1106 if (ucs < table.front().first || ucs > table.back().last) { // NOLINT
    +
    1107 return false;
    +
    1108 }
    +
    1109
    +
    1110 int min = 0;
    +
    1111 int max = N - 1;
    +
    1112 while (max >= min) {
    +
    1113 const int mid = (min + max) / 2;
    +
    1114 if (ucs > table[mid].last) { // NOLINT
    +
    1115 min = mid + 1;
    +
    1116 } else if (ucs < table[mid].first) { // NOLINT
    +
    1117 max = mid - 1;
    +
    1118 } else {
    +
    1119 return true;
    +
    1120 }
    +
    1121 }
    +
    1122
    +
    1123 return false;
    +
    1124}
    +
    1125
    +
    1126// Find a value inside a sorted list of Interval + property.
    +
    1127template <class C, size_t N>
    +
    1128bool Bisearch(uint32_t ucs, const std::array<C, N>& table, C* out) {
    +
    1129 if (ucs < table.front().first || ucs > table.back().last) { // NOLINT
    +
    1130 return false;
    +
    1131 }
    +
    1132
    +
    1133 int min = 0;
    +
    1134 int max = N - 1;
    +
    1135 while (max >= min) {
    +
    1136 const int mid = (min + max) / 2;
    +
    1137 if (ucs > table[mid].last) { // NOLINT
    +
    1138 min = mid + 1;
    +
    1139 } else if (ucs < table[mid].first) { // NOLINT
    +
    1140 max = mid - 1;
    +
    1141 } else {
    +
    1142 *out = table[mid]; // NOLINT
    +
    1143 return true;
    +
    1144 }
    +
    1145 }
    +
    1146
    +
    1147 return false;
    +
    1148}
    +
    1149
    +
    1150int codepoint_width(uint32_t ucs) {
    +
    1151 if (ftxui::IsControl(ucs)) {
    +
    1152 return -1;
    +
    1153 }
    +
    1154
    +
    1155 if (ftxui::IsCombining(ucs)) {
    +
    1156 return 0;
    +
    1157 }
    +
    1158
    +
    1159 if (ftxui::IsFullWidth(ucs)) {
    +
    1160 return 2;
    +
    1161 }
    +
    1162
    +
    1163 return 1;
    +
    1164}
    +
    1165
    +
    1166} // namespace
    +
    1167
    +
    1168namespace ftxui {
    +
    1169
    +
    1170// From UTF8 encoded string |input|, eat in between 1 and 4 byte representing
    +
    1171// one codepoint. Put the codepoint into |ucs|. Start at |start| and update
    +
    1172// |end| to represent the beginning of the next byte to eat for consecutive
    +
    1173// executions.
    +
    +
    1174bool EatCodePoint(const std::string& input,
    +
    1175 size_t start,
    +
    1176 size_t* end,
    +
    1177 uint32_t* ucs) {
    +
    1178 if (start >= input.size()) {
    +
    1179 *end = start + 1;
    +
    1180 return false;
    +
    1181 }
    +
    1182 const uint8_t C0 = input[start];
    +
    1183
    +
    1184 // 1 byte string.
    +
    1185 if ((C0 & 0b1000'0000) == 0b0000'0000) { // NOLINT
    +
    1186 *ucs = C0 & 0b0111'1111; // NOLINT
    +
    1187 *end = start + 1;
    +
    1188 return true;
    +
    1189 }
    +
    1190
    +
    1191 // 2 byte string.
    +
    1192 if ((C0 & 0b1110'0000) == 0b1100'0000 && // NOLINT
    +
    1193 start + 1 < input.size()) {
    +
    1194 const uint8_t C1 = input[start + 1];
    +
    1195 *ucs = 0;
    +
    1196 *ucs += C0 & 0b0001'1111; // NOLINT
    +
    1197 *ucs <<= 6; // NOLINT
    +
    1198 *ucs += C1 & 0b0011'1111; // NOLINT
    +
    1199 *end = start + 2;
    +
    1200 return true;
    +
    1201 }
    +
    1202
    +
    1203 // 3 byte string.
    +
    1204 if ((C0 & 0b1111'0000) == 0b1110'0000 && // NOLINT
    +
    1205 start + 2 < input.size()) {
    +
    1206 const uint8_t C1 = input[start + 1];
    +
    1207 const uint8_t C2 = input[start + 2];
    +
    1208 *ucs = 0;
    +
    1209 *ucs += C0 & 0b0000'1111; // NOLINT
    +
    1210 *ucs <<= 6; // NOLINT
    +
    1211 *ucs += C1 & 0b0011'1111; // NOLINT
    +
    1212 *ucs <<= 6; // NOLINT
    +
    1213 *ucs += C2 & 0b0011'1111; // NOLINT
    +
    1214 *end = start + 3;
    +
    1215 return true;
    +
    1216 }
    +
    1217
    +
    1218 // 4 byte string.
    +
    1219 if ((C0 & 0b1111'1000) == 0b1111'0000 && // NOLINT
    +
    1220 start + 3 < input.size()) {
    +
    1221 const uint8_t C1 = input[start + 1];
    +
    1222 const uint8_t C2 = input[start + 2];
    +
    1223 const uint8_t C3 = input[start + 3];
    +
    1224 *ucs = 0;
    +
    1225 *ucs += C0 & 0b0000'0111; // NOLINT
    +
    1226 *ucs <<= 6; // NOLINT
    +
    1227 *ucs += C1 & 0b0011'1111; // NOLINT
    +
    1228 *ucs <<= 6; // NOLINT
    +
    1229 *ucs += C2 & 0b0011'1111; // NOLINT
    +
    1230 *ucs <<= 6; // NOLINT
    +
    1231 *ucs += C3 & 0b0011'1111; // NOLINT
    +
    1232 *end = start + 4;
    +
    1233 return true;
    +
    1234 }
    +
    1235
    +
    1236 *end = start + 1;
    +
    1237 return false;
    +
    1238}
    +
    +
    1239
    +
    1240// From UTF16 encoded string |input|, eat in between 1 and 4 byte representing
    +
    1241// one codepoint. Put the codepoint into |ucs|. Start at |start| and update
    +
    1242// |end| to represent the beginning of the next byte to eat for consecutive
    +
    1243// executions.
    +
    +
    1244bool EatCodePoint(const std::wstring& input,
    +
    1245 size_t start,
    +
    1246 size_t* end,
    +
    1247 uint32_t* ucs) {
    +
    1248 if (start >= input.size()) {
    +
    1249 *end = start + 1;
    +
    1250 return false;
    +
    1251 }
    +
    1252
    +
    1253 // On linux wstring uses the UTF32 encoding:
    +
    1254 if constexpr (sizeof(wchar_t) == 4) {
    +
    1255 *ucs = input[start]; // NOLINT
    +
    1256 *end = start + 1;
    +
    1257 return true;
    +
    1258 }
    +
    1259
    +
    1260 // On windows, wstring uses the UTF16 encoding:
    +
    1261 int32_t C0 = input[start]; // NOLINT
    +
    1262
    +
    1263 // 1 word size:
    +
    1264 if (C0 < 0xd800 || C0 >= 0xdc00) { // NOLINT
    +
    1265 *ucs = C0;
    +
    1266 *end = start + 1;
    +
    1267 return true;
    +
    1268 }
    +
    1269
    +
    1270 // 2 word size:
    +
    1271 if (start + 1 >= input.size()) {
    +
    1272 *end = start + 2;
    +
    1273 return false;
    +
    1274 }
    +
    1275
    +
    1276 int32_t C1 = input[start + 1]; // NOLINT
    +
    1277 *ucs = ((C0 & 0x3ff) << 10) + (C1 & 0x3ff) + 0x10000; // NOLINT
    +
    1278 *end = start + 2;
    +
    1279 return true;
    +
    1280}
    +
    +
    1281
    +
    +
    1282bool IsCombining(uint32_t ucs) {
    +
    1283 return Bisearch(ucs, g_extend_characters);
    +
    1284}
    +
    +
    1285
    +
    +
    1286bool IsFullWidth(uint32_t ucs) {
    +
    1287 if (ucs < 0x0300) { // Quick path: // NOLINT
    +
    1288 return false;
    +
    1289 }
    +
    1290
    +
    1291 return Bisearch(ucs, g_full_width_characters);
    +
    1292}
    +
    +
    1293
    +
    +
    1294bool IsControl(uint32_t ucs) {
    +
    1295 if (ucs == 0) {
    +
    1296 return true;
    +
    1297 }
    +
    1298 if (ucs < 32) { // NOLINT
    +
    1299 const uint32_t LINE_FEED = 10;
    +
    1300 return ucs != LINE_FEED;
    +
    1301 }
    +
    1302 if (ucs >= 0x7f && ucs < 0xa0) { // NOLINT
    +
    1303 return true;
    +
    1304 }
    +
    1305 return false;
    +
    1306}
    +
    +
    1307
    +
    + +
    1309 WordBreakPropertyInterval interval = {0, 0, WBP::ALetter};
    +
    1310 std::ignore = Bisearch(codepoint, g_word_break_intervals, &interval);
    +
    1311 return interval.property;
    +
    1312}
    +
    +
    1313
    +
    +
    1314int wchar_width(wchar_t ucs) {
    +
    1315 return codepoint_width(uint32_t(ucs));
    +
    1316}
    +
    +
    1317
    +
    +
    1318int wstring_width(const std::wstring& text) {
    +
    1319 int width = 0;
    +
    1320
    +
    1321 for (const wchar_t& it : text) {
    +
    1322 const int w = wchar_width(it);
    +
    1323 if (w < 0) {
    +
    1324 return -1;
    +
    1325 }
    +
    1326 width += w;
    +
    1327 }
    +
    1328 return width;
    +
    1329}
    +
    +
    1330
    +
    +
    1331int string_width(const std::string& input) {
    +
    1332 int width = 0;
    +
    1333 size_t start = 0;
    +
    1334 while (start < input.size()) {
    +
    1335 uint32_t codepoint = 0;
    +
    1336 if (!EatCodePoint(input, start, &start, &codepoint)) {
    +
    1337 continue;
    +
    1338 }
    +
    1339
    +
    1340 if (IsControl(codepoint)) {
    +
    1341 continue;
    +
    1342 }
    +
    1343
    +
    1344 if (IsCombining(codepoint)) {
    +
    1345 continue;
    +
    1346 }
    +
    1347
    +
    1348 if (IsFullWidth(codepoint)) {
    +
    1349 width += 2;
    +
    1350 continue;
    +
    1351 }
    +
    1352
    +
    1353 width += 1;
    +
    1354 }
    +
    1355 return width;
    +
    1356}
    +
    +
    1357
    +
    +
    1358std::vector<std::string> Utf8ToGlyphs(const std::string& input) {
    +
    1359 std::vector<std::string> out;
    +
    1360 out.reserve(input.size());
    +
    1361 size_t start = 0;
    +
    1362 size_t end = 0;
    +
    1363 while (start < input.size()) {
    +
    1364 uint32_t codepoint = 0;
    +
    1365 if (!EatCodePoint(input, start, &end, &codepoint)) {
    +
    1366 start = end;
    +
    1367 continue;
    +
    1368 }
    +
    1369
    +
    1370 const std::string append = input.substr(start, end - start);
    +
    1371 start = end;
    +
    1372
    +
    1373 // Ignore control characters.
    +
    1374 if (IsControl(codepoint)) {
    +
    1375 continue;
    +
    1376 }
    +
    1377
    +
    1378 // Combining characters are put with the previous glyph they are modifying.
    +
    1379 if (IsCombining(codepoint)) {
    +
    1380 if (!out.empty()) {
    +
    1381 out.back() += append;
    +
    1382 }
    +
    1383 continue;
    +
    1384 }
    +
    1385
    +
    1386 // Fullwidth characters take two cells. The second is made of the empty
    +
    1387 // string to reserve the space the first is taking.
    +
    1388 if (IsFullWidth(codepoint)) {
    +
    1389 out.push_back(append);
    +
    1390 out.emplace_back("");
    +
    1391 continue;
    +
    1392 }
    +
    1393
    +
    1394 // Normal characters:
    +
    1395 out.push_back(append);
    +
    1396 }
    +
    1397 return out;
    +
    1398}
    +
    +
    1399
    +
    +
    1400size_t GlyphPrevious(const std::string& input, size_t start) {
    +
    1401 while (true) {
    +
    1402 if (start == 0) {
    +
    1403 return 0;
    +
    1404 }
    +
    1405 start--;
    +
    1406
    +
    1407 // Skip the UTF8 continuation bytes.
    +
    1408 if ((input[start] & 0b1100'0000) == 0b1000'0000) {
    +
    1409 continue;
    +
    1410 }
    +
    1411
    +
    1412 uint32_t codepoint = 0;
    +
    1413 size_t end = 0;
    +
    1414 const bool eaten = EatCodePoint(input, start, &end, &codepoint);
    +
    1415
    +
    1416 // Ignore invalid, control characters and combining characters.
    +
    1417 if (!eaten || IsControl(codepoint) || IsCombining(codepoint)) {
    +
    1418 continue;
    +
    1419 }
    +
    1420
    +
    1421 return start;
    +
    1422 }
    +
    1423}
    +
    +
    1424
    +
    +
    1425size_t GlyphNext(const std::string& input, size_t start) {
    +
    1426 bool glyph_found = false;
    +
    1427 while (start < input.size()) {
    +
    1428 size_t end = 0;
    +
    1429 uint32_t codepoint = 0;
    +
    1430 const bool eaten = EatCodePoint(input, start, &end, &codepoint);
    +
    1431
    +
    1432 // Ignore invalid, control characters and combining characters.
    +
    1433 if (!eaten || IsControl(codepoint) || IsCombining(codepoint)) {
    +
    1434 start = end;
    +
    1435 continue;
    +
    1436 }
    +
    1437
    +
    1438 // We eat the beginning of the next glyph. If we are eating the one
    +
    1439 // requested, return its start position immediately.
    +
    1440 if (glyph_found) {
    +
    1441 return static_cast<int>(start);
    +
    1442 }
    +
    1443
    +
    1444 // Otherwise, skip this glyph and iterate:
    +
    1445 glyph_found = true;
    +
    1446 start = end;
    +
    1447 }
    +
    1448 return static_cast<int>(input.size());
    +
    1449}
    +
    +
    1450
    +
    +
    1451size_t GlyphIterate(const std::string& input, int glyph_offset, size_t start) {
    +
    1452 if (glyph_offset >= 0) {
    +
    1453 for (int i = 0; i < glyph_offset; ++i) {
    +
    1454 start = GlyphNext(input, start);
    +
    1455 }
    +
    1456 return start;
    +
    1457 } else {
    +
    1458 for (int i = 0; i < -glyph_offset; ++i) {
    +
    1459 start = GlyphPrevious(input, start);
    +
    1460 }
    +
    1461 return start;
    +
    1462 }
    +
    1463}
    +
    +
    1464
    +
    +
    1465std::vector<int> CellToGlyphIndex(const std::string& input) {
    +
    1466 int x = -1;
    +
    1467 std::vector<int> out;
    +
    1468 out.reserve(input.size());
    +
    1469 size_t start = 0;
    +
    1470 size_t end = 0;
    +
    1471 while (start < input.size()) {
    +
    1472 uint32_t codepoint = 0;
    +
    1473 const bool eaten = EatCodePoint(input, start, &end, &codepoint);
    +
    1474 start = end;
    +
    1475
    +
    1476 // Ignore invalid / control characters.
    +
    1477 if (!eaten || IsControl(codepoint)) {
    +
    1478 continue;
    +
    1479 }
    +
    1480
    +
    1481 // Combining characters are put with the previous glyph they are modifying.
    +
    1482 if (IsCombining(codepoint)) {
    +
    1483 if (x == -1) {
    +
    1484 ++x;
    +
    1485 out.push_back(x);
    +
    1486 }
    +
    1487 continue;
    +
    1488 }
    +
    1489
    +
    1490 // Fullwidth characters take two cells. The second is made of the empty
    +
    1491 // string to reserve the space the first is taking.
    +
    1492 if (IsFullWidth(codepoint)) {
    +
    1493 ++x;
    +
    1494 out.push_back(x);
    +
    1495 out.push_back(x);
    +
    1496 continue;
    +
    1497 }
    +
    1498
    +
    1499 // Normal characters:
    +
    1500 ++x;
    +
    1501 out.push_back(x);
    +
    1502 }
    +
    1503 return out;
    +
    1504}
    +
    +
    1505
    +
    +
    1506int GlyphCount(const std::string& input) {
    +
    1507 int size = 0;
    +
    1508 size_t start = 0;
    +
    1509 size_t end = 0;
    +
    1510 while (start < input.size()) {
    +
    1511 uint32_t codepoint = 0;
    +
    1512 const bool eaten = EatCodePoint(input, start, &end, &codepoint);
    +
    1513 start = end;
    +
    1514
    +
    1515 // Ignore invalid characters:
    +
    1516 if (!eaten || IsControl(codepoint)) {
    +
    1517 continue;
    +
    1518 }
    +
    1519
    +
    1520 // Ignore combining characters, except when they don't have a preceding to
    +
    1521 // combine with.
    +
    1522 if (IsCombining(codepoint)) {
    +
    1523 if (size == 0) {
    +
    1524 size++;
    +
    1525 }
    +
    1526 continue;
    +
    1527 }
    +
    1528
    +
    1529 size++;
    +
    1530 }
    +
    1531 return size;
    +
    1532}
    +
    +
    1533
    +
    +
    1534std::vector<WordBreakProperty> Utf8ToWordBreakProperty(
    +
    1535 const std::string& input) {
    +
    1536 std::vector<WordBreakProperty> out;
    +
    1537 out.reserve(input.size());
    +
    1538 size_t start = 0;
    +
    1539 size_t end = 0;
    +
    1540 while (start < input.size()) {
    +
    1541 uint32_t codepoint = 0;
    +
    1542 if (!EatCodePoint(input, start, &end, &codepoint)) {
    +
    1543 start = end;
    +
    1544 continue;
    +
    1545 }
    +
    1546 start = end;
    +
    1547
    +
    1548 // Ignore control characters.
    +
    1549 if (IsControl(codepoint)) {
    +
    1550 continue;
    +
    1551 }
    +
    1552
    +
    1553 // Ignore combining characters.
    +
    1554 if (IsCombining(codepoint)) {
    +
    1555 continue;
    +
    1556 }
    +
    1557
    +
    1558 WordBreakPropertyInterval interval = {0, 0, WBP::ALetter};
    +
    1559 std::ignore = Bisearch(codepoint, g_word_break_intervals, &interval);
    +
    1560 out.push_back(interval.property);
    +
    1561 }
    +
    1562 return out;
    +
    1563}
    +
    +
    1564
    +
    1565/// Convert a std::wstring into a UTF8 std::string.
    +
    +
    1566std::string to_string(const std::wstring& s) {
    +
    1567 std::string out;
    +
    1568
    +
    1569 size_t i = 0;
    +
    1570 uint32_t codepoint = 0;
    +
    1571 while (EatCodePoint(s, i, &i, &codepoint)) {
    +
    1572 // Code point <-> UTF-8 conversion
    +
    1573 //
    +
    1574 // ┏━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┓
    +
    1575 // ┃Byte 1 ┃Byte 2 ┃Byte 3 ┃Byte 4 ┃
    +
    1576 // ┡━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━┩
    +
    1577 // │0xxxxxxx│ │ │ │
    +
    1578 // ├────────┼────────┼────────┼────────┤
    +
    1579 // │110xxxxx│10xxxxxx│ │ │
    +
    1580 // ├────────┼────────┼────────┼────────┤
    +
    1581 // │1110xxxx│10xxxxxx│10xxxxxx│ │
    +
    1582 // ├────────┼────────┼────────┼────────┤
    +
    1583 // │11110xxx│10xxxxxx│10xxxxxx│10xxxxxx│
    +
    1584 // └────────┴────────┴────────┴────────┘
    +
    1585
    +
    1586 // 1 byte UTF8
    +
    1587 if (codepoint <= 0b000'0000'0111'1111) { // NOLINT
    +
    1588 const uint8_t p1 = codepoint;
    +
    1589 out.push_back(p1); // NOLINT
    +
    1590 continue;
    +
    1591 }
    +
    1592
    +
    1593 // 2 bytes UTF8
    +
    1594 if (codepoint <= 0b000'0111'1111'1111) { // NOLINT
    +
    1595 uint8_t p2 = codepoint & 0b111111; // NOLINT
    +
    1596 codepoint >>= 6; // NOLINT
    +
    1597 uint8_t p1 = codepoint; // NOLINT
    +
    1598 out.push_back(0b11000000 + p1); // NOLINT
    +
    1599 out.push_back(0b10000000 + p2); // NOLINT
    +
    1600 continue;
    +
    1601 }
    +
    1602
    +
    1603 // 3 bytes UTF8
    +
    1604 if (codepoint <= 0b1111'1111'1111'1111) { // NOLINT
    +
    1605 uint8_t p3 = codepoint & 0b111111; // NOLINT
    +
    1606 codepoint >>= 6; // NOLINT
    +
    1607 uint8_t p2 = codepoint & 0b111111; // NOLINT
    +
    1608 codepoint >>= 6; // NOLINT
    +
    1609 uint8_t p1 = codepoint; // NOLINT
    +
    1610 out.push_back(0b11100000 + p1); // NOLINT
    +
    1611 out.push_back(0b10000000 + p2); // NOLINT
    +
    1612 out.push_back(0b10000000 + p3); // NOLINT
    +
    1613 continue;
    +
    1614 }
    +
    1615
    +
    1616 // 4 bytes UTF8
    +
    1617 if (codepoint <= 0b1'0000'1111'1111'1111'1111) { // NOLINT
    +
    1618 uint8_t p4 = codepoint & 0b111111; // NOLINT
    +
    1619 codepoint >>= 6; // NOLINT
    +
    1620 uint8_t p3 = codepoint & 0b111111; // NOLINT
    +
    1621 codepoint >>= 6; // NOLINT
    +
    1622 uint8_t p2 = codepoint & 0b111111; // NOLINT
    +
    1623 codepoint >>= 6; // NOLINT
    +
    1624 uint8_t p1 = codepoint; // NOLINT
    +
    1625 out.push_back(0b11110000 + p1); // NOLINT
    +
    1626 out.push_back(0b10000000 + p2); // NOLINT
    +
    1627 out.push_back(0b10000000 + p3); // NOLINT
    +
    1628 out.push_back(0b10000000 + p4); // NOLINT
    +
    1629 continue;
    +
    1630 }
    +
    1631
    +
    1632 // Something else?
    +
    1633 }
    +
    1634 return out;
    +
    1635}
    +
    +
    1636
    +
    1637/// Convert a UTF8 std::string into a std::wstring.
    +
    +
    1638std::wstring to_wstring(const std::string& s) {
    +
    1639 std::wstring out;
    +
    1640
    +
    1641 size_t i = 0;
    +
    1642 uint32_t codepoint = 0;
    +
    1643 while (EatCodePoint(s, i, &i, &codepoint)) {
    +
    1644 // On linux wstring are UTF32 encoded:
    +
    1645 if constexpr (sizeof(wchar_t) == 4) {
    +
    1646 out.push_back(codepoint); // NOLINT
    +
    1647 continue;
    +
    1648 }
    +
    1649
    +
    1650 // On Windows, wstring are UTF16 encoded:
    +
    1651
    +
    1652 // Codepoint encoded using 1 word:
    +
    1653 // NOLINTNEXTLINE
    +
    1654 if (codepoint < 0xD800 || (codepoint > 0xDFFF && codepoint < 0x10000)) {
    +
    1655 uint16_t p0 = codepoint; // NOLINT
    +
    1656 out.push_back(p0); // NOLINT
    +
    1657 continue;
    +
    1658 }
    +
    1659
    +
    1660 // Codepoint encoded using 2 words:
    +
    1661 codepoint -= 0x010000; // NOLINT
    +
    1662 uint16_t p0 = (((codepoint << 12) >> 22) + 0xD800); // NOLINT
    +
    1663 uint16_t p1 = (((codepoint << 22) >> 22) + 0xDC00); // NOLINT
    +
    1664 out.push_back(p0); // NOLINT
    +
    1665 out.push_back(p1); // NOLINT
    +
    1666 }
    +
    1667 return out;
    +
    1668}
    +
    +
    1669
    +
    1670} // namespace ftxui
    +
    Decorator size(WidthOrHeight, Constraint, int value)
    Apply a constraint on the size of an element.
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    size_t GlyphNext(const std::string &input, size_t start)
    Definition string.cpp:1425
    +
    bool IsControl(uint32_t ucs)
    Definition string.cpp:1294
    +
    WordBreakProperty CodepointToWordBreakProperty(uint32_t codepoint)
    Definition string.cpp:1308
    +
    int wchar_width(wchar_t)
    Definition string.cpp:1314
    +
    std::vector< std::string > Utf8ToGlyphs(const std::string &input)
    Definition string.cpp:1358
    +
    bool IsCombining(uint32_t ucs)
    Definition string.cpp:1282
    +
    int string_width(const std::string &)
    Definition string.cpp:1331
    +
    std::wstring to_wstring(const std::string &s)
    Convert a UTF8 std::string into a std::wstring.
    Definition string.cpp:1638
    + +
    std::string to_string(const std::wstring &s)
    Convert a std::wstring into a UTF8 std::string.
    Definition string.cpp:1566
    +
    bool EatCodePoint(const std::string &input, size_t start, size_t *end, uint32_t *ucs)
    Definition string.cpp:1174
    +
    std::vector< int > CellToGlyphIndex(const std::string &input)
    Definition string.cpp:1465
    +
    int GlyphCount(const std::string &input)
    Definition string.cpp:1506
    +
    bool IsFullWidth(uint32_t ucs)
    Definition string.cpp:1286
    +
    std::vector< WordBreakProperty > Utf8ToWordBreakProperty(const std::string &input)
    Definition string.cpp:1534
    +
    size_t GlyphIterate(const std::string &input, int glyph_offset, size_t start)
    Definition string.cpp:1451
    +
    int wstring_width(const std::wstring &)
    Definition string.cpp:1318
    +
    size_t GlyphPrevious(const std::string &input, size_t start)
    Definition string.cpp:1400
    + + + +
    +
    + + + + + diff --git a/string_8cppm.html b/string_8cppm.html new file mode 100644 index 000000000..f7d21d217 --- /dev/null +++ b/string_8cppm.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: string.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    string.cppm File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    +
    +
    + + + + + diff --git a/string_8cppm_source.html b/string_8cppm_source.html new file mode 100644 index 000000000..23608f05e --- /dev/null +++ b/string_8cppm_source.html @@ -0,0 +1,232 @@ + + + + + + + + +FTXUI: string.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    string.cppm
    +
    +
    +Go to the documentation of this file.
    1/// @module ftxui.screen.string
    +
    2/// @brief Module file for string functions of the Screen module
    +
    3
    +
    4module;
    +
    5
    + +
    7
    +
    8export module ftxui.screen.string;
    +
    9
    +
    10/**
    +
    11 * @namespace ftxui
    +
    12 * @brief The FTXUI ftxui:: namespace
    +
    13 */
    +
    14export namespace ftxui {
    +
    15 using ftxui::to_string;
    +
    16 using ftxui::to_wstring;
    +
    17 using ftxui::string_width;
    +
    18 using ftxui::Utf8ToGlyphs;
    +
    19 using ftxui::CellToGlyphIndex;
    +
    20}
    +
    Module file for string functions of the Screen module.
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + +
    +
    + + + + + diff --git a/string_8hpp.html b/string_8hpp.html new file mode 100644 index 000000000..f06ac07a9 --- /dev/null +++ b/string_8hpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: string.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    string.hpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + + + + + + + + + + + + + +

    +Functions

    std::string to_string (const std::wstring &s)
     Convert a std::wstring into a UTF8 std::string.
     
    std::wstring to_wstring (const std::string &s)
     Convert a UTF8 std::string into a std::wstring.
     
    template<typename T >
    std::wstring to_wstring (T s)
     
    int string_width (const std::string &)
     
    std::vector< std::string > Utf8ToGlyphs (const std::string &input)
     
    std::vector< int > CellToGlyphIndex (const std::string &input)
     
    +
    +
    + + + + + diff --git a/string_8hpp.js b/string_8hpp.js new file mode 100644 index 000000000..130392250 --- /dev/null +++ b/string_8hpp.js @@ -0,0 +1,9 @@ +var string_8hpp = +[ + [ "to_string", "string_8hpp.html#a757b345f73bb6cde5165a4d7f0c0a298", null ], + [ "to_wstring", "string_8hpp.html#a57429a83a46c643a81dee81e49384439", null ], + [ "to_wstring", "string_8hpp.html#a24ea52e8ef70889ef1da986837e0ff34", null ], + [ "string_width", "string_8hpp.html#a517b35c7721e632812d8b3a7697c4099", null ], + [ "Utf8ToGlyphs", "string_8hpp.html#a389c58d385e861cd2ef109b53fc6ef96", null ], + [ "CellToGlyphIndex", "string_8hpp.html#a9769a28baa6a84d5de6a8bd624a29294", null ] +]; \ No newline at end of file diff --git a/string_8hpp_source.html b/string_8hpp_source.html new file mode 100644 index 000000000..5080ad84b --- /dev/null +++ b/string_8hpp_source.html @@ -0,0 +1,248 @@ + + + + + + + + +FTXUI: string.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    string.hpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#ifndef FTXUI_SCREEN_STRING_HPP
    +
    5#define FTXUI_SCREEN_STRING_HPP
    +
    6
    +
    7#include <string> // for string, wstring, to_string
    +
    8#include <vector> // for vector
    +
    9
    +
    10namespace ftxui {
    +
    11std::string to_string(const std::wstring& s);
    +
    12std::wstring to_wstring(const std::string& s);
    +
    13
    +
    14template <typename T>
    +
    +
    15std::wstring to_wstring(T s) {
    +
    16 return to_wstring(std::to_string(s));
    +
    17}
    +
    +
    18
    +
    19int string_width(const std::string&);
    +
    20
    +
    21// Split the string into a its glyphs. An empty one is inserted ater fullwidth
    +
    22// ones.
    +
    23std::vector<std::string> Utf8ToGlyphs(const std::string& input);
    +
    24
    +
    25// Map every cells drawn by |input| to their corresponding Glyphs. Half-size
    +
    26// Glyphs takes one cell, full-size Glyphs take two cells.
    +
    27std::vector<int> CellToGlyphIndex(const std::string& input);
    +
    28
    +
    29} // namespace ftxui
    +
    30
    +
    31#endif /* end of include guard: FTXUI_SCREEN_STRING_HPP */
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::vector< std::string > Utf8ToGlyphs(const std::string &input)
    Definition string.cpp:1358
    +
    int string_width(const std::string &)
    Definition string.cpp:1331
    +
    std::wstring to_wstring(const std::string &s)
    Convert a UTF8 std::string into a std::wstring.
    Definition string.cpp:1638
    +
    std::string to_string(const std::wstring &s)
    Convert a std::wstring into a UTF8 std::string.
    Definition string.cpp:1566
    +
    std::vector< int > CellToGlyphIndex(const std::string &input)
    Definition string.cpp:1465
    +
    +
    + + + + + diff --git a/string__internal_8hpp.html b/string__internal_8hpp.html new file mode 100644 index 000000000..6b4305140 --- /dev/null +++ b/string__internal_8hpp.html @@ -0,0 +1,291 @@ + + + + + + + + +FTXUI: string_internal.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    string_internal.hpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + +

    +Enumerations

    enum class  WordBreakProperty : int8_t {
    +  ALetter +,
    +  CR +,
    +  Double_Quote +,
    +  Extend +,
    +  ExtendNumLet +,
    +  Format +,
    +  Hebrew_Letter +,
    +  Katakana +,
    +  LF +,
    +  MidLetter +,
    +  MidNum +,
    +  MidNumLet +,
    +  Newline +,
    +  Numeric +,
    +  Regional_Indicator +,
    +  Single_Quote +,
    +  WSegSpace +,
    +  ZWJ +
    + }
     
    + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Functions

    bool EatCodePoint (const std::string &input, size_t start, size_t *end, uint32_t *ucs)
     
    bool EatCodePoint (const std::wstring &input, size_t start, size_t *end, uint32_t *ucs)
     
    bool IsCombining (uint32_t ucs)
     
    bool IsFullWidth (uint32_t ucs)
     
    bool IsControl (uint32_t ucs)
     
    size_t GlyphPrevious (const std::string &input, size_t start)
     
    size_t GlyphNext (const std::string &input, size_t start)
     
    size_t GlyphIterate (const std::string &input, int glyph_offset, size_t start)
     
    int GlyphCount (const std::string &input)
     
    WordBreakProperty CodepointToWordBreakProperty (uint32_t codepoint)
     
    std::vector< WordBreakPropertyUtf8ToWordBreakProperty (const std::string &input)
     
    bool IsWordBreakingCharacter (const std::string &input, size_t glyph_index)
     
    +
    +
    + + + + + diff --git a/string__internal_8hpp.js b/string__internal_8hpp.js new file mode 100644 index 000000000..9495c5b54 --- /dev/null +++ b/string__internal_8hpp.js @@ -0,0 +1,35 @@ +var string__internal_8hpp = +[ + [ "WordBreakProperty", "string__internal_8hpp.html#a5a8ec19f52346e9aad9dbab9108b968a", [ + [ "ALetter", "string__internal_8hpp.html#a5a8ec19f52346e9aad9dbab9108b968aab1bb481a6d76de94d35e1d67cb85d966", null ], + [ "CR", "string__internal_8hpp.html#a5a8ec19f52346e9aad9dbab9108b968aa1d7b33fc26ca22c2011aaa97fecc43d8", null ], + [ "Double_Quote", "string__internal_8hpp.html#a5a8ec19f52346e9aad9dbab9108b968aa3a1f5142815614aa554e376af7047de3", null ], + [ "Extend", "string__internal_8hpp.html#a5a8ec19f52346e9aad9dbab9108b968aa3bc026b815790a05493fa56fc4b8d8bd", null ], + [ "ExtendNumLet", "string__internal_8hpp.html#a5a8ec19f52346e9aad9dbab9108b968aadcba983044c9eb2afae2e2eaef5fe818", null ], + [ "Format", "string__internal_8hpp.html#a5a8ec19f52346e9aad9dbab9108b968aa520d0db389f362bf79ef56ca0af3dcab", null ], + [ "Hebrew_Letter", "string__internal_8hpp.html#a5a8ec19f52346e9aad9dbab9108b968aa3b076a28de949c89c8443aa0cd42ef17", null ], + [ "Katakana", "string__internal_8hpp.html#a5a8ec19f52346e9aad9dbab9108b968aaedb097c9a1cb7aed483367f825211f75", null ], + [ "LF", "string__internal_8hpp.html#a5a8ec19f52346e9aad9dbab9108b968aa618441d41cce47dbcfd9bed6e5ff64e6", null ], + [ "MidLetter", "string__internal_8hpp.html#a5a8ec19f52346e9aad9dbab9108b968aab681d24011467edf425478fed96fbcde", null ], + [ "MidNum", "string__internal_8hpp.html#a5a8ec19f52346e9aad9dbab9108b968aa876e36e8a85514e9c141b2aa3a7bfb5c", null ], + [ "MidNumLet", "string__internal_8hpp.html#a5a8ec19f52346e9aad9dbab9108b968aa4d4a2ec3c1ff2c647ff25b61136aabff", null ], + [ "Newline", "string__internal_8hpp.html#a5a8ec19f52346e9aad9dbab9108b968aa755fee300780823fcf4df98383331745", null ], + [ "Numeric", "string__internal_8hpp.html#a5a8ec19f52346e9aad9dbab9108b968aa87322391cc6e8948ce9fd5d6cb84fced", null ], + [ "Regional_Indicator", "string__internal_8hpp.html#a5a8ec19f52346e9aad9dbab9108b968aa7f219844b91c2bb3bdb5fb7ffbdfca72", null ], + [ "Single_Quote", "string__internal_8hpp.html#a5a8ec19f52346e9aad9dbab9108b968aab6f9a00a0255e4da280686c4640c7671", null ], + [ "WSegSpace", "string__internal_8hpp.html#a5a8ec19f52346e9aad9dbab9108b968aa3ddc36a0c4e381a754fb00548d567d09", null ], + [ "ZWJ", "string__internal_8hpp.html#a5a8ec19f52346e9aad9dbab9108b968aacb4adf7b93435bdfbae8f32d5bcda514", null ] + ] ], + [ "EatCodePoint", "string__internal_8hpp.html#a903cd2e24b3b7cf8d7d4daa680e0a8d5", null ], + [ "EatCodePoint", "string__internal_8hpp.html#a88b8b2f726acaf2aca140a403989d8d0", null ], + [ "IsCombining", "string__internal_8hpp.html#a506e6b467ddd8d11646942fd101d8e9e", null ], + [ "IsFullWidth", "string__internal_8hpp.html#abd13f584efddd3a7e5749c9c5e841a11", null ], + [ "IsControl", "string__internal_8hpp.html#a037df033cc26c960faa54b52bdbea900", null ], + [ "GlyphPrevious", "string__internal_8hpp.html#ae2ef74edc55750554e97ea71c5887650", null ], + [ "GlyphNext", "string__internal_8hpp.html#a02453c4504a5cfbc83b38abd4ec6d8ba", null ], + [ "GlyphIterate", "string__internal_8hpp.html#ad74a7d623ff7a09787469021d30c9461", null ], + [ "GlyphCount", "string__internal_8hpp.html#a9b4f3faecfbeb6b2c0fdf9c30e3f1553", null ], + [ "CodepointToWordBreakProperty", "string__internal_8hpp.html#a191b3278846ceb6ac35d2e4eb26db759", null ], + [ "Utf8ToWordBreakProperty", "string__internal_8hpp.html#ad15724e497f0001e146da530183ca552", null ], + [ "IsWordBreakingCharacter", "string__internal_8hpp.html#a64a9bd1df7ca3ffb1622507d01cd0b13", null ] +]; \ No newline at end of file diff --git a/string__internal_8hpp_source.html b/string__internal_8hpp_source.html new file mode 100644 index 000000000..b1cb3984c --- /dev/null +++ b/string__internal_8hpp_source.html @@ -0,0 +1,309 @@ + + + + + + + + +FTXUI: string_internal.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    string_internal.hpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2023 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#ifndef FTXUI_SCREEN_STRING_INTERNAL_HPP
    +
    5#define FTXUI_SCREEN_STRING_INTERNAL_HPP
    +
    6
    +
    7#include <cstdint>
    +
    8#include <string>
    +
    9#include <vector>
    +
    10
    +
    11namespace ftxui {
    +
    12
    +
    13bool EatCodePoint(const std::string& input,
    +
    14 size_t start,
    +
    15 size_t* end,
    +
    16 uint32_t* ucs);
    +
    17bool EatCodePoint(const std::wstring& input,
    +
    18 size_t start,
    +
    19 size_t* end,
    +
    20 uint32_t* ucs);
    +
    21
    +
    22bool IsCombining(uint32_t ucs);
    +
    23bool IsFullWidth(uint32_t ucs);
    +
    24bool IsControl(uint32_t ucs);
    +
    25
    +
    26size_t GlyphPrevious(const std::string& input, size_t start);
    +
    27size_t GlyphNext(const std::string& input, size_t start);
    +
    28
    +
    29// Return the index in the |input| string of the glyph at |glyph_offset|,
    +
    30// starting at |start|
    +
    31size_t GlyphIterate(const std::string& input,
    +
    32 int glyph_offset,
    +
    33 size_t start = 0);
    +
    34
    +
    35// Returns the number of glyphs in |input|.
    +
    36int GlyphCount(const std::string& input);
    +
    37
    +
    38// Properties from:
    +
    39// https://www.unicode.org/Public/UCD/latest/ucd/auxiliary/WordBreakProperty.txt
    +
    +
    40enum class WordBreakProperty : int8_t {
    +
    41 ALetter,
    +
    42 CR,
    + +
    44 Extend,
    + +
    46 Format,
    + + +
    49 LF,
    + +
    51 MidNum,
    + +
    53 Newline,
    +
    54 Numeric,
    + + + +
    58 ZWJ,
    +
    59};
    +
    + +
    61std::vector<WordBreakProperty> Utf8ToWordBreakProperty(
    +
    62 const std::string& input);
    +
    63
    +
    64bool IsWordBreakingCharacter(const std::string& input, size_t glyph_index);
    +
    65} // namespace ftxui
    +
    66
    +
    67#endif /* end of include guard: FTXUI_SCREEN_STRING_INTERNAL_HPP */
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    size_t GlyphNext(const std::string &input, size_t start)
    Definition string.cpp:1425
    +
    bool IsControl(uint32_t ucs)
    Definition string.cpp:1294
    +
    WordBreakProperty CodepointToWordBreakProperty(uint32_t codepoint)
    Definition string.cpp:1308
    +
    bool IsCombining(uint32_t ucs)
    Definition string.cpp:1282
    + + + + + + + + + + + + + + + + + + + +
    bool IsWordBreakingCharacter(const std::string &input, size_t glyph_index)
    +
    bool EatCodePoint(const std::string &input, size_t start, size_t *end, uint32_t *ucs)
    Definition string.cpp:1174
    +
    int GlyphCount(const std::string &input)
    Definition string.cpp:1506
    +
    bool IsFullWidth(uint32_t ucs)
    Definition string.cpp:1286
    +
    std::vector< WordBreakProperty > Utf8ToWordBreakProperty(const std::string &input)
    Definition string.cpp:1534
    +
    size_t GlyphIterate(const std::string &input, int glyph_offset, size_t start)
    Definition string.cpp:1451
    +
    size_t GlyphPrevious(const std::string &input, size_t start)
    Definition string.cpp:1400
    +
    +
    + + + + + diff --git a/structftxui_1_1AnimatedColorsOption-members.html b/structftxui_1_1AnimatedColorsOption-members.html new file mode 100644 index 000000000..e9d2cf909 --- /dev/null +++ b/structftxui_1_1AnimatedColorsOption-members.html @@ -0,0 +1,213 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    AnimatedColorsOption Member List
    +
    +
    + +

    This is the complete list of members for AnimatedColorsOption, including all inherited members.

    + + + +
    backgroundAnimatedColorsOption
    foregroundAnimatedColorsOption
    +
    + + + + + diff --git a/structftxui_1_1AnimatedColorsOption.html b/structftxui_1_1AnimatedColorsOption.html new file mode 100644 index 000000000..b1161624a --- /dev/null +++ b/structftxui_1_1AnimatedColorsOption.html @@ -0,0 +1,265 @@ + + + + + + + + +FTXUI: AnimatedColorsOption Struct Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    AnimatedColorsOption Struct Reference
    +
    +
    + +

    #include <component_options.hpp>

    + + + + + + +

    +Public Attributes

    AnimatedColorOption background
     
    AnimatedColorOption foreground
     
    +

    Detailed Description

    +
    +

    Definition at line 72 of file component_options.hpp.

    +

    Member Data Documentation

    + +

    ◆ background

    + +
    +
    + + + + +
    AnimatedColorOption background
    +
    +
    Examples
    examples/component/menu_entries_animated.cpp.
    +
    + +

    Definition at line 73 of file component_options.hpp.

    + +
    +
    + +

    ◆ foreground

    + +
    +
    + + + + +
    AnimatedColorOption foreground
    +
    +
    Examples
    examples/component/menu_entries_animated.cpp.
    +
    + +

    Definition at line 74 of file component_options.hpp.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + + diff --git a/structftxui_1_1AnimatedColorsOption.js b/structftxui_1_1AnimatedColorsOption.js new file mode 100644 index 000000000..dd7102da2 --- /dev/null +++ b/structftxui_1_1AnimatedColorsOption.js @@ -0,0 +1,5 @@ +var structftxui_1_1AnimatedColorsOption = +[ + [ "background", "structftxui_1_1AnimatedColorsOption.html#a550692ff465684652d29385a6b24304d", null ], + [ "foreground", "structftxui_1_1AnimatedColorsOption.html#a1acdd8b06eb18ae37ffb815462c4374a", null ] +]; \ No newline at end of file diff --git a/structftxui_1_1EntryState-members.html b/structftxui_1_1EntryState-members.html new file mode 100644 index 000000000..50f0f0996 --- /dev/null +++ b/structftxui_1_1EntryState-members.html @@ -0,0 +1,216 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    EntryState Member List
    +
    +
    + +

    This is the complete list of members for EntryState, including all inherited members.

    + + + + + + +
    activeEntryState
    focusedEntryState
    indexEntryState
    labelEntryState
    stateEntryState
    +
    + + + + + diff --git a/structftxui_1_1EntryState.html b/structftxui_1_1EntryState.html new file mode 100644 index 000000000..340aab0c9 --- /dev/null +++ b/structftxui_1_1EntryState.html @@ -0,0 +1,336 @@ + + + + + + + + +FTXUI: EntryState Struct Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    EntryState Struct Reference
    +
    +
    + +

    arguments for transform from |ButtonOption|, |CheckboxOption|, |RadioboxOption|, |MenuEntryOption|, |MenuOption|. + More...

    + +

    #include <component_options.hpp>

    + + + + + + + + + + + + + + + + + +

    +Public Attributes

    std::string label
     The label to display.
     
    bool state
     The state of the button/checkbox/radiobox.
     
    bool active
     Whether the entry is the active one.
     
    bool focused
     Whether the entry is one focused by the user.
     
    int index
     Index of the entry when applicable or -1.
     
    +

    Detailed Description

    +

    arguments for transform from |ButtonOption|, |CheckboxOption|, |RadioboxOption|, |MenuEntryOption|, |MenuOption|.

    +
    Examples
    examples/component/button.cpp, examples/component/dropdown_custom.cpp, examples/component/menu_entries.cpp, and examples/component/menu_style.cpp.
    +
    + +

    Definition at line 23 of file component_options.hpp.

    +

    Member Data Documentation

    + +

    ◆ label

    + +
    +
    + + + + +
    std::string label
    +
    + +

    The label to display.

    + +

    Definition at line 24 of file component_options.hpp.

    + +
    +
    + +

    ◆ state

    + +
    +
    + + + + +
    bool state
    +
    + +

    The state of the button/checkbox/radiobox.

    + +

    Definition at line 25 of file component_options.hpp.

    + +
    +
    + +

    ◆ active

    + +
    +
    + + + + +
    bool active
    +
    + +

    Whether the entry is the active one.

    + +

    Definition at line 26 of file component_options.hpp.

    + +
    +
    + +

    ◆ focused

    + +
    +
    + + + + +
    bool focused
    +
    + +

    Whether the entry is one focused by the user.

    + +

    Definition at line 27 of file component_options.hpp.

    + +
    +
    + +

    ◆ index

    + +
    +
    + + + + +
    int index
    +
    + +

    Index of the entry when applicable or -1.

    + +

    Definition at line 28 of file component_options.hpp.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + + diff --git a/structftxui_1_1EntryState.js b/structftxui_1_1EntryState.js new file mode 100644 index 000000000..aafd2cc34 --- /dev/null +++ b/structftxui_1_1EntryState.js @@ -0,0 +1,8 @@ +var structftxui_1_1EntryState = +[ + [ "label", "structftxui_1_1EntryState.html#a1dd28f5ea7b5b0780013e960944ddaa0", null ], + [ "state", "structftxui_1_1EntryState.html#ab30ba07e2a0bd07a15e45a92c32db9c5", null ], + [ "active", "structftxui_1_1EntryState.html#a03c996f9fcf0e10baeb3e700be0c409a", null ], + [ "focused", "structftxui_1_1EntryState.html#a2a19dbfcd2235def5967609ab0c7901a", null ], + [ "index", "structftxui_1_1EntryState.html#a750b5d744c39a06bfb13e6eb010e35d0", null ] +]; \ No newline at end of file diff --git a/structftxui_1_1InputState-members.html b/structftxui_1_1InputState-members.html new file mode 100644 index 000000000..1acc60bbb --- /dev/null +++ b/structftxui_1_1InputState-members.html @@ -0,0 +1,215 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    InputState Member List
    +
    +
    + +

    This is the complete list of members for InputState, including all inherited members.

    + + + + + +
    elementInputState
    focusedInputState
    hoveredInputState
    is_placeholderInputState
    +
    + + + + + diff --git a/structftxui_1_1InputState.html b/structftxui_1_1InputState.html new file mode 100644 index 000000000..97eea5230 --- /dev/null +++ b/structftxui_1_1InputState.html @@ -0,0 +1,310 @@ + + + + + + + + +FTXUI: InputState Struct Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    InputState Struct Reference
    +
    +
    + +

    Used to define style for the Input component. + More...

    + +

    #include <component_options.hpp>

    + + + + + + + + + + + + +

    +Public Attributes

    Element element
     
    bool hovered
     Whether the input is hovered by the mouse.
     
    bool focused
     Whether the input is focused by the user.
     
    bool is_placeholder
     
    +

    Detailed Description

    +

    Used to define style for the Input component.

    +
    Examples
    examples/component/input_style.cpp.
    +
    + +

    Definition at line 154 of file component_options.hpp.

    +

    Member Data Documentation

    + +

    ◆ element

    + +
    +
    + + + + +
    Element element
    +
    + +

    Definition at line 155 of file component_options.hpp.

    + +
    +
    + +

    ◆ hovered

    + +
    +
    + + + + +
    bool hovered
    +
    + +

    Whether the input is hovered by the mouse.

    + +

    Definition at line 156 of file component_options.hpp.

    + +
    +
    + +

    ◆ focused

    + +
    +
    + + + + +
    bool focused
    +
    + +

    Whether the input is focused by the user.

    + +

    Definition at line 157 of file component_options.hpp.

    + +
    +
    + +

    ◆ is_placeholder

    + +
    +
    + + + + +
    bool is_placeholder
    +
    +

    Whether the input is empty and displaying the placeholder.

    + +

    Definition at line 158 of file component_options.hpp.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + + diff --git a/structftxui_1_1InputState.js b/structftxui_1_1InputState.js new file mode 100644 index 000000000..3cf92cf6d --- /dev/null +++ b/structftxui_1_1InputState.js @@ -0,0 +1,7 @@ +var structftxui_1_1InputState = +[ + [ "element", "structftxui_1_1InputState.html#ae6bcc69b531dedf3a1d9142f46bcbb77", null ], + [ "hovered", "structftxui_1_1InputState.html#a9a61bb2fb8c309b32c457adb0392ec31", null ], + [ "focused", "structftxui_1_1InputState.html#a2a19dbfcd2235def5967609ab0c7901a", null ], + [ "is_placeholder", "structftxui_1_1InputState.html#aa39d5717e975c9a321417690c76519a1", null ] +]; \ No newline at end of file diff --git a/structftxui_1_1LinearGradient_1_1Stop-members.html b/structftxui_1_1LinearGradient_1_1Stop-members.html new file mode 100644 index 000000000..49e37b74e --- /dev/null +++ b/structftxui_1_1LinearGradient_1_1Stop-members.html @@ -0,0 +1,213 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    LinearGradient::Stop Member List
    +
    +
    + +

    This is the complete list of members for LinearGradient::Stop, including all inherited members.

    + + + +
    colorLinearGradient::Stop
    positionLinearGradient::Stop
    +
    + + + + + diff --git a/structftxui_1_1LinearGradient_1_1Stop.html b/structftxui_1_1LinearGradient_1_1Stop.html new file mode 100644 index 000000000..8137d9057 --- /dev/null +++ b/structftxui_1_1LinearGradient_1_1Stop.html @@ -0,0 +1,262 @@ + + + + + + + + +FTXUI: LinearGradient::Stop Struct Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    LinearGradient::Stop Struct Reference
    +
    +
    + +

    #include <linear_gradient.hpp>

    + + + + + + +

    +Public Attributes

    Color color = Color::Default
     
    std::optional< float > position
     
    +

    Detailed Description

    +

    A stop is a color at a specific position in the gradient. The position is a value between 0.0 and 1.0, where 0.0 is the start of the gradient and 1.0 is the end of the gradient.

    + +

    Definition at line 39 of file linear_gradient.hpp.

    +

    Member Data Documentation

    + +

    ◆ color

    + +
    +
    + + + + +
    Color color = Color::Default
    +
    + +

    Definition at line 40 of file linear_gradient.hpp.

    + +
    +
    + +

    ◆ position

    + +
    +
    + + + + +
    std::optional<float> position
    +
    + +

    Definition at line 41 of file linear_gradient.hpp.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + + diff --git a/structftxui_1_1LinearGradient_1_1Stop.js b/structftxui_1_1LinearGradient_1_1Stop.js new file mode 100644 index 000000000..05fafad42 --- /dev/null +++ b/structftxui_1_1LinearGradient_1_1Stop.js @@ -0,0 +1,5 @@ +var structftxui_1_1LinearGradient_1_1Stop = +[ + [ "color", "structftxui_1_1LinearGradient_1_1Stop.html#aa5f4d1eda21c196bd8401ff73f105073", null ], + [ "position", "structftxui_1_1LinearGradient_1_1Stop.html#a2f3c9e83b473a71f2882ee1ec4fb88de", null ] +]; \ No newline at end of file diff --git a/structftxui_1_1Node_1_1Status-members.html b/structftxui_1_1Node_1_1Status-members.html new file mode 100644 index 000000000..a786a061f --- /dev/null +++ b/structftxui_1_1Node_1_1Status-members.html @@ -0,0 +1,213 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Node::Status Member List
    +
    +
    + +

    This is the complete list of members for Node::Status, including all inherited members.

    + + + +
    iterationNode::Status
    need_iterationNode::Status
    +
    + + + + + diff --git a/structftxui_1_1Node_1_1Status.html b/structftxui_1_1Node_1_1Status.html new file mode 100644 index 000000000..bc2c19a9f --- /dev/null +++ b/structftxui_1_1Node_1_1Status.html @@ -0,0 +1,261 @@ + + + + + + + + +FTXUI: Node::Status Struct Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    Node::Status Struct Reference
    +
    +
    + +

    #include <node.hpp>

    + + + + + + +

    +Public Attributes

    int iteration = 0
     
    bool need_iteration = false
     
    +

    Detailed Description

    +
    +

    Definition at line 70 of file node.hpp.

    +

    Member Data Documentation

    + +

    ◆ iteration

    + +
    +
    + + + + +
    int iteration = 0
    +
    + +

    Definition at line 71 of file node.hpp.

    + +
    +
    + +

    ◆ need_iteration

    + +
    +
    + + + + +
    bool need_iteration = false
    +
    + +

    Definition at line 72 of file node.hpp.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + + diff --git a/structftxui_1_1Node_1_1Status.js b/structftxui_1_1Node_1_1Status.js new file mode 100644 index 000000000..42ff20e43 --- /dev/null +++ b/structftxui_1_1Node_1_1Status.js @@ -0,0 +1,5 @@ +var structftxui_1_1Node_1_1Status = +[ + [ "iteration", "structftxui_1_1Node_1_1Status.html#aa6371382c6b4224e577e14ea610ab9a9", null ], + [ "need_iteration", "structftxui_1_1Node_1_1Status.html#a0fffbfa5479a3b6d3ddf5ff13504a51c", null ] +]; \ No newline at end of file diff --git a/structftxui_1_1Requirement_1_1Focused-members.html b/structftxui_1_1Requirement_1_1Focused-members.html new file mode 100644 index 000000000..0fcd0c3a3 --- /dev/null +++ b/structftxui_1_1Requirement_1_1Focused-members.html @@ -0,0 +1,217 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Requirement::Focused Member List
    +
    +
    + +

    This is the complete list of members for Requirement::Focused, including all inherited members.

    + + + + + + + +
    boxRequirement::Focused
    component_activeRequirement::Focused
    cursor_shapeRequirement::Focused
    enabledRequirement::Focused
    nodeRequirement::Focused
    Prefer(const Focused &other) constRequirement::Focusedinline
    +
    + + + + + diff --git a/structftxui_1_1Requirement_1_1Focused.html b/structftxui_1_1Requirement_1_1Focused.html new file mode 100644 index 000000000..6e4ad8d93 --- /dev/null +++ b/structftxui_1_1Requirement_1_1Focused.html @@ -0,0 +1,349 @@ + + + + + + + + +FTXUI: Requirement::Focused Struct Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    Requirement::Focused Struct Reference
    +
    +
    + +

    #include <requirement.hpp>

    + + + + +

    +Public Member Functions

    bool Prefer (const Focused &other) const
     
    + + + + + + + + + + + +

    +Public Attributes

    bool enabled = false
     
    Box box
     
    Nodenode = nullptr
     
    Screen::Cursor::Shape cursor_shape = Screen::Cursor::Shape::Hidden
     
    bool component_active = false
     
    +

    Detailed Description

    +
    +

    Definition at line 30 of file requirement.hpp.

    +

    Member Function Documentation

    + +

    ◆ Prefer()

    + +
    +
    + + + + + +
    + + + + + + + +
    bool Prefer (const Focused & other) const
    +
    +inline
    +
    + +

    Definition at line 40 of file requirement.hpp.

    + +
    +
    +

    Member Data Documentation

    + +

    ◆ enabled

    + +
    +
    + + + + +
    bool enabled = false
    +
    + +

    Definition at line 31 of file requirement.hpp.

    + +
    +
    + +

    ◆ box

    + +
    +
    + + + + +
    Box box
    +
    + +

    Definition at line 32 of file requirement.hpp.

    + +
    +
    + +

    ◆ node

    + +
    +
    + + + + +
    Node* node = nullptr
    +
    + +

    Definition at line 33 of file requirement.hpp.

    + +
    +
    + +

    ◆ cursor_shape

    + +
    +
    + +

    Definition at line 34 of file requirement.hpp.

    + +
    +
    + +

    ◆ component_active

    + +
    +
    + + + + +
    bool component_active = false
    +
    + +

    Definition at line 37 of file requirement.hpp.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + + diff --git a/structftxui_1_1Requirement_1_1Focused.js b/structftxui_1_1Requirement_1_1Focused.js new file mode 100644 index 000000000..084f3c754 --- /dev/null +++ b/structftxui_1_1Requirement_1_1Focused.js @@ -0,0 +1,9 @@ +var structftxui_1_1Requirement_1_1Focused = +[ + [ "Prefer", "structftxui_1_1Requirement_1_1Focused.html#a8a204963959c73e971c7d030cbc34134", null ], + [ "enabled", "structftxui_1_1Requirement_1_1Focused.html#a8740ba80e30dd75e71d09fa1dcf04f3d", null ], + [ "box", "structftxui_1_1Requirement_1_1Focused.html#ab19e728e80bc2fc43d8e82c3602f8333", null ], + [ "node", "structftxui_1_1Requirement_1_1Focused.html#ab88cd70dad2e152cea983610f2a16e68", null ], + [ "cursor_shape", "structftxui_1_1Requirement_1_1Focused.html#a21f4c5c8f6862a204f795d4f0cb6d479", null ], + [ "component_active", "structftxui_1_1Requirement_1_1Focused.html#ac3226c18ed017dd81566f593d1257ce1", null ] +]; \ No newline at end of file diff --git a/structftxui_1_1ResizableSplitOption-members.html b/structftxui_1_1ResizableSplitOption-members.html new file mode 100644 index 000000000..469acef8a --- /dev/null +++ b/structftxui_1_1ResizableSplitOption-members.html @@ -0,0 +1,216 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    ResizableSplitOption Member List
    +
    + +
    + + + + + diff --git a/structftxui_1_1ResizableSplitOption.html b/structftxui_1_1ResizableSplitOption.html new file mode 100644 index 000000000..2de2852cc --- /dev/null +++ b/structftxui_1_1ResizableSplitOption.html @@ -0,0 +1,321 @@ + + + + + + + + +FTXUI: ResizableSplitOption Struct Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    ResizableSplitOption Struct Reference
    +
    +
    + +

    #include <component_options.hpp>

    + + + + + + + + + + + + +

    +Public Attributes

    Component main
     
    Component back
     
    Ref< Directiondirection = Direction::Left
     
    Ref< int > main_size
     
    std::function< Element()> separator_func = [] { return ::ftxui::separator(); }
     
    +

    Detailed Description

    +
    +

    Definition at line 212 of file component_options.hpp.

    +

    Member Data Documentation

    + +

    ◆ main

    + +
    +
    + + + + +
    Component main
    +
    + +

    Definition at line 213 of file component_options.hpp.

    + +
    +
    + +

    ◆ back

    + +
    +
    + + + + +
    Component back
    +
    + +

    Definition at line 214 of file component_options.hpp.

    + +
    +
    + +

    ◆ direction

    + +
    +
    + + + + +
    Ref<Direction> direction = Direction::Left
    +
    + +

    Definition at line 215 of file component_options.hpp.

    + +
    +
    + +

    ◆ main_size

    + +
    +
    + + + + +
    Ref<int> main_size
    +
    +Initial value: +

    Definition at line 216 of file component_options.hpp.

    + +
    +
    + +

    ◆ separator_func

    + +
    +
    + + + + +
    std::function<Element()> separator_func = [] { return ::ftxui::separator(); }
    +
    + +

    Definition at line 219 of file component_options.hpp.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + + diff --git a/structftxui_1_1ResizableSplitOption.js b/structftxui_1_1ResizableSplitOption.js new file mode 100644 index 000000000..3b2fdb8e2 --- /dev/null +++ b/structftxui_1_1ResizableSplitOption.js @@ -0,0 +1,8 @@ +var structftxui_1_1ResizableSplitOption = +[ + [ "main", "structftxui_1_1ResizableSplitOption.html#af8a61f36bf328de8218ae03ac01294dc", null ], + [ "back", "structftxui_1_1ResizableSplitOption.html#a591ffd25e449a214855e0dfd78dab766", null ], + [ "direction", "structftxui_1_1ResizableSplitOption.html#ade634553502b9c3f7d21cd3f088b362e", null ], + [ "main_size", "structftxui_1_1ResizableSplitOption.html#a3b9f6b5826bf54bda63dcdf0321535ff", null ], + [ "separator_func", "structftxui_1_1ResizableSplitOption.html#a237a29bec11c71ee14c9b36ae94a1dbf", null ] +]; \ No newline at end of file diff --git a/structftxui_1_1Screen_1_1Cursor-members.html b/structftxui_1_1Screen_1_1Cursor-members.html new file mode 100644 index 000000000..1deb198de --- /dev/null +++ b/structftxui_1_1Screen_1_1Cursor-members.html @@ -0,0 +1,222 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Screen::Cursor Member List
    +
    +
    + +

    This is the complete list of members for Screen::Cursor, including all inherited members.

    + + + + + + + + + + + + +
    Bar enum valueScreen::Cursor
    BarBlinking enum valueScreen::Cursor
    Block enum valueScreen::Cursor
    BlockBlinking enum valueScreen::Cursor
    Hidden enum valueScreen::Cursor
    Shape enum nameScreen::Cursor
    shapeScreen::Cursor
    Underline enum valueScreen::Cursor
    UnderlineBlinking enum valueScreen::Cursor
    xScreen::Cursor
    yScreen::Cursor
    +
    + + + + + diff --git a/structftxui_1_1Screen_1_1Cursor.html b/structftxui_1_1Screen_1_1Cursor.html new file mode 100644 index 000000000..ad5ef6193 --- /dev/null +++ b/structftxui_1_1Screen_1_1Cursor.html @@ -0,0 +1,326 @@ + + + + + + + + +FTXUI: Screen::Cursor Struct Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    Screen::Cursor Struct Reference
    +
    +
    + +

    #include <screen.hpp>

    + + + + +

    +Public Types

    enum  Shape {
    +  Hidden = 0 +,
    +  BlockBlinking = 1 +,
    +  Block = 2 +,
    +  UnderlineBlinking = 3 +,
    +  Underline = 4 +,
    +  BarBlinking = 5 +,
    +  Bar = 6 +
    + }
     
    + + + + + + + +

    +Public Attributes

    int x = 0
     
    int y = 0
     
    Shape shape
     
    +

    Detailed Description

    +
    +

    Definition at line 50 of file screen.hpp.

    +

    Member Enumeration Documentation

    + +

    ◆ Shape

    + +
    +
    + + + + +
    enum Shape
    +
    + + + + + + + + +
    Enumerator
    Hidden 
    BlockBlinking 
    Block 
    UnderlineBlinking 
    Underline 
    BarBlinking 
    Bar 
    + +

    Definition at line 54 of file screen.hpp.

    + +
    +
    +

    Member Data Documentation

    + +

    ◆ x

    + +
    +
    + + + + +
    int x = 0
    +
    + +

    Definition at line 51 of file screen.hpp.

    + +
    +
    + +

    ◆ y

    + +
    +
    + + + + +
    int y = 0
    +
    + +

    Definition at line 52 of file screen.hpp.

    + +
    +
    + +

    ◆ shape

    + +
    +
    + + + + +
    Shape shape
    +
    + +

    Definition at line 63 of file screen.hpp.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + + diff --git a/structftxui_1_1Screen_1_1Cursor.js b/structftxui_1_1Screen_1_1Cursor.js new file mode 100644 index 000000000..912d225eb --- /dev/null +++ b/structftxui_1_1Screen_1_1Cursor.js @@ -0,0 +1,15 @@ +var structftxui_1_1Screen_1_1Cursor = +[ + [ "Shape", "structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37c", [ + [ "Hidden", "structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37cacf46e529658ebc6532c204f3246929f4", null ], + [ "BlockBlinking", "structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37ca2f4a0b3cacb4468d8467dc0746ea23aa", null ], + [ "Block", "structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37caa00f801460e81f86eab56d86fe627551", null ], + [ "UnderlineBlinking", "structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37cad7df11ee39d53d4ee2da1b22b2238abc", null ], + [ "Underline", "structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37caa909c5f2b588ba35fcc40b3b504ad2ed", null ], + [ "BarBlinking", "structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37cae7dfc08d4e90b88e0cb1cea7a54796c1", null ], + [ "Bar", "structftxui_1_1Screen_1_1Cursor.html#a55b506070847a13554f8b879c1bfb37ca6424dbda22da2f105580d1c8095600d3", null ] + ] ], + [ "x", "structftxui_1_1Screen_1_1Cursor.html#a6150e0515f7202e2fb518f7206ed97dc", null ], + [ "y", "structftxui_1_1Screen_1_1Cursor.html#a0a2f84ed7838f07779ae24c5a9086d33", null ], + [ "shape", "structftxui_1_1Screen_1_1Cursor.html#a8b9f7758a8bd2bef680aeecc40bcfe04", null ] +]; \ No newline at end of file diff --git a/structftxui_1_1SliderOption-members.html b/structftxui_1_1SliderOption-members.html new file mode 100644 index 000000000..2bce75ccc --- /dev/null +++ b/structftxui_1_1SliderOption-members.html @@ -0,0 +1,219 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    SliderOption< T > Member List
    +
    + +
    + + + + + diff --git a/structftxui_1_1SliderOption.html b/structftxui_1_1SliderOption.html new file mode 100644 index 000000000..515d6b846 --- /dev/null +++ b/structftxui_1_1SliderOption.html @@ -0,0 +1,402 @@ + + + + + + + + +FTXUI: SliderOption< T > Struct Template Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    SliderOption< T > Struct Template Reference
    +
    +
    + +

    #include <component_options.hpp>

    + + + + + + + + + + + + + + + + + + +

    +Public Attributes

    Ref< T > value
     
    ConstRef< T > min = T(0)
     
    ConstRef< T > max = T(100)
     
    ConstRef< T > increment = (max() - min()) / 20
     
    Direction direction = Direction::Right
     
    Color color_active = Color::White
     
    Color color_inactive = Color::GrayDark
     
    std::function< void()> on_change
     
    +

    Detailed Description

    +
    template<typename T>
    +struct ftxui::SliderOption< T >
    Examples
    examples/component/scrollbar.cpp, and examples/component/slider_direction.cpp.
    +
    + +

    Definition at line 225 of file component_options.hpp.

    +

    Member Data Documentation

    + +

    ◆ value

    + +
    +
    +
    +template<typename T >
    + + + + +
    Ref<T> value
    +
    +
    + +

    ◆ min

    + +
    +
    +
    +template<typename T >
    + + + + +
    ConstRef<T> min = T(0)
    +
    +
    Examples
    examples/component/scrollbar.cpp.
    +
    + +

    Definition at line 227 of file component_options.hpp.

    + +
    +
    + +

    ◆ max

    + +
    +
    +
    +template<typename T >
    + + + + +
    ConstRef<T> max = T(100)
    +
    +
    + +

    ◆ increment

    + +
    +
    +
    +template<typename T >
    + + + + +
    ConstRef<T> increment = (max() - min()) / 20
    +
    +
    + +

    ◆ direction

    + +
    +
    +
    +template<typename T >
    + + + + +
    Direction direction = Direction::Right
    +
    +
    + +

    ◆ color_active

    + +
    +
    +
    +template<typename T >
    + + + + +
    Color color_active = Color::White
    +
    +
    Examples
    examples/component/scrollbar.cpp.
    +
    + +

    Definition at line 231 of file component_options.hpp.

    + +
    +
    + +

    ◆ color_inactive

    + +
    +
    +
    +template<typename T >
    + + + + +
    Color color_inactive = Color::GrayDark
    +
    +
    Examples
    examples/component/scrollbar.cpp.
    +
    + +

    Definition at line 232 of file component_options.hpp.

    + +
    +
    + +

    ◆ on_change

    + +
    +
    +
    +template<typename T >
    + + + + +
    std::function<void()> on_change
    +
    + +

    Definition at line 233 of file component_options.hpp.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + + diff --git a/structftxui_1_1SliderOption.js b/structftxui_1_1SliderOption.js new file mode 100644 index 000000000..e7cbc0d1a --- /dev/null +++ b/structftxui_1_1SliderOption.js @@ -0,0 +1,11 @@ +var structftxui_1_1SliderOption = +[ + [ "value", "structftxui_1_1SliderOption.html#ab256d6c86a100045ed2329da289dce3a", null ], + [ "min", "structftxui_1_1SliderOption.html#a337a8e502154b70ef2a1d4bb3cb47ea9", null ], + [ "max", "structftxui_1_1SliderOption.html#abd146f0de5789f02aee07c54e819099b", null ], + [ "increment", "structftxui_1_1SliderOption.html#a752366b00bdf7bba57a18e239e86e2e1", null ], + [ "direction", "structftxui_1_1SliderOption.html#a53421c695d00016ab925777d423b4eb6", null ], + [ "color_active", "structftxui_1_1SliderOption.html#a593f1ba15add21d1972c01372db369df", null ], + [ "color_inactive", "structftxui_1_1SliderOption.html#ad5a77e0bc0ce649271a13949a7a0a635", null ], + [ "on_change", "structftxui_1_1SliderOption.html#abdfe3c83deeec2323ff90248815b8f0a", null ] +]; \ No newline at end of file diff --git a/structftxui_1_1WindowOptions-members.html b/structftxui_1_1WindowOptions-members.html new file mode 100644 index 000000000..6385fb3ee --- /dev/null +++ b/structftxui_1_1WindowOptions-members.html @@ -0,0 +1,222 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    WindowOptions Member List
    +
    + +
    + + + + + diff --git a/structftxui_1_1WindowOptions.html b/structftxui_1_1WindowOptions.html new file mode 100644 index 000000000..79f9d8d89 --- /dev/null +++ b/structftxui_1_1WindowOptions.html @@ -0,0 +1,456 @@ + + + + + + + + +FTXUI: WindowOptions Struct Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    WindowOptions Struct Reference
    +
    +
    + +

    #include <component_options.hpp>

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Public Attributes

    Component inner
     The component wrapped by this window.
     
    ConstStringRef title = ""
     The title displayed by this window.
     
    Ref< int > left = 0
     The left side position of the window.
     
    Ref< int > top = 0
     The top side position of the window.
     
    Ref< int > width = 20
     The width of the window.
     
    Ref< int > height = 10
     The height of the window.
     
    Ref< bool > resize_left = true
     Can the left side be resized?
     
    Ref< bool > resize_right = true
     Can the right side be resized?
     
    Ref< bool > resize_top = true
     Can the top side be resized?
     
    Ref< bool > resize_down = true
     Can the down side be resized?
     
    std::function< Element(const WindowRenderState &)> render
     An optional function to customize how the window looks like:
     
    +

    Detailed Description

    +
    +

    Definition at line 252 of file component_options.hpp.

    +

    Member Data Documentation

    + +

    ◆ inner

    + +
    +
    + + + + +
    Component inner
    +
    + +

    The component wrapped by this window.

    + +

    Definition at line 253 of file component_options.hpp.

    + +
    +
    + +

    ◆ title

    + +
    +
    + + + + +
    ConstStringRef title = ""
    +
    + +

    The title displayed by this window.

    + +

    Definition at line 254 of file component_options.hpp.

    + +
    +
    + +

    ◆ left

    + +
    +
    + + + + +
    Ref<int> left = 0
    +
    + +

    The left side position of the window.

    + +

    Definition at line 256 of file component_options.hpp.

    + +
    +
    + +

    ◆ top

    + +
    +
    + + + + +
    Ref<int> top = 0
    +
    + +

    The top side position of the window.

    + +

    Definition at line 257 of file component_options.hpp.

    + +
    +
    + +

    ◆ width

    + +
    +
    + + + + +
    Ref<int> width = 20
    +
    + +

    The width of the window.

    + +

    Definition at line 258 of file component_options.hpp.

    + +
    +
    + +

    ◆ height

    + +
    +
    + + + + +
    Ref<int> height = 10
    +
    + +

    The height of the window.

    + +

    Definition at line 259 of file component_options.hpp.

    + +
    +
    + +

    ◆ resize_left

    + +
    +
    + + + + +
    Ref<bool> resize_left = true
    +
    + +

    Can the left side be resized?

    + +

    Definition at line 261 of file component_options.hpp.

    + +
    +
    + +

    ◆ resize_right

    + +
    +
    + + + + +
    Ref<bool> resize_right = true
    +
    + +

    Can the right side be resized?

    + +

    Definition at line 262 of file component_options.hpp.

    + +
    +
    + +

    ◆ resize_top

    + +
    +
    + + + + +
    Ref<bool> resize_top = true
    +
    + +

    Can the top side be resized?

    + +

    Definition at line 263 of file component_options.hpp.

    + +
    +
    + +

    ◆ resize_down

    + +
    +
    + + + + +
    Ref<bool> resize_down = true
    +
    + +

    Can the down side be resized?

    + +

    Definition at line 264 of file component_options.hpp.

    + +
    +
    + +

    ◆ render

    + +
    +
    + + + + +
    std::function<Element(const WindowRenderState&)> render
    +
    + +

    An optional function to customize how the window looks like:

    + +

    Definition at line 267 of file component_options.hpp.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + + diff --git a/structftxui_1_1WindowOptions.js b/structftxui_1_1WindowOptions.js new file mode 100644 index 000000000..8ea2a5a02 --- /dev/null +++ b/structftxui_1_1WindowOptions.js @@ -0,0 +1,14 @@ +var structftxui_1_1WindowOptions = +[ + [ "inner", "structftxui_1_1WindowOptions.html#a105501b401a2286451c7992a6d54dcc0", null ], + [ "title", "structftxui_1_1WindowOptions.html#ab923eb70f0f480c7104ee696bd790a36", null ], + [ "left", "structftxui_1_1WindowOptions.html#ad5c9f9e9f1a5086dcc7a11431d37c1f4", null ], + [ "top", "structftxui_1_1WindowOptions.html#ae4390982a6943bb299f8626ffea0c8e5", null ], + [ "width", "structftxui_1_1WindowOptions.html#a9fb534b72660dd8bb6f17ce5d090a94a", null ], + [ "height", "structftxui_1_1WindowOptions.html#a3f551d52ec458be9ffbcd38c715f9e19", null ], + [ "resize_left", "structftxui_1_1WindowOptions.html#a17b2004b29ac06ad2b486d923fad0dbb", null ], + [ "resize_right", "structftxui_1_1WindowOptions.html#abaa0c8009acea8039e5b6f5bab86c4dc", null ], + [ "resize_top", "structftxui_1_1WindowOptions.html#a8885b0a965d3975426bd615b2fef3542", null ], + [ "resize_down", "structftxui_1_1WindowOptions.html#a0e28320aa6145db8201aebb07162d461", null ], + [ "render", "structftxui_1_1WindowOptions.html#aa3858f495756090a379c564844eaf342", null ] +]; \ No newline at end of file diff --git a/structftxui_1_1box__helper_1_1Element-members.html b/structftxui_1_1box__helper_1_1Element-members.html new file mode 100644 index 000000000..73b342733 --- /dev/null +++ b/structftxui_1_1box__helper_1_1Element-members.html @@ -0,0 +1,215 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Element Member List
    +
    +
    + +

    This is the complete list of members for Element, including all inherited members.

    + + + + + +
    flex_growElement
    flex_shrinkElement
    min_sizeElement
    sizeElement
    +
    + + + + + diff --git a/structftxui_1_1box__helper_1_1Element.html b/structftxui_1_1box__helper_1_1Element.html new file mode 100644 index 000000000..b135fc04b --- /dev/null +++ b/structftxui_1_1box__helper_1_1Element.html @@ -0,0 +1,297 @@ + + + + + + + + +FTXUI: Element Struct Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    Element Struct Reference
    +
    +
    + +

    #include <box_helper.hpp>

    + + + + + + + + + + +

    +Public Attributes

    int min_size = 0
     
    int flex_grow = 0
     
    int flex_shrink = 0
     
    int size = 0
     
    +

    Detailed Description

    +
    +

    Definition at line 12 of file box_helper.hpp.

    +

    Member Data Documentation

    + +

    ◆ min_size

    + +
    +
    + + + + +
    int min_size = 0
    +
    + +

    Definition at line 14 of file box_helper.hpp.

    + +
    +
    + +

    ◆ flex_grow

    + +
    +
    + + + + +
    int flex_grow = 0
    +
    + +

    Definition at line 15 of file box_helper.hpp.

    + +
    +
    + +

    ◆ flex_shrink

    + +
    +
    + + + + +
    int flex_shrink = 0
    +
    + +

    Definition at line 16 of file box_helper.hpp.

    + +
    +
    + +

    ◆ size

    + +
    +
    + + + + +
    int size = 0
    +
    + +

    Definition at line 19 of file box_helper.hpp.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + + diff --git a/structftxui_1_1box__helper_1_1Element.js b/structftxui_1_1box__helper_1_1Element.js new file mode 100644 index 000000000..83682f8a9 --- /dev/null +++ b/structftxui_1_1box__helper_1_1Element.js @@ -0,0 +1,7 @@ +var structftxui_1_1box__helper_1_1Element = +[ + [ "min_size", "structftxui_1_1box__helper_1_1Element.html#ac3f0cc8c8c9e0fb97f20cf7777773197", null ], + [ "flex_grow", "structftxui_1_1box__helper_1_1Element.html#a2fb16db68c0bf00d3bf872bc18675116", null ], + [ "flex_shrink", "structftxui_1_1box__helper_1_1Element.html#a94a9a7333988edf4249f38c1b1491cf4", null ], + [ "size", "structftxui_1_1box__helper_1_1Element.html#a439227feff9d7f55384e8780cfc2eb82", null ] +]; \ No newline at end of file diff --git a/structftxui_1_1flexbox__helper_1_1Block-members.html b/structftxui_1_1flexbox__helper_1_1Block-members.html new file mode 100644 index 000000000..fb95ea92e --- /dev/null +++ b/structftxui_1_1flexbox__helper_1_1Block-members.html @@ -0,0 +1,224 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Block Member List
    +
    + +
    + + + + + diff --git a/structftxui_1_1flexbox__helper_1_1Block.html b/structftxui_1_1flexbox__helper_1_1Block.html new file mode 100644 index 000000000..9d2b75b7d --- /dev/null +++ b/structftxui_1_1flexbox__helper_1_1Block.html @@ -0,0 +1,459 @@ + + + + + + + + +FTXUI: Block Struct Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    Block Struct Reference
    +
    +
    + +

    #include <flexbox_helper.hpp>

    + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

    +Public Attributes

    int min_size_x = 0
     
    int min_size_y = 0
     
    int flex_grow_x = 0
     
    int flex_grow_y = 0
     
    int flex_shrink_x = 0
     
    int flex_shrink_y = 0
     
    int line {}
     
    int line_position {}
     
    int x = 0
     
    int y = 0
     
    int dim_x = 0
     
    int dim_y = 0
     
    bool overflow = false
     
    +

    Detailed Description

    +
    +

    Definition at line 13 of file flexbox_helper.hpp.

    +

    Member Data Documentation

    + +

    ◆ min_size_x

    + +
    +
    + + + + +
    int min_size_x = 0
    +
    + +

    Definition at line 15 of file flexbox_helper.hpp.

    + +
    +
    + +

    ◆ min_size_y

    + +
    +
    + + + + +
    int min_size_y = 0
    +
    + +

    Definition at line 16 of file flexbox_helper.hpp.

    + +
    +
    + +

    ◆ flex_grow_x

    + +
    +
    + + + + +
    int flex_grow_x = 0
    +
    + +

    Definition at line 17 of file flexbox_helper.hpp.

    + +
    +
    + +

    ◆ flex_grow_y

    + +
    +
    + + + + +
    int flex_grow_y = 0
    +
    + +

    Definition at line 18 of file flexbox_helper.hpp.

    + +
    +
    + +

    ◆ flex_shrink_x

    + +
    +
    + + + + +
    int flex_shrink_x = 0
    +
    + +

    Definition at line 19 of file flexbox_helper.hpp.

    + +
    +
    + +

    ◆ flex_shrink_y

    + +
    +
    + + + + +
    int flex_shrink_y = 0
    +
    + +

    Definition at line 20 of file flexbox_helper.hpp.

    + +
    +
    + +

    ◆ line

    + +
    +
    + + + + +
    int line {}
    +
    + +

    Definition at line 23 of file flexbox_helper.hpp.

    + +
    +
    + +

    ◆ line_position

    + +
    +
    + + + + +
    int line_position {}
    +
    + +

    Definition at line 24 of file flexbox_helper.hpp.

    + +
    +
    + +

    ◆ x

    + +
    +
    + + + + +
    int x = 0
    +
    + +

    Definition at line 25 of file flexbox_helper.hpp.

    + +
    +
    + +

    ◆ y

    + +
    +
    + + + + +
    int y = 0
    +
    + +

    Definition at line 26 of file flexbox_helper.hpp.

    + +
    +
    + +

    ◆ dim_x

    + +
    +
    + + + + +
    int dim_x = 0
    +
    + +

    Definition at line 27 of file flexbox_helper.hpp.

    + +
    +
    + +

    ◆ dim_y

    + +
    +
    + + + + +
    int dim_y = 0
    +
    + +

    Definition at line 28 of file flexbox_helper.hpp.

    + +
    +
    + +

    ◆ overflow

    + +
    +
    + + + + +
    bool overflow = false
    +
    + +

    Definition at line 29 of file flexbox_helper.hpp.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + + diff --git a/structftxui_1_1flexbox__helper_1_1Block.js b/structftxui_1_1flexbox__helper_1_1Block.js new file mode 100644 index 000000000..d8f5cb8ee --- /dev/null +++ b/structftxui_1_1flexbox__helper_1_1Block.js @@ -0,0 +1,16 @@ +var structftxui_1_1flexbox__helper_1_1Block = +[ + [ "min_size_x", "structftxui_1_1flexbox__helper_1_1Block.html#ab7c34cdb13953ba4b496c2dba7aa1a92", null ], + [ "min_size_y", "structftxui_1_1flexbox__helper_1_1Block.html#a3f7935f028cb7bfadb118396547e27fa", null ], + [ "flex_grow_x", "structftxui_1_1flexbox__helper_1_1Block.html#a874ced28be7064feaaf97c70c2097bd6", null ], + [ "flex_grow_y", "structftxui_1_1flexbox__helper_1_1Block.html#a13f6aa7165c63a4494fc2f1ed4428880", null ], + [ "flex_shrink_x", "structftxui_1_1flexbox__helper_1_1Block.html#ad293f2488e260e36e72fd3da9c16df9a", null ], + [ "flex_shrink_y", "structftxui_1_1flexbox__helper_1_1Block.html#ab4e07297a2a55de7158ef0115b6b46a9", null ], + [ "line", "structftxui_1_1flexbox__helper_1_1Block.html#a41ebd28ef1d7c6ade45642cb6acc1039", null ], + [ "line_position", "structftxui_1_1flexbox__helper_1_1Block.html#a989ca01c829a3fc1e21bdbd0b9c811ed", null ], + [ "x", "structftxui_1_1flexbox__helper_1_1Block.html#a6150e0515f7202e2fb518f7206ed97dc", null ], + [ "y", "structftxui_1_1flexbox__helper_1_1Block.html#a0a2f84ed7838f07779ae24c5a9086d33", null ], + [ "dim_x", "structftxui_1_1flexbox__helper_1_1Block.html#a78e7e791466dc8e951311de2a1709955", null ], + [ "dim_y", "structftxui_1_1flexbox__helper_1_1Block.html#ad26cec1d8cdf8ba04707fd4cf822065a", null ], + [ "overflow", "structftxui_1_1flexbox__helper_1_1Block.html#a49aa97067a36875627e1380c3fb3833d", null ] +]; \ No newline at end of file diff --git a/structftxui_1_1flexbox__helper_1_1Global-members.html b/structftxui_1_1flexbox__helper_1_1Global-members.html new file mode 100644 index 000000000..bdfbf4c6f --- /dev/null +++ b/structftxui_1_1flexbox__helper_1_1Global-members.html @@ -0,0 +1,216 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Global Member List
    +
    +
    + +

    This is the complete list of members for Global, including all inherited members.

    + + + + + + +
    blocksGlobal
    configGlobal
    linesGlobal
    size_xGlobal
    size_yGlobal
    +
    + + + + + diff --git a/structftxui_1_1flexbox__helper_1_1Global.html b/structftxui_1_1flexbox__helper_1_1Global.html new file mode 100644 index 000000000..2a8a61b07 --- /dev/null +++ b/structftxui_1_1flexbox__helper_1_1Global.html @@ -0,0 +1,315 @@ + + + + + + + + +FTXUI: Global Struct Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    Global Struct Reference
    +
    +
    + +

    #include <flexbox_helper.hpp>

    + + + + + + + + + + + + +

    +Public Attributes

    std::vector< Blockblocks
     
    std::vector< Linelines
     
    FlexboxConfig config
     
    int size_x
     
    int size_y
     
    +

    Detailed Description

    +
    +

    Definition at line 41 of file flexbox_helper.hpp.

    +

    Member Data Documentation

    + +

    ◆ blocks

    + +
    +
    + + + + +
    std::vector<Block> blocks
    +
    + +

    Definition at line 42 of file flexbox_helper.hpp.

    + +
    +
    + +

    ◆ lines

    + +
    +
    + + + + +
    std::vector<Line> lines
    +
    + +

    Definition at line 43 of file flexbox_helper.hpp.

    + +
    +
    + +

    ◆ config

    + +
    +
    + + + + +
    FlexboxConfig config
    +
    + +

    Definition at line 44 of file flexbox_helper.hpp.

    + +
    +
    + +

    ◆ size_x

    + +
    +
    + + + + +
    int size_x
    +
    + +

    Definition at line 45 of file flexbox_helper.hpp.

    + +
    +
    + +

    ◆ size_y

    + +
    +
    + + + + +
    int size_y
    +
    + +

    Definition at line 46 of file flexbox_helper.hpp.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + + diff --git a/structftxui_1_1flexbox__helper_1_1Global.js b/structftxui_1_1flexbox__helper_1_1Global.js new file mode 100644 index 000000000..4dc8b048c --- /dev/null +++ b/structftxui_1_1flexbox__helper_1_1Global.js @@ -0,0 +1,8 @@ +var structftxui_1_1flexbox__helper_1_1Global = +[ + [ "blocks", "structftxui_1_1flexbox__helper_1_1Global.html#ac91f06264613997a325271ce8e35d840", null ], + [ "lines", "structftxui_1_1flexbox__helper_1_1Global.html#a441e790889c9bcd6e2deba604663d2ad", null ], + [ "config", "structftxui_1_1flexbox__helper_1_1Global.html#ae1dac1dbfb99211895f88d2c4b609849", null ], + [ "size_x", "structftxui_1_1flexbox__helper_1_1Global.html#aec1dee03c858e0d3910c40c209890ab0", null ], + [ "size_y", "structftxui_1_1flexbox__helper_1_1Global.html#a22aeb82e7a98517be5f90c810e423af0", null ] +]; \ No newline at end of file diff --git a/structftxui_1_1flexbox__helper_1_1Line-members.html b/structftxui_1_1flexbox__helper_1_1Line-members.html new file mode 100644 index 000000000..e33a76bae --- /dev/null +++ b/structftxui_1_1flexbox__helper_1_1Line-members.html @@ -0,0 +1,216 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Line Member List
    +
    +
    + +

    This is the complete list of members for Line, including all inherited members.

    + + + + + + +
    blocksLine
    dim_xLine
    dim_yLine
    xLine
    yLine
    +
    + + + + + diff --git a/structftxui_1_1flexbox__helper_1_1Line.html b/structftxui_1_1flexbox__helper_1_1Line.html new file mode 100644 index 000000000..86b84f13d --- /dev/null +++ b/structftxui_1_1flexbox__helper_1_1Line.html @@ -0,0 +1,315 @@ + + + + + + + + +FTXUI: Line Struct Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    Line Struct Reference
    +
    +
    + +

    #include <flexbox_helper.hpp>

    + + + + + + + + + + + + +

    +Public Attributes

    std::vector< Block * > blocks
     
    int x = 0
     
    int y = 0
     
    int dim_x = 0
     
    int dim_y = 0
     
    +

    Detailed Description

    +
    +

    Definition at line 33 of file flexbox_helper.hpp.

    +

    Member Data Documentation

    + +

    ◆ blocks

    + +
    +
    + + + + +
    std::vector<Block*> blocks
    +
    + +

    Definition at line 34 of file flexbox_helper.hpp.

    + +
    +
    + +

    ◆ x

    + +
    +
    + + + + +
    int x = 0
    +
    + +

    Definition at line 35 of file flexbox_helper.hpp.

    + +
    +
    + +

    ◆ y

    + +
    +
    + + + + +
    int y = 0
    +
    + +

    Definition at line 36 of file flexbox_helper.hpp.

    + +
    +
    + +

    ◆ dim_x

    + +
    +
    + + + + +
    int dim_x = 0
    +
    + +

    Definition at line 37 of file flexbox_helper.hpp.

    + +
    +
    + +

    ◆ dim_y

    + +
    +
    + + + + +
    int dim_y = 0
    +
    + +

    Definition at line 38 of file flexbox_helper.hpp.

    + +
    +
    +
    The documentation for this struct was generated from the following file: +
    +
    + + + + + diff --git a/structftxui_1_1flexbox__helper_1_1Line.js b/structftxui_1_1flexbox__helper_1_1Line.js new file mode 100644 index 000000000..f2481cb05 --- /dev/null +++ b/structftxui_1_1flexbox__helper_1_1Line.js @@ -0,0 +1,8 @@ +var structftxui_1_1flexbox__helper_1_1Line = +[ + [ "blocks", "structftxui_1_1flexbox__helper_1_1Line.html#acb3eeab6f2ab1007cacd9f72caf9cdb8", null ], + [ "x", "structftxui_1_1flexbox__helper_1_1Line.html#a6150e0515f7202e2fb518f7206ed97dc", null ], + [ "y", "structftxui_1_1flexbox__helper_1_1Line.html#a0a2f84ed7838f07779ae24c5a9086d33", null ], + [ "dim_x", "structftxui_1_1flexbox__helper_1_1Line.html#a78e7e791466dc8e951311de2a1709955", null ], + [ "dim_y", "structftxui_1_1flexbox__helper_1_1Line.html#ad26cec1d8cdf8ba04707fd4cf822065a", null ] +]; \ No newline at end of file diff --git a/structftxui_1_1task_1_1PendingTask-members.html b/structftxui_1_1task_1_1PendingTask-members.html new file mode 100644 index 000000000..9cd41d5ff --- /dev/null +++ b/structftxui_1_1task_1_1PendingTask-members.html @@ -0,0 +1,216 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    PendingTask Member List
    +
    +
    + +

    This is the complete list of members for PendingTask, including all inherited members.

    + + + + + + +
    operator<(const PendingTask &other) constPendingTask
    PendingTask(Task t)PendingTaskinline
    PendingTask(Task t, std::chrono::steady_clock::duration duration)PendingTaskinline
    taskPendingTask
    timePendingTask
    +
    + + + + + diff --git a/structftxui_1_1task_1_1PendingTask.html b/structftxui_1_1task_1_1PendingTask.html new file mode 100644 index 000000000..9cc1a8349 --- /dev/null +++ b/structftxui_1_1task_1_1PendingTask.html @@ -0,0 +1,357 @@ + + + + + + + + +FTXUI: PendingTask Struct Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    PendingTask Struct Reference
    +
    +
    + +

    #include <task_internal.hpp>

    + + + + + + + + +

    +Public Member Functions

     PendingTask (Task t)
     
     PendingTask (Task t, std::chrono::steady_clock::duration duration)
     
    bool operator< (const PendingTask &other) const
     
    + + + + + + +

    +Public Attributes

    Task task
     The task to be executed.
     
    std::optional< std::chrono::steady_clock::time_point > time
     
    +

    Detailed Description

    +

    A PendingTask represents a task that is scheduled to be executed at a specific time, or as soon as possible.

    + +

    Definition at line 18 of file task_internal.hpp.

    +

    Constructor & Destructor Documentation

    + +

    ◆ PendingTask() [1/2]

    + +
    +
    + + + + + +
    + + + + + + + +
    PendingTask (Task t)
    +
    +inline
    +
    + +

    Definition at line 20 of file task_internal.hpp.

    + +
    +
    + +

    ◆ PendingTask() [2/2]

    + +
    +
    + + + + + +
    + + + + + + + + + + + +
    PendingTask (Task t,
    std::chrono::steady_clock::duration duration )
    +
    +inline
    +
    + +

    Definition at line 23 of file task_internal.hpp.

    + +
    +
    +

    Member Function Documentation

    + +

    ◆ operator<()

    + +
    +
    + + + + + + + +
    bool operator< (const PendingTask & other) const
    +
    +

    Compare two PendingTasks by their time. If both tasks have no time, they are considered equal.

    + +

    Definition at line 7 of file task.cpp.

    + +
    +
    +

    Member Data Documentation

    + +

    ◆ task

    + +
    +
    + + + + +
    Task task
    +
    + +

    The task to be executed.

    + +

    Definition at line 27 of file task_internal.hpp.

    + +
    +
    + +

    ◆ time

    + +
    +
    + + + + +
    std::optional<std::chrono::steady_clock::time_point> time
    +
    +

    The time when the task should be executed. If the time is empty, the task should be executed as soon as possible.

    + +

    Definition at line 31 of file task_internal.hpp.

    + +
    +
    +
    The documentation for this struct was generated from the following files: +
    +
    + + + + + diff --git a/structftxui_1_1task_1_1PendingTask.js b/structftxui_1_1task_1_1PendingTask.js new file mode 100644 index 000000000..08dffd3b9 --- /dev/null +++ b/structftxui_1_1task_1_1PendingTask.js @@ -0,0 +1,8 @@ +var structftxui_1_1task_1_1PendingTask = +[ + [ "PendingTask", "structftxui_1_1task_1_1PendingTask.html#afc8e67df1a9259a50e7afa49765cb7c8", null ], + [ "PendingTask", "structftxui_1_1task_1_1PendingTask.html#a5e36044e86c7936eee25d0ff222b7235", null ], + [ "operator<", "structftxui_1_1task_1_1PendingTask.html#abca1f607e0e907841b7a6d88190995db", null ], + [ "task", "structftxui_1_1task_1_1PendingTask.html#a8bcc572b9d73774627be66dd46aa61a8", null ], + [ "time", "structftxui_1_1task_1_1PendingTask.html#aae372ed4494e3631e9cac889d7384795", null ] +]; \ No newline at end of file diff --git a/structftxui_1_1task_1_1TaskQueue-members.html b/structftxui_1_1task_1_1TaskQueue-members.html new file mode 100644 index 000000000..ed2bb0011 --- /dev/null +++ b/structftxui_1_1task_1_1TaskQueue-members.html @@ -0,0 +1,215 @@ + + + + + + + + +FTXUI: Member List + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    TaskQueue Member List
    +
    +
    + +

    This is the complete list of members for TaskQueue, including all inherited members.

    + + + + + +
    Get() -> MaybeTaskTaskQueue
    HasImmediateTasks() constTaskQueueinline
    MaybeTask typedefTaskQueue
    PostTask(PendingTask task) -> voidTaskQueue
    +
    + + + + + diff --git a/structftxui_1_1task_1_1TaskQueue.html b/structftxui_1_1task_1_1TaskQueue.html new file mode 100644 index 000000000..422c5acf2 --- /dev/null +++ b/structftxui_1_1task_1_1TaskQueue.html @@ -0,0 +1,327 @@ + + + + + + + + +FTXUI: TaskQueue Struct Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    TaskQueue Struct Reference
    +
    +
    + +

    #include <task_queue.hpp>

    + + + + +

    +Public Types

    using MaybeTask
     
    + + + + + + + +

    +Public Member Functions

    auto PostTask (PendingTask task) -> void
     
    auto Get () -> MaybeTask
     
    bool HasImmediateTasks () const
     
    +

    Detailed Description

    +

    A task queue that schedules tasks to be executed in the future. Tasks can be scheduled to be executed immediately, or after a certain duration.

      +
    • The tasks are executed in the order they were scheduled.
    • +
    • If multiple tasks are scheduled to be executed at the same time, they are executed in the order they were scheduled.
    • +
    • If a task is scheduled to be executed in the past, it is executed immediately.
    • +
    + +

    Definition at line 21 of file task_queue.hpp.

    +

    Member Typedef Documentation

    + +

    ◆ MaybeTask

    + +
    +
    + + + + +
    using MaybeTask
    +
    +Initial value:
    +
    std::variant<Task, std::chrono::steady_clock::duration, std::monostate>
    +
    +

    Definition at line 24 of file task_queue.hpp.

    + +
    +
    +

    Member Function Documentation

    + +

    ◆ PostTask()

    + +
    +
    + + + + + + + +
    auto PostTask (PendingTask task) -> void
    +
    + +

    Definition at line 8 of file task_queue.cpp.

    + +
    +
    + +

    ◆ Get()

    + +
    +
    + + + + + + + +
    auto Get () -> MaybeTask
    +
    + +

    Definition at line 22 of file task_queue.cpp.

    + +
    +
    + +

    ◆ HasImmediateTasks()

    + +
    +
    + + + + + +
    + + + + + + + +
    bool HasImmediateTasks () const
    +
    +inline
    +
    + +

    Definition at line 28 of file task_queue.hpp.

    + +
    +
    +
    The documentation for this struct was generated from the following files: +
    +
    + + + + + diff --git a/structftxui_1_1task_1_1TaskQueue.js b/structftxui_1_1task_1_1TaskQueue.js new file mode 100644 index 000000000..d72ab6f6e --- /dev/null +++ b/structftxui_1_1task_1_1TaskQueue.js @@ -0,0 +1,7 @@ +var structftxui_1_1task_1_1TaskQueue = +[ + [ "MaybeTask", "structftxui_1_1task_1_1TaskQueue.html#aaebfee5f2f839afb18fd9c1a68483188", null ], + [ "PostTask", "structftxui_1_1task_1_1TaskQueue.html#ada41a34871c48f856bf3659e0b0c4f81", null ], + [ "Get", "structftxui_1_1task_1_1TaskQueue.html#aa79dc0bf12b85e6ac05adf59818e3939", null ], + [ "HasImmediateTasks", "structftxui_1_1task_1_1TaskQueue.html#a257afcb3d4b649b1a39a697cea2843ce", null ] +]; \ No newline at end of file diff --git a/style__blink_8cpp.html b/style__blink_8cpp.html new file mode 100644 index 000000000..370e4825a --- /dev/null +++ b/style__blink_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: style_blink.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    style_blink.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Functions

    int main ()
     
    +

    Function Documentation

    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 11 of file style_blink.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/style__blink_8cpp.js b/style__blink_8cpp.js new file mode 100644 index 000000000..ae1274ab9 --- /dev/null +++ b/style__blink_8cpp.js @@ -0,0 +1,4 @@ +var style__blink_8cpp = +[ + [ "main", "style__blink_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/style__blink_8cpp_source.html b/style__blink_8cpp_source.html new file mode 100644 index 000000000..8392e1b1f --- /dev/null +++ b/style__blink_8cpp_source.html @@ -0,0 +1,241 @@ + + + + + + + + +FTXUI: style_blink.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    style_blink.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <ftxui/dom/elements.hpp> // for text, operator|, blink, Fit, hbox, Element
    +
    5#include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    6#include <memory> // for allocator
    +
    7
    +
    8#include "ftxui/dom/node.hpp" // for Render
    +
    9#include "ftxui/screen/color.hpp" // for ftxui
    +
    10
    +
    +
    11int main() {
    +
    12 using namespace ftxui;
    +
    13 auto document = //
    +
    14 hbox({
    +
    15 text("This text is "),
    +
    16 text("blink") | blink,
    +
    17 text(". Do you like it?"),
    +
    18 });
    +
    19 auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    20 Render(screen, document);
    +
    21 screen.Print();
    +
    22
    +
    23 return 0;
    +
    24}
    +
    + + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + + + +
    +
    + + + + + diff --git a/style__bold_8cpp.html b/style__bold_8cpp.html new file mode 100644 index 000000000..b57298a04 --- /dev/null +++ b/style__bold_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: style_bold.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    style_bold.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Functions

    int main ()
     
    +

    Function Documentation

    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 11 of file style_bold.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/style__bold_8cpp.js b/style__bold_8cpp.js new file mode 100644 index 000000000..20856296a --- /dev/null +++ b/style__bold_8cpp.js @@ -0,0 +1,4 @@ +var style__bold_8cpp = +[ + [ "main", "style__bold_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/style__bold_8cpp_source.html b/style__bold_8cpp_source.html new file mode 100644 index 000000000..bf665e3ab --- /dev/null +++ b/style__bold_8cpp_source.html @@ -0,0 +1,241 @@ + + + + + + + + +FTXUI: style_bold.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    style_bold.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <ftxui/dom/elements.hpp> // for text, operator|, bold, Fit, hbox, Element
    +
    5#include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    6#include <memory> // for allocator
    +
    7
    +
    8#include "ftxui/dom/node.hpp" // for Render
    +
    9#include "ftxui/screen/color.hpp" // for ftxui
    +
    10
    +
    +
    11int main() {
    +
    12 using namespace ftxui;
    +
    13 auto document = //
    +
    14 hbox({
    +
    15 text("This text is "),
    +
    16 text("bold") | bold,
    +
    17 text(". Do you like it?"),
    +
    18 });
    +
    19 auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    20 Render(screen, document);
    +
    21 screen.Print();
    +
    22
    +
    23 return 0;
    +
    24}
    +
    + + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + + +
    int main()
    +
    +
    + + + + + diff --git a/style__color_8cpp.html b/style__color_8cpp.html new file mode 100644 index 000000000..68225f2bd --- /dev/null +++ b/style__color_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: style_color.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    style_color.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Functions

    int main ()
     
    +

    Function Documentation

    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 12 of file style_color.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/style__color_8cpp.js b/style__color_8cpp.js new file mode 100644 index 000000000..2a909913a --- /dev/null +++ b/style__color_8cpp.js @@ -0,0 +1,4 @@ +var style__color_8cpp = +[ + [ "main", "style__color_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/style__color_8cpp_source.html b/style__color_8cpp_source.html new file mode 100644 index 000000000..1d6b74d51 --- /dev/null +++ b/style__color_8cpp_source.html @@ -0,0 +1,286 @@ + + + + + + + + +FTXUI: style_color.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    style_color.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <ftxui/dom/linear_gradient.hpp> // for LinearGradient
    +
    5#include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    6#include <memory> // for allocator
    +
    7
    +
    8#include "ftxui/dom/elements.hpp" // for text, bgcolor, color, vbox, filler, Fit, hbox
    +
    9#include "ftxui/dom/node.hpp" // for Render
    +
    10#include "ftxui/screen/color.hpp" // for Color, operator""_rgb, Color::Black, Color::Blue, Color::BlueLight, Color::Cyan, Color::CyanLight, Color::DeepSkyBlue4, Color::Default, Color::GrayDark, Color::GrayLight, Color::Green, Color::GreenLight, Color::Magenta, Color::MagentaLight, Color::Red, Color::RedLight, Color::SkyBlue1, Color::White, Color::Yellow, Color::YellowLight, ftxui
    +
    11
    +
    +
    12int main() {
    +
    13 using namespace ftxui;
    +
    14 auto document = hbox({
    +
    15 vbox({
    +
    16 color(Color::Default, text("Default")),
    +
    17 color(Color::Black, text("Black")),
    +
    18 color(Color::GrayDark, text("GrayDark")),
    +
    19 color(Color::GrayLight, text("GrayLight")),
    +
    20 color(Color::White, text("White")),
    +
    21 color(Color::Blue, text("Blue")),
    +
    22 color(Color::BlueLight, text("BlueLight")),
    +
    23 color(Color::Cyan, text("Cyan")),
    +
    24 color(Color::CyanLight, text("CyanLight")),
    +
    25 color(Color::Green, text("Green")),
    +
    26 color(Color::GreenLight, text("GreenLight")),
    +
    27 color(Color::Magenta, text("Magenta")),
    +
    28 color(Color::MagentaLight, text("MagentaLight")),
    +
    29 color(Color::Red, text("Red")),
    +
    30 color(Color::RedLight, text("RedLight")),
    +
    31 color(Color::Yellow, text("Yellow")),
    +
    32 color(Color::YellowLight, text("YellowLight")),
    +
    33 color(0x66ff66_rgb, text("Phosphor")),
    +
    34 color(LinearGradient(Color::SkyBlue1, Color::DeepSkyBlue4),
    +
    35 text("Skyblue to DeepSkyBlue")),
    +
    36 }),
    +
    37 vbox({
    +
    38 bgcolor(Color::Default, text("Default")),
    +
    39 bgcolor(Color::Black, text("Black")),
    +
    40 bgcolor(Color::GrayDark, text("GrayDark")),
    +
    41 bgcolor(Color::GrayLight, text("GrayLight")),
    +
    42 bgcolor(Color::White, text("White")),
    +
    43 bgcolor(Color::Blue, text("Blue")),
    +
    44 bgcolor(Color::BlueLight, text("BlueLight")),
    +
    45 bgcolor(Color::Cyan, text("Cyan")),
    +
    46 bgcolor(Color::CyanLight, text("CyanLight")),
    +
    47 bgcolor(Color::Green, text("Green")),
    +
    48 bgcolor(Color::GreenLight, text("GreenLight")),
    +
    49 bgcolor(Color::Magenta, text("Magenta")),
    +
    50 bgcolor(Color::MagentaLight, text("MagentaLight")),
    +
    51 bgcolor(Color::Red, text("Red")),
    +
    52 bgcolor(Color::RedLight, text("RedLight")),
    +
    53 bgcolor(Color::Yellow, text("Yellow")),
    +
    54 bgcolor(Color::YellowLight, text("YellowLight")),
    +
    55 bgcolor(0x66ff66_rgb, text("Phosphor")),
    +
    56 bgcolor(LinearGradient(Color::SkyBlue1, Color::DeepSkyBlue4),
    +
    57 text("Skyblue to DeepSkyBlue")),
    +
    58 }),
    +
    59 filler(),
    +
    60 });
    +
    61
    +
    62 auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    63 Render(screen, document);
    +
    64 screen.Print();
    +
    65
    +
    66 return 0;
    +
    67}
    +
    + + +
    A class representing the settings for linear-gradient color effect.
    + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + + +
    int main()
    +
    +
    + + + + + diff --git a/style__dim_8cpp.html b/style__dim_8cpp.html new file mode 100644 index 000000000..93f76dd56 --- /dev/null +++ b/style__dim_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: style_dim.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    style_dim.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Functions

    int main ()
     
    +

    Function Documentation

    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 11 of file style_dim.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/style__dim_8cpp.js b/style__dim_8cpp.js new file mode 100644 index 000000000..60079fc94 --- /dev/null +++ b/style__dim_8cpp.js @@ -0,0 +1,4 @@ +var style__dim_8cpp = +[ + [ "main", "style__dim_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/style__dim_8cpp_source.html b/style__dim_8cpp_source.html new file mode 100644 index 000000000..7fcbffd67 --- /dev/null +++ b/style__dim_8cpp_source.html @@ -0,0 +1,241 @@ + + + + + + + + +FTXUI: style_dim.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    style_dim.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <ftxui/dom/elements.hpp> // for text, operator|, dim, Fit, hbox, Element
    +
    5#include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    6#include <memory> // for allocator
    +
    7
    +
    8#include "ftxui/dom/node.hpp" // for Render
    +
    9#include "ftxui/screen/color.hpp" // for ftxui
    +
    10
    +
    +
    11int main() {
    +
    12 using namespace ftxui;
    +
    13 auto document = //
    +
    14 hbox({
    +
    15 text("This text is "),
    +
    16 text("dim") | dim,
    +
    17 text(". Do you like it?"),
    +
    18 });
    +
    19 auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    20 Render(screen, document);
    +
    21 screen.Print();
    +
    22
    +
    23 return 0;
    +
    24}
    +
    + + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + + +
    int main()
    Definition style_dim.cpp:11
    +
    +
    + + + + + diff --git a/style__gallery_8cpp.html b/style__gallery_8cpp.html new file mode 100644 index 000000000..8bd9b3191 --- /dev/null +++ b/style__gallery_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: style_gallery.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    style_gallery.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Functions

    int main ()
     
    +

    Function Documentation

    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 11 of file style_gallery.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/style__gallery_8cpp.js b/style__gallery_8cpp.js new file mode 100644 index 000000000..d14988af7 --- /dev/null +++ b/style__gallery_8cpp.js @@ -0,0 +1,4 @@ +var style__gallery_8cpp = +[ + [ "main", "style__gallery_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/style__gallery_8cpp_source.html b/style__gallery_8cpp_source.html new file mode 100644 index 000000000..67ce9657e --- /dev/null +++ b/style__gallery_8cpp_source.html @@ -0,0 +1,252 @@ + + + + + + + + +FTXUI: style_gallery.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    style_gallery.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <ftxui/dom/elements.hpp> // for text, operator|, Element, bgcolor, color, blink, bold, dim, inverted, underlined, Fit, hbox
    +
    5#include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    6#include <memory> // for allocator
    +
    7
    +
    8#include "ftxui/dom/node.hpp" // for Render
    +
    9#include "ftxui/screen/color.hpp" // for Color, Color::Blue, ftxui
    +
    10
    +
    +
    11int main() {
    +
    12 using namespace ftxui;
    +
    13 // clang-format off
    +
    14 auto document =
    +
    15 hbox({
    +
    16 text("normal") , text(" ") ,
    +
    17 text("bold") | bold , text(" ") ,
    +
    18 text("italic") | italic , text(" ") ,
    +
    19 text("dim") | dim , text(" ") ,
    +
    20 text("inverted") | inverted , text(" ") ,
    +
    21 text("underlined") | underlined , text(" ") ,
    +
    22 text("underlinedDouble") | underlinedDouble , text(" ") ,
    +
    23 text("blink") | blink , text(" ") ,
    +
    24 text("strikethrough") | strikethrough , text(" ") ,
    +
    25 text("color") | color(Color::Blue) , text(" ") ,
    +
    26 text("bgcolor") | bgcolor(Color::Blue) , text(" ") ,
    +
    27 text("hyperlink") | hyperlink("https://github.com/ArthurSonzogni/FTXUI"),
    +
    28 });
    +
    29 // clang-format on
    +
    30 auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    31 Render(screen, document);
    +
    32 screen.Print();
    +
    33
    +
    34 return 0;
    +
    35}
    +
    + + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + + + +
    +
    + + + + + diff --git a/style__hyperlink_8cpp.html b/style__hyperlink_8cpp.html new file mode 100644 index 000000000..ba0e9e451 --- /dev/null +++ b/style__hyperlink_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: style_hyperlink.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    style_hyperlink.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Functions

    int main ()
     
    +

    Function Documentation

    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 11 of file style_hyperlink.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/style__hyperlink_8cpp.js b/style__hyperlink_8cpp.js new file mode 100644 index 000000000..ff5ea0e7b --- /dev/null +++ b/style__hyperlink_8cpp.js @@ -0,0 +1,4 @@ +var style__hyperlink_8cpp = +[ + [ "main", "style__hyperlink_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/style__hyperlink_8cpp_source.html b/style__hyperlink_8cpp_source.html new file mode 100644 index 000000000..bd2dd80ab --- /dev/null +++ b/style__hyperlink_8cpp_source.html @@ -0,0 +1,241 @@ + + + + + + + + +FTXUI: style_hyperlink.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    style_hyperlink.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <ftxui/dom/elements.hpp> // for text, operator|, bold, Fit, hbox, Element
    +
    5#include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    6#include <memory> // for allocator
    +
    7
    +
    8#include "ftxui/dom/node.hpp" // for Render
    +
    9#include "ftxui/screen/color.hpp" // for ftxui
    +
    10
    +
    +
    11int main() {
    +
    12 using namespace ftxui;
    +
    13 auto document = //
    +
    14 hbox({
    +
    15 text("This text is an "),
    +
    16 text("hyperlink") | hyperlink("https://www.google.com"),
    +
    17 text(". Do you like it?"),
    +
    18 });
    +
    19 auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    20 Render(screen, document);
    +
    21 screen.Print();
    +
    22
    +
    23 return 0;
    +
    24}
    +
    + + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + + + +
    +
    + + + + + diff --git a/style__inverted_8cpp.html b/style__inverted_8cpp.html new file mode 100644 index 000000000..527cc1e3d --- /dev/null +++ b/style__inverted_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: style_inverted.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    style_inverted.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Functions

    int main ()
     
    +

    Function Documentation

    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 11 of file style_inverted.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/style__inverted_8cpp.js b/style__inverted_8cpp.js new file mode 100644 index 000000000..c3e4ef3fd --- /dev/null +++ b/style__inverted_8cpp.js @@ -0,0 +1,4 @@ +var style__inverted_8cpp = +[ + [ "main", "style__inverted_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/style__inverted_8cpp_source.html b/style__inverted_8cpp_source.html new file mode 100644 index 000000000..fd73fd5e6 --- /dev/null +++ b/style__inverted_8cpp_source.html @@ -0,0 +1,240 @@ + + + + + + + + +FTXUI: style_inverted.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    style_inverted.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <ftxui/dom/elements.hpp> // for text, operator|, inverted, Fit, hbox, Element
    +
    5#include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    6#include <memory> // for allocator
    +
    7
    +
    8#include "ftxui/dom/node.hpp" // for Render
    +
    9#include "ftxui/screen/color.hpp" // for ftxui
    +
    10
    +
    +
    11int main() {
    +
    12 using namespace ftxui;
    +
    13 auto document = hbox({
    +
    14 text("This text is "),
    +
    15 text("inverted") | inverted,
    +
    16 text(". Do you like it?"),
    +
    17 });
    +
    18 auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    19 Render(screen, document);
    +
    20 screen.Print();
    +
    21
    +
    22 return 0;
    +
    23}
    +
    + + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + + +
    int main()
    +
    +
    + + + + + diff --git a/style__italic_8cpp.html b/style__italic_8cpp.html new file mode 100644 index 000000000..305238b6d --- /dev/null +++ b/style__italic_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: style_italic.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    style_italic.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Functions

    int main ()
     
    +

    Function Documentation

    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 11 of file style_italic.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/style__italic_8cpp.js b/style__italic_8cpp.js new file mode 100644 index 000000000..fb754dc66 --- /dev/null +++ b/style__italic_8cpp.js @@ -0,0 +1,4 @@ +var style__italic_8cpp = +[ + [ "main", "style__italic_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/style__italic_8cpp_source.html b/style__italic_8cpp_source.html new file mode 100644 index 000000000..b44927204 --- /dev/null +++ b/style__italic_8cpp_source.html @@ -0,0 +1,240 @@ + + + + + + + + +FTXUI: style_italic.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    style_italic.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2025 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <ftxui/dom/elements.hpp> // for text, operator|, inverted, Fit, hbox, Element
    +
    5#include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    6#include <memory> // for allocator
    +
    7
    +
    8#include "ftxui/dom/node.hpp" // for Render
    +
    9#include "ftxui/screen/color.hpp" // for ftxui
    +
    10
    +
    +
    11int main() {
    +
    12 using namespace ftxui;
    +
    13 auto document = hbox({
    +
    14 text("This text is "),
    +
    15 text("italic") | italic,
    +
    16 text(". Do you like it?"),
    +
    17 });
    +
    18 auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    19 Render(screen, document);
    +
    20 screen.Print();
    +
    21
    +
    22 return 0;
    +
    23}
    +
    + + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + + +
    int main()
    +
    +
    + + + + + diff --git a/style__strikethrough_8cpp.html b/style__strikethrough_8cpp.html new file mode 100644 index 000000000..0ac58b585 --- /dev/null +++ b/style__strikethrough_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: style_strikethrough.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    style_strikethrough.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Functions

    int main ()
     
    +

    Function Documentation

    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 11 of file style_strikethrough.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/style__strikethrough_8cpp.js b/style__strikethrough_8cpp.js new file mode 100644 index 000000000..ce2c4ca0d --- /dev/null +++ b/style__strikethrough_8cpp.js @@ -0,0 +1,4 @@ +var style__strikethrough_8cpp = +[ + [ "main", "style__strikethrough_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/style__strikethrough_8cpp_source.html b/style__strikethrough_8cpp_source.html new file mode 100644 index 000000000..98b729ac9 --- /dev/null +++ b/style__strikethrough_8cpp_source.html @@ -0,0 +1,241 @@ + + + + + + + + +FTXUI: style_strikethrough.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    style_strikethrough.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <ftxui/dom/elements.hpp> // for text, operator|, strikethrough, Fit, hbox, Element
    +
    5#include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    6#include <memory> // for allocator
    +
    7
    +
    8#include "ftxui/dom/node.hpp" // for Render
    +
    9#include "ftxui/screen/color.hpp" // for ftxui
    +
    10
    +
    +
    11int main() {
    +
    12 using namespace ftxui;
    +
    13 auto document = //
    +
    14 hbox({
    +
    15 text("This text is "),
    +
    16 text("strikethrough") | strikethrough,
    +
    17 text(". Do you like it?"),
    +
    18 });
    +
    19 auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    20 Render(screen, document);
    +
    21 screen.Print();
    +
    22
    +
    23 return 0;
    +
    24}
    +
    + + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + + +
    int main()
    +
    +
    + + + + + diff --git a/style__underlined_8cpp.html b/style__underlined_8cpp.html new file mode 100644 index 000000000..13ac27a80 --- /dev/null +++ b/style__underlined_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: style_underlined.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    style_underlined.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Functions

    int main ()
     
    +

    Function Documentation

    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 11 of file style_underlined.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/style__underlined_8cpp.js b/style__underlined_8cpp.js new file mode 100644 index 000000000..d2cd99674 --- /dev/null +++ b/style__underlined_8cpp.js @@ -0,0 +1,4 @@ +var style__underlined_8cpp = +[ + [ "main", "style__underlined_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/style__underlined_8cpp_source.html b/style__underlined_8cpp_source.html new file mode 100644 index 000000000..bbfd68210 --- /dev/null +++ b/style__underlined_8cpp_source.html @@ -0,0 +1,241 @@ + + + + + + + + +FTXUI: style_underlined.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    style_underlined.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <ftxui/dom/elements.hpp> // for text, operator|, underlined, Fit, hbox, Element
    +
    5#include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    6#include <memory> // for allocator
    +
    7
    +
    8#include "ftxui/dom/node.hpp" // for Render
    +
    9#include "ftxui/screen/color.hpp" // for ftxui
    +
    10
    +
    +
    11int main() {
    +
    12 using namespace ftxui;
    +
    13 auto document = //
    +
    14 hbox({
    +
    15 text("This text is "),
    +
    16 text("underlined") | underlined,
    +
    17 text(". Do you like it?"),
    +
    18 });
    +
    19 auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    20 Render(screen, document);
    +
    21 screen.Print();
    +
    22
    +
    23 return 0;
    +
    24}
    +
    + + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + + +
    int main()
    +
    +
    + + + + + diff --git a/style__underlined__double_8cpp.html b/style__underlined__double_8cpp.html new file mode 100644 index 000000000..3c0e3815a --- /dev/null +++ b/style__underlined__double_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: style_underlined_double.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    style_underlined_double.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Functions

    int main ()
     
    +

    Function Documentation

    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 11 of file style_underlined_double.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/style__underlined__double_8cpp.js b/style__underlined__double_8cpp.js new file mode 100644 index 000000000..34de53f63 --- /dev/null +++ b/style__underlined__double_8cpp.js @@ -0,0 +1,4 @@ +var style__underlined__double_8cpp = +[ + [ "main", "style__underlined__double_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/style__underlined__double_8cpp_source.html b/style__underlined__double_8cpp_source.html new file mode 100644 index 000000000..977e8bd3e --- /dev/null +++ b/style__underlined__double_8cpp_source.html @@ -0,0 +1,241 @@ + + + + + + + + +FTXUI: style_underlined_double.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    style_underlined_double.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <ftxui/dom/elements.hpp> // for text, operator|, underlinedDouble, Fit, hbox, Element
    +
    5#include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    6#include <memory> // for allocator
    +
    7
    +
    8#include "ftxui/dom/node.hpp" // for Render
    +
    9#include "ftxui/screen/color.hpp" // for ftxui
    +
    10
    +
    +
    11int main() {
    +
    12 using namespace ftxui;
    +
    13 auto document = //
    +
    14 hbox({
    +
    15 text("This text is "),
    +
    16 text("underlinedDouble") | underlinedDouble,
    +
    17 text(". Do you like it?"),
    +
    18 });
    +
    19 auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    20 Render(screen, document);
    +
    21 screen.Print();
    +
    22
    +
    23 return 0;
    +
    24}
    +
    + + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + + + +
    +
    + + + + + diff --git a/stylesheet.css b/stylesheet.css new file mode 100644 index 000000000..a9cfd6fe4 --- /dev/null +++ b/stylesheet.css @@ -0,0 +1,119 @@ +html { + --primary-color: #9ed072; /* green (identifier, strings) */ + --primary-dark-color: #f39660; /* orange (functions, tags) */ + --primary-light-color: #7fbbb3; /* teal (types, decorators) */ + + --page-background-color: #2c2e34; /* main background */ + --page-foreground-color: #e2e2e3; /* main text */ + --page-secondary-foreground-color: #9aa5ce; /* dim text */ + --separator-color: #3b3e48; + --side-nav-background: #1a1b26; + + --code-background: #2a2e38; + --code-foreground: #e2e2e3; + + --tablehead-background: #1f1f28; + + --blockquote-background: #3a3e44; + --blockquote-foreground: #d4bfff; + + --warning-color: #e0af68; + --warning-color-dark: #ff9e64; + --warning-color-darker: #f7768e; + --bug-color: #f7768e; + + --fragment-background: #222222; + --fragment-foreground: #e2e2e3; + --fragment-keyword: #f7768e; /* pink */ + --fragment-keywordtype: #7fbbb3; /* teal */ + --fragment-keywordflow: #e0af68; /* orange-yellow */ + --fragment-token: #9ed072; /* green */ + --fragment-comment: #5c6370; + --fragment-link: #7aa2f7; /* blue link */ + --fragment-preprocessor: #f39660; /* orange */ + --fragment-linenumber-color: #414868; + --fragment-linenumber-background: #2c2e34; + --fragment-linenumber-border: #1a1b26; + --fragment-lineheight: 1.125em; +} + +/* Base style for all sections */ +.section.note, +.section.warning, +.section.remark, +.section.attention, +.section.important { + border-left: 4px solid var(--primary-dark-color); + border-radius: 6px; + padding: 0.9em 1.2em; + margin: 1.5em 0; + background-color: #2e303e; + color: var(--page-foreground-color); + font-size: 0.95em; +} + +/* Section title */ +.section.note dt, +.section.warning dt, +.section.remark dt, +.section.attention dt, +.section.important dt { + font-weight: bold; + display: block; + margin-bottom: 0.35em; +} + +/* Section body */ +.section.note dd, +.section.warning dd, +.section.remark dd, +.section.attention dd, +.section.important dd { + margin: 0; +} + +/* Note - soft cyan */ +.section.note { + border-left-color: #7fbbb3; + background-color: #263640; +} +.section.note dt { + color: #7fbbb3; +} + +/* Warning - amber */ +.section.warning { + border-left-color: #e0af68; + background-color: #3d2f1f; +} +.section.warning dt { + color: #e0af68; +} + +/* Tip (Remark) - green */ +.section.remark { + border-left-color: #9ed072; + background-color: #2d3a2d; +} +.section.remark dt { + color: #9ed072; +} + +/* Caution (Attention) - bold red-orange */ +.section.attention { + border-left-color: #f7768e; + background-color: #3d2a2e; +} +.section.attention dt { + color: #f7768e; +} + +/* Important - purple */ +.section.important { + border-left-color: #ab9df2; + background-color: #2f2a3a; +} +.section.important dt { + color: #ab9df2; +} + diff --git a/svg.min.js b/svg.min.js new file mode 100644 index 000000000..916732fe5 --- /dev/null +++ b/svg.min.js @@ -0,0 +1,46 @@ +/*! +* @svgdotjs/svg.js - A lightweight library for manipulating and animating SVG. +* @version 3.1.2 +* https://svgjs.dev/ +* +* @copyright Wout Fierens +* @license MIT +* +* BUILT: Wed Jan 26 2022 23:19:07 GMT+0100 (Mitteleuropäische Normalzeit) +*/var SVG=function(){"use strict";const methods$1={};const names=[];function registerMethods(name,m){if(Array.isArray(name)){for(const _name of name){registerMethods(_name,m)}return}if(typeof name==="object"){for(const _name in name){registerMethods(_name,name[_name])}return}addMethodNames(Object.getOwnPropertyNames(m));methods$1[name]=Object.assign(methods$1[name]||{},m)}function getMethodsFor(name){return methods$1[name]||{}}function getMethodNames(){return[...new Set(names)]}function addMethodNames(_names){names.push(..._names)}function map(array,block){let i;const il=array.length;const result=[];for(i=0;i=0;i--){assignNewId(node.children[i])}if(node.id){node.id=eid(node.nodeName);return node}return node}function extend(modules,methods){let key,i;modules=Array.isArray(modules)?modules:[modules];for(i=modules.length-1;i>=0;i--){for(key in methods){modules[i].prototype[key]=methods[key]}}}function wrapWithAttrCheck(fn){return function(...args){const o=args[args.length-1];if(o&&o.constructor===Object&&!(o instanceof Array)){return fn.apply(this,args.slice(0,-1)).attr(o)}else{return fn.apply(this,args)}}}function siblings(){return this.parent().children()}function position(){return this.parent().index(this)}function next(){return this.siblings()[this.position()+1]}function prev(){return this.siblings()[this.position()-1]}function forward(){const i=this.position();const p=this.parent();p.add(this.remove(),i+1);return this}function backward(){const i=this.position();const p=this.parent();p.add(this.remove(),i?i-1:0);return this}function front(){const p=this.parent();p.add(this.remove());return this}function back(){const p=this.parent();p.add(this.remove(),0);return this}function before(element){element=makeInstance(element);element.remove();const i=this.position();this.parent().add(element,i);return this}function after(element){element=makeInstance(element);element.remove();const i=this.position();this.parent().add(element,i+1);return this}function insertBefore(element){element=makeInstance(element);element.before(this);return this}function insertAfter(element){element=makeInstance(element);element.after(this);return this}registerMethods("Dom",{siblings:siblings,position:position,next:next,prev:prev,forward:forward,backward:backward,front:front,back:back,before:before,after:after,insertBefore:insertBefore,insertAfter:insertAfter});const numberAndUnit=/^([+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?)([a-z%]*)$/i;const hex=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i;const rgb=/rgb\((\d+),(\d+),(\d+)\)/;const reference=/(#[a-z_][a-z0-9\-_]*)/i;const transforms=/\)\s*,?\s*/;const whitespace=/\s/g;const isHex=/^#[a-f0-9]{3}$|^#[a-f0-9]{6}$/i;const isRgb=/^rgb\(/;const isBlank=/^(\s+)?$/;const isNumber=/^[+-]?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;const isImage=/\.(jpg|jpeg|png|gif|svg)(\?[^=]+.*)?/i;const delimiter=/[\s,]+/;const isPathLetter=/[MLHVCSQTAZ]/i;var regex={__proto__:null,numberAndUnit:numberAndUnit,hex:hex,rgb:rgb,reference:reference,transforms:transforms,whitespace:whitespace,isHex:isHex,isRgb:isRgb,isBlank:isBlank,isNumber:isNumber,isImage:isImage,delimiter:delimiter,isPathLetter:isPathLetter};function classes(){const attr=this.attr("class");return attr==null?[]:attr.trim().split(delimiter)}function hasClass(name){return this.classes().indexOf(name)!==-1}function addClass(name){if(!this.hasClass(name)){const array=this.classes();array.push(name);this.attr("class",array.join(" "))}return this}function removeClass(name){if(this.hasClass(name)){this.attr("class",this.classes().filter(function(c){return c!==name}).join(" "))}return this}function toggleClass(name){return this.hasClass(name)?this.removeClass(name):this.addClass(name)}registerMethods("Dom",{classes:classes,hasClass:hasClass,addClass:addClass,removeClass:removeClass,toggleClass:toggleClass});function css(style,val){const ret={};if(arguments.length===0){this.node.style.cssText.split(/\s*;\s*/).filter(function(el){return!!el.length}).forEach(function(el){const t=el.split(/\s*:\s*/);ret[t[0]]=t[1]});return ret}if(arguments.length<2){if(Array.isArray(style)){for(const name of style){const cased=camelCase(name);ret[name]=this.node.style[cased]}return ret}if(typeof style==="string"){return this.node.style[camelCase(style)]}if(typeof style==="object"){for(const name in style){this.node.style[camelCase(name)]=style[name]==null||isBlank.test(style[name])?"":style[name]}}}if(arguments.length===2){this.node.style[camelCase(style)]=val==null||isBlank.test(val)?"":val}return this}function show(){return this.css("display","")}function hide(){return this.css("display","none")}function visible(){return this.css("display")!=="none"}registerMethods("Dom",{css:css,show:show,hide:hide,visible:visible});function data(a,v,r){if(a==null){return this.data(map(filter(this.node.attributes,el=>el.nodeName.indexOf("data-")===0),el=>el.nodeName.slice(5)))}else if(a instanceof Array){const data={};for(const key of a){data[key]=this.data(key)}return data}else if(typeof a==="object"){for(v in a){this.data(v,a[v])}}else if(arguments.length<2){try{return JSON.parse(this.attr("data-"+a))}catch(e){return this.attr("data-"+a)}}else{this.attr("data-"+a,v===null?null:r===true||typeof v==="string"||typeof v==="number"?v:JSON.stringify(v))}return this}registerMethods("Dom",{data:data});function remember(k,v){if(typeof arguments[0]==="object"){for(const key in k){this.remember(key,k[key])}}else if(arguments.length===1){return this.memory()[k]}else{this.memory()[k]=v}return this}function forget(){if(arguments.length===0){this._memory={}}else{for(let i=arguments.length-1;i>=0;i--){delete this.memory()[arguments[i]]}}return this}function memory(){return this._memory=this._memory||{}}registerMethods("Dom",{remember:remember,forget:forget,memory:memory});function sixDigitHex(hex){return hex.length===4?["#",hex.substring(1,2),hex.substring(1,2),hex.substring(2,3),hex.substring(2,3),hex.substring(3,4),hex.substring(3,4)].join(""):hex}function componentHex(component){const integer=Math.round(component);const bounded=Math.max(0,Math.min(255,integer));const hex=bounded.toString(16);return hex.length===1?"0"+hex:hex}function is(object,space){for(let i=space.length;i--;){if(object[space[i]]==null){return false}}return true}function getParameters(a,b){const params=is(a,"rgb")?{_a:a.r,_b:a.g,_c:a.b,_d:0,space:"rgb"}:is(a,"xyz")?{_a:a.x,_b:a.y,_c:a.z,_d:0,space:"xyz"}:is(a,"hsl")?{_a:a.h,_b:a.s,_c:a.l,_d:0,space:"hsl"}:is(a,"lab")?{_a:a.l,_b:a.a,_c:a.b,_d:0,space:"lab"}:is(a,"lch")?{_a:a.l,_b:a.c,_c:a.h,_d:0,space:"lch"}:is(a,"cmyk")?{_a:a.c,_b:a.m,_c:a.y,_d:a.k,space:"cmyk"}:{_a:0,_b:0,_c:0,space:"rgb"};params.space=b||params.space;return params}function cieSpace(space){if(space==="lab"||space==="xyz"||space==="lch"){return true}else{return false}}function hueToRgb(p,q,t){if(t<0)t+=1;if(t>1)t-=1;if(t<1/6)return p+(q-p)*6*t;if(t<1/2)return q;if(t<2/3)return p+(q-p)*(2/3-t)*6;return p}class Color{constructor(...inputs){this.init(...inputs)}static isColor(color){return color&&(color instanceof Color||this.isRgb(color)||this.test(color))}static isRgb(color){return color&&typeof color.r==="number"&&typeof color.g==="number"&&typeof color.b==="number"}static random(mode="vibrant",t,u){const{random,round,sin,PI:pi}=Math;if(mode==="vibrant"){const l=(81-57)*random()+57;const c=(83-45)*random()+45;const h=360*random();const color=new Color(l,c,h,"lch");return color}else if(mode==="sine"){t=t==null?random():t;const r=round(80*sin(2*pi*t/.5+.01)+150);const g=round(50*sin(2*pi*t/.5+4.6)+200);const b=round(100*sin(2*pi*t/.5+2.3)+150);const color=new Color(r,g,b);return color}else if(mode==="pastel"){const l=(94-86)*random()+86;const c=(26-9)*random()+9;const h=360*random();const color=new Color(l,c,h,"lch");return color}else if(mode==="dark"){const l=10+10*random();const c=(125-75)*random()+86;const h=360*random();const color=new Color(l,c,h,"lch");return color}else if(mode==="rgb"){const r=255*random();const g=255*random();const b=255*random();const color=new Color(r,g,b);return color}else if(mode==="lab"){const l=100*random();const a=256*random()-128;const b=256*random()-128;const color=new Color(l,a,b,"lab");return color}else if(mode==="grey"){const grey=255*random();const color=new Color(grey,grey,grey);return color}else{throw new Error("Unsupported random color mode")}}static test(color){return typeof color==="string"&&(isHex.test(color)||isRgb.test(color))}cmyk(){const{_a,_b,_c}=this.rgb();const[r,g,b]=[_a,_b,_c].map(v=>v/255);const k=Math.min(1-r,1-g,1-b);if(k===1){return new Color(0,0,0,1,"cmyk")}const c=(1-r-k)/(1-k);const m=(1-g-k)/(1-k);const y=(1-b-k)/(1-k);const color=new Color(c,m,y,k,"cmyk");return color}hsl(){const{_a,_b,_c}=this.rgb();const[r,g,b]=[_a,_b,_c].map(v=>v/255);const max=Math.max(r,g,b);const min=Math.min(r,g,b);const l=(max+min)/2;const isGrey=max===min;const delta=max-min;const s=isGrey?0:l>.5?delta/(2-max-min):delta/(max+min);const h=isGrey?0:max===r?((g-b)/delta+(gparseInt(v));Object.assign(this,{_a:_a,_b:_b,_c:_c,_d:0,space:"rgb"})}else if(isHex.test(a)){const hexParse=v=>parseInt(v,16);const[,_a,_b,_c]=hex.exec(sixDigitHex(a)).map(hexParse);Object.assign(this,{_a:_a,_b:_b,_c:_c,_d:0,space:"rgb"})}else throw Error("Unsupported string format, can't construct Color")}const{_a,_b,_c,_d}=this;const components=this.space==="rgb"?{r:_a,g:_b,b:_c}:this.space==="xyz"?{x:_a,y:_b,z:_c}:this.space==="hsl"?{h:_a,s:_b,l:_c}:this.space==="lab"?{l:_a,a:_b,b:_c}:this.space==="lch"?{l:_a,c:_b,h:_c}:this.space==="cmyk"?{c:_a,m:_b,y:_c,k:_d}:{};Object.assign(this,components)}lab(){const{x,y,z}=this.xyz();const l=116*y-16;const a=500*(x-y);const b=200*(y-z);const color=new Color(l,a,b,"lab");return color}lch(){const{l,a,b}=this.lab();const c=Math.sqrt(a**2+b**2);let h=180*Math.atan2(b,a)/Math.PI;if(h<0){h*=-1;h=360-h}const color=new Color(l,c,h,"lch");return color}rgb(){if(this.space==="rgb"){return this}else if(cieSpace(this.space)){let{x,y,z}=this;if(this.space==="lab"||this.space==="lch"){let{l,a,b}=this;if(this.space==="lch"){const{c,h}=this;const dToR=Math.PI/180;a=c*Math.cos(dToR*h);b=c*Math.sin(dToR*h)}const yL=(l+16)/116;const xL=a/500+yL;const zL=yL-b/200;const ct=16/116;const mx=.008856;const nm=7.787;x=.95047*(xL**3>mx?xL**3:(xL-ct)/nm);y=1*(yL**3>mx?yL**3:(yL-ct)/nm);z=1.08883*(zL**3>mx?zL**3:(zL-ct)/nm)}const rU=x*3.2406+y*-1.5372+z*-.4986;const gU=x*-.9689+y*1.8758+z*.0415;const bU=x*.0557+y*-.204+z*1.057;const pow=Math.pow;const bd=.0031308;const r=rU>bd?1.055*pow(rU,1/2.4)-.055:12.92*rU;const g=gU>bd?1.055*pow(gU,1/2.4)-.055:12.92*gU;const b=bU>bd?1.055*pow(bU,1/2.4)-.055:12.92*bU;const color=new Color(255*r,255*g,255*b);return color}else if(this.space==="hsl"){let{h,s,l}=this;h/=360;s/=100;l/=100;if(s===0){l*=255;const color=new Color(l,l,l);return color}const q=l<.5?l*(1+s):l+s-l*s;const p=2*l-q;const r=255*hueToRgb(p,q,h+1/3);const g=255*hueToRgb(p,q,h);const b=255*hueToRgb(p,q,h-1/3);const color=new Color(r,g,b);return color}else if(this.space==="cmyk"){const{c,m,y,k}=this;const r=255*(1-Math.min(1,c*(1-k)+k));const g=255*(1-Math.min(1,m*(1-k)+k));const b=255*(1-Math.min(1,y*(1-k)+k));const color=new Color(r,g,b);return color}else{return this}}toArray(){const{_a,_b,_c,_d,space}=this;return[_a,_b,_c,_d,space]}toHex(){const[r,g,b]=this._clamped().map(componentHex);return`#${r}${g}${b}`}toRgb(){const[rV,gV,bV]=this._clamped();const string=`rgb(${rV},${gV},${bV})`;return string}toString(){return this.toHex()}xyz(){const{_a:r255,_b:g255,_c:b255}=this.rgb();const[r,g,b]=[r255,g255,b255].map(v=>v/255);const rL=r>.04045?Math.pow((r+.055)/1.055,2.4):r/12.92;const gL=g>.04045?Math.pow((g+.055)/1.055,2.4):g/12.92;const bL=b>.04045?Math.pow((b+.055)/1.055,2.4):b/12.92;const xU=(rL*.4124+gL*.3576+bL*.1805)/.95047;const yU=(rL*.2126+gL*.7152+bL*.0722)/1;const zU=(rL*.0193+gL*.1192+bL*.9505)/1.08883;const x=xU>.008856?Math.pow(xU,1/3):7.787*xU+16/116;const y=yU>.008856?Math.pow(yU,1/3):7.787*yU+16/116;const z=zU>.008856?Math.pow(zU,1/3):7.787*zU+16/116;const color=new Color(x,y,z,"xyz");return color}_clamped(){const{_a,_b,_c}=this.rgb();const{max,min,round}=Math;const format=v=>max(0,min(round(v),255));return[_a,_b,_c].map(format)}}class Point{constructor(...args){this.init(...args)}clone(){return new Point(this)}init(x,y){const base={x:0,y:0};const source=Array.isArray(x)?{x:x[0],y:x[1]}:typeof x==="object"?{x:x.x,y:x.y}:{x:x,y:y};this.x=source.x==null?base.x:source.x;this.y=source.y==null?base.y:source.y;return this}toArray(){return[this.x,this.y]}transform(m){return this.clone().transformO(m)}transformO(m){if(!Matrix.isMatrixLike(m)){m=new Matrix(m)}const{x,y}=this;this.x=m.a*x+m.c*y+m.e;this.y=m.b*x+m.d*y+m.f;return this}}function point(x,y){return new Point(x,y).transform(this.screenCTM().inverse())}function closeEnough(a,b,threshold){return Math.abs(b-a)<(threshold||1e-6)}class Matrix{constructor(...args){this.init(...args)}static formatTransforms(o){const flipBoth=o.flip==="both"||o.flip===true;const flipX=o.flip&&(flipBoth||o.flip==="x")?-1:1;const flipY=o.flip&&(flipBoth||o.flip==="y")?-1:1;const skewX=o.skew&&o.skew.length?o.skew[0]:isFinite(o.skew)?o.skew:isFinite(o.skewX)?o.skewX:0;const skewY=o.skew&&o.skew.length?o.skew[1]:isFinite(o.skew)?o.skew:isFinite(o.skewY)?o.skewY:0;const scaleX=o.scale&&o.scale.length?o.scale[0]*flipX:isFinite(o.scale)?o.scale*flipX:isFinite(o.scaleX)?o.scaleX*flipX:flipX;const scaleY=o.scale&&o.scale.length?o.scale[1]*flipY:isFinite(o.scale)?o.scale*flipY:isFinite(o.scaleY)?o.scaleY*flipY:flipY;const shear=o.shear||0;const theta=o.rotate||o.theta||0;const origin=new Point(o.origin||o.around||o.ox||o.originX,o.oy||o.originY);const ox=origin.x;const oy=origin.y;const position=new Point(o.position||o.px||o.positionX||NaN,o.py||o.positionY||NaN);const px=position.x;const py=position.y;const translate=new Point(o.translate||o.tx||o.translateX,o.ty||o.translateY);const tx=translate.x;const ty=translate.y;const relative=new Point(o.relative||o.rx||o.relativeX,o.ry||o.relativeY);const rx=relative.x;const ry=relative.y;return{scaleX:scaleX,scaleY:scaleY,skewX:skewX,skewY:skewY,shear:shear,theta:theta,rx:rx,ry:ry,tx:tx,ty:ty,ox:ox,oy:oy,px:px,py:py}}static fromArray(a){return{a:a[0],b:a[1],c:a[2],d:a[3],e:a[4],f:a[5]}}static isMatrixLike(o){return o.a!=null||o.b!=null||o.c!=null||o.d!=null||o.e!=null||o.f!=null}static matrixMultiply(l,r,o){const a=l.a*r.a+l.c*r.b;const b=l.b*r.a+l.d*r.b;const c=l.a*r.c+l.c*r.d;const d=l.b*r.c+l.d*r.d;const e=l.e+l.a*r.e+l.c*r.f;const f=l.f+l.b*r.e+l.d*r.f;o.a=a;o.b=b;o.c=c;o.d=d;o.e=e;o.f=f;return o}around(cx,cy,matrix){return this.clone().aroundO(cx,cy,matrix)}aroundO(cx,cy,matrix){const dx=cx||0;const dy=cy||0;return this.translateO(-dx,-dy).lmultiplyO(matrix).translateO(dx,dy)}clone(){return new Matrix(this)}decompose(cx=0,cy=0){const a=this.a;const b=this.b;const c=this.c;const d=this.d;const e=this.e;const f=this.f;const determinant=a*d-b*c;const ccw=determinant>0?1:-1;const sx=ccw*Math.sqrt(a*a+b*b);const thetaRad=Math.atan2(ccw*b,ccw*a);const theta=180/Math.PI*thetaRad;const ct=Math.cos(thetaRad);const st=Math.sin(thetaRad);const lam=(a*c+b*d)/determinant;const sy=c*sx/(lam*a-b)||d*sx/(lam*b+a);const tx=e-cx+cx*ct*sx+cy*(lam*ct*sx-st*sy);const ty=f-cy+cx*st*sx+cy*(lam*st*sx+ct*sy);return{scaleX:sx,scaleY:sy,shear:lam,rotate:theta,translateX:tx,translateY:ty,originX:cx,originY:cy,a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}equals(other){if(other===this)return true;const comp=new Matrix(other);return closeEnough(this.a,comp.a)&&closeEnough(this.b,comp.b)&&closeEnough(this.c,comp.c)&&closeEnough(this.d,comp.d)&&closeEnough(this.e,comp.e)&&closeEnough(this.f,comp.f)}flip(axis,around){return this.clone().flipO(axis,around)}flipO(axis,around){return axis==="x"?this.scaleO(-1,1,around,0):axis==="y"?this.scaleO(1,-1,0,around):this.scaleO(-1,-1,axis,around||axis)}init(source){const base=Matrix.fromArray([1,0,0,1,0,0]);source=source instanceof Element?source.matrixify():typeof source==="string"?Matrix.fromArray(source.split(delimiter).map(parseFloat)):Array.isArray(source)?Matrix.fromArray(source):typeof source==="object"&&Matrix.isMatrixLike(source)?source:typeof source==="object"?(new Matrix).transform(source):arguments.length===6?Matrix.fromArray([].slice.call(arguments)):base;this.a=source.a!=null?source.a:base.a;this.b=source.b!=null?source.b:base.b;this.c=source.c!=null?source.c:base.c;this.d=source.d!=null?source.d:base.d;this.e=source.e!=null?source.e:base.e;this.f=source.f!=null?source.f:base.f;return this}inverse(){return this.clone().inverseO()}inverseO(){const a=this.a;const b=this.b;const c=this.c;const d=this.d;const e=this.e;const f=this.f;const det=a*d-b*c;if(!det)throw new Error("Cannot invert "+this);const na=d/det;const nb=-b/det;const nc=-c/det;const nd=a/det;const ne=-(na*e+nc*f);const nf=-(nb*e+nd*f);this.a=na;this.b=nb;this.c=nc;this.d=nd;this.e=ne;this.f=nf;return this}lmultiply(matrix){return this.clone().lmultiplyO(matrix)}lmultiplyO(matrix){const r=this;const l=matrix instanceof Matrix?matrix:new Matrix(matrix);return Matrix.matrixMultiply(l,r,this)}multiply(matrix){return this.clone().multiplyO(matrix)}multiplyO(matrix){const l=this;const r=matrix instanceof Matrix?matrix:new Matrix(matrix);return Matrix.matrixMultiply(l,r,this)}rotate(r,cx,cy){return this.clone().rotateO(r,cx,cy)}rotateO(r,cx=0,cy=0){r=radians(r);const cos=Math.cos(r);const sin=Math.sin(r);const{a,b,c,d,e,f}=this;this.a=a*cos-b*sin;this.b=b*cos+a*sin;this.c=c*cos-d*sin;this.d=d*cos+c*sin;this.e=e*cos-f*sin+cy*sin-cx*cos+cx;this.f=f*cos+e*sin-cx*sin-cy*cos+cy;return this}scale(x,y,cx,cy){return this.clone().scaleO(...arguments)}scaleO(x,y=x,cx=0,cy=0){if(arguments.length===3){cy=cx;cx=y;y=x}const{a,b,c,d,e,f}=this;this.a=a*x;this.b=b*y;this.c=c*x;this.d=d*y;this.e=e*x-cx*x+cx;this.f=f*y-cy*y+cy;return this}shear(a,cx,cy){return this.clone().shearO(a,cx,cy)}shearO(lx,cx=0,cy=0){const{a,b,c,d,e,f}=this;this.a=a+b*lx;this.c=c+d*lx;this.e=e+f*lx-cy*lx;return this}skew(x,y,cx,cy){return this.clone().skewO(...arguments)}skewO(x,y=x,cx=0,cy=0){if(arguments.length===3){cy=cx;cx=y;y=x}x=radians(x);y=radians(y);const lx=Math.tan(x);const ly=Math.tan(y);const{a,b,c,d,e,f}=this;this.a=a+b*lx;this.b=b+a*ly;this.c=c+d*lx;this.d=d+c*ly;this.e=e+f*lx-cy*lx;this.f=f+e*ly-cx*ly;return this}skewX(x,cx,cy){return this.skew(x,0,cx,cy)}skewY(y,cx,cy){return this.skew(0,y,cx,cy)}toArray(){return[this.a,this.b,this.c,this.d,this.e,this.f]}toString(){return"matrix("+this.a+","+this.b+","+this.c+","+this.d+","+this.e+","+this.f+")"}transform(o){if(Matrix.isMatrixLike(o)){const matrix=new Matrix(o);return matrix.multiplyO(this)}const t=Matrix.formatTransforms(o);const current=this;const{x:ox,y:oy}=new Point(t.ox,t.oy).transform(current);const transformer=(new Matrix).translateO(t.rx,t.ry).lmultiplyO(current).translateO(-ox,-oy).scaleO(t.scaleX,t.scaleY).skewO(t.skewX,t.skewY).shearO(t.shear).rotateO(t.theta).translateO(ox,oy);if(isFinite(t.px)||isFinite(t.py)){const origin=new Point(ox,oy).transform(transformer);const dx=isFinite(t.px)?t.px-origin.x:0;const dy=isFinite(t.py)?t.py-origin.y:0;transformer.translateO(dx,dy)}transformer.translateO(t.tx,t.ty);return transformer}translate(x,y){return this.clone().translateO(x,y)}translateO(x,y){this.e+=x||0;this.f+=y||0;return this}valueOf(){return{a:this.a,b:this.b,c:this.c,d:this.d,e:this.e,f:this.f}}}function ctm(){return new Matrix(this.node.getCTM())}function screenCTM(){if(typeof this.isRoot==="function"&&!this.isRoot()){const rect=this.rect(1,1);const m=rect.node.getScreenCTM();rect.remove();return new Matrix(m)}return new Matrix(this.node.getScreenCTM())}register(Matrix,"Matrix");function parser(){if(!parser.nodes){const svg=makeInstance().size(2,0);svg.node.style.cssText=["opacity: 0","position: absolute","left: -100%","top: -100%","overflow: hidden"].join(";");svg.attr("focusable","false");svg.attr("aria-hidden","true");const path=svg.path().node;parser.nodes={svg:svg,path:path}}if(!parser.nodes.svg.node.parentNode){const b=globals.document.body||globals.document.documentElement;parser.nodes.svg.addTo(b)}return parser.nodes}function isNulledBox(box){return!box.width&&!box.height&&!box.x&&!box.y}function domContains(node){return node===globals.document||(globals.document.documentElement.contains||function(node){while(node.parentNode){node=node.parentNode}return node===globals.document}).call(globals.document.documentElement,node)}class Box{constructor(...args){this.init(...args)}addOffset(){this.x+=globals.window.pageXOffset;this.y+=globals.window.pageYOffset;return new Box(this)}init(source){const base=[0,0,0,0];source=typeof source==="string"?source.split(delimiter).map(parseFloat):Array.isArray(source)?source:typeof source==="object"?[source.left!=null?source.left:source.x,source.top!=null?source.top:source.y,source.width,source.height]:arguments.length===4?[].slice.call(arguments):base;this.x=source[0]||0;this.y=source[1]||0;this.width=this.w=source[2]||0;this.height=this.h=source[3]||0;this.x2=this.x+this.w;this.y2=this.y+this.h;this.cx=this.x+this.w/2;this.cy=this.y+this.h/2;return this}isNulled(){return isNulledBox(this)}merge(box){const x=Math.min(this.x,box.x);const y=Math.min(this.y,box.y);const width=Math.max(this.x+this.width,box.x+box.width)-x;const height=Math.max(this.y+this.height,box.y+box.height)-y;return new Box(x,y,width,height)}toArray(){return[this.x,this.y,this.width,this.height]}toString(){return this.x+" "+this.y+" "+this.width+" "+this.height}transform(m){if(!(m instanceof Matrix)){m=new Matrix(m)}let xMin=Infinity;let xMax=-Infinity;let yMin=Infinity;let yMax=-Infinity;const pts=[new Point(this.x,this.y),new Point(this.x2,this.y),new Point(this.x,this.y2),new Point(this.x2,this.y2)];pts.forEach(function(p){p=p.transform(m);xMin=Math.min(xMin,p.x);xMax=Math.max(xMax,p.x);yMin=Math.min(yMin,p.y);yMax=Math.max(yMax,p.y)});return new Box(xMin,yMin,xMax-xMin,yMax-yMin)}}function getBox(el,getBBoxFn,retry){let box;try{box=getBBoxFn(el.node);if(isNulledBox(box)&&!domContains(el.node)){throw new Error("Element not in the dom")}}catch(e){box=retry(el)}return box}function bbox(){const getBBox=node=>node.getBBox();const retry=el=>{try{const clone=el.clone().addTo(parser().svg).show();const box=clone.node.getBBox();clone.remove();return box}catch(e){throw new Error(`Getting bbox of element "${el.node.nodeName}" is not possible: ${e.toString()}`)}};const box=getBox(this,getBBox,retry);const bbox=new Box(box);return bbox}function rbox(el){const getRBox=node=>node.getBoundingClientRect();const retry=el=>{throw new Error(`Getting rbox of element "${el.node.nodeName}" is not possible`)};const box=getBox(this,getRBox,retry);const rbox=new Box(box);if(el){return rbox.transform(el.screenCTM().inverseO())}return rbox.addOffset()}function inside(x,y){const box=this.bbox();return x>box.x&&y>box.y&&x{return fnOrMethodName.call(el,el,i,arr)})}else{return this.map(el=>{return el[fnOrMethodName](...args)})}},toArray(){return Array.prototype.concat.apply([],this)}});const reserved=["toArray","constructor","each"];List.extend=function(methods){methods=methods.reduce((obj,name)=>{if(reserved.includes(name))return obj;if(name[0]==="_")return obj;obj[name]=function(...attrs){return this.each(name,...attrs)};return obj},{});extend([List],methods)};function baseFind(query,parent){return new List(map((parent||globals.document).querySelectorAll(query),function(node){return adopt(node)}))}function find(query){return baseFind(query,this.node)}function findOne(query){return adopt(this.node.querySelector(query))}let listenerId=0;const windowEvents={};function getEvents(instance){let n=instance.getEventHolder();if(n===globals.window)n=windowEvents;if(!n.events)n.events={};return n.events}function getEventTarget(instance){return instance.getEventTarget()}function clearEvents(instance){let n=instance.getEventHolder();if(n===globals.window)n=windowEvents;if(n.events)n.events={}}function on(node,events,listener,binding,options){const l=listener.bind(binding||node);const instance=makeInstance(node);const bag=getEvents(instance);const n=getEventTarget(instance);events=Array.isArray(events)?events:events.split(delimiter);if(!listener._svgjsListenerId){listener._svgjsListenerId=++listenerId}events.forEach(function(event){const ev=event.split(".")[0];const ns=event.split(".")[1]||"*";bag[ev]=bag[ev]||{};bag[ev][ns]=bag[ev][ns]||{};bag[ev][ns][listener._svgjsListenerId]=l;n.addEventListener(ev,l,options||false)})}function off(node,events,listener,options){const instance=makeInstance(node);const bag=getEvents(instance);const n=getEventTarget(instance);if(typeof listener==="function"){listener=listener._svgjsListenerId;if(!listener)return}events=Array.isArray(events)?events:(events||"").split(delimiter);events.forEach(function(event){const ev=event&&event.split(".")[0];const ns=event&&event.split(".")[1];let namespace,l;if(listener){if(bag[ev]&&bag[ev][ns||"*"]){n.removeEventListener(ev,bag[ev][ns||"*"][listener],options||false);delete bag[ev][ns||"*"][listener]}}else if(ev&&ns){if(bag[ev]&&bag[ev][ns]){for(l in bag[ev][ns]){off(n,[ev,ns].join("."),l)}delete bag[ev][ns]}}else if(ns){for(event in bag){for(namespace in bag[event]){if(ns===namespace){off(n,[event,ns].join("."))}}}}else if(ev){if(bag[ev]){for(namespace in bag[ev]){off(n,[ev,namespace].join("."))}delete bag[ev]}}else{for(event in bag){off(n,event)}clearEvents(instance)}})}function dispatch(node,event,data,options){const n=getEventTarget(node);if(event instanceof globals.window.Event){n.dispatchEvent(event)}else{event=new globals.window.CustomEvent(event,{detail:data,cancelable:true,...options});n.dispatchEvent(event)}return event}class EventTarget extends Base{addEventListener(){}dispatch(event,data,options){return dispatch(this,event,data,options)}dispatchEvent(event){const bag=this.getEventHolder().events;if(!bag)return true;const events=bag[event.type];for(const i in events){for(const j in events[i]){events[i][j](event)}}return!event.defaultPrevented}fire(event,data,options){this.dispatch(event,data,options);return this}getEventHolder(){return this}getEventTarget(){return this}off(event,listener,options){off(this,event,listener,options);return this}on(event,listener,binding,options){on(this,event,listener,binding,options);return this}removeEventListener(){}}register(EventTarget,"EventTarget");function noop(){}const timeline={duration:400,ease:">",delay:0};const attrs={"fill-opacity":1,"stroke-opacity":1,"stroke-width":0,"stroke-linejoin":"miter","stroke-linecap":"butt",fill:"#000000",stroke:"#000000",opacity:1,x:0,y:0,cx:0,cy:0,width:0,height:0,r:0,rx:0,ry:0,offset:0,"stop-opacity":1,"stop-color":"#000000","text-anchor":"start"};var defaults={__proto__:null,noop:noop,timeline:timeline,attrs:attrs};class SVGArray extends Array{constructor(...args){super(...args);this.init(...args)}clone(){return new this.constructor(this)}init(arr){if(typeof arr==="number")return this;this.length=0;this.push(...this.parse(arr));return this}parse(array=[]){if(array instanceof Array)return array;return array.trim().split(delimiter).map(parseFloat)}toArray(){return Array.prototype.concat.apply([],this)}toSet(){return new Set(this)}toString(){return this.join(" ")}valueOf(){const ret=[];ret.push(...this);return ret}}class SVGNumber{constructor(...args){this.init(...args)}convert(unit){return new SVGNumber(this.value,unit)}divide(number){number=new SVGNumber(number);return new SVGNumber(this/number,this.unit||number.unit)}init(value,unit){unit=Array.isArray(value)?value[1]:unit;value=Array.isArray(value)?value[0]:value;this.value=0;this.unit=unit||"";if(typeof value==="number"){this.value=isNaN(value)?0:!isFinite(value)?value<0?-34e37:+34e37:value}else if(typeof value==="string"){unit=value.match(numberAndUnit);if(unit){this.value=parseFloat(unit[1]);if(unit[5]==="%"){this.value/=100}else if(unit[5]==="s"){this.value*=1e3}this.unit=unit[5]}}else{if(value instanceof SVGNumber){this.value=value.valueOf();this.unit=value.unit}}return this}minus(number){number=new SVGNumber(number);return new SVGNumber(this-number,this.unit||number.unit)}plus(number){number=new SVGNumber(number);return new SVGNumber(this+number,this.unit||number.unit)}times(number){number=new SVGNumber(number);return new SVGNumber(this*number,this.unit||number.unit)}toArray(){return[this.value,this.unit]}toJSON(){return this.toString()}toString(){return(this.unit==="%"?~~(this.value*1e8)/1e6:this.unit==="s"?this.value/1e3:this.value)+this.unit}valueOf(){return this.value}}const hooks=[];function registerAttrHook(fn){hooks.push(fn)}function attr(attr,val,ns){if(attr==null){attr={};val=this.node.attributes;for(const node of val){attr[node.nodeName]=isNumber.test(node.nodeValue)?parseFloat(node.nodeValue):node.nodeValue}return attr}else if(attr instanceof Array){return attr.reduce((last,curr)=>{last[curr]=this.attr(curr);return last},{})}else if(typeof attr==="object"&&attr.constructor===Object){for(val in attr)this.attr(val,attr[val])}else if(val===null){this.node.removeAttribute(attr)}else if(val==null){val=this.node.getAttribute(attr);return val==null?attrs[attr]:isNumber.test(val)?parseFloat(val):val}else{val=hooks.reduce((_val,hook)=>{return hook(attr,_val,this)},val);if(typeof val==="number"){val=new SVGNumber(val)}else if(Color.isColor(val)){val=new Color(val)}else if(val.constructor===Array){val=new SVGArray(val)}if(attr==="leading"){if(this.leading){this.leading(val)}}else{typeof ns==="string"?this.node.setAttributeNS(ns,attr,val.toString()):this.node.setAttribute(attr,val.toString())}if(this.rebuild&&(attr==="font-size"||attr==="x")){this.rebuild()}}return this}class Dom extends EventTarget{constructor(node,attrs){super();this.node=node;this.type=node.nodeName;if(attrs&&node!==attrs){this.attr(attrs)}}add(element,i){element=makeInstance(element);if(element.removeNamespace&&this.node instanceof globals.window.SVGElement){element.removeNamespace()}if(i==null){this.node.appendChild(element.node)}else if(element.node!==this.node.childNodes[i]){this.node.insertBefore(element.node,this.node.childNodes[i])}return this}addTo(parent,i){return makeInstance(parent).put(this,i)}children(){return new List(map(this.node.children,function(node){return adopt(node)}))}clear(){while(this.node.hasChildNodes()){this.node.removeChild(this.node.lastChild)}return this}clone(deep=true){this.writeDataToDom();return new this.constructor(assignNewId(this.node.cloneNode(deep)))}each(block,deep){const children=this.children();let i,il;for(i=0,il=children.length;i=0}html(htmlOrFn,outerHTML){return this.xml(htmlOrFn,outerHTML,html)}id(id){if(typeof id==="undefined"&&!this.node.id){this.node.id=eid(this.type)}return this.attr("id",id)}index(element){return[].slice.call(this.node.childNodes).indexOf(element.node)}last(){return adopt(this.node.lastChild)}matches(selector){const el=this.node;const matcher=el.matches||el.matchesSelector||el.msMatchesSelector||el.mozMatchesSelector||el.webkitMatchesSelector||el.oMatchesSelector||null;return matcher&&matcher.call(el,selector)}parent(type){let parent=this;if(!parent.node.parentNode)return null;parent=adopt(parent.node.parentNode);if(!type)return parent;do{if(typeof type==="string"?parent.matches(type):parent instanceof type)return parent}while(parent=adopt(parent.node.parentNode));return parent}put(element,i){element=makeInstance(element);this.add(element,i);return element}putIn(parent,i){return makeInstance(parent).add(this,i)}remove(){if(this.parent()){this.parent().removeElement(this)}return this}removeElement(element){this.node.removeChild(element.node);return this}replace(element){element=makeInstance(element);if(this.node.parentNode){this.node.parentNode.replaceChild(element.node,this.node)}return element}round(precision=2,map=null){const factor=10**precision;const attrs=this.attr(map);for(const i in attrs){if(typeof attrs[i]==="number"){attrs[i]=Math.round(attrs[i]*factor)/factor}}this.attr(attrs);return this}svg(svgOrFn,outerSVG){return this.xml(svgOrFn,outerSVG,svg)}toString(){return this.id()}words(text){this.node.textContent=text;return this}wrap(node){const parent=this.parent();if(!parent){return this.addTo(node)}const position=parent.index(this);return parent.put(node,position).put(this)}writeDataToDom(){this.each(function(){this.writeDataToDom()});return this}xml(xmlOrFn,outerXML,ns){if(typeof xmlOrFn==="boolean"){ns=outerXML;outerXML=xmlOrFn;xmlOrFn=null}if(xmlOrFn==null||typeof xmlOrFn==="function"){outerXML=outerXML==null?true:outerXML;this.writeDataToDom();let current=this;if(xmlOrFn!=null){current=adopt(current.node.cloneNode(true));if(outerXML){const result=xmlOrFn(current);current=result||current;if(result===false)return""}current.each(function(){const result=xmlOrFn(this);const _this=result||this;if(result===false){this.remove()}else if(result&&this!==_this){this.replace(_this)}},true)}return outerXML?current.node.outerHTML:current.node.innerHTML}outerXML=outerXML==null?false:outerXML;const well=create("wrapper",ns);const fragment=globals.document.createDocumentFragment();well.innerHTML=xmlOrFn;for(let len=well.children.length;len--;){fragment.appendChild(well.firstElementChild)}const parent=this.parent();return outerXML?this.replace(fragment)&&parent:this.add(fragment)}}extend(Dom,{attr:attr,find:find,findOne:findOne});register(Dom,"Dom");class Element extends Dom{constructor(node,attrs){super(node,attrs);this.dom={};this.node.instance=this;if(node.hasAttribute("svgjs:data")){this.setData(JSON.parse(node.getAttribute("svgjs:data"))||{})}}center(x,y){return this.cx(x).cy(y)}cx(x){return x==null?this.x()+this.width()/2:this.x(x-this.width()/2)}cy(y){return y==null?this.y()+this.height()/2:this.y(y-this.height()/2)}defs(){const root=this.root();return root&&root.defs()}dmove(x,y){return this.dx(x).dy(y)}dx(x=0){return this.x(new SVGNumber(x).plus(this.x()))}dy(y=0){return this.y(new SVGNumber(y).plus(this.y()))}getEventHolder(){return this}height(height){return this.attr("height",height)}move(x,y){return this.x(x).y(y)}parents(until=this.root()){const isSelector=typeof until==="string";if(!isSelector){until=makeInstance(until)}const parents=new List;let parent=this;while((parent=parent.parent())&&parent.node!==globals.document&&parent.nodeName!=="#document-fragment"){parents.push(parent);if(!isSelector&&parent.node===until.node){break}if(isSelector&&parent.matches(until)){break}if(parent.node===this.root().node){return null}}return parents}reference(attr){attr=this.attr(attr);if(!attr)return null;const m=(attr+"").match(reference);return m?makeInstance(m[1]):null}root(){const p=this.parent(getClass(root));return p&&p.root()}setData(o){this.dom=o;return this}size(width,height){const p=proportionalSize(this,width,height);return this.width(new SVGNumber(p.width)).height(new SVGNumber(p.height))}width(width){return this.attr("width",width)}writeDataToDom(){this.node.removeAttribute("svgjs:data");if(Object.keys(this.dom).length){this.node.setAttribute("svgjs:data",JSON.stringify(this.dom))}return super.writeDataToDom()}x(x){return this.attr("x",x)}y(y){return this.attr("y",y)}}extend(Element,{bbox:bbox,rbox:rbox,inside:inside,point:point,ctm:ctm,screenCTM:screenCTM});register(Element,"Element");const sugar={stroke:["color","width","opacity","linecap","linejoin","miterlimit","dasharray","dashoffset"],fill:["color","opacity","rule"],prefix:function(t,a){return a==="color"?t:t+"-"+a}};["fill","stroke"].forEach(function(m){const extension={};let i;extension[m]=function(o){if(typeof o==="undefined"){return this.attr(m)}if(typeof o==="string"||o instanceof Color||Color.isRgb(o)||o instanceof Element){this.attr(m,o)}else{for(i=sugar[m].length-1;i>=0;i--){if(o[sugar[m][i]]!=null){this.attr(sugar.prefix(m,sugar[m][i]),o[sugar[m][i]])}}}return this};registerMethods(["Element","Runner"],extension)});registerMethods(["Element","Runner"],{matrix:function(mat,b,c,d,e,f){if(mat==null){return new Matrix(this)}return this.attr("transform",new Matrix(mat,b,c,d,e,f))},rotate:function(angle,cx,cy){return this.transform({rotate:angle,ox:cx,oy:cy},true)},skew:function(x,y,cx,cy){return arguments.length===1||arguments.length===3?this.transform({skew:x,ox:y,oy:cx},true):this.transform({skew:[x,y],ox:cx,oy:cy},true)},shear:function(lam,cx,cy){return this.transform({shear:lam,ox:cx,oy:cy},true)},scale:function(x,y,cx,cy){return arguments.length===1||arguments.length===3?this.transform({scale:x,ox:y,oy:cx},true):this.transform({scale:[x,y],ox:cx,oy:cy},true)},translate:function(x,y){return this.transform({translate:[x,y]},true)},relative:function(x,y){return this.transform({relative:[x,y]},true)},flip:function(direction="both",origin="center"){if("xybothtrue".indexOf(direction)===-1){origin=direction;direction="both"}return this.transform({flip:direction,origin:origin},true)},opacity:function(value){return this.attr("opacity",value)}});registerMethods("radius",{radius:function(x,y=x){const type=(this._element||this).type;return type==="radialGradient"?this.attr("r",new SVGNumber(x)):this.rx(x).ry(y)}});registerMethods("Path",{length:function(){return this.node.getTotalLength()},pointAt:function(length){return new Point(this.node.getPointAtLength(length))}});registerMethods(["Element","Runner"],{font:function(a,v){if(typeof a==="object"){for(v in a)this.font(v,a[v]);return this}return a==="leading"?this.leading(v):a==="anchor"?this.attr("text-anchor",v):a==="size"||a==="family"||a==="weight"||a==="stretch"||a==="variant"||a==="style"?this.attr("font-"+a,v):this.attr(a,v)}});const methods=["click","dblclick","mousedown","mouseup","mouseover","mouseout","mousemove","mouseenter","mouseleave","touchstart","touchmove","touchleave","touchend","touchcancel"].reduce(function(last,event){const fn=function(f){if(f===null){this.off(event)}else{this.on(event,f)}return this};last[event]=fn;return last},{});registerMethods("Element",methods);function untransform(){return this.attr("transform",null)}function matrixify(){const matrix=(this.attr("transform")||"").split(transforms).slice(0,-1).map(function(str){const kv=str.trim().split("(");return[kv[0],kv[1].split(delimiter).map(function(str){return parseFloat(str)})]}).reverse().reduce(function(matrix,transform){if(transform[0]==="matrix"){return matrix.lmultiply(Matrix.fromArray(transform[1]))}return matrix[transform[0]].apply(matrix,transform[1])},new Matrix);return matrix}function toParent(parent,i){if(this===parent)return this;const ctm=this.screenCTM();const pCtm=parent.screenCTM().inverse();this.addTo(parent,i).untransform().transform(pCtm.multiply(ctm));return this}function toRoot(i){return this.toParent(this.root(),i)}function transform(o,relative){if(o==null||typeof o==="string"){const decomposed=new Matrix(this).decompose();return o==null?decomposed:decomposed[o]}if(!Matrix.isMatrixLike(o)){o={...o,origin:getOrigin(o,this)}}const cleanRelative=relative===true?this:relative||false;const result=new Matrix(cleanRelative).transform(o);return this.attr("transform",result)}registerMethods("Element",{untransform:untransform,matrixify:matrixify,toParent:toParent,toRoot:toRoot,transform:transform});class Container extends Element{flatten(parent=this,index){this.each(function(){if(this instanceof Container){return this.flatten().ungroup()}});return this}ungroup(parent=this.parent(),index=parent.index(this)){index=index===-1?parent.children().length:index;this.each(function(i,children){return children[children.length-i-1].toParent(parent,index)});return this.remove()}}register(Container,"Container");class Defs extends Container{constructor(node,attrs=node){super(nodeOrNew("defs",node),attrs)}flatten(){return this}ungroup(){return this}}register(Defs,"Defs");class Shape extends Element{}register(Shape,"Shape");function rx(rx){return this.attr("rx",rx)}function ry(ry){return this.attr("ry",ry)}function x$3(x){return x==null?this.cx()-this.rx():this.cx(x+this.rx())}function y$3(y){return y==null?this.cy()-this.ry():this.cy(y+this.ry())}function cx$1(x){return this.attr("cx",x)}function cy$1(y){return this.attr("cy",y)}function width$2(width){return width==null?this.rx()*2:this.rx(new SVGNumber(width).divide(2))}function height$2(height){return height==null?this.ry()*2:this.ry(new SVGNumber(height).divide(2))}var circled={__proto__:null,rx:rx,ry:ry,x:x$3,y:y$3,cx:cx$1,cy:cy$1,width:width$2,height:height$2};class Ellipse extends Shape{constructor(node,attrs=node){super(nodeOrNew("ellipse",node),attrs)}size(width,height){const p=proportionalSize(this,width,height);return this.rx(new SVGNumber(p.width).divide(2)).ry(new SVGNumber(p.height).divide(2))}}extend(Ellipse,circled);registerMethods("Container",{ellipse:wrapWithAttrCheck(function(width=0,height=width){return this.put(new Ellipse).size(width,height).move(0,0)})});register(Ellipse,"Ellipse");class Fragment extends Dom{constructor(node=globals.document.createDocumentFragment()){super(node)}xml(xmlOrFn,outerXML,ns){if(typeof xmlOrFn==="boolean"){ns=outerXML;outerXML=xmlOrFn;xmlOrFn=null}if(xmlOrFn==null||typeof xmlOrFn==="function"){const wrapper=new Dom(create("wrapper",ns));wrapper.add(this.node.cloneNode(true));return wrapper.xml(false,ns)}return super.xml(xmlOrFn,false,ns)}}register(Fragment,"Fragment");function from(x,y){return(this._element||this).type==="radialGradient"?this.attr({fx:new SVGNumber(x),fy:new SVGNumber(y)}):this.attr({x1:new SVGNumber(x),y1:new SVGNumber(y)})}function to(x,y){return(this._element||this).type==="radialGradient"?this.attr({cx:new SVGNumber(x),cy:new SVGNumber(y)}):this.attr({x2:new SVGNumber(x),y2:new SVGNumber(y)})}var gradiented={__proto__:null,from:from,to:to};class Gradient extends Container{constructor(type,attrs){super(nodeOrNew(type+"Gradient",typeof type==="string"?null:type),attrs)}attr(a,b,c){if(a==="transform")a="gradientTransform";return super.attr(a,b,c)}bbox(){return new Box}targets(){return baseFind('svg [fill*="'+this.id()+'"]')}toString(){return this.url()}update(block){this.clear();if(typeof block==="function"){block.call(this,this)}return this}url(){return'url("#'+this.id()+'")'}}extend(Gradient,gradiented);registerMethods({Container:{gradient(...args){return this.defs().gradient(...args)}},Defs:{gradient:wrapWithAttrCheck(function(type,block){return this.put(new Gradient(type)).update(block)})}});register(Gradient,"Gradient");class Pattern extends Container{constructor(node,attrs=node){super(nodeOrNew("pattern",node),attrs)}attr(a,b,c){if(a==="transform")a="patternTransform";return super.attr(a,b,c)}bbox(){return new Box}targets(){return baseFind('svg [fill*="'+this.id()+'"]')}toString(){return this.url()}update(block){this.clear();if(typeof block==="function"){block.call(this,this)}return this}url(){return'url("#'+this.id()+'")'}}registerMethods({Container:{pattern(...args){return this.defs().pattern(...args)}},Defs:{pattern:wrapWithAttrCheck(function(width,height,block){return this.put(new Pattern).update(block).attr({x:0,y:0,width:width,height:height,patternUnits:"userSpaceOnUse"})})}});register(Pattern,"Pattern");class Image extends Shape{constructor(node,attrs=node){super(nodeOrNew("image",node),attrs)}load(url,callback){if(!url)return this;const img=new globals.window.Image;on(img,"load",function(e){const p=this.parent(Pattern);if(this.width()===0&&this.height()===0){this.size(img.width,img.height)}if(p instanceof Pattern){if(p.width()===0&&p.height()===0){p.size(this.width(),this.height())}}if(typeof callback==="function"){callback.call(this,e)}},this);on(img,"load error",function(){off(img)});return this.attr("href",img.src=url,xlink)}}registerAttrHook(function(attr,val,_this){if(attr==="fill"||attr==="stroke"){if(isImage.test(val)){val=_this.root().defs().image(val)}}if(val instanceof Image){val=_this.root().defs().pattern(0,0,pattern=>{pattern.add(val)})}return val});registerMethods({Container:{image:wrapWithAttrCheck(function(source,callback){return this.put(new Image).size(0,0).load(source,callback)})}});register(Image,"Image");class PointArray extends SVGArray{bbox(){let maxX=-Infinity;let maxY=-Infinity;let minX=Infinity;let minY=Infinity;this.forEach(function(el){maxX=Math.max(el[0],maxX);maxY=Math.max(el[1],maxY);minX=Math.min(el[0],minX);minY=Math.min(el[1],minY)});return new Box(minX,minY,maxX-minX,maxY-minY)}move(x,y){const box=this.bbox();x-=box.x;y-=box.y;if(!isNaN(x)&&!isNaN(y)){for(let i=this.length-1;i>=0;i--){this[i]=[this[i][0]+x,this[i][1]+y]}}return this}parse(array=[0,0]){const points=[];if(array instanceof Array){array=Array.prototype.concat.apply([],array)}else{array=array.trim().split(delimiter).map(parseFloat)}if(array.length%2!==0)array.pop();for(let i=0,len=array.length;i=0;i--){if(box.width)this[i][0]=(this[i][0]-box.x)*width/box.width+box.x;if(box.height)this[i][1]=(this[i][1]-box.y)*height/box.height+box.y}return this}toLine(){return{x1:this[0][0],y1:this[0][1],x2:this[1][0],y2:this[1][1]}}toString(){const array=[];for(let i=0,il=this.length;i":function(pos){return-Math.cos(pos*Math.PI)/2+.5},">":function(pos){return Math.sin(pos*Math.PI/2)},"<":function(pos){return-Math.cos(pos*Math.PI/2)+1},bezier:function(x1,y1,x2,y2){return function(t){if(t<0){if(x1>0){return y1/x1*t}else if(x2>0){return y2/x2*t}else{return 0}}else if(t>1){if(x2<1){return(1-y2)/(1-x2)*t+(y2-x2)/(1-x2)}else if(x1<1){return(1-y1)/(1-x1)*t+(y1-x1)/(1-x1)}else{return 1}}else{return 3*t*(1-t)**2*y1+3*t**2*(1-t)*y2+t**3}}},steps:function(steps,stepPosition="end"){stepPosition=stepPosition.split("-").reverse()[0];let jumps=steps;if(stepPosition==="none"){--jumps}else if(stepPosition==="both"){++jumps}return(t,beforeFlag=false)=>{let step=Math.floor(t*steps);const jumping=t*step%1===0;if(stepPosition==="start"||stepPosition==="both"){++step}if(beforeFlag&&jumping){--step}if(t>=0&&step<0){step=0}if(t<=1&&step>jumps){step=jumps}return step/jumps}}};class Stepper{done(){return false}}class Ease extends Stepper{constructor(fn=timeline.ease){super();this.ease=easing[fn]||fn}step(from,to,pos){if(typeof from!=="number"){return pos<1?from:to}return from+(to-from)*this.ease(pos)}}class Controller extends Stepper{constructor(fn){super();this.stepper=fn}done(c){return c.done}step(current,target,dt,c){return this.stepper(current,target,dt,c)}}function recalculate(){const duration=(this._duration||500)/1e3;const overshoot=this._overshoot||0;const eps=1e-10;const pi=Math.PI;const os=Math.log(overshoot/100+eps);const zeta=-os/Math.sqrt(pi*pi+os*os);const wn=3.9/(zeta*duration);this.d=2*zeta*wn;this.k=wn*wn}class Spring extends Controller{constructor(duration=500,overshoot=0){super();this.duration(duration).overshoot(overshoot)}step(current,target,dt,c){if(typeof current==="string")return current;c.done=dt===Infinity;if(dt===Infinity)return target;if(dt===0)return current;if(dt>100)dt=16;dt/=1e3;const velocity=c.velocity||0;const acceleration=-this.d*velocity-this.k*(current-target);const newPosition=current+velocity*dt+acceleration*dt*dt/2;c.velocity=velocity+acceleration*dt;c.done=Math.abs(target-newPosition)+Math.abs(velocity)<.002;return c.done?target:newPosition}}extend(Spring,{duration:makeSetterGetter("_duration",recalculate),overshoot:makeSetterGetter("_overshoot",recalculate)});class PID extends Controller{constructor(p=.1,i=.01,d=0,windup=1e3){super();this.p(p).i(i).d(d).windup(windup)}step(current,target,dt,c){if(typeof current==="string")return current;c.done=dt===Infinity;if(dt===Infinity)return target;if(dt===0)return current;const p=target-current;let i=(c.integral||0)+p*dt;const d=(p-(c.error||0))/dt;const windup=this._windup;if(windup!==false){i=Math.max(-windup,Math.min(i,windup))}c.error=p;c.integral=i;c.done=Math.abs(p)<.001;return c.done?target:current+(this.P*p+this.I*i+this.D*d)}}extend(PID,{windup:makeSetterGetter("_windup"),p:makeSetterGetter("P"),i:makeSetterGetter("I"),d:makeSetterGetter("D")});const segmentParameters={M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7,Z:0};const pathHandlers={M:function(c,p,p0){p.x=p0.x=c[0];p.y=p0.y=c[1];return["M",p.x,p.y]},L:function(c,p){p.x=c[0];p.y=c[1];return["L",c[0],c[1]]},H:function(c,p){p.x=c[0];return["H",c[0]]},V:function(c,p){p.y=c[0];return["V",c[0]]},C:function(c,p){p.x=c[4];p.y=c[5];return["C",c[0],c[1],c[2],c[3],c[4],c[5]]},S:function(c,p){p.x=c[2];p.y=c[3];return["S",c[0],c[1],c[2],c[3]]},Q:function(c,p){p.x=c[2];p.y=c[3];return["Q",c[0],c[1],c[2],c[3]]},T:function(c,p){p.x=c[0];p.y=c[1];return["T",c[0],c[1]]},Z:function(c,p,p0){p.x=p0.x;p.y=p0.y;return["Z"]},A:function(c,p){p.x=c[5];p.y=c[6];return["A",c[0],c[1],c[2],c[3],c[4],c[5],c[6]]}};const mlhvqtcsaz="mlhvqtcsaz".split("");for(let i=0,il=mlhvqtcsaz.length;i=0;i--){l=this[i][0];if(l==="M"||l==="L"||l==="T"){this[i][1]+=x;this[i][2]+=y}else if(l==="H"){this[i][1]+=x}else if(l==="V"){this[i][1]+=y}else if(l==="C"||l==="S"||l==="Q"){this[i][1]+=x;this[i][2]+=y;this[i][3]+=x;this[i][4]+=y;if(l==="C"){this[i][5]+=x;this[i][6]+=y}}else if(l==="A"){this[i][6]+=x;this[i][7]+=y}}}return this}parse(d="M0 0"){if(Array.isArray(d)){d=Array.prototype.concat.apply([],d).toString()}return pathParser(d)}size(width,height){const box=this.bbox();let i,l;box.width=box.width===0?1:box.width;box.height=box.height===0?1:box.height;for(i=this.length-1;i>=0;i--){l=this[i][0];if(l==="M"||l==="L"||l==="T"){this[i][1]=(this[i][1]-box.x)*width/box.width+box.x;this[i][2]=(this[i][2]-box.y)*height/box.height+box.y}else if(l==="H"){this[i][1]=(this[i][1]-box.x)*width/box.width+box.x}else if(l==="V"){this[i][1]=(this[i][1]-box.y)*height/box.height+box.y}else if(l==="C"||l==="S"||l==="Q"){this[i][1]=(this[i][1]-box.x)*width/box.width+box.x;this[i][2]=(this[i][2]-box.y)*height/box.height+box.y;this[i][3]=(this[i][3]-box.x)*width/box.width+box.x;this[i][4]=(this[i][4]-box.y)*height/box.height+box.y;if(l==="C"){this[i][5]=(this[i][5]-box.x)*width/box.width+box.x;this[i][6]=(this[i][6]-box.y)*height/box.height+box.y}}else if(l==="A"){this[i][1]=this[i][1]*width/box.width;this[i][2]=this[i][2]*height/box.height;this[i][6]=(this[i][6]-box.x)*width/box.width+box.x;this[i][7]=(this[i][7]-box.y)*height/box.height+box.y}}return this}toString(){return arrayToString(this)}}const getClassForType=value=>{const type=typeof value;if(type==="number"){return SVGNumber}else if(type==="string"){if(Color.isColor(value)){return Color}else if(delimiter.test(value)){return isPathLetter.test(value)?PathArray:SVGArray}else if(numberAndUnit.test(value)){return SVGNumber}else{return NonMorphable}}else if(morphableTypes.indexOf(value.constructor)>-1){return value.constructor}else if(Array.isArray(value)){return SVGArray}else if(type==="object"){return ObjectBag}else{return NonMorphable}};class Morphable{constructor(stepper){this._stepper=stepper||new Ease("-");this._from=null;this._to=null;this._type=null;this._context=null;this._morphObj=null}at(pos){return this._morphObj.morph(this._from,this._to,pos,this._stepper,this._context)}done(){const complete=this._context.map(this._stepper.done).reduce(function(last,curr){return last&&curr},true);return complete}from(val){if(val==null){return this._from}this._from=this._set(val);return this}stepper(stepper){if(stepper==null)return this._stepper;this._stepper=stepper;return this}to(val){if(val==null){return this._to}this._to=this._set(val);return this}type(type){if(type==null){return this._type}this._type=type;return this}_set(value){if(!this._type){this.type(getClassForType(value))}let result=new this._type(value);if(this._type===Color){result=this._to?result[this._to[4]]():this._from?result[this._from[4]]():result}if(this._type===ObjectBag){result=this._to?result.align(this._to):this._from?result.align(this._from):result}result=result.toConsumable();this._morphObj=this._morphObj||new this._type;this._context=this._context||Array.apply(null,Array(result.length)).map(Object).map(function(o){o.done=true;return o});return result}}class NonMorphable{constructor(...args){this.init(...args)}init(val){val=Array.isArray(val)?val[0]:val;this.value=val;return this}toArray(){return[this.value]}valueOf(){return this.value}}class TransformBag{constructor(...args){this.init(...args)}init(obj){if(Array.isArray(obj)){obj={scaleX:obj[0],scaleY:obj[1],shear:obj[2],rotate:obj[3],translateX:obj[4],translateY:obj[5],originX:obj[6],originY:obj[7]}}Object.assign(this,TransformBag.defaults,obj);return this}toArray(){const v=this;return[v.scaleX,v.scaleY,v.shear,v.rotate,v.translateX,v.translateY,v.originX,v.originY]}}TransformBag.defaults={scaleX:1,scaleY:1,shear:0,rotate:0,translateX:0,translateY:0,originX:0,originY:0};const sortByKey=(a,b)=>{return a[0]b[0]?1:0};class ObjectBag{constructor(...args){this.init(...args)}align(other){const values=this.values;for(let i=0,il=values.length;ilast.concat(curr),[]);return this}toArray(){return this.values}valueOf(){const obj={};const arr=this.values;while(arr.length){const key=arr.shift();const Type=arr.shift();const num=arr.shift();const values=arr.splice(0,num);obj[key]=new Type(values)}return obj}}const morphableTypes=[NonMorphable,TransformBag,ObjectBag];function registerMorphableType(type=[]){morphableTypes.push(...[].concat(type))}function makeMorphable(){extend(morphableTypes,{to(val){return(new Morphable).type(this.constructor).from(this.toArray()).to(val)},fromArray(arr){this.init(arr);return this},toConsumable(){return this.toArray()},morph(from,to,pos,stepper,context){const mapper=function(i,index){return stepper.step(i,to[index],pos,context[index],context)};return this.fromArray(from.map(mapper))}})}class Path extends Shape{constructor(node,attrs=node){super(nodeOrNew("path",node),attrs)}array(){return this._array||(this._array=new PathArray(this.attr("d")))}clear(){delete this._array;return this}height(height){return height==null?this.bbox().height:this.size(this.bbox().width,height)}move(x,y){return this.attr("d",this.array().move(x,y))}plot(d){return d==null?this.array():this.clear().attr("d",typeof d==="string"?d:this._array=new PathArray(d))}size(width,height){const p=proportionalSize(this,width,height);return this.attr("d",this.array().size(p.width,p.height))}width(width){return width==null?this.bbox().width:this.size(width,this.bbox().height)}x(x){return x==null?this.bbox().x:this.move(x,this.bbox().y)}y(y){return y==null?this.bbox().y:this.move(this.bbox().x,y)}}Path.prototype.MorphArray=PathArray;registerMethods({Container:{path:wrapWithAttrCheck(function(d){return this.put(new Path).plot(d||new PathArray)})}});register(Path,"Path");function array(){return this._array||(this._array=new PointArray(this.attr("points")))}function clear(){delete this._array;return this}function move$2(x,y){return this.attr("points",this.array().move(x,y))}function plot(p){return p==null?this.array():this.clear().attr("points",typeof p==="string"?p:this._array=new PointArray(p))}function size$1(width,height){const p=proportionalSize(this,width,height);return this.attr("points",this.array().size(p.width,p.height))}var poly={__proto__:null,array:array,clear:clear,move:move$2,plot:plot,size:size$1};class Polygon extends Shape{constructor(node,attrs=node){super(nodeOrNew("polygon",node),attrs)}}registerMethods({Container:{polygon:wrapWithAttrCheck(function(p){return this.put(new Polygon).plot(p||new PointArray)})}});extend(Polygon,pointed);extend(Polygon,poly);register(Polygon,"Polygon");class Polyline extends Shape{constructor(node,attrs=node){super(nodeOrNew("polyline",node),attrs)}}registerMethods({Container:{polyline:wrapWithAttrCheck(function(p){return this.put(new Polyline).plot(p||new PointArray)})}});extend(Polyline,pointed);extend(Polyline,poly);register(Polyline,"Polyline");class Rect extends Shape{constructor(node,attrs=node){super(nodeOrNew("rect",node),attrs)}}extend(Rect,{rx:rx,ry:ry});registerMethods({Container:{rect:wrapWithAttrCheck(function(width,height){return this.put(new Rect).size(width,height)})}});register(Rect,"Rect");class Queue{constructor(){this._first=null;this._last=null}first(){return this._first&&this._first.value}last(){return this._last&&this._last.value}push(value){const item=typeof value.next!=="undefined"?value:{value:value,next:null,prev:null};if(this._last){item.prev=this._last;this._last.next=item;this._last=item}else{this._last=item;this._first=item}return item}remove(item){if(item.prev)item.prev.next=item.next;if(item.next)item.next.prev=item.prev;if(item===this._last)this._last=item.prev;if(item===this._first)this._first=item.next;item.prev=null;item.next=null}shift(){const remove=this._first;if(!remove)return null;this._first=remove.next;if(this._first)this._first.prev=null;this._last=this._first?this._last:null;return remove.value}}const Animator={nextDraw:null,frames:new Queue,timeouts:new Queue,immediates:new Queue,timer:()=>globals.window.performance||globals.window.Date,transforms:[],frame(fn){const node=Animator.frames.push({run:fn});if(Animator.nextDraw===null){Animator.nextDraw=globals.window.requestAnimationFrame(Animator._draw)}return node},timeout(fn,delay){delay=delay||0;const time=Animator.timer().now()+delay;const node=Animator.timeouts.push({run:fn,time:time});if(Animator.nextDraw===null){Animator.nextDraw=globals.window.requestAnimationFrame(Animator._draw)}return node},immediate(fn){const node=Animator.immediates.push(fn);if(Animator.nextDraw===null){Animator.nextDraw=globals.window.requestAnimationFrame(Animator._draw)}return node},cancelFrame(node){node!=null&&Animator.frames.remove(node)},clearTimeout(node){node!=null&&Animator.timeouts.remove(node)},cancelImmediate(node){node!=null&&Animator.immediates.remove(node)},_draw(now){let nextTimeout=null;const lastTimeout=Animator.timeouts.last();while(nextTimeout=Animator.timeouts.shift()){if(now>=nextTimeout.time){nextTimeout.run()}else{Animator.timeouts.push(nextTimeout)}if(nextTimeout===lastTimeout)break}let nextFrame=null;const lastFrame=Animator.frames.last();while(nextFrame!==lastFrame&&(nextFrame=Animator.frames.shift())){nextFrame.run(now)}let nextImmediate=null;while(nextImmediate=Animator.immediates.shift()){nextImmediate()}Animator.nextDraw=Animator.timeouts.first()||Animator.frames.first()?globals.window.requestAnimationFrame(Animator._draw):null}};const makeSchedule=function(runnerInfo){const start=runnerInfo.start;const duration=runnerInfo.runner.duration();const end=start+duration;return{start:start,duration:duration,end:end,runner:runnerInfo.runner}};const defaultSource=function(){const w=globals.window;return(w.performance||w.Date).now()};class Timeline extends EventTarget{constructor(timeSource=defaultSource){super();this._timeSource=timeSource;this._startTime=0;this._speed=1;this._persist=0;this._nextFrame=null;this._paused=true;this._runners=[];this._runnerIds=[];this._lastRunnerId=-1;this._time=0;this._lastSourceTime=0;this._lastStepTime=0;this._step=this._stepFn.bind(this,false);this._stepImmediate=this._stepFn.bind(this,true)}active(){return!!this._nextFrame}finish(){this.time(this.getEndTimeOfTimeline()+1);return this.pause()}getEndTime(){const lastRunnerInfo=this.getLastRunnerInfo();const lastDuration=lastRunnerInfo?lastRunnerInfo.runner.duration():0;const lastStartTime=lastRunnerInfo?lastRunnerInfo.start:this._time;return lastStartTime+lastDuration}getEndTimeOfTimeline(){const endTimes=this._runners.map(i=>i.start+i.runner.duration());return Math.max(0,...endTimes)}getLastRunnerInfo(){return this.getRunnerInfoById(this._lastRunnerId)}getRunnerInfoById(id){return this._runners[this._runnerIds.indexOf(id)]||null}pause(){this._paused=true;return this._continue()}persist(dtOrForever){if(dtOrForever==null)return this._persist;this._persist=dtOrForever;return this}play(){this._paused=false;return this.updateTime()._continue()}reverse(yes){const currentSpeed=this.speed();if(yes==null)return this.speed(-currentSpeed);const positive=Math.abs(currentSpeed);return this.speed(yes?-positive:positive)}schedule(runner,delay,when){if(runner==null){return this._runners.map(makeSchedule)}let absoluteStartTime=0;const endTime=this.getEndTime();delay=delay||0;if(when==null||when==="last"||when==="after"){absoluteStartTime=endTime}else if(when==="absolute"||when==="start"){absoluteStartTime=delay;delay=0}else if(when==="now"){absoluteStartTime=this._time}else if(when==="relative"){const runnerInfo=this.getRunnerInfoById(runner.id);if(runnerInfo){absoluteStartTime=runnerInfo.start+delay;delay=0}}else if(when==="with-last"){const lastRunnerInfo=this.getLastRunnerInfo();const lastStartTime=lastRunnerInfo?lastRunnerInfo.start:this._time;absoluteStartTime=lastStartTime}else{throw new Error('Invalid value for the "when" parameter')}runner.unschedule();runner.timeline(this);const persist=runner.persist();const runnerInfo={persist:persist===null?this._persist:persist,start:absoluteStartTime+delay,runner:runner};this._lastRunnerId=runner.id;this._runners.push(runnerInfo);this._runners.sort((a,b)=>a.start-b.start);this._runnerIds=this._runners.map(info=>info.runner.id);this.updateTime()._continue();return this}seek(dt){return this.time(this._time+dt)}source(fn){if(fn==null)return this._timeSource;this._timeSource=fn;return this}speed(speed){if(speed==null)return this._speed;this._speed=speed;return this}stop(){this.time(0);return this.pause()}time(time){if(time==null)return this._time;this._time=time;return this._continue(true)}unschedule(runner){const index=this._runnerIds.indexOf(runner.id);if(index<0)return this;this._runners.splice(index,1);this._runnerIds.splice(index,1);runner.timeline(null);return this}updateTime(){if(!this.active()){this._lastSourceTime=this._timeSource()}return this}_continue(immediateStep=false){Animator.cancelFrame(this._nextFrame);this._nextFrame=null;if(immediateStep)return this._stepImmediate();if(this._paused)return this;this._nextFrame=Animator.frame(this._step);return this}_stepFn(immediateStep=false){const time=this._timeSource();let dtSource=time-this._lastSourceTime;if(immediateStep)dtSource=0;const dtTime=this._speed*dtSource+(this._time-this._lastStepTime);this._lastSourceTime=time;if(!immediateStep){this._time+=dtTime;this._time=this._time<0?0:this._time}this._lastStepTime=this._time;this.fire("time",this._time);for(let k=this._runners.length;k--;){const runnerInfo=this._runners[k];const runner=runnerInfo.runner;const dtToStart=this._time-runnerInfo.start;if(dtToStart<=0){runner.reset()}}let runnersLeft=false;for(let i=0,len=this._runners.length;i0){this._continue()}else{this.pause();this.fire("finished")}return this}}registerMethods({Element:{timeline:function(timeline){if(timeline==null){this._timeline=this._timeline||new Timeline;return this._timeline}else{this._timeline=timeline;return this}}}});class Runner extends EventTarget{constructor(options){super();this.id=Runner.id++;options=options==null?timeline.duration:options;options=typeof options==="function"?new Controller(options):options;this._element=null;this._timeline=null;this.done=false;this._queue=[];this._duration=typeof options==="number"&&options;this._isDeclarative=options instanceof Controller;this._stepper=this._isDeclarative?options:new Ease;this._history={};this.enabled=true;this._time=0;this._lastTime=0;this._reseted=true;this.transforms=new Matrix;this.transformId=1;this._haveReversed=false;this._reverse=false;this._loopsDone=0;this._swing=false;this._wait=0;this._times=1;this._frameId=null;this._persist=this._isDeclarative?true:null}static sanitise(duration,delay,when){let times=1;let swing=false;let wait=0;duration=duration||timeline.duration;delay=delay||timeline.delay;when=when||"last";if(typeof duration==="object"&&!(duration instanceof Stepper)){delay=duration.delay||delay;when=duration.when||when;swing=duration.swing||swing;times=duration.times||times;wait=duration.wait||wait;duration=duration.duration||timeline.duration}return{duration:duration,delay:delay,swing:swing,times:times,wait:wait,when:when}}active(enabled){if(enabled==null)return this.enabled;this.enabled=enabled;return this}addTransform(transform,index){this.transforms.lmultiplyO(transform);return this}after(fn){return this.on("finished",fn)}animate(duration,delay,when){const o=Runner.sanitise(duration,delay,when);const runner=new Runner(o.duration);if(this._timeline)runner.timeline(this._timeline);if(this._element)runner.element(this._element);return runner.loop(o).schedule(o.delay,o.when)}clearTransform(){this.transforms=new Matrix;return this}clearTransformsFromQueue(){if(!this.done||!this._timeline||!this._timeline._runnerIds.includes(this.id)){this._queue=this._queue.filter(item=>{return!item.isTransform})}}delay(delay){return this.animate(0,delay)}duration(){return this._times*(this._wait+this._duration)-this._wait}during(fn){return this.queue(null,fn)}ease(fn){this._stepper=new Ease(fn);return this}element(element){if(element==null)return this._element;this._element=element;element._prepareRunner();return this}finish(){return this.step(Infinity)}loop(times,swing,wait){if(typeof times==="object"){swing=times.swing;wait=times.wait;times=times.times}this._times=times||Infinity;this._swing=swing||false;this._wait=wait||0;if(this._times===true){this._times=Infinity}return this}loops(p){const loopDuration=this._duration+this._wait;if(p==null){const loopsDone=Math.floor(this._time/loopDuration);const relativeTime=this._time-loopsDone*loopDuration;const position=relativeTime/this._duration;return Math.min(loopsDone+position,this._times)}const whole=Math.floor(p);const partial=p%1;const time=loopDuration*whole+this._duration*partial;return this.time(time)}persist(dtOrForever){if(dtOrForever==null)return this._persist;this._persist=dtOrForever;return this}position(p){const x=this._time;const d=this._duration;const w=this._wait;const t=this._times;const s=this._swing;const r=this._reverse;let position;if(p==null){const f=function(x){const swinging=s*Math.floor(x%(2*(w+d))/(w+d));const backwards=swinging&&!r||!swinging&&r;const uncliped=Math.pow(-1,backwards)*(x%(w+d))/d+backwards;const clipped=Math.max(Math.min(uncliped,1),0);return clipped};const endTime=t*(w+d)-w;position=x<=0?Math.round(f(1e-5)):x=0;this._lastPosition=position;const duration=this.duration();const justStarted=this._lastTime<=0&&this._time>0;const justFinished=this._lastTime=duration;this._lastTime=this._time;if(justStarted){this.fire("start",this)}const declarative=this._isDeclarative;this.done=!declarative&&!justFinished&&this._time>=duration;this._reseted=false;let converged=false;if(running||declarative){this._initialise(running);this.transforms=new Matrix;converged=this._run(declarative?dt:position);this.fire("step",this)}this.done=this.done||converged&&declarative;if(justFinished){this.fire("finished",this)}return this}time(time){if(time==null){return this._time}const dt=time-this._time;this.step(dt);return this}timeline(timeline){if(typeof timeline==="undefined")return this._timeline;this._timeline=timeline;return this}unschedule(){const timeline=this.timeline();timeline&&timeline.unschedule(this);return this}_initialise(running){if(!running&&!this._isDeclarative)return;for(let i=0,len=this._queue.length;ilast.lmultiplyO(curr);const getRunnerTransform=runner=>runner.transforms;function mergeTransforms(){const runners=this._transformationRunners.runners;const netTransform=runners.map(getRunnerTransform).reduce(lmultiply,new Matrix);this.transform(netTransform);this._transformationRunners.merge();if(this._transformationRunners.length()===1){this._frameId=null}}class RunnerArray{constructor(){this.runners=[];this.ids=[]}add(runner){if(this.runners.includes(runner))return;const id=runner.id+1;this.runners.push(runner);this.ids.push(id);return this}clearBefore(id){const deleteCnt=this.ids.indexOf(id+1)||1;this.ids.splice(0,deleteCnt,0);this.runners.splice(0,deleteCnt,new FakeRunner).forEach(r=>r.clearTransformsFromQueue());return this}edit(id,newRunner){const index=this.ids.indexOf(id+1);this.ids.splice(index,1,id+1);this.runners.splice(index,1,newRunner);return this}getByID(id){return this.runners[this.ids.indexOf(id+1)]}length(){return this.ids.length}merge(){let lastRunner=null;for(let i=0;irunner.id<=current.id).map(getRunnerTransform).reduce(lmultiply,new Matrix)},_addRunner(runner){this._transformationRunners.add(runner);Animator.cancelImmediate(this._frameId);this._frameId=Animator.immediate(mergeTransforms.bind(this))},_prepareRunner(){if(this._frameId==null){this._transformationRunners=(new RunnerArray).add(new FakeRunner(new Matrix(this)))}}}});const difference=(a,b)=>a.filter(x=>!b.includes(x));extend(Runner,{attr(a,v){return this.styleAttr("attr",a,v)},css(s,v){return this.styleAttr("css",s,v)},styleAttr(type,nameOrAttrs,val){if(typeof nameOrAttrs==="string"){return this.styleAttr(type,{[nameOrAttrs]:val})}let attrs=nameOrAttrs;if(this._tryRetarget(type,attrs))return this;let morpher=new Morphable(this._stepper).to(attrs);let keys=Object.keys(attrs);this.queue(function(){morpher=morpher.from(this.element()[type](keys))},function(pos){this.element()[type](morpher.at(pos).valueOf());return morpher.done()},function(newToAttrs){const newKeys=Object.keys(newToAttrs);const differences=difference(newKeys,keys);if(differences.length){const addedFromAttrs=this.element()[type](differences);const oldFromAttrs=new ObjectBag(morpher.from()).valueOf();Object.assign(oldFromAttrs,addedFromAttrs);morpher.from(oldFromAttrs)}const oldToAttrs=new ObjectBag(morpher.to()).valueOf();Object.assign(oldToAttrs,newToAttrs);morpher.to(oldToAttrs);keys=newKeys;attrs=newToAttrs});this._rememberMorpher(type,morpher);return this},zoom(level,point){if(this._tryRetarget("zoom",level,point))return this;let morpher=new Morphable(this._stepper).to(new SVGNumber(level));this.queue(function(){morpher=morpher.from(this.element().zoom())},function(pos){this.element().zoom(morpher.at(pos),point);return morpher.done()},function(newLevel,newPoint){point=newPoint;morpher.to(newLevel)});this._rememberMorpher("zoom",morpher);return this},transform(transforms,relative,affine){relative=transforms.relative||relative;if(this._isDeclarative&&!relative&&this._tryRetarget("transform",transforms)){return this}const isMatrix=Matrix.isMatrixLike(transforms);affine=transforms.affine!=null?transforms.affine:affine!=null?affine:!isMatrix;const morpher=new Morphable(this._stepper).type(affine?TransformBag:Matrix);let origin;let element;let current;let currentAngle;let startTransform;function setup(){element=element||this.element();origin=origin||getOrigin(transforms,element);startTransform=new Matrix(relative?undefined:element);element._addRunner(this);if(!relative){element._clearTransformRunnersBefore(this)}}function run(pos){if(!relative)this.clearTransform();const{x,y}=new Point(origin).transform(element._currentTransform(this));let target=new Matrix({...transforms,origin:[x,y]});let start=this._isDeclarative&¤t?current:startTransform;if(affine){target=target.decompose(x,y);start=start.decompose(x,y);const rTarget=target.rotate;const rCurrent=start.rotate;const possibilities=[rTarget-360,rTarget,rTarget+360];const distances=possibilities.map(a=>Math.abs(a-rCurrent));const shortest=Math.min(...distances);const index=distances.indexOf(shortest);target.rotate=possibilities[index]}if(relative){if(!isMatrix){target.rotate=transforms.rotate||0}if(this._isDeclarative&¤tAngle){start.rotate=currentAngle}}morpher.from(start);morpher.to(target);const affineParameters=morpher.at(pos);currentAngle=affineParameters.rotate;current=new Matrix(affineParameters);this.addTransform(current);element._addRunner(this);return morpher.done()}function retarget(newTransforms){if((newTransforms.origin||"center").toString()!==(transforms.origin||"center").toString()){origin=getOrigin(newTransforms,element)}transforms={...newTransforms,origin:origin}}this.queue(setup,run,retarget,true);this._isDeclarative&&this._rememberMorpher("transform",morpher);return this},x(x,relative){return this._queueNumber("x",x)},y(y){return this._queueNumber("y",y)},dx(x=0){return this._queueNumberDelta("x",x)},dy(y=0){return this._queueNumberDelta("y",y)},dmove(x,y){return this.dx(x).dy(y)},_queueNumberDelta(method,to){to=new SVGNumber(to);if(this._tryRetarget(method,to))return this;const morpher=new Morphable(this._stepper).to(to);let from=null;this.queue(function(){from=this.element()[method]();morpher.from(from);morpher.to(from+to)},function(pos){this.element()[method](morpher.at(pos));return morpher.done()},function(newTo){morpher.to(from+new SVGNumber(newTo))});this._rememberMorpher(method,morpher);return this},_queueObject(method,to){if(this._tryRetarget(method,to))return this;const morpher=new Morphable(this._stepper).to(to);this.queue(function(){morpher.from(this.element()[method]())},function(pos){this.element()[method](morpher.at(pos));return morpher.done()});this._rememberMorpher(method,morpher);return this},_queueNumber(method,value){return this._queueObject(method,new SVGNumber(value))},cx(x){return this._queueNumber("cx",x)},cy(y){return this._queueNumber("cy",y)},move(x,y){return this.x(x).y(y)},center(x,y){return this.cx(x).cy(y)},size(width,height){let box;if(!width||!height){box=this._element.bbox()}if(!width){width=box.width/box.height*height}if(!height){height=box.height/box.width*width}return this.width(width).height(height)},width(width){return this._queueNumber("width",width)},height(height){return this._queueNumber("height",height)},plot(a,b,c,d){if(arguments.length===4){return this.plot([a,b,c,d])}if(this._tryRetarget("plot",a))return this;const morpher=new Morphable(this._stepper).type(this._element.MorphArray).to(a);this.queue(function(){morpher.from(this._element.array())},function(pos){this._element.plot(morpher.at(pos));return morpher.done()});this._rememberMorpher("plot",morpher);return this},leading(value){return this._queueNumber("leading",value)},viewbox(x,y,width,height){return this._queueObject("viewbox",new Box(x,y,width,height))},update(o){if(typeof o!=="object"){return this.update({offset:arguments[0],color:arguments[1],opacity:arguments[2]})}if(o.opacity!=null)this.attr("stop-opacity",o.opacity);if(o.color!=null)this.attr("stop-color",o.color);if(o.offset!=null)this.attr("offset",o.offset);return this}});extend(Runner,{rx:rx,ry:ry,from:from,to:to});register(Runner,"Runner");class Svg extends Container{constructor(node,attrs=node){super(nodeOrNew("svg",node),attrs);this.namespace()}defs(){if(!this.isRoot())return this.root().defs();return adopt(this.node.querySelector("defs"))||this.put(new Defs)}isRoot(){return!this.node.parentNode||!(this.node.parentNode instanceof globals.window.SVGElement)&&this.node.parentNode.nodeName!=="#document-fragment"}namespace(){if(!this.isRoot())return this.root().namespace();return this.attr({xmlns:svg,version:"1.1"}).attr("xmlns:xlink",xlink,xmlns).attr("xmlns:svgjs",svgjs,xmlns)}removeNamespace(){return this.attr({xmlns:null,version:null}).attr("xmlns:xlink",null,xmlns).attr("xmlns:svgjs",null,xmlns)}root(){if(this.isRoot())return this;return super.root()}}registerMethods({Container:{nested:wrapWithAttrCheck(function(){return this.put(new Svg)})}});register(Svg,"Svg",true);class Symbol extends Container{constructor(node,attrs=node){super(nodeOrNew("symbol",node),attrs)}}registerMethods({Container:{symbol:wrapWithAttrCheck(function(){return this.put(new Symbol)})}});register(Symbol,"Symbol");function plain(text){if(this._build===false){this.clear()}this.node.appendChild(globals.document.createTextNode(text));return this}function length(){return this.node.getComputedTextLength()}function x$1(x,box=this.bbox()){if(x==null){return box.x}return this.attr("x",this.attr("x")+x-box.x)}function y$1(y,box=this.bbox()){if(y==null){return box.y}return this.attr("y",this.attr("y")+y-box.y)}function move$1(x,y,box=this.bbox()){return this.x(x,box).y(y,box)}function cx(x,box=this.bbox()){if(x==null){return box.cx}return this.attr("x",this.attr("x")+x-box.cx)}function cy(y,box=this.bbox()){if(y==null){return box.cy}return this.attr("y",this.attr("y")+y-box.cy)}function center(x,y,box=this.bbox()){return this.cx(x,box).cy(y,box)}function ax(x){return this.attr("x",x)}function ay(y){return this.attr("y",y)}function amove(x,y){return this.ax(x).ay(y)}function build(build){this._build=!!build;return this}var textable={__proto__:null,plain:plain,length:length,x:x$1,y:y$1,move:move$1,cx:cx,cy:cy,center:center,ax:ax,ay:ay,amove:amove,build:build};class Text extends Shape{constructor(node,attrs=node){super(nodeOrNew("text",node),attrs);this.dom.leading=new SVGNumber(1.3);this._rebuild=true;this._build=false}leading(value){if(value==null){return this.dom.leading}this.dom.leading=new SVGNumber(value);return this.rebuild()}rebuild(rebuild){if(typeof rebuild==="boolean"){this._rebuild=rebuild}if(this._rebuild){const self=this;let blankLineOffset=0;const leading=this.dom.leading;this.each(function(i){const fontSize=globals.window.getComputedStyle(this.node).getPropertyValue("font-size");const dy=leading*new SVGNumber(fontSize);if(this.dom.newLined){this.attr("x",self.attr("x"));if(this.text()==="\n"){blankLineOffset+=dy}else{this.attr("dy",i?dy+blankLineOffset:0);blankLineOffset=0}}});this.fire("rebuild")}return this}setData(o){this.dom=o;this.dom.leading=new SVGNumber(o.leading||1.3);return this}text(text){if(text===undefined){const children=this.node.childNodes;let firstLine=0;text="";for(let i=0,len=children.length;i{let bbox;try{bbox=child.bbox()}catch(e){return}const m=new Matrix(child);const matrix=m.translate(dx,dy).transform(m.inverse());const p=new Point(bbox.x,bbox.y).transform(matrix);child.move(p.x,p.y)});return this}function dx(dx){return this.dmove(dx,0)}function dy(dy){return this.dmove(0,dy)}function height(height,box=this.bbox()){if(height==null)return box.height;return this.size(box.width,height,box)}function move(x=0,y=0,box=this.bbox()){const dx=x-box.x;const dy=y-box.y;return this.dmove(dx,dy)}function size(width,height,box=this.bbox()){const p=proportionalSize(this,width,height,box);const scaleX=p.width/box.width;const scaleY=p.height/box.height;this.children().forEach((child,i)=>{const o=new Point(box).transform(new Matrix(child).inverse());child.scale(scaleX,scaleY,o.x,o.y)});return this}function width(width,box=this.bbox()){if(width==null)return box.width;return this.size(width,box.height,box)}function x(x,box=this.bbox()){if(x==null)return box.x;return this.move(x,box.y,box)}function y(y,box=this.bbox()){if(y==null)return box.y;return this.move(box.x,y,box)}var containerGeometry={__proto__:null,dmove:dmove,dx:dx,dy:dy,height:height,move:move,size:size,width:width,x:x,y:y};class G extends Container{constructor(node,attrs=node){super(nodeOrNew("g",node),attrs)}}extend(G,containerGeometry);registerMethods({Container:{group:wrapWithAttrCheck(function(){return this.put(new G)})}});register(G,"G");class A extends Container{constructor(node,attrs=node){super(nodeOrNew("a",node),attrs)}target(target){return this.attr("target",target)}to(url){return this.attr("href",url,xlink)}}extend(A,containerGeometry);registerMethods({Container:{link:wrapWithAttrCheck(function(url){return this.put(new A).to(url)})},Element:{unlink(){const link=this.linker();if(!link)return this;const parent=link.parent();if(!parent){return this.remove()}const index=parent.index(link);parent.add(this,index);link.remove();return this},linkTo(url){let link=this.linker();if(!link){link=new A;this.wrap(link)}if(typeof url==="function"){url.call(link,link)}else{link.to(url)}return this},linker(){const link=this.parent();if(link&&link.node.nodeName.toLowerCase()==="a"){return link}return null}}});register(A,"A");class Mask extends Container{constructor(node,attrs=node){super(nodeOrNew("mask",node),attrs)}remove(){this.targets().forEach(function(el){el.unmask()});return super.remove()}targets(){return baseFind('svg [mask*="'+this.id()+'"]')}}registerMethods({Container:{mask:wrapWithAttrCheck(function(){return this.defs().put(new Mask)})},Element:{masker(){return this.reference("mask")},maskWith(element){const masker=element instanceof Mask?element:this.parent().mask().add(element);return this.attr("mask",'url("#'+masker.id()+'")')},unmask(){return this.attr("mask",null)}}});register(Mask,"Mask");class Stop extends Element{constructor(node,attrs=node){super(nodeOrNew("stop",node),attrs)}update(o){if(typeof o==="number"||o instanceof SVGNumber){o={offset:arguments[0],color:arguments[1],opacity:arguments[2]}}if(o.opacity!=null)this.attr("stop-opacity",o.opacity);if(o.color!=null)this.attr("stop-color",o.color);if(o.offset!=null)this.attr("offset",new SVGNumber(o.offset));return this}}registerMethods({Gradient:{stop:function(offset,color,opacity){return this.put(new Stop).update(offset,color,opacity)}}});register(Stop,"Stop");function cssRule(selector,rule){if(!selector)return"";if(!rule)return selector;let ret=selector+"{";for(const i in rule){ret+=unCamelCase(i)+":"+rule[i]+";"}ret+="}";return ret}class Style extends Element{constructor(node,attrs=node){super(nodeOrNew("style",node),attrs)}addText(w=""){this.node.textContent+=w;return this}font(name,src,params={}){return this.rule("@font-face",{fontFamily:name,src:src,...params})}rule(selector,obj){return this.addText(cssRule(selector,obj))}}registerMethods("Dom",{style(selector,obj){return this.put(new Style).rule(selector,obj)},fontface(name,src,params){return this.put(new Style).font(name,src,params)}});register(Style,"Style");class TextPath extends Text{constructor(node,attrs=node){super(nodeOrNew("textPath",node),attrs)}array(){const track=this.track();return track?track.array():null}plot(d){const track=this.track();let pathArray=null;if(track){pathArray=track.plot(d)}return d==null?pathArray:this}track(){return this.reference("href")}}registerMethods({Container:{textPath:wrapWithAttrCheck(function(text,path){if(!(text instanceof Text)){text=this.text(text)}return text.path(path)})},Text:{path:wrapWithAttrCheck(function(track,importNodes=true){const textPath=new TextPath;if(!(track instanceof Path)){track=this.defs().path(track)}textPath.attr("href","#"+track,xlink);let node;if(importNodes){while(node=this.node.firstChild){textPath.node.appendChild(node)}}return this.put(textPath)}),textPath(){return this.findOne("textPath")}},Path:{text:wrapWithAttrCheck(function(text){if(!(text instanceof Text)){text=(new Text).addTo(this.parent()).text(text)}return text.path(this)}),targets(){return baseFind("svg textPath").filter(node=>{return(node.attr("href")||"").includes(this.id())})}}});TextPath.prototype.MorphArray=PathArray;register(TextPath,"TextPath");class Use extends Shape{constructor(node,attrs=node){super(nodeOrNew("use",node),attrs)}use(element,file){return this.attr("href",(file||"")+"#"+element,xlink)}}registerMethods({Container:{use:wrapWithAttrCheck(function(element,file){return this.put(new Use).use(element,file)})}});register(Use,"Use");const SVG$1=makeInstance;extend([Svg,Symbol,Image,Pattern,Marker],getMethodsFor("viewbox"));extend([Line,Polyline,Polygon,Path],getMethodsFor("marker"));extend(Text,getMethodsFor("Text"));extend(Path,getMethodsFor("Path"));extend(Defs,getMethodsFor("Defs"));extend([Text,Tspan],getMethodsFor("Tspan"));extend([Rect,Ellipse,Gradient,Runner],getMethodsFor("radius"));extend(EventTarget,getMethodsFor("EventTarget"));extend(Dom,getMethodsFor("Dom"));extend(Element,getMethodsFor("Element"));extend(Shape,getMethodsFor("Shape"));extend([Container,Fragment],getMethodsFor("Container"));extend(Gradient,getMethodsFor("Gradient"));extend(Runner,getMethodsFor("Runner"));List.extend(getMethodNames());registerMorphableType([SVGNumber,Color,Box,Matrix,SVGArray,PointArray,PathArray,Point]);makeMorphable();var svgMembers={__proto__:null,Morphable:Morphable,registerMorphableType:registerMorphableType,makeMorphable:makeMorphable,TransformBag:TransformBag,ObjectBag:ObjectBag,NonMorphable:NonMorphable,defaults:defaults,utils:utils,namespaces:namespaces,regex:regex,SVG:SVG$1,parser:parser,find:baseFind,getWindow:getWindow,registerWindow:registerWindow,restoreWindow:restoreWindow,saveWindow:saveWindow,withWindow:withWindow,Animator:Animator,Controller:Controller,Ease:Ease,PID:PID,Spring:Spring,easing:easing,Queue:Queue,Runner:Runner,Timeline:Timeline,Array:SVGArray,Box:Box,Color:Color,EventTarget:EventTarget,Matrix:Matrix,Number:SVGNumber,PathArray:PathArray,Point:Point,PointArray:PointArray,List:List,Circle:Circle,ClipPath:ClipPath,Container:Container,Defs:Defs,Dom:Dom,Element:Element,Ellipse:Ellipse,ForeignObject:ForeignObject,Fragment:Fragment,Gradient:Gradient,G:G,A:A,Image:Image,Line:Line,Marker:Marker,Mask:Mask,Path:Path,Pattern:Pattern,Polygon:Polygon,Polyline:Polyline,Rect:Rect,Shape:Shape,Stop:Stop,Style:Style,Svg:Svg,Symbol:Symbol,Text:Text,TextPath:TextPath,Tspan:Tspan,Use:Use,windowEvents:windowEvents,getEvents:getEvents,getEventTarget:getEventTarget,clearEvents:clearEvents,on:on,off:off,dispatch:dispatch,root:root,create:create,makeInstance:makeInstance,nodeOrNew:nodeOrNew,adopt:adopt,mockAdopt:mockAdopt,register:register,getClass:getClass,eid:eid,assignNewId:assignNewId,extend:extend,wrapWithAttrCheck:wrapWithAttrCheck};function SVG(element,isHTML){return makeInstance(element,isHTML)}Object.assign(SVG,svgMembers);return SVG}(); +/*! + @licstart The following is the entire license notice for the JavaScript code in this file. + The code below is based on SVGPan Library 1.2 and was modified for doxygen + to support both zooming and panning via the mouse and via embedded buttons. + + This code is licensed under the following BSD license: + + Copyright 2009-2010 Andrea Leofreddi . All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, are + permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of + conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright notice, this list + of conditions and the following disclaimer in the documentation and/or other materials + provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY Andrea Leofreddi ``AS IS'' AND ANY EXPRESS OR IMPLIED + WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Andrea Leofreddi OR + CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF + ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + The views and conclusions contained in the software and documentation are those of the + authors and should not be interpreted as representing official policies, either expressed + or implied, of Andrea Leofreddi. + + @licend The above is the entire license notice for the JavaScript code in this file + */ +var root=document.documentElement;var state="none";var stateOrigin;var stateTf=root.createSVGMatrix();var cursorGrab=' url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAAOCAMAAAAolt3jAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAAlQTFRFAAAA////////c3ilYwAAAAN0Uk5T//8A18oNQQAAAD1JREFUeNp0zlEKACAIA9Bt9z90bZBZkQj29qFBEuBOzQHSnWTTyckEfqUuZgFvslH4ch3qLCO/Kr8cAgwATw4Ax6XRCcoAAAAASUVORK5CYII="), move';var zoomSteps=10;var zoomInFactor;var zoomOutFactor;var windowWidth;var windowHeight;var svgDoc;var minZoom;var maxZoom;if(!window)window=this;function show(){if(window.innerHeight){windowWidth=window.innerWidth;windowHeight=window.innerHeight}else if(document.documentElement.clientWidth){windowWidth=document.documentElement.clientWidth;windowHeight=document.documentElement.clientHeight}if(!windowWidth||!windowHeight){windowWidth=800;windowHeight=600}minZoom=Math.min(Math.min(viewHeight,windowHeight)/viewHeight,Math.min(viewWidth,windowWidth)/viewWidth);maxZoom=minZoom+1.5;zoomInFactor=Math.pow(maxZoom/minZoom,1/zoomSteps);zoomOutFactor=1/zoomInFactor;var g=svgDoc.getElementById("viewport");try{var bb=g.getBBox();var tx=(windowWidth-viewWidth*minZoom+8)/(2*minZoom);var ty=viewHeight+(windowHeight-viewHeight*minZoom)/(2*minZoom);var a="scale("+minZoom+") rotate(0) translate("+tx+" "+ty+")";g.setAttribute("transform",a)}catch(e){}}function init(evt){svgDoc=evt.target.ownerDocument;try{if(top.window&&top.window.registerShow){top.window.registerShow(sectionId,show)}}catch(e){}show();setAttributes(root,{onmousedown:"handleMouseDown(evt)",onmousemove:"handleMouseMove(evt)",onmouseup:"handleMouseUp(evt)"});if(window.addEventListener){if(navigator.userAgent.toLowerCase().indexOf("webkit")>=0||navigator.userAgent.toLowerCase().indexOf("opera")>=0||navigator.appVersion.indexOf("MSIE")!=-1){window.addEventListener("mousewheel",handleMouseWheel,false)}else{window.addEventListener("DOMMouseScroll",handleMouseWheel,false)}}}window.onresize=function(){if(svgDoc){show()}};function getEventPoint(evt){var p=root.createSVGPoint();p.x=evt.clientX;p.y=evt.clientY;return p}function setCTM(element,matrix){var s="matrix("+matrix.a+","+matrix.b+","+matrix.c+","+matrix.d+","+matrix.e+","+matrix.f+")";element.setAttribute("transform",s)}function setAttributes(element,attributes){for(i in attributes)element.setAttributeNS(null,i,attributes[i])}function doZoom(g,point,zoomFactor){var p=point.matrixTransform(g.getCTM().inverse());var k=root.createSVGMatrix().translate(p.x,p.y).scale(zoomFactor).translate(-p.x,-p.y);var n=g.getCTM().multiply(k);var s=Math.max(n.a,n.d);if(s>maxZoom)n=n.translate(p.x,p.y).scale(maxZoom/s).translate(-p.x,-p.y);else if(s');d.write("Print SVG");d.write('');d.write('
    '+xs+"
    ");d.write("");d.write("");d.close()}catch(e){alert("Failed to open popup window needed for printing!\n"+e.message)}}function highlightEdges(){var elems=document.getElementsByTagName("g");if(elems){for(var i=0;i g");function findEnclosingG(domEl){let curEl=domEl;while(curEl.nodeName!="g"||curEl.id.substr(0,4)!="Node"){curEl=curEl.parentElement}return curEl}function onMouseOverElem(domEl){let e=SVG(findEnclosingG(domEl.target));walk(s,e=>{if(SVG(e)!=s)SVG(e).attr("data-mouse-over-selected","false")});walk(e,e=>SVG(e).attr("data-mouse-over-selected","true"));let{nodes,edges}=getEdgesAndDistance1Nodes(SVG(e),s);for(let node of nodes){walk(node,e=>SVG(e).attr("data-mouse-over-selected","true"))}for(let edge of edges){walk(edge,e=>SVG(e).attr("data-mouse-over-selected","true"))}}function onMouseOutElem(domEl){let e=SVG(findEnclosingG(domEl.target));walk(s,e=>e.attr("data-mouse-over-selected",null))}let gs=s.find("g[id^=Node]");for(let g of gs){g.on("mouseover",onMouseOverElem);g.on("mouseout",onMouseOutElem)}} diff --git a/sync_off.png b/sync_off.png new file mode 100644 index 000000000..0cf4ab7a0 Binary files /dev/null and b/sync_off.png differ diff --git a/sync_on.png b/sync_on.png new file mode 100644 index 000000000..04564eb97 Binary files /dev/null and b/sync_on.png differ diff --git a/tab__horizontal_8cpp.html b/tab__horizontal_8cpp.html new file mode 100644 index 000000000..26b4b76b2 --- /dev/null +++ b/tab__horizontal_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: tab_horizontal.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    tab_horizontal.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Functions

    int main ()
     
    +

    Function Documentation

    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 16 of file tab_horizontal.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/tab__horizontal_8cpp.js b/tab__horizontal_8cpp.js new file mode 100644 index 000000000..ed537a984 --- /dev/null +++ b/tab__horizontal_8cpp.js @@ -0,0 +1,4 @@ +var tab__horizontal_8cpp = +[ + [ "main", "tab__horizontal_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/tab__horizontal_8cpp_source.html b/tab__horizontal_8cpp_source.html new file mode 100644 index 000000000..df097cdaa --- /dev/null +++ b/tab__horizontal_8cpp_source.html @@ -0,0 +1,297 @@ + + + + + + + + +FTXUI: tab_horizontal.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    tab_horizontal.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <memory> // for allocator, __shared_ptr_access, shared_ptr
    +
    5#include <string> // for string, basic_string
    +
    6#include <vector> // for vector
    +
    7
    +
    8#include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    9#include "ftxui/component/component.hpp" // for Radiobox, Renderer, Tab, Toggle, Vertical
    +
    10#include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    11#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    12#include "ftxui/dom/elements.hpp" // for Element, separator, operator|, vbox, border
    +
    13
    +
    14using namespace ftxui;
    +
    15
    +
    +
    16int main() {
    +
    17 std::vector<std::string> tab_values{
    +
    18 "tab_1",
    +
    19 "tab_2",
    +
    20 "tab_3",
    +
    21 };
    +
    22 int tab_selected = 0;
    +
    23 auto tab_toggle = Toggle(&tab_values, &tab_selected);
    +
    24
    +
    25 std::vector<std::string> tab_1_entries{
    +
    26 "Forest",
    +
    27 "Water",
    +
    28 "I don't know",
    +
    29 };
    +
    30 int tab_1_selected = 0;
    +
    31
    +
    32 std::vector<std::string> tab_2_entries{
    +
    33 "Hello",
    +
    34 "Hi",
    +
    35 "Hay",
    +
    36 };
    +
    37 int tab_2_selected = 0;
    +
    38
    +
    39 std::vector<std::string> tab_3_entries{
    +
    40 "Table",
    +
    41 "Nothing",
    +
    42 "Is",
    +
    43 "Empty",
    +
    44 };
    +
    45 int tab_3_selected = 0;
    +
    46 auto tab_container = Container::Tab(
    +
    47 {
    +
    48 Radiobox(&tab_1_entries, &tab_1_selected),
    +
    49 Radiobox(&tab_2_entries, &tab_2_selected),
    +
    50 Radiobox(&tab_3_entries, &tab_3_selected),
    +
    51 },
    +
    52 &tab_selected);
    +
    53
    +
    54 auto container = Container::Vertical({
    +
    55 tab_toggle,
    +
    56 tab_container,
    +
    57 });
    +
    58
    +
    59 auto renderer = Renderer(container, [&] {
    +
    60 return vbox({
    +
    61 tab_toggle->Render(),
    +
    62 separator(),
    +
    63 tab_container->Render(),
    +
    64 }) |
    +
    65 border;
    +
    66 });
    +
    67
    + +
    69 screen.Loop(renderer);
    +
    70}
    +
    + + + + +
    static ScreenInteractive TerminalOutput()
    +
    Component Toggle(ConstStringListRef entries, int *selected)
    An horizontal list of elements. The user can navigate through them.
    +
    Component Radiobox(RadioboxOption options)
    A list of element, where only one can be selected.
    +
    Component Renderer(Component child, std::function< Element()>)
    Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
    +
    Component Vertical(Components children)
    A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
    +
    Component Tab(Components children, int *selector)
    A list of components, where only one is drawn and interacted with at a time. The |selector| gives the...
    +
    virtual void Render(Screen &screen)
    Display an element on a ftxui::Screen.
    Definition node.cpp:59
    +
    Element separator()
    Draw a vertical or horizontal separation in between two other elements.
    +
    Element vbox(Elements)
    A container displaying elements vertically one by one.
    Definition vbox.cpp:96
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + +
    int main()
    +
    +
    + + + + + diff --git a/tab__vertical_8cpp.html b/tab__vertical_8cpp.html new file mode 100644 index 000000000..0013bfc86 --- /dev/null +++ b/tab__vertical_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: tab_vertical.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    tab_vertical.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Functions

    int main ()
     
    +

    Function Documentation

    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 16 of file tab_vertical.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/tab__vertical_8cpp.js b/tab__vertical_8cpp.js new file mode 100644 index 000000000..5be3b2562 --- /dev/null +++ b/tab__vertical_8cpp.js @@ -0,0 +1,4 @@ +var tab__vertical_8cpp = +[ + [ "main", "tab__vertical_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/tab__vertical_8cpp_source.html b/tab__vertical_8cpp_source.html new file mode 100644 index 000000000..cad457763 --- /dev/null +++ b/tab__vertical_8cpp_source.html @@ -0,0 +1,297 @@ + + + + + + + + +FTXUI: tab_vertical.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    tab_vertical.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <memory> // for allocator, __shared_ptr_access, shared_ptr
    +
    5#include <string> // for string, basic_string
    +
    6#include <vector> // for vector
    +
    7
    +
    8#include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    9#include "ftxui/component/component.hpp" // for Radiobox, Horizontal, Menu, Renderer, Tab
    +
    10#include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    11#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    12#include "ftxui/dom/elements.hpp" // for Element, separator, hbox, operator|, border
    +
    13
    +
    14using namespace ftxui;
    +
    15
    +
    +
    16int main() {
    +
    17 std::vector<std::string> tab_values{
    +
    18 "tab_1",
    +
    19 "tab_2",
    +
    20 "tab_3",
    +
    21 };
    +
    22 int tab_selected = 0;
    +
    23 auto tab_menu = Menu(&tab_values, &tab_selected);
    +
    24
    +
    25 std::vector<std::string> tab_1_entries{
    +
    26 "Forest",
    +
    27 "Water",
    +
    28 "I don't know",
    +
    29 };
    +
    30 int tab_1_selected = 0;
    +
    31
    +
    32 std::vector<std::string> tab_2_entries{
    +
    33 "Hello",
    +
    34 "Hi",
    +
    35 "Hay",
    +
    36 };
    +
    37 int tab_2_selected = 0;
    +
    38
    +
    39 std::vector<std::string> tab_3_entries{
    +
    40 "Table",
    +
    41 "Nothing",
    +
    42 "Is",
    +
    43 "Empty",
    +
    44 };
    +
    45 int tab_3_selected = 0;
    +
    46 auto tab_container = Container::Tab(
    +
    47 {
    +
    48 Radiobox(&tab_1_entries, &tab_1_selected),
    +
    49 Radiobox(&tab_2_entries, &tab_2_selected),
    +
    50 Radiobox(&tab_3_entries, &tab_3_selected),
    +
    51 },
    +
    52 &tab_selected);
    +
    53
    +
    54 auto container = Container::Horizontal({
    +
    55 tab_menu,
    +
    56 tab_container,
    +
    57 });
    +
    58
    +
    59 auto renderer = Renderer(container, [&] {
    +
    60 return hbox({
    +
    61 tab_menu->Render(),
    +
    62 separator(),
    +
    63 tab_container->Render(),
    +
    64 }) |
    +
    65 border;
    +
    66 });
    +
    67
    + +
    69 screen.Loop(renderer);
    +
    70}
    +
    + + + + +
    static ScreenInteractive TerminalOutput()
    +
    Component Horizontal(Components children)
    A list of components, drawn one by one horizontally and navigated horizontally using left/right arrow...
    +
    Component Menu(MenuOption options)
    A list of text. The focused element is selected.
    +
    Component Radiobox(RadioboxOption options)
    A list of element, where only one can be selected.
    +
    Component Renderer(Component child, std::function< Element()>)
    Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
    +
    Component Tab(Components children, int *selector)
    A list of components, where only one is drawn and interacted with at a time. The |selector| gives the...
    +
    virtual void Render(Screen &screen)
    Display an element on a ftxui::Screen.
    Definition node.cpp:59
    +
    Element separator()
    Draw a vertical or horizontal separation in between two other elements.
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    Element hbox(Elements)
    A container displaying elements horizontally one by one.
    Definition hbox.cpp:94
    + +
    int main()
    +
    +
    + + + + + diff --git a/tab_a.png b/tab_a.png new file mode 100644 index 000000000..e5bcea333 Binary files /dev/null and b/tab_a.png differ diff --git a/tab_ad.png b/tab_ad.png new file mode 100644 index 000000000..2877c3eb4 Binary files /dev/null and b/tab_ad.png differ diff --git a/tab_b.png b/tab_b.png new file mode 100644 index 000000000..0b8599a33 Binary files /dev/null and b/tab_b.png differ diff --git a/tab_bd.png b/tab_bd.png new file mode 100644 index 000000000..2d37f809f Binary files /dev/null and b/tab_bd.png differ diff --git a/tab_h.png b/tab_h.png new file mode 100644 index 000000000..5820c9ef7 Binary files /dev/null and b/tab_h.png differ diff --git a/tab_hd.png b/tab_hd.png new file mode 100644 index 000000000..973beb40e Binary files /dev/null and b/tab_hd.png differ diff --git a/tab_s.png b/tab_s.png new file mode 100644 index 000000000..57454d4a4 Binary files /dev/null and b/tab_s.png differ diff --git a/tab_sd.png b/tab_sd.png new file mode 100644 index 000000000..34c367d12 Binary files /dev/null and b/tab_sd.png differ diff --git a/table_8cppm.html b/table_8cppm.html new file mode 100644 index 000000000..d4484cdc9 --- /dev/null +++ b/table_8cppm.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: table.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    table.cppm File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    +
    +
    + + + + + diff --git a/table_8cppm_source.html b/table_8cppm_source.html new file mode 100644 index 000000000..0d87ff53a --- /dev/null +++ b/table_8cppm_source.html @@ -0,0 +1,231 @@ + + + + + + + + +FTXUI: table.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    table.cppm
    +
    +
    +Go to the documentation of this file.
    1/// @module ftxui.dom.table
    +
    2/// @brief Module file for the Table class of the Dom module
    +
    3
    +
    4module;
    +
    5
    +
    6#include <ftxui/dom/table.hpp>
    +
    7
    +
    8export module ftxui.dom.table;
    +
    9
    +
    10/**
    +
    11 * @namespace ftxui
    +
    12 * @brief The FTXUI ftxui:: namespace
    +
    13 */
    +
    14export namespace ftxui {
    +
    15 using ftxui::Table;
    + +
    17}
    + +
    Table is a utility to draw tables.
    Definition table.hpp:36
    +
    Module file for the Table class of the Dom module.
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + +
    +
    + + + + + diff --git a/table_8hpp.html b/table_8hpp.html new file mode 100644 index 000000000..256e8540d --- /dev/null +++ b/table_8hpp.html @@ -0,0 +1,229 @@ + + + + + + + + +FTXUI: table.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    table.hpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + + + +

    +Classes

    class  Table
     Table is a utility to draw tables. More...
     
    class  TableSelection
     
    + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    +
    +
    + + + + + diff --git a/table_8hpp.js b/table_8hpp.js new file mode 100644 index 000000000..684608739 --- /dev/null +++ b/table_8hpp.js @@ -0,0 +1,4 @@ +var table_8hpp = +[ + [ "TableSelection", "classftxui_1_1TableSelection.html", "classftxui_1_1TableSelection" ] +]; \ No newline at end of file diff --git a/table_8hpp_source.html b/table_8hpp_source.html new file mode 100644 index 000000000..3b7ad3334 --- /dev/null +++ b/table_8hpp_source.html @@ -0,0 +1,339 @@ + + + + + + + + +FTXUI: table.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    table.hpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2021 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#ifndef FTXUI_DOM_TABLE
    +
    5#define FTXUI_DOM_TABLE
    +
    6
    +
    7#include <string> // for string
    +
    8#include <vector> // for vector
    +
    9
    +
    10#include "ftxui/dom/elements.hpp" // for Element, BorderStyle, LIGHT, Decorator
    +
    11
    +
    12namespace ftxui {
    +
    13
    +
    14class Table;
    +
    15class TableSelection;
    +
    16
    +
    17/// @brief Table is a utility to draw tables.
    +
    18///
    +
    19/// **example**
    +
    20/// ```cpp
    +
    21/// auto table = Table({
    +
    22/// {"X", "Y"},
    +
    23/// {"-1", "1"},
    +
    24/// {"+0", "0"},
    +
    25/// {"+1", "1"},
    +
    26/// });
    +
    27///
    +
    28/// table.SelectAll().Border(LIGHT);
    +
    29/// table.SelectRow(1).Border(DOUBLE);
    +
    30/// table.SelectRow(1).SeparatorInternal(LIGHT);
    +
    31///
    +
    32/// std::move(table).Render();
    +
    33/// ```
    +
    34///
    +
    35/// @ingroup dom
    +
    +
    36class Table {
    +
    37 public:
    +
    38 Table();
    +
    39 explicit Table(std::vector<std::vector<std::string>>);
    +
    40 explicit Table(std::vector<std::vector<Element>>);
    +
    41 Table(std::initializer_list<std::vector<std::string>> init);
    + +
    43 TableSelection SelectCell(int column, int row);
    +
    44 TableSelection SelectRow(int row_index);
    +
    45 TableSelection SelectRows(int row_min, int row_max);
    +
    46 TableSelection SelectColumn(int column_index);
    +
    47 TableSelection SelectColumns(int column_min, int column_max);
    +
    48 TableSelection SelectRectangle(int column_min,
    +
    49 int column_max,
    +
    50 int row_min,
    +
    51 int row_max);
    + +
    53
    +
    54 private:
    +
    55 void Initialize(std::vector<std::vector<Element>>);
    +
    56 friend TableSelection;
    +
    57 std::vector<std::vector<Element>> elements_;
    +
    58 int input_dim_x_ = 0;
    +
    59 int input_dim_y_ = 0;
    +
    60 int dim_x_ = 0;
    +
    61 int dim_y_ = 0;
    +
    62};
    +
    +
    63
    +
    + +
    65 public:
    +
    66 void Decorate(Decorator);
    +
    67 void DecorateAlternateRow(Decorator, int modulo = 2, int shift = 0);
    +
    68 void DecorateAlternateColumn(Decorator, int modulo = 2, int shift = 0);
    +
    69
    + +
    71 void DecorateCellsAlternateColumn(Decorator, int modulo = 2, int shift = 0);
    +
    72 void DecorateCellsAlternateRow(Decorator, int modulo = 2, int shift = 0);
    +
    73
    +
    74 void Border(BorderStyle border = LIGHT);
    +
    75 void BorderLeft(BorderStyle border = LIGHT);
    +
    76 void BorderRight(BorderStyle border = LIGHT);
    +
    77 void BorderTop(BorderStyle border = LIGHT);
    +
    78 void BorderBottom(BorderStyle border = LIGHT);
    +
    79
    +
    80 void Separator(BorderStyle border = LIGHT);
    +
    81 void SeparatorVertical(BorderStyle border = LIGHT);
    + +
    83
    +
    84 private:
    +
    85 friend Table;
    +
    86 Table* table_;
    +
    87 int x_min_;
    +
    88 int x_max_;
    +
    89 int y_min_;
    +
    90 int y_max_;
    +
    91};
    +
    +
    92
    +
    93} // namespace ftxui
    +
    94
    +
    95#endif /* end of include guard: FTXUI_DOM_TABLE */
    + +
    void DecorateAlternateColumn(Decorator, int modulo=2, int shift=0)
    Apply the decorator to the selection. This decorate only the lines modulo modulo with a shift of shif...
    +
    void SeparatorVertical(BorderStyle border=LIGHT)
    Draw some vertical separator lines in the selection.
    +
    void DecorateCells(Decorator)
    Apply the decorator to the selection.
    +
    void BorderLeft(BorderStyle border=LIGHT)
    Draw some separator lines to the left side of the selection.
    +
    void DecorateCellsAlternateColumn(Decorator, int modulo=2, int shift=0)
    Apply the decorator to the selection. This decorate only the corners modulo modulo with a shift of sh...
    +
    void Decorate(Decorator)
    Apply the decorator to the selection. This decorate both the cells, the lines and the corners.
    +
    void DecorateAlternateRow(Decorator, int modulo=2, int shift=0)
    Apply the decorator to the selection. This decorate only the lines modulo modulo with a shift of shif...
    +
    void BorderTop(BorderStyle border=LIGHT)
    Draw some separator lines to the top side of the selection.
    +
    void Separator(BorderStyle border=LIGHT)
    Draw some separator lines in the selection.
    +
    void BorderBottom(BorderStyle border=LIGHT)
    Draw some separator lines to the bottom side of the selection.
    +
    void DecorateCellsAlternateRow(Decorator, int modulo=2, int shift=0)
    Apply the decorator to the selection. This decorate only the corners modulo modulo with a shift of sh...
    +
    void BorderRight(BorderStyle border=LIGHT)
    Draw some separator lines to the right side of the selection.
    +
    void Border(BorderStyle border=LIGHT)
    Apply a border around the selection.
    +
    void SeparatorHorizontal(BorderStyle border=LIGHT)
    Draw some horizontal separator lines in the selection.
    + +
    Element Render()
    Render the table.
    +
    Table()
    Create an empty table.
    +
    TableSelection SelectCell(int column, int row)
    Select a cell of the table.
    +
    TableSelection SelectColumn(int column_index)
    Select a column of the table.
    +
    TableSelection SelectRow(int row_index)
    Select a row of the table.
    +
    TableSelection SelectColumns(int column_min, int column_max)
    Select a range of columns of the table.
    +
    TableSelection SelectRows(int row_min, int row_max)
    Select a range of rows of the table.
    +
    TableSelection SelectAll()
    Select all the table.
    +
    TableSelection SelectRectangle(int column_min, int column_max, int row_min, int row_max)
    Select a rectangle of the table.
    +
    Table is a utility to draw tables.
    Definition table.hpp:36
    +
    BorderStyle
    BorderStyle is an enumeration that represents the different styles of borders that can be applied to ...
    Definition elements.hpp:35
    +
    @ LIGHT
    Definition elements.hpp:36
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::function< Element(Element)> Decorator
    Definition elements.hpp:24
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    +
    + + + + + diff --git a/tabs.css b/tabs.css new file mode 100644 index 000000000..79508e5de --- /dev/null +++ b/tabs.css @@ -0,0 +1 @@ +.sm{position:relative;z-index:9999}.sm,.sm ul,.sm li{display:block;list-style:none;margin:0;padding:0;line-height:normal;direction:ltr;text-align:left;-webkit-tap-highlight-color:rgba(0,0,0,0)}.sm-rtl,.sm-rtl ul,.sm-rtl li{direction:rtl;text-align:right}.sm>li>h1,.sm>li>h2,.sm>li>h3,.sm>li>h4,.sm>li>h5,.sm>li>h6{margin:0;padding:0}.sm ul{display:none}.sm li,.sm a{position:relative}.sm a{display:block}.sm a.disabled{cursor:not-allowed}.sm:after{content:"\00a0";display:block;height:0;font:0/0 serif;clear:both;visibility:hidden;overflow:hidden}.sm,.sm *,.sm *:before,.sm *:after{-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box}.main-menu-btn{position:relative;display:inline-block;width:36px;height:36px;text-indent:36px;margin-left:8px;white-space:nowrap;overflow:hidden;cursor:pointer;-webkit-tap-highlight-color:rgba(0,0,0,0)}.main-menu-btn-icon,.main-menu-btn-icon:before,.main-menu-btn-icon:after{position:absolute;top:50%;left:2px;height:2px;width:24px;background:#13429F;-webkit-transition:all .25s;transition:all .25s}.main-menu-btn-icon:before{content:'';top:-7px;left:0}.main-menu-btn-icon:after{content:'';top:7px;left:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon{height:0}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:before{top:0;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}#main-menu-state:checked ~ .main-menu-btn .main-menu-btn-icon:after{top:0;-webkit-transform:rotate(45deg);transform:rotate(45deg)}#main-menu-state{position:absolute;width:1px;height:1px;margin:-1px;border:0;padding:0;overflow:hidden;clip:rect(1px,1px,1px,1px)}#main-menu-state:not(:checked) ~ #main-menu{display:none}#main-menu-state:checked ~ #main-menu{display:block}@media(min-width:768px){.main-menu-btn{position:absolute;top:-99999px}#main-menu-state:not(:checked) ~ #main-menu{display:block}}.sm-dox{background-image:url('tab_b.png')}.sm-dox a,.sm-dox a:focus,.sm-dox a:hover,.sm-dox a:active{padding:0 12px;padding-right:43px;font-family:'Lucida Grande',Geneva,Helvetica,Arial,sans-serif;font-size:13px;font-weight:bold;line-height:36px;text-decoration:none;text-shadow:0px 1px 1px rgba(255, 255, 255, 0.9);color:#0E3177;outline:0}.sm-dox a:hover{background-image:url('tab_a.png');background-repeat:repeat-x;color:white;text-shadow:0px 1px 1px rgba(0, 0, 0, 1.0)}.sm-dox a.current{color:#d23600}.sm-dox a.disabled{color:#bbb}.sm-dox a span.sub-arrow{position:absolute;top:50%;margin-top:-14px;left:auto;right:3px;width:28px;height:28px;overflow:hidden;font:bold 12px/28px monospace !important;text-align:center;text-shadow:none;background:rgba(255, 255, 255, 0.5);-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox a span.sub-arrow:before{display:block;content:'+'}.sm-dox a.highlighted span.sub-arrow:before{display:block;content:'-'}.sm-dox>li:first-child>a,.sm-dox>li:first-child>:not(ul) a{-moz-border-radius:5px 5px 0 0;-webkit-border-radius:5px;border-radius:5px 5px 0 0}.sm-dox>li:last-child>a,.sm-dox>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul{-moz-border-radius:0 0 5px 5px;-webkit-border-radius:0;border-radius:0 0 5px 5px}.sm-dox>li:last-child>a.highlighted,.sm-dox>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>a.highlighted,.sm-dox>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>ul>li:last-child>*:not(ul) a.highlighted{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox ul{background:white}.sm-dox ul a,.sm-dox ul a:focus,.sm-dox ul a:hover,.sm-dox ul a:active{font-size:12px;border-left:8px solid transparent;line-height:36px;text-shadow:none;background-color:white;background-image:none}.sm-dox ul a:hover{background-image:url('tab_a.png');background-repeat:repeat-x;color:white;text-shadow:0 1px 1px black}.sm-dox ul ul a,.sm-dox ul ul a:hover,.sm-dox ul ul a:focus,.sm-dox ul ul a:active{border-left:16px solid transparent}.sm-dox ul ul ul a,.sm-dox ul ul ul a:hover,.sm-dox ul ul ul a:focus,.sm-dox ul ul ul a:active{border-left:24px solid transparent}.sm-dox ul ul ul ul a,.sm-dox ul ul ul ul a:hover,.sm-dox ul ul ul ul a:focus,.sm-dox ul ul ul ul a:active{border-left:32px solid transparent}.sm-dox ul ul ul ul ul a,.sm-dox ul ul ul ul ul a:hover,.sm-dox ul ul ul ul ul a:focus,.sm-dox ul ul ul ul ul a:active{border-left:40px solid transparent}@media(min-width:768px){.sm-dox ul{position:absolute;width:12em}.sm-dox li{float:left}.sm-dox.sm-rtl li{float:right}.sm-dox ul li,.sm-dox.sm-rtl ul li,.sm-dox.sm-vertical li{float:none}.sm-dox a{white-space:nowrap}.sm-dox ul a,.sm-dox.sm-vertical a{white-space:normal}.sm-dox .sm-nowrap>li>a,.sm-dox .sm-nowrap>li>:not(ul) a{white-space:nowrap}.sm-dox{padding:0 10px;background-image:url('tab_b.png');line-height:36px}.sm-dox a span.sub-arrow{top:50%;margin-top:-2px;right:12px;width:0;height:0;border-width:4px;border-style:solid dashed dashed dashed;border-color:#0E3177 transparent transparent transparent;background:transparent;-moz-border-radius:0;-webkit-border-radius:0;border-radius:0}.sm-dox a,.sm-dox a:focus,.sm-dox a:active,.sm-dox a:hover,.sm-dox a.highlighted{padding:0 12px;background-image:url('tab_s.png');background-repeat:no-repeat;background-position:right;-moz-border-radius:0 !important;-webkit-border-radius:0;border-radius:0 !important}.sm-dox a:hover{background-image:url('tab_a.png');background-repeat:repeat-x;color:white;text-shadow:0px 1px 1px rgba(0, 0, 0, 1.0)}.sm-dox a:hover span.sub-arrow{border-color:white transparent transparent transparent}.sm-dox a.has-submenu{padding-right:24px}.sm-dox li{border-top:0}.sm-dox>li>ul:before,.sm-dox>li>ul:after{content:'';position:absolute;top:-18px;left:30px;width:0;height:0;overflow:hidden;border-width:9px;border-style:dashed dashed solid dashed;border-color:transparent transparent #bbb transparent}.sm-dox>li>ul:after{top:-16px;left:31px;border-width:8px;border-color:transparent transparent white transparent}.sm-dox ul{border:1px solid #bbb;padding:5px 0;background:white;-moz-border-radius:5px !important;-webkit-border-radius:5px;border-radius:5px !important;-moz-box-shadow:0 5px 9px rgba(0,0,0,0.2);-webkit-box-shadow:0 5px 9px rgba(0,0,0,0.2);box-shadow:0 5px 9px rgba(0,0,0,0.2)}.sm-dox ul a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-color:transparent transparent transparent #555555;border-style:dashed dashed dashed solid}.sm-dox ul a,.sm-dox ul a:hover,.sm-dox ul a:focus,.sm-dox ul a:active,.sm-dox ul a.highlighted{color:#555555;background-image:none;border:0 !important}.sm-dox ul a:hover{background-image:url('tab_a.png');background-repeat:repeat-x;color:white;text-shadow:0px 1px 1px rgba(0, 0, 0, 1.0)}.sm-dox ul a:hover span.sub-arrow{border-color:transparent transparent transparent white}.sm-dox span.scroll-up,.sm-dox span.scroll-down{position:absolute;display:none;visibility:hidden;overflow:hidden;background:white;height:36px}.sm-dox span.scroll-up:hover,.sm-dox span.scroll-down:hover{background:#eee}.sm-dox span.scroll-up:hover span.scroll-up-arrow,.sm-dox span.scroll-up:hover span.scroll-down-arrow{border-color:transparent transparent #d23600 transparent}.sm-dox span.scroll-down:hover span.scroll-down-arrow{border-color:#d23600 transparent transparent transparent}.sm-dox span.scroll-up-arrow,.sm-dox span.scroll-down-arrow{position:absolute;top:0;left:50%;margin-left:-6px;width:0;height:0;overflow:hidden;border-width:6px;border-style:dashed dashed solid dashed;border-color:transparent transparent #555555 transparent}.sm-dox span.scroll-down-arrow{top:8px;border-style:solid dashed dashed dashed;border-color:#555555 transparent transparent transparent}.sm-dox.sm-rtl a.has-submenu{padding-right:12px;padding-left:24px}.sm-dox.sm-rtl a span.sub-arrow{right:auto;left:12px}.sm-dox.sm-rtl.sm-vertical a.has-submenu{padding:10px 20px}.sm-dox.sm-rtl.sm-vertical a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-rtl>li>ul:before{left:auto;right:30px}.sm-dox.sm-rtl>li>ul:after{left:auto;right:31px}.sm-dox.sm-rtl ul a.has-submenu{padding:10px 20px !important}.sm-dox.sm-rtl ul a span.sub-arrow{right:auto;left:8px;border-style:dashed solid dashed dashed;border-color:transparent #555 transparent transparent}.sm-dox.sm-vertical{padding:10px 0;-moz-border-radius:5px;-webkit-border-radius:5px;border-radius:5px}.sm-dox.sm-vertical a{padding:10px 20px}.sm-dox.sm-vertical a:hover,.sm-dox.sm-vertical a:focus,.sm-dox.sm-vertical a:active,.sm-dox.sm-vertical a.highlighted{background:#fff}.sm-dox.sm-vertical a.disabled{background-image:url('tab_b.png')}.sm-dox.sm-vertical a span.sub-arrow{right:8px;top:50%;margin-top:-5px;border-width:5px;border-style:dashed dashed dashed solid;border-color:transparent transparent transparent #555}.sm-dox.sm-vertical>li>ul:before,.sm-dox.sm-vertical>li>ul:after{display:none}.sm-dox.sm-vertical ul a{padding:10px 20px}.sm-dox.sm-vertical ul a:hover,.sm-dox.sm-vertical ul a:focus,.sm-dox.sm-vertical ul a:active,.sm-dox.sm-vertical ul a.highlighted{background:#eee}.sm-dox.sm-vertical ul a.disabled{background:white}} diff --git a/task_8cpp.html b/task_8cpp.html new file mode 100644 index 000000000..b6da4f687 --- /dev/null +++ b/task_8cpp.html @@ -0,0 +1,222 @@ + + + + + + + + +FTXUI: task.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    task.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    namespace  ftxui::task
     
    +
    +
    + + + + + diff --git a/task_8cpp_source.html b/task_8cpp_source.html new file mode 100644 index 000000000..b1e2c2cfc --- /dev/null +++ b/task_8cpp_source.html @@ -0,0 +1,235 @@ + + + + + + + + +FTXUI: task.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    task.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2024 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    + +
    5
    +
    6namespace ftxui::task {
    +
    +
    7bool PendingTask::operator<(const PendingTask& other) const {
    +
    8 if (!time && !other.time) {
    +
    9 return false;
    +
    10 }
    +
    11 if (!time) {
    +
    12 return true;
    +
    13 }
    +
    14 if (!other.time) {
    +
    15 return false;
    +
    16 }
    +
    17 return time.value() > other.time.value();
    +
    18}
    +
    +
    19} // namespace ftxui::task
    + + +
    std::optional< std::chrono::steady_clock::time_point > time
    +
    bool operator<(const PendingTask &other) const
    Definition task.cpp:7
    + +
    +
    + + + + + diff --git a/task_8cppm.html b/task_8cppm.html new file mode 100644 index 000000000..48861e27e --- /dev/null +++ b/task_8cppm.html @@ -0,0 +1,220 @@ + + + + + + + + +FTXUI: task.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    task.cppm File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    +
    +
    + + + + + diff --git a/task_8cppm_source.html b/task_8cppm_source.html new file mode 100644 index 000000000..4e56ab843 --- /dev/null +++ b/task_8cppm_source.html @@ -0,0 +1,233 @@ + + + + + + + + +FTXUI: task.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    task.cppm
    +
    +
    +Go to the documentation of this file.
    1/// @module ftxui.component.task
    +
    2/// @brief Module file for the Task class of the Component module
    +
    3
    +
    4module;
    +
    5
    + +
    7
    +
    8export module ftxui.component.task;
    +
    9
    +
    10/**
    +
    11 * @namespace ftxui
    +
    12 * @brief The FTXUI ftxui:: namespace
    +
    13 */
    +
    14export namespace ftxui {
    + +
    16 using ftxui::Closure;
    +
    17 using ftxui::Task;
    +
    18}
    + +
    Module file for the Task class of the Component module.
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::variant< Event, Closure, AnimationTask > Task
    Definition task.hpp:14
    +
    std::function< void()> Closure
    Definition task.hpp:13
    + +
    +
    + + + + + diff --git a/task_8hpp.html b/task_8hpp.html new file mode 100644 index 000000000..b4a926385 --- /dev/null +++ b/task_8hpp.html @@ -0,0 +1,234 @@ + + + + + + + + +FTXUI: task.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    task.hpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Classes

    class  AnimationTask
     
    + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + + +

    +Typedefs

    using Closure = std::function<void()>
     
    using Task = std::variant<Event, Closure, AnimationTask>
     
    +
    +
    + + + + + diff --git a/task_8hpp.js b/task_8hpp.js new file mode 100644 index 000000000..9daabc136 --- /dev/null +++ b/task_8hpp.js @@ -0,0 +1,6 @@ +var task_8hpp = +[ + [ "AnimationTask", "classftxui_1_1AnimationTask.html", null ], + [ "Closure", "task_8hpp.html#adc2f3bfa69ce99c596a1ff1b69b04d33", null ], + [ "Task", "task_8hpp.html#aaa92a82e968c721805c62787cd000534", null ] +]; \ No newline at end of file diff --git a/task_8hpp_source.html b/task_8hpp_source.html new file mode 100644 index 000000000..aa1b4c299 --- /dev/null +++ b/task_8hpp_source.html @@ -0,0 +1,231 @@ + + + + + + + + +FTXUI: task.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    task.hpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2022 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#ifndef FTXUI_COMPONENT_ANIMATION_HPP
    +
    5#define FTXUI_COMPONENT_ANIMATION_HPP
    +
    6
    +
    7#include <functional>
    +
    8#include <variant>
    + +
    10
    +
    11namespace ftxui {
    + +
    13using Closure = std::function<void()>;
    +
    14using Task = std::variant<Event, Closure, AnimationTask>;
    +
    15} // namespace ftxui
    +
    16
    +
    17#endif // FTXUI_COMPONENT_ANIMATION_HPP
    + + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::variant< Event, Closure, AnimationTask > Task
    Definition task.hpp:14
    +
    std::function< void()> Closure
    Definition task.hpp:13
    +
    +
    + + + + + diff --git a/task__internal_8hpp.html b/task__internal_8hpp.html new file mode 100644 index 000000000..a0b5f87e1 --- /dev/null +++ b/task__internal_8hpp.html @@ -0,0 +1,235 @@ + + + + + + + + +FTXUI: task_internal.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    task_internal.hpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Classes

    struct  PendingTask
     
    + + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    namespace  ftxui::task
     
    + + + + +

    +Typedefs

    using Task = std::function<void()>
     A task represents a unit of work.
     
    +
    +
    + + + + + diff --git a/task__internal_8hpp.js b/task__internal_8hpp.js new file mode 100644 index 000000000..28167b168 --- /dev/null +++ b/task__internal_8hpp.js @@ -0,0 +1,5 @@ +var task__internal_8hpp = +[ + [ "PendingTask", "structftxui_1_1task_1_1PendingTask.html", "structftxui_1_1task_1_1PendingTask" ], + [ "Task", "task__internal_8hpp.html#a8cb97ed7903b5e83d45d0a985e629185", null ] +]; \ No newline at end of file diff --git a/task__internal_8hpp_source.html b/task__internal_8hpp_source.html new file mode 100644 index 000000000..f6a084ae4 --- /dev/null +++ b/task__internal_8hpp_source.html @@ -0,0 +1,261 @@ + + + + + + + + +FTXUI: task_internal.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    task_internal.hpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2024 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#ifndef TASK_HPP
    +
    5#define TASK_HPP
    +
    6
    +
    7#include <chrono>
    +
    8#include <functional>
    +
    9#include <optional>
    +
    10
    +
    11namespace ftxui::task {
    +
    12
    +
    13/// A task represents a unit of work.
    +
    14using Task = std::function<void()>;
    +
    15
    +
    16/// A PendingTask represents a task that is scheduled to be executed at a
    +
    17/// specific time, or as soon as possible.
    +
    + +
    19 // Immediate task:
    +
    20 PendingTask(Task t) : task(std::move(t)) {} // NOLINT
    +
    21
    +
    22 // Delayed task with a duration
    +
    +
    23 PendingTask(Task t, std::chrono::steady_clock::duration duration)
    +
    24 : task(std::move(t)), time(std::chrono::steady_clock::now() + duration) {}
    +
    +
    25
    +
    26 /// The task to be executed.
    + +
    28
    +
    29 /// The time when the task should be executed. If the time is empty, the task
    +
    30 /// should be executed as soon as possible.
    +
    31 std::optional<std::chrono::steady_clock::time_point> time;
    +
    32
    +
    33 /// Compare two PendingTasks by their time.
    +
    34 /// If both tasks have no time, they are considered equal.
    +
    35 bool operator<(const PendingTask& other) const;
    +
    36};
    +
    +
    37
    +
    38} // namespace ftxui::task
    +
    39
    +
    40#endif // TASK_HPP_
    + +
    std::function< void()> Task
    A task represents a unit of work.
    + +
    PendingTask(Task t, std::chrono::steady_clock::duration duration)
    +
    Task task
    The task to be executed.
    +
    std::optional< std::chrono::steady_clock::time_point > time
    +
    bool operator<(const PendingTask &other) const
    Definition task.cpp:7
    + +
    +
    + + + + + diff --git a/task__queue_8cpp.html b/task__queue_8cpp.html new file mode 100644 index 000000000..a9636ebd9 --- /dev/null +++ b/task__queue_8cpp.html @@ -0,0 +1,222 @@ + + + + + + + + +FTXUI: task_queue.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    task_queue.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    namespace  ftxui::task
     
    +
    +
    + + + + + diff --git a/task__queue_8cpp_source.html b/task__queue_8cpp_source.html new file mode 100644 index 000000000..e0e96a093 --- /dev/null +++ b/task__queue_8cpp_source.html @@ -0,0 +1,272 @@ + + + + + + + + +FTXUI: task_queue.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    task_queue.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2024 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    + +
    5
    +
    6namespace ftxui::task {
    +
    7
    +
    +
    8auto TaskQueue::PostTask(PendingTask task) -> void {
    +
    9 if (!task.time) {
    +
    10 immediate_tasks_.push(task);
    +
    11 return;
    +
    12 }
    +
    13
    +
    14 if (task.time.value() < std::chrono::steady_clock::now()) {
    +
    15 immediate_tasks_.push(task);
    +
    16 return;
    +
    17 }
    +
    18
    +
    19 delayed_tasks_.push(task);
    +
    20}
    +
    +
    21
    +
    + +
    23 // Attempt to execute a task immediately.
    +
    24 if (!immediate_tasks_.empty()) {
    +
    25 auto task = immediate_tasks_.front();
    +
    26 immediate_tasks_.pop();
    +
    27 return task.task;
    +
    28 }
    +
    29
    +
    30 // Move all tasks that can be executed to the immediate queue.
    +
    31 auto now = std::chrono::steady_clock::now();
    +
    32 while (!delayed_tasks_.empty() && delayed_tasks_.top().time.value() <= now) {
    +
    33 immediate_tasks_.push(delayed_tasks_.top());
    +
    34 delayed_tasks_.pop();
    +
    35 }
    +
    36
    +
    37 // Attempt to execute a task immediately.
    +
    38 if (!immediate_tasks_.empty()) {
    +
    39 auto task = immediate_tasks_.front();
    +
    40 immediate_tasks_.pop();
    +
    41 return task.task;
    +
    42 }
    +
    43
    +
    44 // If there are no tasks to execute, return the delay until the next task.
    +
    45 if (!delayed_tasks_.empty()) {
    +
    46 return delayed_tasks_.top().time.value() - now;
    +
    47 }
    +
    48
    +
    49 // If there are no tasks to execute, return the maximum duration.
    +
    50 return std::monostate{};
    +
    51}
    +
    +
    52
    +
    53} // namespace ftxui::task
    + + +
    auto Get() -> MaybeTask
    +
    std::variant< Task, std::chrono::steady_clock::duration, std::monostate > MaybeTask
    +
    auto PostTask(PendingTask task) -> void
    Definition task_queue.cpp:8
    + +
    +
    + + + + + diff --git a/task__queue_8hpp.html b/task__queue_8hpp.html new file mode 100644 index 000000000..1fcbda416 --- /dev/null +++ b/task__queue_8hpp.html @@ -0,0 +1,228 @@ + + + + + + + + +FTXUI: task_queue.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    task_queue.hpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Classes

    struct  TaskQueue
     
    + + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    namespace  ftxui::task
     
    +
    +
    + + + + + diff --git a/task__queue_8hpp.js b/task__queue_8hpp.js new file mode 100644 index 000000000..e56be2490 --- /dev/null +++ b/task__queue_8hpp.js @@ -0,0 +1,4 @@ +var task__queue_8hpp = +[ + [ "TaskQueue", "structftxui_1_1task_1_1TaskQueue.html", "structftxui_1_1task_1_1TaskQueue" ] +]; \ No newline at end of file diff --git a/task__queue_8hpp_source.html b/task__queue_8hpp_source.html new file mode 100644 index 000000000..b2bc863c3 --- /dev/null +++ b/task__queue_8hpp_source.html @@ -0,0 +1,256 @@ + + + + + + + + +FTXUI: task_queue.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    task_queue.hpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2024 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#ifndef TASK_QUEUE_HPP
    +
    5#define TASK_QUEUE_HPP
    +
    6
    +
    7#include <queue>
    +
    8#include <variant>
    +
    9
    +
    10#include "ftxui/component/task_internal.hpp" // for PendingTask, Task
    +
    11
    +
    12namespace ftxui::task {
    +
    13
    +
    14/// A task queue that schedules tasks to be executed in the future. Tasks can be
    +
    15/// scheduled to be executed immediately, or after a certain duration.
    +
    16/// - The tasks are executed in the order they were scheduled.
    +
    17/// - If multiple tasks are scheduled to be executed at the same time, they are
    +
    18/// executed in the order they were scheduled.
    +
    19/// - If a task is scheduled to be executed in the past, it is executed
    +
    20/// immediately.
    +
    +
    21struct TaskQueue {
    +
    22 auto PostTask(PendingTask task) -> void;
    +
    23
    +
    24 using MaybeTask =
    +
    25 std::variant<Task, std::chrono::steady_clock::duration, std::monostate>;
    +
    26 auto Get() -> MaybeTask;
    +
    27
    +
    28 bool HasImmediateTasks() const { return !immediate_tasks_.empty(); }
    +
    29
    +
    30 private:
    +
    31 std::queue<PendingTask> immediate_tasks_;
    +
    32 std::priority_queue<PendingTask> delayed_tasks_;
    +
    33};
    +
    +
    34
    +
    35} // namespace ftxui::task
    +
    36
    +
    37#endif
    + + + +
    bool HasImmediateTasks() const
    +
    auto Get() -> MaybeTask
    +
    std::variant< Task, std::chrono::steady_clock::duration, std::monostate > MaybeTask
    +
    auto PostTask(PendingTask task) -> void
    Definition task_queue.cpp:8
    + +
    +
    + + + + + diff --git a/task__runner_8cpp.html b/task__runner_8cpp.html new file mode 100644 index 000000000..9445e0c3e --- /dev/null +++ b/task__runner_8cpp.html @@ -0,0 +1,222 @@ + + + + + + + + +FTXUI: task_runner.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    task_runner.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    namespace  ftxui::task
     
    +
    +
    + + + + + diff --git a/task__runner_8cpp_source.html b/task__runner_8cpp_source.html new file mode 100644 index 000000000..66b930ed8 --- /dev/null +++ b/task__runner_8cpp_source.html @@ -0,0 +1,310 @@ + + + + + + + + +FTXUI: task_runner.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    task_runner.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2024 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    + +
    5
    +
    6#include <cassert>
    +
    7#include <thread>
    +
    8
    +
    9namespace ftxui::task {
    +
    10
    +
    11static thread_local TaskRunner* current_task_runner = nullptr; // NOLINT
    +
    12
    +
    + +
    14 assert(!previous_task_runner_);
    +
    15 previous_task_runner_ = current_task_runner;
    +
    16 current_task_runner = this;
    +
    17}
    +
    +
    18
    +
    + +
    20 current_task_runner = previous_task_runner_;
    +
    21}
    +
    +
    22
    +
    23// static
    +
    + +
    25 assert(current_task_runner);
    +
    26 return current_task_runner;
    +
    27}
    +
    +
    28
    +
    +
    29auto TaskRunner::PostTask(Task task) -> void {
    +
    30 queue_.PostTask(PendingTask{std::move(task)});
    +
    31}
    +
    +
    32
    +
    + +
    34 std::chrono::steady_clock::duration duration)
    +
    35 -> void {
    +
    36 queue_.PostTask(PendingTask{std::move(task), duration});
    +
    37}
    +
    +
    38
    +
    39/// Runs the tasks in the queue.
    +
    + +
    41 -> std::optional<std::chrono::steady_clock::duration> {
    +
    42 while (true) {
    +
    43 auto maybe_task = queue_.Get();
    +
    44 if (std::holds_alternative<std::monostate>(maybe_task)) {
    +
    45 // No more tasks to execute, exit the loop.
    +
    46 return std::nullopt;
    +
    47 }
    +
    48
    +
    49 if (std::holds_alternative<Task>(maybe_task)) {
    +
    50 executed_tasks_++;
    +
    51 std::get<Task>(maybe_task)();
    +
    52 continue;
    +
    53 }
    +
    54
    +
    55 if (std::holds_alternative<std::chrono::steady_clock::duration>(
    +
    56 maybe_task)) {
    +
    57 return std::get<std::chrono::steady_clock::duration>(maybe_task);
    +
    58 }
    +
    59 }
    +
    60}
    +
    +
    61
    +
    +
    62auto TaskRunner::Run() -> void {
    +
    63 while (true) {
    +
    64 auto duration = RunUntilIdle();
    +
    65 if (!duration) {
    +
    66 // No more tasks to execute, exit the loop.
    +
    67 return;
    +
    68 }
    +
    69
    +
    70 // Sleep for the duration until the next task can be executed.
    +
    71 std::this_thread::sleep_for(duration.value());
    +
    72 }
    +
    73}
    +
    +
    74
    +
    75} // namespace ftxui::task
    + +
    static auto Current() -> TaskRunner *
    + +
    auto PostTask(Task task) -> void
    Schedules a task to be executed immediately.
    +
    auto RunUntilIdle() -> std::optional< std::chrono::steady_clock::duration >
    Runs the tasks in the queue.
    +
    auto PostDelayedTask(Task task, std::chrono::steady_clock::duration duration) -> void
    Schedules a task to be executed after a certain duration.
    + + + +
    std::function< void()> Task
    A task represents a unit of work.
    + + +
    +
    + + + + + diff --git a/task__runner_8hpp.html b/task__runner_8hpp.html new file mode 100644 index 000000000..935821194 --- /dev/null +++ b/task__runner_8hpp.html @@ -0,0 +1,228 @@ + + + + + + + + +FTXUI: task_runner.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    task_runner.hpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Classes

    class  TaskRunner
     
    + + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    namespace  ftxui::task
     
    +
    +
    + + + + + diff --git a/task__runner_8hpp.js b/task__runner_8hpp.js new file mode 100644 index 000000000..91465b4ed --- /dev/null +++ b/task__runner_8hpp.js @@ -0,0 +1,4 @@ +var task__runner_8hpp = +[ + [ "TaskRunner", "classftxui_1_1task_1_1TaskRunner.html", "classftxui_1_1task_1_1TaskRunner" ] +]; \ No newline at end of file diff --git a/task__runner_8hpp_source.html b/task__runner_8hpp_source.html new file mode 100644 index 000000000..11967de9c --- /dev/null +++ b/task__runner_8hpp_source.html @@ -0,0 +1,273 @@ + + + + + + + + +FTXUI: task_runner.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    task_runner.hpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2024 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#ifndef TASK_RUNNER_HPP
    +
    5#define TASK_RUNNER_HPP
    +
    6
    + + +
    9
    +
    10namespace ftxui::task {
    +
    11
    +
    + +
    13 public:
    +
    14 TaskRunner();
    + +
    16
    +
    17 // Returns the task runner for the current thread.
    +
    18 static auto Current() -> TaskRunner*;
    +
    19
    +
    20 /// Schedules a task to be executed immediately.
    +
    21 auto PostTask(Task task) -> void;
    +
    22
    +
    23 /// Schedules a task to be executed after a certain duration.
    +
    24 auto PostDelayedTask(Task task, std::chrono::steady_clock::duration duration)
    +
    25 -> void;
    +
    26
    +
    27 /// Runs the tasks in the queue, return the delay until the next delayed task
    +
    28 /// can be executed.
    +
    29 auto RunUntilIdle() -> std::optional<std::chrono::steady_clock::duration>;
    +
    30
    +
    31 // Runs the tasks in the queue, blocking until all tasks are executed.
    +
    32 auto Run() -> void;
    +
    33
    +
    34 bool HasImmediateTasks() const { return queue_.HasImmediateTasks(); }
    +
    35
    +
    36 size_t ExecutedTasks() const { return executed_tasks_; }
    +
    37
    +
    38 private:
    +
    39 TaskRunner* previous_task_runner_ = nullptr;
    +
    40 TaskQueue queue_;
    +
    41 size_t executed_tasks_ = 0;
    +
    42};
    +
    +
    43
    +
    44} // namespace ftxui::task
    +
    45
    +
    46#endif // TASK_RUNNER_HPP
    + +
    bool HasImmediateTasks() const
    +
    static auto Current() -> TaskRunner *
    + +
    auto PostTask(Task task) -> void
    Schedules a task to be executed immediately.
    +
    auto RunUntilIdle() -> std::optional< std::chrono::steady_clock::duration >
    Runs the tasks in the queue.
    +
    auto PostDelayedTask(Task task, std::chrono::steady_clock::duration duration) -> void
    Schedules a task to be executed after a certain duration.
    + +
    size_t ExecutedTasks() const
    + + +
    std::function< void()> Task
    A task represents a unit of work.
    + +
    bool HasImmediateTasks() const
    + + +
    +
    + + + + + diff --git a/terminal_8cpp.html b/terminal_8cpp.html new file mode 100644 index 000000000..132f7fa1c --- /dev/null +++ b/terminal_8cpp.html @@ -0,0 +1,238 @@ + + + + + + + + +FTXUI: terminal.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    terminal.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    namespace  ftxui::Terminal
     
    + + + + + + + + + + + + + +

    +Functions

    Dimensions Size ()
     Get the terminal size.
     
    void SetFallbackSize (const Dimensions &fallbackSize)
     Override terminal size in case auto-detection fails.
     
    Color ColorSupport ()
     Get the color support of the terminal.
     
    void SetColorSupport (Color color)
     Override terminal color support in case auto-detection fails.
     
    +
    +
    + + + + + diff --git a/terminal_8cpp.js b/terminal_8cpp.js new file mode 100644 index 000000000..777a65ba5 --- /dev/null +++ b/terminal_8cpp.js @@ -0,0 +1,7 @@ +var terminal_8cpp = +[ + [ "Size", "terminal_8cpp.html#gad890c37601448c82ed0d5051c29e2f0c", null ], + [ "SetFallbackSize", "terminal_8cpp.html#a765662bcabb59dc93884674ee2fcc9fc", null ], + [ "ColorSupport", "terminal_8cpp.html#gae6e034f37aa66cfe4458a8cb6e8fc526", null ], + [ "SetColorSupport", "terminal_8cpp.html#ga65945a706131f407a47a1b9960dc1a4a", null ] +]; \ No newline at end of file diff --git a/terminal_8cpp_source.html b/terminal_8cpp_source.html new file mode 100644 index 000000000..1a15a08b3 --- /dev/null +++ b/terminal_8cpp_source.html @@ -0,0 +1,375 @@ + + + + + + + + +FTXUI: terminal.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    terminal.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <cstdlib> // for getenv
    +
    5#include <string> // for string, allocator
    +
    6
    + +
    8
    +
    9#if defined(_WIN32)
    +
    10#define WIN32_LEAN_AND_MEAN
    +
    11
    +
    12#ifndef NOMINMAX
    +
    13#define NOMINMAX
    +
    14#endif
    +
    15
    +
    16#include <windows.h>
    +
    17#else
    +
    18#include <sys/ioctl.h> // for winsize, ioctl, TIOCGWINSZ
    +
    19#include <unistd.h> // for STDOUT_FILENO
    +
    20#endif
    +
    21
    +
    22namespace ftxui {
    +
    23
    +
    24namespace {
    +
    25
    +
    26bool g_cached = false; // NOLINT
    +
    27Terminal::Color g_cached_supported_color; // NOLINT
    +
    28
    +
    29Dimensions& FallbackSize() {
    +
    30#if defined(__EMSCRIPTEN__)
    +
    31 // This dimension was chosen arbitrarily to be able to display:
    +
    32 // https://arthursonzogni.com/FTXUI/examples
    +
    33 // This will have to be improved when someone has time to implement and need
    +
    34 // it.
    +
    35 constexpr int fallback_width = 140;
    +
    36 constexpr int fallback_height = 43;
    +
    37#else
    +
    38 // The terminal size in VT100 was 80x24. It is still used nowadays by
    +
    39 // default in many terminal emulator. That's a good choice for a fallback
    +
    40 // value.
    +
    41 constexpr int fallback_width = 80;
    +
    42 constexpr int fallback_height = 24;
    +
    43#endif
    +
    44 static Dimensions g_fallback_size{
    +
    45 fallback_width,
    +
    46 fallback_height,
    +
    47 };
    +
    48 return g_fallback_size;
    +
    49}
    +
    50
    +
    51const char* Safe(const char* c) {
    +
    52 return (c != nullptr) ? c : "";
    +
    53}
    +
    54
    +
    55bool Contains(const std::string& s, const char* key) {
    +
    56 return s.find(key) != std::string::npos;
    +
    57}
    +
    58
    +
    59Terminal::Color ComputeColorSupport() {
    +
    60#if defined(__EMSCRIPTEN__)
    + +
    62#endif
    +
    63
    +
    64 std::string COLORTERM = Safe(std::getenv("COLORTERM")); // NOLINT
    +
    65 if (Contains(COLORTERM, "24bit") || Contains(COLORTERM, "truecolor")) {
    + +
    67 }
    +
    68
    +
    69 std::string TERM = Safe(std::getenv("TERM")); // NOLINT
    +
    70 if (Contains(COLORTERM, "256") || Contains(TERM, "256")) {
    + +
    72 }
    +
    73
    +
    74#if defined(FTXUI_MICROSOFT_TERMINAL_FALLBACK)
    +
    75 // Microsoft terminals do not properly declare themselves supporting true
    +
    76 // colors: https://github.com/microsoft/terminal/issues/1040
    +
    77 // As a fallback, assume microsoft terminal are the ones not setting those
    +
    78 // variables, and enable true colors.
    +
    79 if (TERM.empty() && COLORTERM.empty()) {
    + +
    81 }
    +
    82#endif
    +
    83
    + +
    85}
    +
    86
    +
    87} // namespace
    +
    88
    +
    89namespace Terminal {
    +
    90
    +
    91/// @brief Get the terminal size.
    +
    92/// @return The terminal size.
    +
    93/// @ingroup screen
    +
    + +
    95#if defined(__EMSCRIPTEN__)
    +
    96 // This dimension was chosen arbitrarily to be able to display:
    +
    97 // https://arthursonzogni.com/FTXUI/examples
    +
    98 // This will have to be improved when someone has time to implement and need
    +
    99 // it.
    +
    100 return FallbackSize();
    +
    101#elif defined(_WIN32)
    +
    102 CONSOLE_SCREEN_BUFFER_INFO csbi;
    +
    103
    +
    104 if (GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi)) {
    +
    105 return Dimensions{csbi.srWindow.Right - csbi.srWindow.Left + 1,
    +
    106 csbi.srWindow.Bottom - csbi.srWindow.Top + 1};
    +
    107 }
    +
    108
    +
    109 return FallbackSize();
    +
    110#else
    +
    111 winsize w{};
    +
    112 const int status = ioctl(STDOUT_FILENO, TIOCGWINSZ, &w); // NOLINT
    +
    113 // The ioctl return value result should be checked. Some operating systems
    +
    114 // don't support TIOCGWINSZ.
    +
    115 if (w.ws_col == 0 || w.ws_row == 0 || status < 0) {
    +
    116 return FallbackSize();
    +
    117 }
    +
    118 return Dimensions{w.ws_col, w.ws_row};
    +
    119#endif
    +
    120}
    +
    +
    121
    +
    122/// @brief Override terminal size in case auto-detection fails
    +
    123/// @param fallbackSize Terminal dimensions to fallback to
    +
    +
    124void SetFallbackSize(const Dimensions& fallbackSize) {
    +
    125 FallbackSize() = fallbackSize;
    +
    126}
    +
    +
    127
    +
    128/// @brief Get the color support of the terminal.
    +
    129/// @ingroup screen
    +
    + +
    131 if (!g_cached) {
    +
    132 g_cached = true;
    +
    133 g_cached_supported_color = ComputeColorSupport();
    +
    134 }
    +
    135 return g_cached_supported_color;
    +
    136}
    +
    +
    137
    +
    138/// @brief Override terminal color support in case auto-detection fails
    +
    139/// @ingroup dom
    +
    + +
    141 g_cached = true;
    +
    142 g_cached_supported_color = color;
    +
    143}
    +
    +
    144
    +
    145} // namespace Terminal
    +
    146} // namespace ftxui
    +
    void SetColorSupport(Color color)
    Override terminal color support in case auto-detection fails.
    Definition terminal.cpp:140
    +
    Decorator color(Color)
    Decorate using a foreground color.
    +
    Color
    Color is an enumeration that represents the color support of the terminal.
    Definition terminal.hpp:23
    +
    Dimensions Size()
    Get the terminal size.
    Definition terminal.cpp:94
    +
    Color ColorSupport()
    Get the color support of the terminal.
    Definition terminal.cpp:130
    + + + +
    Dimensions is a structure that represents the size of the terminal.
    Definition terminal.hpp:11
    +
    void SetFallbackSize(const Dimensions &fallbackSize)
    Override terminal size in case auto-detection fails.
    Definition terminal.cpp:124
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + +
    +
    + + + + + diff --git a/terminal_8cppm.html b/terminal_8cppm.html new file mode 100644 index 000000000..8bf37f638 --- /dev/null +++ b/terminal_8cppm.html @@ -0,0 +1,222 @@ + + + + + + + + +FTXUI: terminal.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    terminal.cppm File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    namespace  ftxui::Terminal
     
    +
    +
    + + + + + diff --git a/terminal_8cppm_source.html b/terminal_8cppm_source.html new file mode 100644 index 000000000..dd4d8107a --- /dev/null +++ b/terminal_8cppm_source.html @@ -0,0 +1,238 @@ + + + + + + + + +FTXUI: terminal.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    terminal.cppm
    +
    +
    +Go to the documentation of this file.
    1/// @module ftxui.screen.terminal
    +
    2/// @brief Module file for the Terminal namespace of the Screen module
    +
    3
    +
    4module;
    +
    5
    + +
    7
    +
    8export module ftxui.screen.terminal;
    +
    9
    +
    10/**
    +
    11 * @namespace ftxui
    +
    12 * @brief The FTXUI ftxui:: namespace
    +
    13 */
    +
    14export namespace ftxui {
    + +
    16
    +
    17 namespace Terminal {
    +
    18 using ftxui::Terminal::Size;
    +
    19 using ftxui::Terminal::SetFallbackSize;
    + +
    21 using ftxui::Terminal::ColorSupport;
    +
    22 using ftxui::Terminal::SetColorSupport;
    +
    23 }
    +
    24}
    +
    Color
    Color is an enumeration that represents the color support of the terminal.
    Definition terminal.hpp:23
    +
    Dimensions is a structure that represents the size of the terminal.
    Definition terminal.hpp:11
    +
    Module file for the Terminal namespace of the Screen module.
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + +
    +
    + + + + + diff --git a/terminal_8hpp.html b/terminal_8hpp.html new file mode 100644 index 000000000..ec7a5b7f4 --- /dev/null +++ b/terminal_8hpp.html @@ -0,0 +1,261 @@ + + + + + + + + +FTXUI: terminal.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    terminal.hpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Classes

    struct  Dimensions
     Dimensions is a structure that represents the size of the terminal. More...
     
    + + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    namespace  ftxui::Terminal
     
    + + + + +

    +Enumerations

    enum  Color {
    +  Palette1 +,
    +  Palette16 +,
    +  Palette256 +,
    +  TrueColor +
    + }
     Color is an enumeration that represents the color support of the terminal. More...
     
    + + + + + + + + + + + + + +

    +Functions

    Dimensions Size ()
     Get the terminal size.
     
    void SetFallbackSize (const Dimensions &fallbackSize)
     Override terminal size in case auto-detection fails.
     
    Color ColorSupport ()
     Get the color support of the terminal.
     
    void SetColorSupport (Color color)
     Override terminal color support in case auto-detection fails.
     
    +
    +
    + + + + + diff --git a/terminal_8hpp.js b/terminal_8hpp.js new file mode 100644 index 000000000..77ab5b50f --- /dev/null +++ b/terminal_8hpp.js @@ -0,0 +1,13 @@ +var terminal_8hpp = +[ + [ "Color", "terminal_8hpp.html#gab87bacfdad76e61b9412d7124be44c1c", [ + [ "Palette1", "terminal_8hpp.html#ggab87bacfdad76e61b9412d7124be44c1caf8fee1420fe204b3dafbacf27a545c41", null ], + [ "Palette16", "terminal_8hpp.html#ggab87bacfdad76e61b9412d7124be44c1cae5a76102d821ec8233fee04273c60349", null ], + [ "Palette256", "terminal_8hpp.html#ggab87bacfdad76e61b9412d7124be44c1ca7b88ab2a5c8fe8866c96ea4acb623876", null ], + [ "TrueColor", "terminal_8hpp.html#ggab87bacfdad76e61b9412d7124be44c1ca7afd9568e82d523c91b2bfe0cc47be29", null ] + ] ], + [ "Size", "terminal_8hpp.html#gad890c37601448c82ed0d5051c29e2f0c", null ], + [ "SetFallbackSize", "terminal_8hpp.html#a765662bcabb59dc93884674ee2fcc9fc", null ], + [ "ColorSupport", "terminal_8hpp.html#gae6e034f37aa66cfe4458a8cb6e8fc526", null ], + [ "SetColorSupport", "terminal_8hpp.html#ga65945a706131f407a47a1b9960dc1a4a", null ] +]; \ No newline at end of file diff --git a/terminal_8hpp_source.html b/terminal_8hpp_source.html new file mode 100644 index 000000000..3a1563c2a --- /dev/null +++ b/terminal_8hpp_source.html @@ -0,0 +1,265 @@ + + + + + + + + +FTXUI: terminal.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    terminal.hpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#ifndef FTXUI_SCREEN_TERMINAL_HPP
    +
    5#define FTXUI_SCREEN_TERMINAL_HPP
    +
    6
    +
    7namespace ftxui {
    +
    8
    +
    9/// @brief Dimensions is a structure that represents the size of the terminal
    +
    10/// @ingroup screen
    +
    +
    11struct Dimensions {
    +
    12 int dimx;
    +
    13 int dimy;
    +
    14};
    +
    +
    15
    +
    +
    16namespace Terminal {
    + +
    18void SetFallbackSize(const Dimensions& fallbackSize);
    +
    19
    +
    20/// @brief Color is an enumeration that represents the color support of the
    +
    21/// terminal.
    +
    22/// @ingroup screen
    + + +
    30void SetColorSupport(Color color);
    +
    31
    +
    32} // namespace Terminal
    +
    +
    33
    +
    34} // namespace ftxui
    +
    35
    +
    36#endif // FTXUI_SCREEN_TERMINAL_HPP
    +
    void SetColorSupport(Color color)
    Override terminal color support in case auto-detection fails.
    Definition terminal.cpp:140
    + + +
    Color is a class that represents a color in the terminal user interface.
    Definition color.hpp:22
    +
    Color
    Color is an enumeration that represents the color support of the terminal.
    Definition terminal.hpp:23
    +
    Dimensions Size()
    Get the terminal size.
    Definition terminal.cpp:94
    +
    Color ColorSupport()
    Get the color support of the terminal.
    Definition terminal.cpp:130
    + + + + +
    Dimensions is a structure that represents the size of the terminal.
    Definition terminal.hpp:11
    +
    void SetFallbackSize(const Dimensions &fallbackSize)
    Override terminal size in case auto-detection fails.
    Definition terminal.cpp:124
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    +
    + + + + + diff --git a/terminal__input__parser_8cpp.html b/terminal__input__parser_8cpp.html new file mode 100644 index 000000000..af6baaf01 --- /dev/null +++ b/terminal__input__parser_8cpp.html @@ -0,0 +1,226 @@ + + + + + + + + +FTXUI: terminal_input_parser.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    terminal_input_parser.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + +

    +Variables

    const std::map< std::string, std::string > g_uniformize
     
    +
    +
    + + + + + diff --git a/terminal__input__parser_8cpp.js b/terminal__input__parser_8cpp.js new file mode 100644 index 000000000..16327a379 --- /dev/null +++ b/terminal__input__parser_8cpp.js @@ -0,0 +1,4 @@ +var terminal__input__parser_8cpp = +[ + [ "g_uniformize", "terminal__input__parser_8cpp.html#a81094ad1eae10308826bbd3be2723b18", null ] +]; \ No newline at end of file diff --git a/terminal__input__parser_8cpp_source.html b/terminal__input__parser_8cpp_source.html new file mode 100644 index 000000000..a81aafc01 --- /dev/null +++ b/terminal__input__parser_8cpp_source.html @@ -0,0 +1,696 @@ + + + + + + + + +FTXUI: terminal_input_parser.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    terminal_input_parser.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    + +
    5
    +
    6#include <cstdint> // for uint32_t
    +
    7#include <ftxui/component/mouse.hpp> // for Mouse, Mouse::Button, Mouse::Motion
    +
    8#include <functional> // for std::function
    +
    9#include <map>
    +
    10#include <memory> // for unique_ptr, allocator
    +
    11#include <utility> // for move
    +
    12#include <vector>
    +
    13#include "ftxui/component/event.hpp" // for Event
    +
    14#include "ftxui/component/task.hpp" // for Task
    +
    15
    +
    16namespace ftxui {
    +
    17
    +
    18// NOLINTNEXTLINE
    +
    +
    19const std::map<std::string, std::string> g_uniformize = {
    +
    20 // Microsoft's terminal uses a different new line character for the return
    +
    21 // key. This also happens with linux with the `bind` command:
    +
    22 // See https://github.com/ArthurSonzogni/FTXUI/issues/337
    +
    23 // Here, we uniformize the new line character to `\n`.
    +
    24 {"\r", "\n"},
    +
    25
    +
    26 // See: https://github.com/ArthurSonzogni/FTXUI/issues/508
    +
    27 {std::string({8}), std::string({127})},
    +
    28
    +
    29 // See: https://github.com/ArthurSonzogni/FTXUI/issues/626
    +
    30 //
    +
    31 // Depending on the Cursor Key Mode (DECCKM), the terminal sends different
    +
    32 // escape sequences:
    +
    33 //
    +
    34 // Key Normal Application
    +
    35 // ----- -------- -----------
    +
    36 // Up ESC [ A ESC O A
    +
    37 // Down ESC [ B ESC O B
    +
    38 // Right ESC [ C ESC O C
    +
    39 // Left ESC [ D ESC O D
    +
    40 // Home ESC [ H ESC O H
    +
    41 // End ESC [ F ESC O F
    +
    42 //
    +
    43 {"\x1BOA", "\x1B[A"}, // UP
    +
    44 {"\x1BOB", "\x1B[B"}, // DOWN
    +
    45 {"\x1BOC", "\x1B[C"}, // RIGHT
    +
    46 {"\x1BOD", "\x1B[D"}, // LEFT
    +
    47 {"\x1BOH", "\x1B[H"}, // HOME
    +
    48 {"\x1BOF", "\x1B[F"}, // END
    +
    49
    +
    50 // Variations around the FN keys.
    +
    51 // Internally, we are using:
    +
    52 // vt220, xterm-vt200, xterm-xf86-v44, xterm-new, mgt, screen
    +
    53 // See: https://invisible-island.net/xterm/xterm-function-keys.html
    +
    54
    +
    55 // For linux OS console (CTRL+ALT+FN), who do not belong to any
    +
    56 // real standard.
    +
    57 // See: https://github.com/ArthurSonzogni/FTXUI/issues/685
    +
    58 {"\x1B[[A", "\x1BOP"}, // F1
    +
    59 {"\x1B[[B", "\x1BOQ"}, // F2
    +
    60 {"\x1B[[C", "\x1BOR"}, // F3
    +
    61 {"\x1B[[D", "\x1BOS"}, // F4
    +
    62 {"\x1B[[E", "\x1B[15~"}, // F5
    +
    63
    +
    64 // xterm-r5, xterm-r6, rxvt
    +
    65 {"\x1B[11~", "\x1BOP"}, // F1
    +
    66 {"\x1B[12~", "\x1BOQ"}, // F2
    +
    67 {"\x1B[13~", "\x1BOR"}, // F3
    +
    68 {"\x1B[14~", "\x1BOS"}, // F4
    +
    69
    +
    70 // vt100
    +
    71 {"\x1BOt", "\x1B[15~"}, // F5
    +
    72 {"\x1BOu", "\x1B[17~"}, // F6
    +
    73 {"\x1BOv", "\x1B[18~"}, // F7
    +
    74 {"\x1BOl", "\x1B[19~"}, // F8
    +
    75 {"\x1BOw", "\x1B[20~"}, // F9
    +
    76 {"\x1BOx", "\x1B[21~"}, // F10
    +
    77
    +
    78 // scoansi
    +
    79 {"\x1B[M", "\x1BOP"}, // F1
    +
    80 {"\x1B[N", "\x1BOQ"}, // F2
    +
    81 {"\x1B[O", "\x1BOR"}, // F3
    +
    82 {"\x1B[P", "\x1BOS"}, // F4
    +
    83 {"\x1B[Q", "\x1B[15~"}, // F5
    +
    84 {"\x1B[R", "\x1B[17~"}, // F6
    +
    85 {"\x1B[S", "\x1B[18~"}, // F7
    +
    86 {"\x1B[T", "\x1B[19~"}, // F8
    +
    87 {"\x1B[U", "\x1B[20~"}, // F9
    +
    88 {"\x1B[V", "\x1B[21~"}, // F10
    +
    89 {"\x1B[W", "\x1B[23~"}, // F11
    +
    90 {"\x1B[X", "\x1B[24~"}, // F12
    +
    91};
    +
    +
    92
    +
    + +
    94 : out_(std::move(out)) {}
    +
    +
    95
    +
    + +
    97 timeout_ += time;
    +
    98 const int timeout_threshold = 50;
    +
    99 if (timeout_ < timeout_threshold) {
    +
    100 return;
    +
    101 }
    +
    102 timeout_ = 0;
    +
    103 if (!pending_.empty()) {
    +
    104 Send(SPECIAL);
    +
    105 }
    +
    106}
    +
    +
    107
    +
    + +
    109 pending_ += c;
    +
    110 timeout_ = 0;
    +
    111 position_ = -1;
    +
    112 Send(Parse());
    +
    113}
    +
    +
    114
    +
    115unsigned char TerminalInputParser::Current() {
    +
    116 return pending_[position_];
    +
    117}
    +
    118
    +
    119bool TerminalInputParser::Eat() {
    +
    120 position_++;
    +
    121 return position_ < static_cast<int>(pending_.size());
    +
    122}
    +
    123
    +
    124void TerminalInputParser::Send(TerminalInputParser::Output output) {
    +
    125 switch (output.type) {
    +
    126 case UNCOMPLETED:
    +
    127 return;
    +
    128
    +
    129 case DROP:
    +
    130 pending_.clear();
    +
    131 return;
    +
    132
    +
    133 case CHARACTER:
    +
    134 out_(Event::Character(std::move(pending_)));
    +
    135 pending_.clear();
    +
    136 return;
    +
    137
    +
    138 case SPECIAL: {
    +
    139 auto it = g_uniformize.find(pending_);
    +
    140 if (it != g_uniformize.end()) {
    +
    141 pending_ = it->second;
    +
    142 }
    +
    143 out_(Event::Special(std::move(pending_)));
    +
    144 pending_.clear();
    +
    145 }
    +
    146 return;
    +
    147
    +
    148 case MOUSE:
    +
    149 out_(Event::Mouse(std::move(pending_), output.mouse)); // NOLINT
    +
    150 pending_.clear();
    +
    151 return;
    +
    152
    +
    153 case CURSOR_POSITION:
    +
    154 out_(Event::CursorPosition(std::move(pending_), // NOLINT
    +
    155 output.cursor.x, // NOLINT
    +
    156 output.cursor.y)); // NOLINT
    +
    157 pending_.clear();
    +
    158 return;
    +
    159
    +
    160 case CURSOR_SHAPE:
    +
    161 out_(Event::CursorShape(std::move(pending_), output.cursor_shape));
    +
    162 pending_.clear();
    +
    163 return;
    +
    164 }
    +
    165 // NOT_REACHED().
    +
    166}
    +
    167
    +
    168TerminalInputParser::Output TerminalInputParser::Parse() {
    +
    169 if (!Eat()) {
    +
    170 return UNCOMPLETED;
    +
    171 }
    +
    172
    +
    173 if (Current() == '\x1B') {
    +
    174 return ParseESC();
    +
    175 }
    +
    176
    +
    177 if (Current() < 32) { // C0 NOLINT
    +
    178 return SPECIAL;
    +
    179 }
    +
    180
    +
    181 if (Current() == 127) { // Delete // NOLINT
    +
    182 return SPECIAL;
    +
    183 }
    +
    184
    +
    185 return ParseUTF8();
    +
    186}
    +
    187
    +
    188// Code point <-> UTF-8 conversion
    +
    189//
    +
    190// ┏━━━━━━━━┳━━━━━━━━┳━━━━━━━━┳━━━━━━━━┓
    +
    191// ┃Byte 1 ┃Byte 2 ┃Byte 3 ┃Byte 4 ┃
    +
    192// ┡━━━━━━━━╇━━━━━━━━╇━━━━━━━━╇━━━━━━━━┩
    +
    193// │0xxxxxxx│ │ │ │
    +
    194// ├────────┼────────┼────────┼────────┤
    +
    195// │110xxxxx│10xxxxxx│ │ │
    +
    196// ├────────┼────────┼────────┼────────┤
    +
    197// │1110xxxx│10xxxxxx│10xxxxxx│ │
    +
    198// ├────────┼────────┼────────┼────────┤
    +
    199// │11110xxx│10xxxxxx│10xxxxxx│10xxxxxx│
    +
    200// └────────┴────────┴────────┴────────┘
    +
    201//
    +
    202// Then some sequences are illegal if it exist a shorter representation of the
    +
    203// same codepoint.
    +
    204TerminalInputParser::Output TerminalInputParser::ParseUTF8() {
    +
    205 auto head = Current();
    +
    206 unsigned char selector = 0b1000'0000; // NOLINT
    +
    207
    +
    208 // The non code-point part of the first byte.
    +
    209 unsigned char mask = selector;
    +
    210
    +
    211 // Find the first zero in the first byte.
    +
    212 unsigned int first_zero = 8; // NOLINT
    +
    213 for (unsigned int i = 0; i < 8; ++i) { // NOLINT
    +
    214 mask |= selector;
    +
    215 if (!(head & selector)) {
    +
    216 first_zero = i;
    +
    217 break;
    +
    218 }
    +
    219 selector >>= 1U;
    +
    220 }
    +
    221
    +
    222 // Accumulate the value of the first byte.
    +
    223 auto value = uint32_t(head & ~mask); // NOLINT
    +
    224
    +
    225 // Invalid UTF8, with more than 5 bytes.
    +
    226 const unsigned int max_utf8_bytes = 5;
    +
    227 if (first_zero == 1 || first_zero >= max_utf8_bytes) {
    +
    228 return DROP;
    +
    229 }
    +
    230
    +
    231 // Multi byte UTF-8.
    +
    232 for (unsigned int i = 2; i <= first_zero; ++i) {
    +
    233 if (!Eat()) {
    +
    234 return UNCOMPLETED;
    +
    235 }
    +
    236
    +
    237 // Invalid continuation byte.
    +
    238 head = Current();
    +
    239 if ((head & 0b1100'0000) != 0b1000'0000) { // NOLINT
    +
    240 return DROP;
    +
    241 }
    +
    242 value <<= 6; // NOLINT
    +
    243 value += head & 0b0011'1111; // NOLINT
    +
    244 }
    +
    245
    +
    246 // Check for overlong UTF8 encoding.
    +
    247 int extra_byte = 0;
    +
    248 if (value <= 0b000'0000'0111'1111) { // NOLINT
    +
    249 extra_byte = 0; // NOLINT
    +
    250 } else if (value <= 0b000'0111'1111'1111) { // NOLINT
    +
    251 extra_byte = 1; // NOLINT
    +
    252 } else if (value <= 0b1111'1111'1111'1111) { // NOLINT
    +
    253 extra_byte = 2; // NOLINT
    +
    254 } else if (value <= 0b1'0000'1111'1111'1111'1111) { // NOLINT
    +
    255 extra_byte = 3; // NOLINT
    +
    256 } else { // NOLINT
    +
    257 return DROP;
    +
    258 }
    +
    259
    +
    260 if (extra_byte != position_) {
    +
    261 return DROP;
    +
    262 }
    +
    263
    +
    264 return CHARACTER;
    +
    265}
    +
    266
    +
    267TerminalInputParser::Output TerminalInputParser::ParseESC() {
    +
    268 if (!Eat()) {
    +
    269 return UNCOMPLETED;
    +
    270 }
    +
    271 switch (Current()) {
    +
    272 case 'P':
    +
    273 return ParseDCS();
    +
    274 case '[':
    +
    275 return ParseCSI();
    +
    276 case ']':
    +
    277 return ParseOSC();
    +
    278
    +
    279 // Expecting 2 characters.
    +
    280 case ' ':
    +
    281 case '#':
    +
    282 case '%':
    +
    283 case '(':
    +
    284 case ')':
    +
    285 case '*':
    +
    286 case '+':
    +
    287 case 'O':
    +
    288 case 'N': {
    +
    289 if (!Eat()) {
    +
    290 return UNCOMPLETED;
    +
    291 }
    +
    292 return SPECIAL;
    +
    293 }
    +
    294 // Expecting 1 character:
    +
    295 default:
    +
    296 return SPECIAL;
    +
    297 }
    +
    298}
    +
    299
    +
    300// ESC P ... ESC BACKSLASH
    +
    301TerminalInputParser::Output TerminalInputParser::ParseDCS() {
    +
    302 // Parse until the string terminator ST.
    +
    303 while (true) {
    +
    304 if (!Eat()) {
    +
    305 return UNCOMPLETED;
    +
    306 }
    +
    307
    +
    308 if (Current() != '\x1B') {
    +
    309 continue;
    +
    310 }
    +
    311
    +
    312 if (!Eat()) {
    +
    313 return UNCOMPLETED;
    +
    314 }
    +
    315
    +
    316 if (Current() != '\\') {
    +
    317 continue;
    +
    318 }
    +
    319
    +
    320 if (pending_.size() == 10 && //
    +
    321 pending_[2] == '1' && //
    +
    322 pending_[3] == '$' && //
    +
    323 pending_[4] == 'r' && //
    +
    324 true) {
    +
    325 Output output(CURSOR_SHAPE);
    +
    326 output.cursor_shape = pending_[5] - '0';
    +
    327 return output;
    +
    328 }
    +
    329
    +
    330 return SPECIAL;
    +
    331 }
    +
    332}
    +
    333
    +
    334TerminalInputParser::Output TerminalInputParser::ParseCSI() {
    +
    335 bool altered = false;
    +
    336 int argument = 0;
    +
    337 std::vector<int> arguments;
    +
    338 while (true) {
    +
    339 if (!Eat()) {
    +
    340 return UNCOMPLETED;
    +
    341 }
    +
    342
    +
    343 if (Current() == '<') {
    +
    344 altered = true;
    +
    345 continue;
    +
    346 }
    +
    347
    +
    348 if (Current() >= '0' && Current() <= '9') {
    +
    349 argument *= 10; // NOLINT
    +
    350 argument += Current() - '0';
    +
    351 continue;
    +
    352 }
    +
    353
    +
    354 if (Current() == ';') {
    +
    355 arguments.push_back(argument);
    +
    356 argument = 0;
    +
    357 continue;
    +
    358 }
    +
    359
    +
    360 // CSI is terminated by a character in the range 0x40–0x7E
    +
    361 // (ASCII @A–Z[\]^_`a–z{|}~),
    +
    362 if (Current() >= '@' && Current() <= '~' &&
    +
    363 // Note: I don't remember why we exclude '<'
    +
    364 Current() != '<' &&
    +
    365 // To handle F1-F4, we exclude '['.
    +
    366 Current() != '[') {
    +
    367 arguments.push_back(argument);
    +
    368 argument = 0; // NOLINT
    +
    369
    +
    370 switch (Current()) {
    +
    371 case 'M':
    +
    372 return ParseMouse(altered, true, std::move(arguments));
    +
    373 case 'm':
    +
    374 return ParseMouse(altered, false, std::move(arguments));
    +
    375 case 'R':
    +
    376 return ParseCursorPosition(std::move(arguments));
    +
    377 default:
    +
    378 return SPECIAL;
    +
    379 }
    +
    380 }
    +
    381
    +
    382 // Invalid ESC in CSI.
    +
    383 if (Current() == '\x1B') {
    +
    384 return SPECIAL;
    +
    385 }
    +
    386 }
    +
    387}
    +
    388
    +
    389TerminalInputParser::Output TerminalInputParser::ParseOSC() {
    +
    390 // Parse until the string terminator ST.
    +
    391 while (true) {
    +
    392 if (!Eat()) {
    +
    393 return UNCOMPLETED;
    +
    394 }
    +
    395 if (Current() != '\x1B') {
    +
    396 continue;
    +
    397 }
    +
    398 if (!Eat()) {
    +
    399 return UNCOMPLETED;
    +
    400 }
    +
    401 if (Current() != '\\') {
    +
    402 continue;
    +
    403 }
    +
    404 return SPECIAL;
    +
    405 }
    +
    406}
    +
    407
    +
    408TerminalInputParser::Output TerminalInputParser::ParseMouse( // NOLINT
    +
    409 bool altered,
    +
    410 bool pressed,
    +
    411 std::vector<int> arguments) {
    +
    412 if (arguments.size() != 3) {
    +
    413 return SPECIAL;
    +
    414 }
    +
    415
    +
    416 (void)altered;
    +
    417
    +
    418 Output output(MOUSE);
    +
    419 output.mouse.motion = Mouse::Motion(pressed); // NOLINT
    +
    420
    +
    421 // Bits value Modifer Comment
    +
    422 // ---- ----- ------- ---------
    +
    423 // 0 1 1 2 button 0 = Left, 1 = Middle, 2 = Right, 3 = Release
    +
    424 // 2 4 Shift
    +
    425 // 3 8 Meta
    +
    426 // 4 16 Control
    +
    427 // 5 32 Move
    +
    428 // 6 64 Wheel
    +
    429
    +
    430 // clang-format off
    +
    431 const int button = arguments[0] & (1 + 2); // NOLINT
    +
    432 const bool is_shift = arguments[0] & 4; // NOLINT
    +
    433 const bool is_meta = arguments[0] & 8; // NOLINT
    +
    434 const bool is_control = arguments[0] & 16; // NOLINT
    +
    435 const bool is_move = arguments[0] & 32; // NOLINT
    +
    436 const bool is_wheel = arguments[0] & 64; // NOLINT
    +
    437 // clang-format on
    +
    438
    +
    439 output.mouse.motion = is_move ? Mouse::Moved : Mouse::Motion(pressed);
    +
    440 output.mouse.button = is_wheel ? Mouse::Button(Mouse::WheelUp + button) //
    +
    441 : Mouse::Button(button);
    +
    442 output.mouse.shift = is_shift;
    +
    443 output.mouse.meta = is_meta;
    +
    444 output.mouse.control = is_control;
    +
    445 output.mouse.x = arguments[1]; // NOLINT
    +
    446 output.mouse.y = arguments[2]; // NOLINT
    +
    447
    +
    448 // Motion event.
    +
    449 return output;
    +
    450}
    +
    451
    +
    452// NOLINTNEXTLINE
    +
    453TerminalInputParser::Output TerminalInputParser::ParseCursorPosition(
    +
    454 std::vector<int> arguments) {
    +
    455 if (arguments.size() != 2) {
    +
    456 return SPECIAL;
    +
    457 }
    +
    458 Output output(CURSOR_POSITION);
    +
    459 output.cursor.y = arguments[0]; // NOLINT
    +
    460 output.cursor.x = arguments[1]; // NOLINT
    +
    461 return output;
    +
    462}
    +
    463
    +
    464} // namespace ftxui
    + + +
    TerminalInputParser(std::function< void(Event)> out)
    + + + + + +
    static Event Special(std::string)
    An custom event whose meaning is defined by the user of the library.
    Definition event.cpp:74
    +
    Represent an event. It can be key press event, a terminal resize, or more ...
    Definition event.hpp:29
    + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    const std::map< std::string, std::string > g_uniformize
    + + +
    +
    + + + + + diff --git a/terminal__input__parser_8hpp.html b/terminal__input__parser_8hpp.html new file mode 100644 index 000000000..b030b4e46 --- /dev/null +++ b/terminal__input__parser_8hpp.html @@ -0,0 +1,226 @@ + + + + + + + + +FTXUI: terminal_input_parser.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    terminal_input_parser.hpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Classes

    class  TerminalInputParser
     
    + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    +
    +
    + + + + + diff --git a/terminal__input__parser_8hpp.js b/terminal__input__parser_8hpp.js new file mode 100644 index 000000000..99afbf10d --- /dev/null +++ b/terminal__input__parser_8hpp.js @@ -0,0 +1,4 @@ +var terminal__input__parser_8hpp = +[ + [ "TerminalInputParser", "classftxui_1_1TerminalInputParser.html", "classftxui_1_1TerminalInputParser" ] +]; \ No newline at end of file diff --git a/terminal__input__parser_8hpp_source.html b/terminal__input__parser_8hpp_source.html new file mode 100644 index 000000000..3a9b773df --- /dev/null +++ b/terminal__input__parser_8hpp_source.html @@ -0,0 +1,291 @@ + + + + + + + + +FTXUI: terminal_input_parser.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    terminal_input_parser.hpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#ifndef FTXUI_COMPONENT_TERMINAL_INPUT_PARSER
    +
    5#define FTXUI_COMPONENT_TERMINAL_INPUT_PARSER
    +
    6
    +
    7#include <functional>
    +
    8#include <string> // for string
    +
    9#include <vector> // for vector
    +
    10
    +
    11#include "ftxui/component/mouse.hpp" // for Mouse
    +
    12
    +
    13namespace ftxui {
    +
    14struct Event;
    +
    15
    +
    16// Parse a sequence of |char| accross |time|. Produces |Event|.
    +
    + +
    18 public:
    +
    19 explicit TerminalInputParser(std::function<void(Event)> out);
    +
    20 void Timeout(int time);
    +
    21 void Add(char c);
    +
    22
    +
    23 private:
    +
    24 unsigned char Current();
    +
    25 bool Eat();
    +
    26
    +
    27 enum Type {
    +
    28 UNCOMPLETED,
    +
    29 DROP,
    +
    30 CHARACTER,
    +
    31 MOUSE,
    +
    32 CURSOR_POSITION,
    +
    33 CURSOR_SHAPE,
    +
    34 SPECIAL,
    +
    35 };
    +
    36
    +
    37 struct CursorPosition {
    +
    38 int x;
    +
    39 int y;
    +
    40 };
    +
    41
    +
    42 struct Output {
    +
    43 Type type;
    +
    44 union {
    +
    45 Mouse mouse;
    +
    46 CursorPosition cursor{};
    +
    47 int cursor_shape;
    +
    48 };
    +
    49
    +
    50 Output(Type t) // NOLINT
    +
    51 : type(t) {}
    +
    52 };
    +
    53
    +
    54 void Send(Output output);
    +
    55 Output Parse();
    +
    56 Output ParseUTF8();
    +
    57 Output ParseESC();
    +
    58 Output ParseDCS();
    +
    59 Output ParseCSI();
    +
    60 Output ParseOSC();
    +
    61 Output ParseMouse(bool altered, bool pressed, std::vector<int> arguments);
    +
    62 Output ParseCursorPosition(std::vector<int> arguments);
    +
    63
    +
    64 std::function<void(Event)> out_;
    +
    65 int position_ = -1;
    +
    66 int timeout_ = 0;
    +
    67 std::string pending_;
    +
    68};
    +
    +
    69
    +
    70} // namespace ftxui
    +
    71
    +
    72#endif /* end of include guard: FTXUI_COMPONENT_TERMINAL_INPUT_PARSER */
    + + + +
    TerminalInputParser(std::function< void(Event)> out)
    +
    Represent an event. It can be key press event, a terminal resize, or more ...
    Definition event.hpp:29
    +
    A mouse event. It contains the coordinate of the mouse, the button pressed and the modifier (shift,...
    Definition mouse.hpp:11
    + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    +
    + + + + + diff --git a/terminal__input__parser__test__fuzzer_8cpp.html b/terminal__input__parser__test__fuzzer_8cpp.html new file mode 100644 index 000000000..871d92c75 --- /dev/null +++ b/terminal__input__parser__test__fuzzer_8cpp.html @@ -0,0 +1,243 @@ + + + + + + + + +FTXUI: terminal_input_parser_test_fuzzer.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    terminal_input_parser_test_fuzzer.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Functions

    int LLVMFuzzerTestOneInput (const char *data, size_t size)
     
    +

    Function Documentation

    + +

    ◆ LLVMFuzzerTestOneInput()

    + +
    +
    + + + + + + + + + + + +
    int LLVMFuzzerTestOneInput (const char * data,
    size_t size )
    +
    + +

    Definition at line 8 of file terminal_input_parser_test_fuzzer.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/terminal__input__parser__test__fuzzer_8cpp.js b/terminal__input__parser__test__fuzzer_8cpp.js new file mode 100644 index 000000000..f287ddaaf --- /dev/null +++ b/terminal__input__parser__test__fuzzer_8cpp.js @@ -0,0 +1,4 @@ +var terminal__input__parser__test__fuzzer_8cpp = +[ + [ "LLVMFuzzerTestOneInput", "terminal__input__parser__test__fuzzer_8cpp.html#af5589fffd86439465eeb19c9774d1982", null ] +]; \ No newline at end of file diff --git a/terminal__input__parser__test__fuzzer_8cpp_source.html b/terminal__input__parser__test__fuzzer_8cpp_source.html new file mode 100644 index 000000000..15a0b037e --- /dev/null +++ b/terminal__input__parser__test__fuzzer_8cpp_source.html @@ -0,0 +1,233 @@ + + + + + + + + +FTXUI: terminal_input_parser_test_fuzzer.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    terminal_input_parser_test_fuzzer.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2021 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <cstddef>
    + + +
    7
    +
    +
    8extern "C" int LLVMFuzzerTestOneInput(const char* data, size_t size) {
    +
    9 using namespace ftxui;
    +
    10 auto parser = TerminalInputParser([&](Event) {});
    +
    11 for (size_t i = 0; i < size; ++i) {
    +
    12 parser.Add(data[i]);
    +
    13 }
    +
    14
    +
    15 return 0; // Non-zero return values are reserved for future use.
    +
    16}
    +
    + + +
    Represent an event. It can be key press event, a terminal resize, or more ...
    Definition event.hpp:29
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + +
    int LLVMFuzzerTestOneInput(const char *data, size_t size)
    +
    +
    + + + + + diff --git a/text_8cpp.html b/text_8cpp.html new file mode 100644 index 000000000..9534752f7 --- /dev/null +++ b/text_8cpp.html @@ -0,0 +1,236 @@ + + + + + + + + +FTXUI: text.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    text.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + + + + + + + + + + +

    +Functions

    Element text (std::string text)
     Display a piece of UTF8 encoded unicode text.
     
    Element text (std::wstring text)
     Display a piece of unicode text.
     
    Element vtext (std::string text)
     Display a piece of unicode text vertically.
     
    Element vtext (std::wstring text)
     Display a piece unicode text vertically.
     
    +
    +
    + + + + + diff --git a/text_8cpp.js b/text_8cpp.js new file mode 100644 index 000000000..3c87e01d0 --- /dev/null +++ b/text_8cpp.js @@ -0,0 +1,7 @@ +var text_8cpp = +[ + [ "text", "text_8cpp.html#ga366051704fd333c23460f7932598a5e3", null ], + [ "text", "text_8cpp.html#ga75baaa2734ed76a9f478beaafa87ae57", null ], + [ "vtext", "text_8cpp.html#ga64172a43b4b526afeb6313e6e1a6d5a1", null ], + [ "vtext", "text_8cpp.html#ga9f9f7485a45aa9d432726ca9845d1eac", null ] +]; \ No newline at end of file diff --git a/text_8cpp_source.html b/text_8cpp_source.html new file mode 100644 index 000000000..3529f7c97 --- /dev/null +++ b/text_8cpp_source.html @@ -0,0 +1,460 @@ + + + + + + + + +FTXUI: text.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    text.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <algorithm> // for min
    +
    5#include <memory> // for make_shared
    +
    6#include <sstream>
    +
    7#include <string> // for string, wstring
    +
    8#include <utility> // for move
    +
    9
    +
    10#include "ftxui/dom/deprecated.hpp" // for text, vtext
    +
    11#include "ftxui/dom/elements.hpp" // for Element, text, vtext
    +
    12#include "ftxui/dom/node.hpp" // for Node
    +
    13#include "ftxui/dom/requirement.hpp" // for Requirement
    +
    14#include "ftxui/dom/selection.hpp" // for Selection
    +
    15#include "ftxui/screen/box.hpp" // for Box
    +
    16#include "ftxui/screen/screen.hpp" // for Pixel, Screen
    +
    17#include "ftxui/screen/string.hpp" // for string_width, Utf8ToGlyphs, to_string
    +
    18
    +
    19namespace ftxui {
    +
    20
    +
    21namespace {
    +
    22using ftxui::Screen;
    +
    23
    +
    24class Text : public Node {
    +
    25 public:
    +
    26 explicit Text(std::string text) : text_(std::move(text)) {}
    +
    27
    +
    28 void ComputeRequirement() override {
    +
    29 requirement_.min_x = string_width(text_);
    +
    30 requirement_.min_y = 1;
    +
    31 has_selection = false;
    +
    32 }
    +
    33
    +
    34 void Select(Selection& selection) override {
    +
    35 if (Box::Intersection(selection.GetBox(), box_).IsEmpty()) {
    +
    36 return;
    +
    37 }
    +
    38
    +
    39 const Selection selection_saturated = selection.SaturateHorizontal(box_);
    +
    40
    +
    41 has_selection = true;
    +
    42 selection_start_ = selection_saturated.GetBox().x_min;
    +
    43 selection_end_ = selection_saturated.GetBox().x_max;
    +
    44
    +
    45 std::stringstream ss;
    +
    46 int x = box_.x_min;
    +
    47 for (const auto& cell : Utf8ToGlyphs(text_)) {
    +
    48 if (cell == "\n") {
    +
    49 continue;
    +
    50 }
    +
    51 if (selection_start_ <= x && x <= selection_end_) {
    +
    52 ss << cell;
    +
    53 }
    +
    54 x++;
    +
    55 }
    +
    56 selection.AddPart(ss.str(), box_.y_min, selection_start_, selection_end_);
    +
    57 }
    +
    58
    +
    59 void Render(Screen& screen) override {
    +
    60 int x = box_.x_min;
    +
    61 const int y = box_.y_min;
    +
    62
    +
    63 if (y > box_.y_max) {
    +
    64 return;
    +
    65 }
    +
    66
    +
    67 for (const auto& cell : Utf8ToGlyphs(text_)) {
    +
    68 if (x > box_.x_max) {
    +
    69 break;
    +
    70 }
    +
    71 if (cell == "\n") {
    +
    72 continue;
    +
    73 }
    +
    74 screen.PixelAt(x, y).character = cell;
    +
    75
    +
    76 if (has_selection) {
    +
    77 auto selectionTransform = screen.GetSelectionStyle();
    +
    78 if ((x >= selection_start_) && (x <= selection_end_)) {
    +
    79 selectionTransform(screen.PixelAt(x, y));
    +
    80 }
    +
    81 }
    +
    82
    +
    83 ++x;
    +
    84 }
    +
    85 }
    +
    86
    +
    87 private:
    +
    88 std::string text_;
    +
    89 bool has_selection = false;
    +
    90 int selection_start_ = 0;
    +
    91 int selection_end_ = -1;
    +
    92};
    +
    93
    +
    94class VText : public Node {
    +
    95 public:
    +
    96 explicit VText(std::string text)
    +
    97 : text_(std::move(text)), width_{std::min(string_width(text_), 1)} {}
    +
    98
    +
    99 void ComputeRequirement() override {
    +
    100 requirement_.min_x = width_;
    +
    101 requirement_.min_y = string_width(text_);
    +
    102 }
    +
    103
    +
    104 void Render(Screen& screen) override {
    +
    105 const int x = box_.x_min;
    +
    106 int y = box_.y_min;
    +
    107 if (x + width_ - 1 > box_.x_max) {
    +
    108 return;
    +
    109 }
    +
    110 for (const auto& it : Utf8ToGlyphs(text_)) {
    +
    111 if (y > box_.y_max) {
    +
    112 return;
    +
    113 }
    +
    114 screen.PixelAt(x, y).character = it;
    +
    115 y += 1;
    +
    116 }
    +
    117 }
    +
    118
    +
    119 private:
    +
    120 std::string text_;
    +
    121 int width_ = 1;
    +
    122};
    +
    123
    +
    124} // namespace
    +
    125
    +
    126/// @brief Display a piece of UTF8 encoded unicode text.
    +
    127/// @ingroup dom
    +
    128/// @see ftxui::to_wstring
    +
    129///
    +
    130/// ### Example
    +
    131///
    +
    132/// ```cpp
    +
    133/// Element document = text("Hello world!");
    +
    134/// ```
    +
    135///
    +
    136/// ### Output
    +
    137///
    +
    138/// ```bash
    +
    139/// Hello world!
    +
    140/// ```
    +
    +
    141Element text(std::string text) {
    +
    142 return std::make_shared<Text>(std::move(text));
    +
    143}
    +
    +
    144
    +
    145/// @brief Display a piece of unicode text.
    +
    146/// @ingroup dom
    +
    147/// @see ftxui::to_wstring
    +
    148///
    +
    149/// ### Example
    +
    150///
    +
    151/// ```cpp
    +
    152/// Element document = text(L"Hello world!");
    +
    153/// ```
    +
    154///
    +
    155/// ### Output
    +
    156///
    +
    157/// ```bash
    +
    158/// Hello world!
    +
    159/// ```
    +
    +
    160Element text(std::wstring text) { // NOLINT
    +
    161 return std::make_shared<Text>(to_string(text));
    +
    162}
    +
    +
    163
    +
    164/// @brief Display a piece of unicode text vertically.
    +
    165/// @ingroup dom
    +
    166/// @see ftxui::to_wstring
    +
    167///
    +
    168/// ### Example
    +
    169///
    +
    170/// ```cpp
    +
    171/// Element document = vtext("Hello world!");
    +
    172/// ```
    +
    173///
    +
    174/// ### Output
    +
    175///
    +
    176/// ```bash
    +
    177/// H
    +
    178/// e
    +
    179/// l
    +
    180/// l
    +
    181/// o
    +
    182///
    +
    183/// w
    +
    184/// o
    +
    185/// r
    +
    186/// l
    +
    187/// d
    +
    188/// !
    +
    189/// ```
    +
    +
    190Element vtext(std::string text) {
    +
    191 return std::make_shared<VText>(std::move(text));
    +
    192}
    +
    +
    193
    +
    194/// @brief Display a piece unicode text vertically.
    +
    195/// @ingroup dom
    +
    196/// @see ftxui::to_wstring
    +
    197///
    +
    198/// ### Example
    +
    199///
    +
    200/// ```cpp
    +
    201/// Element document = vtext(L"Hello world!");
    +
    202/// ```
    +
    203///
    +
    204/// ### Output
    +
    205///
    +
    206/// ```bash
    +
    207/// H
    +
    208/// e
    +
    209/// l
    +
    210/// l
    +
    211/// o
    +
    212///
    +
    213/// w
    +
    214/// o
    +
    215/// r
    +
    216/// l
    +
    217/// d
    +
    218/// !
    +
    219/// ```
    +
    +
    220Element vtext(std::wstring text) { // NOLINT
    +
    221 return std::make_shared<VText>(to_string(text));
    +
    222}
    +
    +
    223
    +
    224} // namespace ftxui
    + + + +
    Element text(std::wstring text)
    Display a piece of unicode text.
    Definition text.cpp:160
    +
    Element vtext(std::wstring text)
    Display a piece unicode text vertically.
    Definition text.cpp:220
    +
    void Render(Screen &screen, const Element &element)
    Display an element on a ftxui::Screen.
    Definition node.cpp:84
    +
    static auto Intersection(Box a, Box b) -> Box
    Definition box.cpp:11
    +
    A rectangular grid of Pixel.
    Definition screen.hpp:26
    + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    std::vector< std::string > Utf8ToGlyphs(const std::string &input)
    Definition string.cpp:1358
    +
    int string_width(const std::string &)
    Definition string.cpp:1331
    +
    std::string to_string(const std::wstring &s)
    Convert a std::wstring into a UTF8 std::string.
    Definition string.cpp:1566
    + + + + + +
    +
    + + + + + diff --git a/textarea_8cpp.html b/textarea_8cpp.html new file mode 100644 index 000000000..ee55dc017 --- /dev/null +++ b/textarea_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: textarea.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    textarea.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Functions

    int main ()
     
    +

    Function Documentation

    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 13 of file textarea.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/textarea_8cpp.js b/textarea_8cpp.js new file mode 100644 index 000000000..896e697cf --- /dev/null +++ b/textarea_8cpp.js @@ -0,0 +1,4 @@ +var textarea_8cpp = +[ + [ "main", "textarea_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/textarea_8cpp_source.html b/textarea_8cpp_source.html new file mode 100644 index 000000000..87f058c17 --- /dev/null +++ b/textarea_8cpp_source.html @@ -0,0 +1,252 @@ + + + + + + + + +FTXUI: textarea.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    textarea.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <memory> // for allocator, __shared_ptr_access, shared_ptr
    +
    5#include <string> // for string
    +
    6
    +
    7#include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    8#include "ftxui/component/component.hpp" // for Input, Renderer, ResizableSplitLeft
    +
    9#include "ftxui/component/component_base.hpp" // for ComponentBase, Component
    +
    10#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    11#include "ftxui/dom/elements.hpp" // for operator|, separator, text, Element, flex, vbox, border
    +
    12
    +
    +
    13int main() {
    +
    14 using namespace ftxui;
    +
    15
    +
    16 std::string content_1;
    +
    17 std::string content_2;
    +
    18 auto textarea_1 = Input(&content_1);
    +
    19 auto textarea_2 = Input(&content_2);
    +
    20 int size = 50;
    +
    21 auto layout = ResizableSplitLeft(textarea_1, textarea_2, &size);
    +
    22
    +
    23 auto component = Renderer(layout, [&] {
    +
    24 return vbox({
    +
    25 text("Input:"),
    +
    26 separator(),
    +
    27 layout->Render() | flex,
    +
    28 }) |
    +
    29 border;
    +
    30 });
    +
    31
    +
    32 auto screen = ScreenInteractive::Fullscreen();
    +
    33 screen.Loop(component);
    +
    34}
    +
    + + + + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + +
    int main()
    Definition textarea.cpp:13
    +
    +
    + + + + + diff --git a/todo.html b/todo.html new file mode 100644 index 000000000..2bab21c58 --- /dev/null +++ b/todo.html @@ -0,0 +1,215 @@ + + + + + + + + +FTXUI: Todo List + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Todo List
    +
    +
    +
    +
    Page Conan
    +

    Add instructions on how to use the conan recipe.

    +

    Please consider adding an "official" recipe to Conan Center if know how. It could be a github action that will automatically update the conan center when a new release is made.

    +
    +
    +
    +
    +
    + + + + + diff --git a/toggle_8cpp.html b/toggle_8cpp.html new file mode 100644 index 000000000..84ee85513 --- /dev/null +++ b/toggle_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: toggle.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    toggle.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Functions

    int main ()
     
    +

    Function Documentation

    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 16 of file toggle.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/toggle_8cpp.js b/toggle_8cpp.js new file mode 100644 index 000000000..80fc46ee9 --- /dev/null +++ b/toggle_8cpp.js @@ -0,0 +1,4 @@ +var toggle_8cpp = +[ + [ "main", "toggle_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/toggle_8cpp_source.html b/toggle_8cpp_source.html new file mode 100644 index 000000000..25a0fdeb1 --- /dev/null +++ b/toggle_8cpp_source.html @@ -0,0 +1,291 @@ + + + + + + + + +FTXUI: toggle.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    toggle.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <memory> // for allocator, __shared_ptr_access
    +
    5#include <string> // for string, basic_string
    +
    6#include <vector> // for vector
    +
    7
    +
    8#include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    9#include "ftxui/component/component.hpp" // for Toggle, Renderer, Vertical
    +
    10#include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    11#include "ftxui/component/screen_interactive.hpp" // for Component, ScreenInteractive
    +
    12#include "ftxui/dom/elements.hpp" // for text, hbox, vbox, Element
    +
    13
    +
    14using namespace ftxui;
    +
    15
    +
    +
    16int main() {
    +
    17 std::vector<std::string> toggle_1_entries = {
    +
    18 "On",
    +
    19 "Off",
    +
    20 };
    +
    21 std::vector<std::string> toggle_2_entries = {
    +
    22 "Enabled",
    +
    23 "Disabled",
    +
    24 };
    +
    25 std::vector<std::string> toggle_3_entries = {
    +
    26 "10€",
    +
    27 "0€",
    +
    28 };
    +
    29 std::vector<std::string> toggle_4_entries = {
    +
    30 "Nothing",
    +
    31 "One element",
    +
    32 "Several elements",
    +
    33 };
    +
    34
    +
    35 int toggle_1_selected = 0;
    +
    36 int toggle_2_selected = 0;
    +
    37 int toggle_3_selected = 0;
    +
    38 int toggle_4_selected = 0;
    +
    39 Component toggle_1 = Toggle(&toggle_1_entries, &toggle_1_selected);
    +
    40 Component toggle_2 = Toggle(&toggle_2_entries, &toggle_2_selected);
    +
    41 Component toggle_3 = Toggle(&toggle_3_entries, &toggle_3_selected);
    +
    42 Component toggle_4 = Toggle(&toggle_4_entries, &toggle_4_selected);
    +
    43
    +
    44 auto container = Container::Vertical({
    +
    45 toggle_1,
    +
    46 toggle_2,
    +
    47 toggle_3,
    +
    48 toggle_4,
    +
    49 });
    +
    50
    +
    51 auto renderer = Renderer(container, [&] {
    +
    52 return vbox({
    +
    53 text("Choose your options:"),
    +
    54 text(""),
    +
    55 hbox(text(" * Poweroff on startup : "), toggle_1->Render()),
    +
    56 hbox(text(" * Out of process : "), toggle_2->Render()),
    +
    57 hbox(text(" * Price of the information : "), toggle_3->Render()),
    +
    58 hbox(text(" * Number of elements : "), toggle_4->Render()),
    +
    59 });
    +
    60 });
    +
    61
    + +
    63 screen.Loop(renderer);
    +
    64}
    +
    + + + + +
    static ScreenInteractive TerminalOutput()
    +
    Element Render()
    Draw the component. Build a ftxui::Element to be drawn on the ftxui::Screen representing this ftxui::...
    +
    Component Toggle(ConstStringListRef entries, int *selected)
    An horizontal list of elements. The user can navigate through them.
    +
    Component Renderer(Component child, std::function< Element()>)
    Return a new Component, similar to |child|, but using |render| as the Component::Render() event.
    +
    Component Vertical(Components children)
    A list of components, drawn one by one vertically and navigated vertically using up/down arrow key or...
    +
    Element text(std::wstring text)
    Display a piece of unicode text.
    Definition text.cpp:160
    +
    Element vbox(Elements)
    A container displaying elements vertically one by one.
    Definition vbox.cpp:96
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    Element hbox(Elements)
    A container displaying elements horizontally one by one.
    Definition hbox.cpp:94
    +
    std::shared_ptr< ComponentBase > Component
    + +
    int main()
    Definition toggle.cpp:16
    +
    +
    + + + + + diff --git a/topics.html b/topics.html new file mode 100644 index 000000000..7456e2dd8 --- /dev/null +++ b/topics.html @@ -0,0 +1,215 @@ + + + + + + + + +FTXUI: Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    Reference
    +
    +
    +
    Here is a list of all topics with brief descriptions:
    +
    +
    + + + + + diff --git a/topics.js b/topics.js new file mode 100644 index 000000000..b72621278 --- /dev/null +++ b/topics.js @@ -0,0 +1,6 @@ +var topics = +[ + [ "ftxui/screen", "group__screen.html", "group__screen" ], + [ "ftxui/dom", "group__dom.html", "group__dom" ], + [ "ftxui/component", "group__component.html", "group__component" ] +]; \ No newline at end of file diff --git a/underlined_8cpp.html b/underlined_8cpp.html new file mode 100644 index 000000000..01513d0ff --- /dev/null +++ b/underlined_8cpp.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: underlined.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    underlined.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + +

    +Functions

    Element underlined (Element child)
     Underline the given element.
     
    +
    +
    + + + + + diff --git a/underlined_8cpp.js b/underlined_8cpp.js new file mode 100644 index 000000000..6e58ff176 --- /dev/null +++ b/underlined_8cpp.js @@ -0,0 +1,4 @@ +var underlined_8cpp = +[ + [ "underlined", "underlined_8cpp.html#ga5ad450c97c4d084b64ffb5b5ca942664", null ] +]; \ No newline at end of file diff --git a/underlined_8cpp_source.html b/underlined_8cpp_source.html new file mode 100644 index 000000000..c7677e1f0 --- /dev/null +++ b/underlined_8cpp_source.html @@ -0,0 +1,259 @@ + + + + + + + + +FTXUI: underlined.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    underlined.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <memory> // for make_shared
    +
    5#include <utility> // for move
    +
    6
    +
    7#include "ftxui/dom/elements.hpp" // for Element, underlined
    +
    8#include "ftxui/dom/node.hpp" // for Node
    +
    9#include "ftxui/dom/node_decorator.hpp" // for NodeDecorator
    +
    10#include "ftxui/screen/box.hpp" // for Box
    +
    11#include "ftxui/screen/screen.hpp" // for Pixel, Screen
    +
    12
    +
    13namespace ftxui {
    +
    14
    +
    15namespace {
    +
    16class Underlined : public NodeDecorator {
    +
    17 public:
    + +
    19
    +
    20 void Render(Screen& screen) override {
    +
    21 Node::Render(screen);
    +
    22 for (int y = box_.y_min; y <= box_.y_max; ++y) {
    +
    23 for (int x = box_.x_min; x <= box_.x_max; ++x) {
    +
    24 screen.PixelAt(x, y).underlined = true;
    +
    25 }
    +
    26 }
    +
    27 }
    +
    28};
    +
    29} // namespace
    +
    30
    +
    31/// @brief Underline the given element.
    +
    32/// @ingroup dom
    +
    + +
    34 return std::make_shared<Underlined>(std::move(child));
    +
    35}
    +
    +
    36
    +
    37} // namespace ftxui
    + +
    NodeDecorator(Element child)
    + +
    friend void Render(Screen &screen, Node *node, Selection &selection)
    Definition node.cpp:96
    +
    Element underlined(Element)
    Underline the given element.
    +
    void Render(Screen &screen, const Element &element)
    Display an element on a ftxui::Screen.
    Definition node.cpp:84
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    + + + +
    +
    + + + + + diff --git a/underlined__double_8cpp.html b/underlined__double_8cpp.html new file mode 100644 index 000000000..6671600f8 --- /dev/null +++ b/underlined__double_8cpp.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: underlined_double.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    underlined_double.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + +

    +Functions

    Element underlinedDouble (Element child)
     Apply a underlinedDouble to text.
     
    +
    +
    + + + + + diff --git a/underlined__double_8cpp.js b/underlined__double_8cpp.js new file mode 100644 index 000000000..53f7d20c5 --- /dev/null +++ b/underlined__double_8cpp.js @@ -0,0 +1,4 @@ +var underlined__double_8cpp = +[ + [ "underlinedDouble", "underlined__double_8cpp.html#ga16d1b74107610750276499ddb3dde8da", null ] +]; \ No newline at end of file diff --git a/underlined__double_8cpp_source.html b/underlined__double_8cpp_source.html new file mode 100644 index 000000000..faaed3520 --- /dev/null +++ b/underlined__double_8cpp_source.html @@ -0,0 +1,258 @@ + + + + + + + + +FTXUI: underlined_double.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    underlined_double.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2023 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <memory> // for make_shared
    +
    5#include <utility> // for move
    +
    6
    +
    7#include "ftxui/dom/elements.hpp" // for Element, underlinedDouble
    +
    8#include "ftxui/dom/node.hpp" // for Node
    +
    9#include "ftxui/dom/node_decorator.hpp" // for NodeDecorator
    +
    10#include "ftxui/screen/box.hpp" // for Box
    +
    11#include "ftxui/screen/screen.hpp" // for Pixel, Screen
    +
    12
    +
    13namespace ftxui {
    +
    14
    +
    15/// @brief Apply a underlinedDouble to text.
    +
    16/// @ingroup dom
    +
    + +
    18 class Impl : public NodeDecorator {
    +
    19 public:
    +
    20 using NodeDecorator::NodeDecorator;
    +
    21
    +
    22 void Render(Screen& screen) override {
    +
    23 for (int y = box_.y_min; y <= box_.y_max; ++y) {
    +
    24 for (int x = box_.x_min; x <= box_.x_max; ++x) {
    +
    25 screen.PixelAt(x, y).underlined_double = true;
    +
    26 }
    +
    27 }
    +
    28 Node::Render(screen);
    +
    29 }
    +
    30 };
    +
    31
    +
    32 return std::make_shared<Impl>(std::move(child));
    +
    33}
    +
    +
    34
    +
    35} // namespace ftxui
    + + + +
    Element underlinedDouble(Element)
    Apply a underlinedDouble to text.
    +
    Pixel & PixelAt(int x, int y)
    Access a cell (Pixel) at a given position.
    Definition image.cpp:43
    +
    bool underlined_double
    Definition pixel.hpp:34
    +
    A rectangular grid of Pixel.
    Definition screen.hpp:26
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    + + + +
    +
    + + + + + diff --git a/util_8cppm.html b/util_8cppm.html new file mode 100644 index 000000000..1fe40972e --- /dev/null +++ b/util_8cppm.html @@ -0,0 +1,211 @@ + + + + + + + + +FTXUI: util.cppm File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    util.cppm File Reference
    module ftxui.util
    +
    + +
    + + + + + diff --git a/util_8cppm_source.html b/util_8cppm_source.html new file mode 100644 index 000000000..3cd55018c --- /dev/null +++ b/util_8cppm_source.html @@ -0,0 +1,219 @@ + + + + + + + + +FTXUI: util.cppm Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    util.cppm
    +
    +
    +Go to the documentation of this file.
    1/// @module ftxui.util
    +
    2/// @brief Module file for FTXUI utility operations.
    +
    3
    +
    4export module ftxui.util;
    +
    5
    +
    6export import ftxui.util.autoreset;
    +
    7export import ftxui.util.ref;
    +
    Module file for the AutoReset class of the Util module.
    +
    Module file for the Ref classes of the Util module.
    +
    Module file for FTXUI utility operations.
    +
    +
    + + + + + diff --git a/util_8hpp.html b/util_8hpp.html new file mode 100644 index 000000000..9d030af17 --- /dev/null +++ b/util_8hpp.html @@ -0,0 +1,229 @@ + + + + + + + + +FTXUI: util.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    util.hpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    namespace  ftxui::util
     
    + + + + +

    +Functions

    template<class T >
    constexpr const T & clamp (const T &v, const T &lo, const T &hi)
     
    +
    +
    + + + + + diff --git a/util_8hpp.js b/util_8hpp.js new file mode 100644 index 000000000..f40b55906 --- /dev/null +++ b/util_8hpp.js @@ -0,0 +1,4 @@ +var util_8hpp = +[ + [ "clamp", "util_8hpp.html#aab9f0232e41c960b4a09629eac33aef3", null ] +]; \ No newline at end of file diff --git a/util_8hpp_source.html b/util_8hpp_source.html new file mode 100644 index 000000000..63b6c119c --- /dev/null +++ b/util_8hpp_source.html @@ -0,0 +1,232 @@ + + + + + + + + +FTXUI: util.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    util.hpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2022 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#ifndef FTXUI_SCREEN_UTIL_HPP
    +
    5#define FTXUI_SCREEN_UTIL_HPP
    +
    6
    +
    +
    7namespace ftxui::util {
    +
    8
    +
    9// Similar to std::clamp, but allow hi to be lower than lo.
    +
    10template <class T>
    +
    +
    11constexpr const T& clamp(const T& v, const T& lo, const T& hi) {
    +
    12 return v < lo ? lo : hi < v ? hi : v;
    +
    13}
    +
    +
    14
    +
    15} // namespace ftxui::util
    +
    +
    16
    +
    17#endif /* end of include guard: FTXUI_SCREEN_UTIL_HPP */
    + +
    constexpr const T & clamp(const T &v, const T &lo, const T &hi)
    Definition util.hpp:11
    +
    +
    + + + + + diff --git a/vbox_8cpp.html b/vbox_8cpp.html new file mode 100644 index 000000000..594a6452b --- /dev/null +++ b/vbox_8cpp.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: vbox.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    vbox.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + + +

    +Namespaces

    namespace  ftxui
     The FTXUI ftxui:: namespace.
     
    + + + + +

    +Functions

    Element vbox (Elements children)
     A container displaying elements vertically one by one.
     
    +
    +
    + + + + + diff --git a/vbox_8cpp.js b/vbox_8cpp.js new file mode 100644 index 000000000..f7269e587 --- /dev/null +++ b/vbox_8cpp.js @@ -0,0 +1,4 @@ +var vbox_8cpp = +[ + [ "vbox", "vbox_8cpp.html#gafd28058f0ccbbdf34691a85a7cc9b2e3", null ] +]; \ No newline at end of file diff --git a/vbox_8cpp_source.html b/vbox_8cpp_source.html new file mode 100644 index 000000000..c75875d6c --- /dev/null +++ b/vbox_8cpp_source.html @@ -0,0 +1,324 @@ + + + + + + + + +FTXUI: vbox.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    vbox.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <algorithm> // for max
    +
    5#include <cstddef> // for size_t
    +
    6#include <memory> // for __shared_ptr_access, shared_ptr, make_shared, allocator_traits<>::value_type
    +
    7#include <utility> // for move
    +
    8#include <vector> // for vector, __alloc_traits<>::value_type
    +
    9
    +
    10#include "ftxui/dom/box_helper.hpp" // for Element, Compute
    +
    11#include "ftxui/dom/elements.hpp" // for Element, Elements, vbox
    +
    12#include "ftxui/dom/node.hpp" // for Node, Elements
    +
    13#include "ftxui/dom/requirement.hpp" // for Requirement
    +
    14#include "ftxui/dom/selection.hpp" // for Selection
    +
    15#include "ftxui/screen/box.hpp" // for Box
    +
    16
    +
    17namespace ftxui {
    +
    18
    +
    19namespace {
    +
    20class VBox : public Node {
    +
    21 public:
    +
    22 explicit VBox(Elements children) : Node(std::move(children)) {}
    +
    23
    +
    24 private:
    +
    25 void ComputeRequirement() override {
    +
    26 requirement_ = Requirement{};
    +
    27
    +
    28 for (auto& child : children_) {
    +
    29 child->ComputeRequirement();
    +
    30
    +
    31 // Propagate the focused requirement.
    +
    32 if (requirement_.focused.Prefer(child->requirement().focused)) {
    +
    33 requirement_.focused = child->requirement().focused;
    +
    34 requirement_.focused.box.Shift(0, requirement_.min_y);
    +
    35 }
    +
    36
    +
    37 // Extend the min_x and min_y to contain all the children
    +
    38 requirement_.min_y += child->requirement().min_y;
    +
    39 requirement_.min_x =
    +
    40 std::max(requirement_.min_x, child->requirement().min_x);
    +
    41 }
    +
    42 }
    +
    43
    +
    44 void SetBox(Box box) override {
    +
    45 Node::SetBox(box);
    +
    46
    +
    47 std::vector<box_helper::Element> elements(children_.size());
    +
    48 for (size_t i = 0; i < children_.size(); ++i) {
    +
    49 auto& element = elements[i];
    +
    50 const auto& requirement = children_[i]->requirement();
    +
    51 element.min_size = requirement.min_y;
    +
    52 element.flex_grow = requirement.flex_grow_y;
    +
    53 element.flex_shrink = requirement.flex_shrink_y;
    +
    54 }
    +
    55 const int target_size = box.y_max - box.y_min + 1;
    +
    56 box_helper::Compute(&elements, target_size);
    +
    57
    +
    58 int y = box.y_min;
    +
    59 for (size_t i = 0; i < children_.size(); ++i) {
    +
    60 box.y_min = y;
    +
    61 box.y_max = y + elements[i].size - 1;
    +
    62 children_[i]->SetBox(box);
    +
    63 y = box.y_max + 1;
    +
    64 }
    +
    65 }
    +
    66
    +
    67 void Select(Selection& selection) override {
    +
    68 // If this Node box_ doesn't intersect with the selection, then no
    +
    69 // selection.
    +
    70 if (Box::Intersection(selection.GetBox(), box_).IsEmpty()) {
    +
    71 return;
    +
    72 }
    +
    73
    +
    74 Selection selection_saturated = selection.SaturateVertical(box_);
    +
    75
    +
    76 for (auto& child : children_) {
    +
    77 child->Select(selection_saturated);
    +
    78 }
    +
    79 }
    +
    80};
    +
    81} // namespace
    +
    82
    +
    83/// @brief A container displaying elements vertically one by one.
    +
    84/// @param children The elements in the container
    +
    85/// @return The container.
    +
    86/// @ingroup dom
    +
    87///
    +
    88/// #### Example
    +
    89///
    +
    90/// ```cpp
    +
    91/// vbox({
    +
    92/// text("Up"),
    +
    93/// text("Down"),
    +
    94/// });
    +
    95/// ```
    +
    + +
    97 return std::make_shared<VBox>(std::move(children));
    +
    98}
    +
    +
    99
    +
    100} // namespace ftxui
    + + + +
    virtual void SetBox(Box box)
    Assign a position and a dimension to an element for drawing.
    Definition node.cpp:41
    +
    Element vbox(Elements)
    A container displaying elements vertically one by one.
    Definition vbox.cpp:96
    +
    static auto Intersection(Box a, Box b) -> Box
    Definition box.cpp:11
    +
    void Compute(std::vector< Element > *elements, int target_size)
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    +
    std::shared_ptr< Node > Element
    Definition elements.hpp:22
    +
    std::vector< Element > Elements
    Definition elements.hpp:23
    + + + +
    +
    + + + + + diff --git a/vbox__hbox_8cpp.html b/vbox__hbox_8cpp.html new file mode 100644 index 000000000..480717971 --- /dev/null +++ b/vbox__hbox_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: vbox_hbox.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    vbox_hbox.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Functions

    int main ()
     
    +

    Function Documentation

    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 12 of file vbox_hbox.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/vbox__hbox_8cpp.js b/vbox__hbox_8cpp.js new file mode 100644 index 000000000..e18ca7187 --- /dev/null +++ b/vbox__hbox_8cpp.js @@ -0,0 +1,4 @@ +var vbox__hbox_8cpp = +[ + [ "main", "vbox__hbox_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/vbox__hbox_8cpp_source.html b/vbox__hbox_8cpp_source.html new file mode 100644 index 000000000..79b686d16 --- /dev/null +++ b/vbox__hbox_8cpp_source.html @@ -0,0 +1,257 @@ + + + + + + + + +FTXUI: vbox_hbox.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    vbox_hbox.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <stdio.h> // for getchar
    +
    5#include <ftxui/dom/elements.hpp> // for filler, text, hbox, vbox
    +
    6#include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    7#include <memory> // for allocator
    +
    8
    +
    9#include "ftxui/dom/node.hpp" // for Render
    +
    10#include "ftxui/screen/color.hpp" // for ftxui
    +
    11
    +
    +
    12int main() {
    +
    13 using namespace ftxui;
    +
    14 auto document = //
    +
    15 vbox({
    +
    16 hbox({
    +
    17 text("north-west"),
    +
    18 filler(),
    +
    19 text("north-east"),
    +
    20 }),
    +
    21 filler(),
    +
    22 hbox({
    +
    23 filler(),
    +
    24 text("center"),
    +
    25 filler(),
    +
    26 }),
    +
    27 filler(),
    +
    28 hbox({
    +
    29 text("south-west"),
    +
    30 filler(),
    +
    31 text("south-east"),
    +
    32 }),
    +
    33 });
    +
    34 auto screen = Screen::Create(Dimension::Full());
    +
    35 Render(screen, document);
    +
    36 screen.Print();
    +
    37 getchar();
    +
    38
    +
    39 return 0;
    +
    40}
    +
    + + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + + +
    int main()
    Definition vbox_hbox.cpp:12
    +
    +
    + + + + + diff --git a/vflow_8cpp.html b/vflow_8cpp.html new file mode 100644 index 000000000..cd6b419a9 --- /dev/null +++ b/vflow_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: vflow.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    vflow.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Functions

    int main ()
     
    +

    Function Documentation

    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 12 of file vflow.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/vflow_8cpp.js b/vflow_8cpp.js new file mode 100644 index 000000000..f3c07095b --- /dev/null +++ b/vflow_8cpp.js @@ -0,0 +1,4 @@ +var vflow_8cpp = +[ + [ "main", "vflow_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/vflow_8cpp_source.html b/vflow_8cpp_source.html new file mode 100644 index 000000000..bae774197 --- /dev/null +++ b/vflow_8cpp_source.html @@ -0,0 +1,267 @@ + + + + + + + + +FTXUI: vflow.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    vflow.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2020 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <stdio.h> // for getchar
    +
    5#include <ftxui/dom/elements.hpp> // for operator|, Element, size, text, hcenter, Fit, vflow, window, EQUAL, bold, border, dim, HEIGHT, WIDTH
    +
    6#include <ftxui/screen/screen.hpp> // for Full, Screen
    +
    7#include <string> // for allocator, char_traits, operator+, to_string, string
    +
    8
    +
    9#include "ftxui/dom/node.hpp" // for Render
    +
    10#include "ftxui/screen/color.hpp" // for ftxui
    +
    11
    +
    +
    12int main() {
    +
    13 using namespace ftxui;
    +
    14 auto make_box = [](int dimx, int dimy) {
    +
    15 std::string title = std::to_string(dimx) + "x" + std::to_string(dimy);
    +
    16 return window(text(title) | hcenter | bold,
    +
    17 text("content") | hcenter | dim) |
    +
    18 size(WIDTH, EQUAL, dimx) | size(HEIGHT, EQUAL, dimy);
    +
    19 };
    +
    20
    +
    21 auto document = vflow({
    +
    22 make_box(7, 7),
    +
    23 make_box(7, 5),
    +
    24 make_box(5, 7),
    +
    25 make_box(10, 4),
    +
    26 make_box(10, 4),
    +
    27 make_box(10, 4),
    +
    28 make_box(10, 4),
    +
    29 make_box(11, 4),
    +
    30 make_box(11, 4),
    +
    31 make_box(11, 4),
    +
    32 make_box(11, 4),
    +
    33 make_box(12, 4),
    +
    34 make_box(12, 5),
    +
    35 make_box(12, 4),
    +
    36 make_box(13, 4),
    +
    37 make_box(13, 3),
    +
    38 make_box(13, 3),
    +
    39 make_box(10, 3),
    +
    40 }) |
    +
    41 border;
    +
    42
    +
    43 auto screen = Screen::Create(Dimension::Full(), Dimension::Fit(document));
    +
    44 Render(screen, document);
    +
    45 screen.Print();
    +
    46 getchar();
    +
    47
    +
    48 return 0;
    +
    49}
    +
    + + +
    Element make_box(int x, int y)
    +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + + +
    int main()
    Definition vflow.cpp:12
    +
    +
    + + + + + diff --git a/warn__windows__macro_8hpp.html b/warn__windows__macro_8hpp.html new file mode 100644 index 000000000..3287df402 --- /dev/null +++ b/warn__windows__macro_8hpp.html @@ -0,0 +1,211 @@ + + + + + + + + +FTXUI: warn_windows_macro.hpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    warn_windows_macro.hpp File Reference
    +
    + +
    + + + + + diff --git a/warn__windows__macro_8hpp_source.html b/warn__windows__macro_8hpp_source.html new file mode 100644 index 000000000..09e2d5396 --- /dev/null +++ b/warn__windows__macro_8hpp_source.html @@ -0,0 +1,227 @@ + + + + + + + + +FTXUI: warn_windows_macro.hpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    warn_windows_macro.hpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2025 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4
    +
    5#ifndef FTXUI_UTIL_WARN_WINDOWS_MACRO_H_
    +
    6#define FTXUI_UTIL_WARN_WINDOWS_MACRO_H_
    +
    7
    +
    8#ifdef min
    +
    9#error \
    +
    10 "The macro 'min' is defined, which conflicts with the standard C++ library and FTXUI. This is often caused by including <windows.h>. To fix this, add '#define NOMINMAX' before including <windows.h>, or pass '/DNOMINMAX' as a compiler flag."
    +
    11#endif
    +
    12
    +
    13#ifdef max
    +
    14#error \
    +
    15 "The macro 'max' is defined, which conflicts with the standard C++ library and FTXUI. This is often caused by including <windows.h>. To fix this, add '#define NOMINMAX' before including <windows.h>, or pass '/DNOMINMAX' as a compiler flag."
    +
    16#endif
    +
    17
    +
    18#endif // FTXUI_UTIL_WARN_WINDOWS_MACRO_H_
    +
    +
    + + + + + diff --git a/with__restored__io_8cpp.html b/with__restored__io_8cpp.html new file mode 100644 index 000000000..f2475d41a --- /dev/null +++ b/with__restored__io_8cpp.html @@ -0,0 +1,239 @@ + + + + + + + + +FTXUI: with_restored_io.cpp File Reference + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    + +
    with_restored_io.cpp File Reference
    +
    +
    + +

    Go to the source code of this file.

    + + + + +

    +Functions

    int main ()
     
    +

    Function Documentation

    + +

    ◆ main()

    + +
    +
    + + + + + + + +
    int main ()
    +
    + +

    Definition at line 15 of file with_restored_io.cpp.

    + +
    +
    +
    +
    + + + + + diff --git a/with__restored__io_8cpp.js b/with__restored__io_8cpp.js new file mode 100644 index 000000000..3f6a22860 --- /dev/null +++ b/with__restored__io_8cpp.js @@ -0,0 +1,4 @@ +var with__restored__io_8cpp = +[ + [ "main", "with__restored__io_8cpp.html#ae66f6b31b5ad750f1fe042a706a4e3d4", null ] +]; \ No newline at end of file diff --git a/with__restored__io_8cpp_source.html b/with__restored__io_8cpp_source.html new file mode 100644 index 000000000..db2eacd29 --- /dev/null +++ b/with__restored__io_8cpp_source.html @@ -0,0 +1,278 @@ + + + + + + + + +FTXUI: with_restored_io.cpp Source File + + + + + + + + + + + + + + + + + + + + + + +
    +
    + + + + + + +
    +
    FTXUI 6.1.9 +
    +
    C++ functional terminal UI.
    +
    +
    + + + + + + + + +
    +
    + +
    +
    +
    + +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    Loading...
    +
    Searching...
    +
    No Matches
    +
    +
    +
    +
    + +
    +
    with_restored_io.cpp
    +
    +
    +Go to the documentation of this file.
    1// Copyright 2022 Arthur Sonzogni. All rights reserved.
    +
    2// Use of this source code is governed by the MIT license that can be found in
    +
    3// the LICENSE file.
    +
    4#include <cstdlib> // for system, EXIT_SUCCESS
    +
    5#include <iostream> // for operator<<, basic_ostream, basic_ostream::operator<<, cout, endl, flush, ostream, basic_ostream<>::__ostream_type, cin
    +
    6#include <memory> // for shared_ptr, __shared_ptr_access, allocator
    +
    7#include <string> // for getline, string
    +
    8
    +
    9#include "ftxui/component/captured_mouse.hpp" // for ftxui
    +
    10#include "ftxui/component/component.hpp" // for Button, Horizontal, Renderer
    +
    11#include "ftxui/component/component_base.hpp" // for ComponentBase
    +
    12#include "ftxui/component/screen_interactive.hpp" // for ScreenInteractive
    +
    13#include "ftxui/dom/elements.hpp" // for operator|, filler, Element, borderEmpty, hbox, size, paragraph, vbox, LESS_THAN, border, center, HEIGHT, WIDTH
    +
    14
    +
    +
    15int main() {
    +
    16 using namespace ftxui;
    +
    17
    +
    18 auto screen = ScreenInteractive::Fullscreen();
    +
    19
    +
    20 // When pressing this button, "screen.WithRestoredIO" will execute the
    +
    21 // temporarily uninstall the terminal hook and execute the provided callback
    +
    22 // function. This allow running the application in a non-interactive mode.
    +
    23 auto btn_run = Button("Execute with restored IO", screen.WithRestoredIO([] {
    +
    24 std::cout << "This is a child program using stdin/stdout." << std::endl;
    +
    25 for (int i = 0; i < 10; ++i) {
    +
    26 std::cout << "Please enter 10 strings (" << i << "/10)" << std::flush;
    +
    27 std::string input;
    +
    28 std::getline(std::cin, input);
    +
    29 }
    +
    30 }));
    +
    31
    +
    32 auto btn_quit = Button("Quit", screen.ExitLoopClosure());
    +
    33
    +
    34 auto layout = Container::Horizontal({
    +
    35 btn_run,
    +
    36 btn_quit,
    +
    37 });
    +
    38
    +
    39 auto renderer = Renderer(layout, [&] {
    +
    40 auto explanation = paragraph(
    +
    41 "After clicking this button, the ScreenInteractive will be "
    +
    42 "suspended and access to stdin/stdout will temporarilly be "
    +
    43 "restore for running a function.");
    +
    44 auto element = vbox({
    +
    45 explanation | borderEmpty,
    +
    46 hbox({
    +
    47 btn_run->Render(),
    +
    48 filler(),
    +
    49 btn_quit->Render(),
    +
    50 }),
    +
    51 });
    +
    52
    +
    53 element = element | borderEmpty | border | size(WIDTH, LESS_THAN, 80) |
    +
    54 size(HEIGHT, LESS_THAN, 20) | center;
    +
    55 return element;
    +
    56 });
    +
    57
    +
    58 screen.Loop(renderer);
    +
    59 return EXIT_SUCCESS;
    +
    60}
    +
    + + + + +
    The FTXUI ftxui:: namespace.
    Definition animation.hpp:10
    + +
    int main()
    +
    +
    + + + + +